2018-12-14 06:01:51 +07:00
|
|
|
buildscript{
|
|
|
|
repositories{
|
2017-04-30 08:25:59 +07:00
|
|
|
mavenLocal()
|
|
|
|
mavenCentral()
|
2017-12-20 08:51:46 +07:00
|
|
|
google()
|
2018-12-14 06:01:51 +07:00
|
|
|
maven{ url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
2017-04-30 08:25:59 +07:00
|
|
|
jcenter()
|
|
|
|
}
|
2018-12-30 03:58:11 +07:00
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
dependencies{
|
|
|
|
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.5'
|
2018-11-30 22:28:27 +07:00
|
|
|
classpath "com.badlogicgames.gdx:gdx-tools:1.9.9"
|
2019-03-10 04:47:08 +07:00
|
|
|
classpath "com.badlogicgames.packr:packr:2.1-SNAPSHOT"
|
2017-04-30 08:25:59 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
allprojects{
|
2017-04-30 08:25:59 +07:00
|
|
|
apply plugin: "idea"
|
|
|
|
|
2017-12-19 12:05:41 +07:00
|
|
|
version = 'release'
|
2018-02-22 07:50:27 +07:00
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
ext{
|
2018-11-21 23:00:50 +07:00
|
|
|
versionNumber = '4'
|
2019-03-06 04:07:48 +07:00
|
|
|
versionModifier = 'beta'
|
2018-12-14 06:01:51 +07:00
|
|
|
if(!project.hasProperty("versionType")) versionType = 'official'
|
2018-02-09 11:41:07 +07:00
|
|
|
appName = 'Mindustry'
|
2018-11-17 11:36:11 +07:00
|
|
|
gdxVersion = '1.9.9'
|
2018-04-28 03:01:37 +07:00
|
|
|
roboVMVersion = '2.3.0'
|
2018-12-30 00:22:41 +07:00
|
|
|
arcHash = null
|
2019-02-08 11:06:43 +07:00
|
|
|
|
|
|
|
debugged = {
|
|
|
|
return new File(projectDir.parent, '../debug').exists() && System.properties["release"] == null
|
|
|
|
}
|
2018-12-30 00:22:41 +07:00
|
|
|
|
|
|
|
localArc = {
|
|
|
|
return (System.properties["release"] == null || System.properties["release"] == "false") && new File(projectDir.parent, '../Arc').exists()
|
|
|
|
}
|
|
|
|
|
|
|
|
getArcHash = {
|
|
|
|
//get latest commit hash from gtihub since JITPack's '-snapshot' version doesn't work correctly
|
2018-12-30 01:06:17 +07:00
|
|
|
if(arcHash == null){
|
|
|
|
try{
|
2019-01-29 03:43:33 +07:00
|
|
|
arcHash = 'git ls-remote https://github.com/Anuken/Arc.git'.execute().text.split("\t")[0]
|
2018-12-30 23:41:06 +07:00
|
|
|
}catch(e){
|
2018-12-30 22:27:37 +07:00
|
|
|
e.printStackTrace()
|
2018-12-30 01:06:17 +07:00
|
|
|
arcHash = "-SNAPSHOT";
|
|
|
|
}
|
2018-12-30 03:58:11 +07:00
|
|
|
}
|
2018-12-30 00:22:41 +07:00
|
|
|
return arcHash
|
|
|
|
}
|
|
|
|
|
2018-12-29 23:59:43 +07:00
|
|
|
arcModule = { String name ->
|
2018-12-30 00:22:41 +07:00
|
|
|
if(localArc()){
|
2018-12-29 23:59:43 +07:00
|
|
|
return project(":Arc:$name")
|
|
|
|
}else{
|
2018-12-30 00:22:41 +07:00
|
|
|
//skip to last submodule
|
2018-12-29 23:59:43 +07:00
|
|
|
if(name.contains(':')) name = name.split(':').last()
|
2018-12-30 00:22:41 +07:00
|
|
|
return "com.github.Anuken.Arc:$name:${getArcHash()}"
|
2018-12-29 23:59:43 +07:00
|
|
|
}
|
|
|
|
}
|
2018-02-09 11:41:07 +07:00
|
|
|
|
|
|
|
getVersionString = {
|
|
|
|
String buildVersion = getBuildVersion()
|
2018-10-17 11:36:43 +07:00
|
|
|
return "$versionNumber-$versionModifier-$buildVersion"
|
2018-02-09 11:41:07 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
getBuildVersion = {
|
|
|
|
if(!project.hasProperty("buildversion")) return "custom build"
|
|
|
|
return project.getProperties()["buildversion"]
|
|
|
|
}
|
|
|
|
|
|
|
|
getPackage = {
|
|
|
|
return project.ext.mainClassName.substring(0, project.ext.mainClassName.indexOf("desktop") - 1)
|
|
|
|
}
|
2018-05-04 00:04:30 +07:00
|
|
|
|
2018-07-21 11:44:13 +07:00
|
|
|
generateLocales = {
|
2018-09-10 03:19:53 +07:00
|
|
|
def output = 'en\n'
|
2018-08-25 00:54:53 +07:00
|
|
|
def bundles = new File(project(':core').projectDir, 'assets/bundles/')
|
2018-12-14 06:01:51 +07:00
|
|
|
bundles.listFiles().each{ other ->
|
2018-10-06 22:56:39 +07:00
|
|
|
if(other.name == "bundle.properties") return
|
2018-09-10 03:19:53 +07:00
|
|
|
output += other.name.substring("bundle".length() + 1, other.name.lastIndexOf('.')) + "\n"
|
2018-07-21 11:44:13 +07:00
|
|
|
}
|
2018-10-06 22:56:39 +07:00
|
|
|
new File(project(':core').projectDir, 'assets/locales').text = output
|
2018-07-21 11:44:13 +07:00
|
|
|
}
|
|
|
|
|
2018-05-04 00:04:30 +07:00
|
|
|
writeVersion = {
|
2018-08-25 00:54:53 +07:00
|
|
|
def pfile = new File(project(':core').projectDir, 'assets/version.properties')
|
2018-05-04 00:04:30 +07:00
|
|
|
def props = new Properties()
|
|
|
|
|
|
|
|
try{
|
|
|
|
pfile.createNewFile()
|
2018-12-14 06:01:51 +07:00
|
|
|
}catch(Exception ignored){}
|
2018-05-04 00:04:30 +07:00
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
if(pfile.exists()){
|
2018-05-04 00:04:30 +07:00
|
|
|
props.load(new FileInputStream(pfile))
|
|
|
|
|
2018-09-04 23:10:48 +07:00
|
|
|
String buildid = getBuildVersion()
|
2018-05-04 00:04:30 +07:00
|
|
|
|
2018-09-04 23:10:48 +07:00
|
|
|
props["type"] = versionType
|
|
|
|
props["number"] = versionNumber
|
|
|
|
props["modifier"] = versionModifier
|
|
|
|
props["build"] = buildid
|
2018-05-04 00:04:30 +07:00
|
|
|
|
|
|
|
props.store(pfile.newWriter(), "Autogenerated file. Do not modify.")
|
|
|
|
}
|
|
|
|
}
|
2017-04-30 08:25:59 +07:00
|
|
|
}
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
repositories{
|
2017-04-30 08:25:59 +07:00
|
|
|
mavenLocal()
|
|
|
|
mavenCentral()
|
2018-12-14 06:01:51 +07:00
|
|
|
maven{ url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
|
|
|
maven{ url "https://oss.sonatype.org/content/repositories/releases/" }
|
|
|
|
maven{ url 'https://jitpack.io' }
|
2017-04-30 08:25:59 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
project(":desktop"){
|
2017-04-30 08:25:59 +07:00
|
|
|
apply plugin: "java"
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
dependencies{
|
2017-04-30 08:25:59 +07:00
|
|
|
compile project(":core")
|
2018-12-27 05:38:40 +07:00
|
|
|
compile project(":net")
|
2018-12-28 03:47:17 +07:00
|
|
|
|
2019-02-08 11:06:43 +07:00
|
|
|
if(debugged()) compile project(":debug")
|
2018-09-11 06:33:12 +07:00
|
|
|
|
2017-04-30 08:25:59 +07:00
|
|
|
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
2018-11-07 00:55:13 +07:00
|
|
|
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
|
2018-12-27 05:38:40 +07:00
|
|
|
|
2018-12-29 23:59:43 +07:00
|
|
|
compile arcModule("backends:backend-lwjgl3")
|
2018-05-14 11:43:53 +07:00
|
|
|
compile 'com.github.MinnDevelopment:java-discord-rpc:v2.0.0'
|
2017-04-30 08:25:59 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
project(":ios"){
|
2018-04-28 03:01:37 +07:00
|
|
|
apply plugin: "java"
|
|
|
|
apply plugin: "robovm"
|
|
|
|
|
2018-11-21 07:28:26 +07:00
|
|
|
task incrementConfig{
|
|
|
|
def vfile = file('robovm.properties')
|
|
|
|
|
|
|
|
def props = new Properties()
|
2018-11-21 23:00:50 +07:00
|
|
|
if(vfile.exists()){
|
|
|
|
props.load(new FileInputStream(vfile))
|
|
|
|
}
|
2018-11-21 07:28:26 +07:00
|
|
|
|
2018-11-21 23:00:50 +07:00
|
|
|
props['app.id'] = 'io.anuke.mindustry'
|
|
|
|
props['app.version'] = '4.0'
|
|
|
|
props['app.mainclass'] = 'io.anuke.mindustry.IOSLauncher'
|
|
|
|
props['app.executable'] = 'IOSLauncher'
|
|
|
|
props['app.name'] = 'Mindustry'
|
2018-12-14 06:01:51 +07:00
|
|
|
props['app.build'] = (!props.containsKey("app.build") ? 40 : props['app.build'].toInteger() + 1) + ""
|
2018-11-21 07:28:26 +07:00
|
|
|
props.store(vfile.newWriter(), null)
|
|
|
|
}
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
dependencies{
|
2018-04-28 03:01:37 +07:00
|
|
|
compile project(":core")
|
2018-12-28 03:47:17 +07:00
|
|
|
compile project(":net")
|
2018-04-28 10:42:59 +07:00
|
|
|
|
2018-12-29 23:59:43 +07:00
|
|
|
compile arcModule("backends:backend-robovm")
|
2018-12-28 03:47:17 +07:00
|
|
|
|
2018-04-28 03:01:37 +07:00
|
|
|
compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
|
|
|
|
compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
|
|
|
|
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
|
2018-11-07 00:55:13 +07:00
|
|
|
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
|
2018-04-28 03:01:37 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
project(":core"){
|
2017-04-30 08:25:59 +07:00
|
|
|
apply plugin: "java"
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
task finish{
|
2018-07-21 11:44:13 +07:00
|
|
|
generateLocales()
|
|
|
|
}
|
|
|
|
|
2019-01-06 21:42:08 +07:00
|
|
|
task cleanGen{
|
|
|
|
doFirst{
|
|
|
|
delete{
|
|
|
|
delete "../core/src/io/anuke/mindustry/gen/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task copyGen{
|
|
|
|
doLast{
|
|
|
|
copy{
|
|
|
|
from("../core/build/classes/java/main/io/anuke/mindustry/gen/"){
|
|
|
|
include "**/*.java"
|
|
|
|
}
|
|
|
|
|
|
|
|
into "../core/src/io/anuke/mindustry/gen"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
dependencies{
|
2019-01-06 21:42:08 +07:00
|
|
|
compileJava.dependsOn(cleanGen)
|
2019-01-09 23:52:45 +07:00
|
|
|
compileJava.finalizedBy(copyGen)
|
2018-12-30 00:22:41 +07:00
|
|
|
|
2018-12-29 23:59:43 +07:00
|
|
|
compile arcModule("arc-core")
|
|
|
|
compile arcModule("extensions:freetype")
|
2019-02-08 11:06:43 +07:00
|
|
|
if(localArc() && debugged()) compile arcModule("extensions:recorder")
|
2018-05-12 21:30:23 +07:00
|
|
|
|
2018-10-29 05:34:18 +07:00
|
|
|
compileOnly project(":annotations")
|
2018-10-29 01:26:58 +07:00
|
|
|
annotationProcessor project(":annotations")
|
2017-04-30 08:25:59 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
project(":server"){
|
2018-01-28 11:42:42 +07:00
|
|
|
apply plugin: "java"
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
dependencies{
|
2018-01-28 11:42:42 +07:00
|
|
|
compile project(":core")
|
2018-12-27 05:38:40 +07:00
|
|
|
compile project(":net")
|
2018-12-29 23:59:43 +07:00
|
|
|
compile arcModule("backends:backend-headless")
|
2018-01-28 11:42:42 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-04 07:58:35 +07:00
|
|
|
project(":tests"){
|
|
|
|
apply plugin: "java"
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
dependencies{
|
2018-10-04 07:58:35 +07:00
|
|
|
testImplementation project(":core")
|
2018-11-23 05:30:49 +07:00
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-params:5.3.1"
|
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-api:5.3.1"
|
|
|
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.3.1"
|
2018-12-29 23:59:43 +07:00
|
|
|
compile arcModule("backends:backend-headless")
|
2018-10-04 07:58:35 +07:00
|
|
|
}
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
test{
|
2018-10-04 07:58:35 +07:00
|
|
|
useJUnitPlatform()
|
|
|
|
workingDir = new File("../core/assets")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
project(":tools"){
|
2018-06-16 05:06:05 +07:00
|
|
|
apply plugin: "java"
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
dependencies{
|
2018-06-16 05:06:05 +07:00
|
|
|
compile project(":core")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
project(":annotations"){
|
2018-05-12 21:30:23 +07:00
|
|
|
apply plugin: "java"
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
dependencies{
|
2018-05-14 06:41:50 +07:00
|
|
|
compile 'com.squareup:javapoet:1.11.0'
|
|
|
|
}
|
2018-05-12 21:30:23 +07:00
|
|
|
}
|
|
|
|
|
2018-12-27 05:38:40 +07:00
|
|
|
project(":net"){
|
2018-01-02 01:32:18 +07:00
|
|
|
apply plugin: "java"
|
|
|
|
|
2018-12-14 06:01:51 +07:00
|
|
|
dependencies{
|
2018-01-02 01:32:18 +07:00
|
|
|
compile project(":core")
|
2018-09-09 04:07:25 +07:00
|
|
|
compile "org.lz4:lz4-java:1.4.1"
|
2019-01-05 03:12:34 +07:00
|
|
|
compile 'com.github.Anuken:kryonet:a64d2280880e80566ca1bdaffa55de43e51cad38'
|
2018-08-31 08:39:27 +07:00
|
|
|
compile 'com.github.Anuken:WaifUPnP:05eb46bc577fd7674596946ba288c96c0cedd893'
|
2018-01-02 01:32:18 +07:00
|
|
|
}
|
2018-12-30 21:21:16 +07:00
|
|
|
}
|