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