2017-04-29 21:25:59 -04:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
mavenLocal()
|
|
|
|
mavenCentral()
|
2017-12-19 20:51:46 -05:00
|
|
|
google()
|
2017-04-29 21:25:59 -04:00
|
|
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
|
|
|
jcenter()
|
|
|
|
}
|
|
|
|
dependencies {
|
2018-04-27 16:01:37 -04:00
|
|
|
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.0'
|
2017-04-29 21:25:59 -04:00
|
|
|
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
|
2018-10-15 16:31:01 -04:00
|
|
|
classpath 'com.android.tools.build:gradle:3.2.1'
|
2018-01-26 15:09:13 -05:00
|
|
|
classpath "com.badlogicgames.gdx:gdx-tools:1.9.8"
|
2017-04-29 21:25:59 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
allprojects {
|
|
|
|
apply plugin: "eclipse"
|
|
|
|
apply plugin: "idea"
|
|
|
|
|
2017-12-19 00:05:41 -05:00
|
|
|
version = 'release'
|
2018-02-21 19:50:27 -05:00
|
|
|
|
2017-04-29 21:25:59 -04:00
|
|
|
ext {
|
2018-04-21 18:39:49 -04:00
|
|
|
versionNumber = '4.0'
|
2018-09-04 12:10:48 -04:00
|
|
|
versionModifier = 'alpha'
|
|
|
|
versionType = 'official'
|
2018-02-08 23:41:07 -05:00
|
|
|
appName = 'Mindustry'
|
2017-12-21 20:59:40 -05:00
|
|
|
gdxVersion = '1.9.8'
|
2018-04-27 16:01:37 -04:00
|
|
|
roboVMVersion = '2.3.0'
|
2018-10-17 10:20:58 -04:00
|
|
|
uCoreVersion = '53f99fbdc50910a15b4f55e9739385f47cf800cf'
|
2018-02-08 23:41:07 -05:00
|
|
|
|
|
|
|
getVersionString = {
|
|
|
|
String buildVersion = getBuildVersion()
|
2018-10-17 00:36:43 -04:00
|
|
|
return "$versionNumber-$versionModifier-$buildVersion"
|
2018-02-08 23:41:07 -05: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 13:04:30 -04:00
|
|
|
|
2018-07-21 00:44:13 -04:00
|
|
|
generateLocales = {
|
2018-09-09 16:19:53 -04:00
|
|
|
def output = 'en\n'
|
2018-08-24 13:54:53 -04:00
|
|
|
def bundles = new File(project(':core').projectDir, 'assets/bundles/')
|
2018-07-21 00:44:13 -04:00
|
|
|
bundles.listFiles().each { other ->
|
2018-10-06 11:56:39 -04:00
|
|
|
if(other.name == "bundle.properties") return
|
2018-09-09 16:19:53 -04:00
|
|
|
output += other.name.substring("bundle".length() + 1, other.name.lastIndexOf('.')) + "\n"
|
2018-07-21 00:44:13 -04:00
|
|
|
}
|
2018-10-06 11:56:39 -04:00
|
|
|
new File(project(':core').projectDir, 'assets/locales').text = output
|
2018-07-21 00:44:13 -04:00
|
|
|
}
|
|
|
|
|
2018-05-03 13:04:30 -04:00
|
|
|
writeVersion = {
|
2018-08-24 13:54:53 -04:00
|
|
|
def pfile = new File(project(':core').projectDir, 'assets/version.properties')
|
2018-05-03 13:04:30 -04:00
|
|
|
def props = new Properties()
|
|
|
|
|
|
|
|
try{
|
|
|
|
pfile.createNewFile()
|
2018-10-06 11:56:39 -04:00
|
|
|
}catch (Exception ignored){}
|
2018-05-03 13:04:30 -04:00
|
|
|
|
|
|
|
if(pfile.exists()) {
|
|
|
|
|
|
|
|
props.load(new FileInputStream(pfile))
|
|
|
|
|
2018-09-04 12:10:48 -04:00
|
|
|
String buildid = getBuildVersion()
|
2018-05-03 13:04:30 -04:00
|
|
|
|
2018-09-04 12:10:48 -04:00
|
|
|
props["type"] = versionType
|
|
|
|
props["number"] = versionNumber
|
|
|
|
props["modifier"] = versionModifier
|
|
|
|
props["build"] = buildid
|
2018-05-03 13:04:30 -04:00
|
|
|
|
|
|
|
props.store(pfile.newWriter(), "Autogenerated file. Do not modify.")
|
|
|
|
}
|
|
|
|
}
|
2017-04-29 21:25:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenLocal()
|
|
|
|
mavenCentral()
|
|
|
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
|
|
|
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
|
2017-06-29 00:54:10 -04:00
|
|
|
maven { url 'https://jitpack.io' }
|
2017-04-29 21:25:59 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
project(":desktop") {
|
|
|
|
apply plugin: "java"
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile project(":core")
|
2018-01-01 13:32:18 -05:00
|
|
|
compile project(":kryonet")
|
2018-09-25 23:27:19 -04:00
|
|
|
if(new File(projectDir.parent, '../debug').exists() && System.properties["release"] == null) compile project(":debug")
|
2018-09-10 19:33:12 -04:00
|
|
|
|
2017-04-29 21:25:59 -04:00
|
|
|
compile "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
|
|
|
|
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
2017-12-22 18:10:34 -05:00
|
|
|
compile "com.badlogicgames.gdx:gdx-controllers-lwjgl3:$gdxVersion"
|
2018-05-13 21:43:53 -07:00
|
|
|
compile 'com.github.MinnDevelopment:java-discord-rpc:v2.0.0'
|
2017-04-29 21:25:59 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
project(":html") {
|
|
|
|
apply plugin: "gwt"
|
|
|
|
apply plugin: "war"
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile project(":core")
|
2018-06-09 17:05:47 -04:00
|
|
|
compileOnly project(":annotations")
|
|
|
|
|
2017-04-29 21:25:59 -04:00
|
|
|
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
|
|
|
|
compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
|
|
|
|
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
|
2017-12-22 18:10:34 -05:00
|
|
|
|
|
|
|
compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion:sources"
|
|
|
|
compile "com.badlogicgames.gdx:gdx-controllers-gwt:$gdxVersion"
|
|
|
|
compile "com.badlogicgames.gdx:gdx-controllers-gwt:$gdxVersion:sources"
|
2017-04-29 21:25:59 -04:00
|
|
|
}
|
2018-10-03 15:53:33 -04:00
|
|
|
}
|
2018-06-09 17:05:47 -04:00
|
|
|
|
2018-04-27 16:01:37 -04:00
|
|
|
project(":ios") {
|
|
|
|
apply plugin: "java"
|
|
|
|
apply plugin: "robovm"
|
|
|
|
|
2018-08-08 14:42:10 -04:00
|
|
|
task copyGen{
|
2018-08-22 12:42:19 -04:00
|
|
|
copy{
|
|
|
|
from ("core/build/classes/java/main/io/anuke/mindustry/gen/"){
|
|
|
|
include "**/*.java"
|
2018-08-08 14:42:10 -04:00
|
|
|
}
|
2018-08-22 12:42:19 -04:00
|
|
|
|
|
|
|
into "ios/src/io/anuke/mindustry/gen"
|
2018-08-08 14:42:10 -04:00
|
|
|
}
|
|
|
|
|
2018-08-22 12:42:19 -04:00
|
|
|
doFirst{
|
2018-08-08 14:42:10 -04:00
|
|
|
delete{
|
2018-08-22 12:42:19 -04:00
|
|
|
delete "ios/src/io/anuke/mindustry/gen/"
|
2018-08-08 14:42:10 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-22 12:42:19 -04:00
|
|
|
build.dependsOn(copyGen)
|
2018-04-27 16:01:37 -04:00
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile project(":core")
|
2018-04-27 23:42:59 -04:00
|
|
|
implementation project(":kryonet")
|
|
|
|
|
2018-04-27 16:01:37 -04:00
|
|
|
compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
|
|
|
|
compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
|
|
|
|
compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
|
|
|
|
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-29 21:25:59 -04:00
|
|
|
project(":core") {
|
|
|
|
apply plugin: "java"
|
|
|
|
|
2018-07-21 00:44:13 -04:00
|
|
|
task finish {
|
|
|
|
generateLocales()
|
|
|
|
}
|
|
|
|
|
2017-04-29 21:25:59 -04:00
|
|
|
dependencies {
|
2018-06-06 14:51:25 -04:00
|
|
|
compileOnly project(":annotations")
|
2018-07-21 00:44:13 -04:00
|
|
|
build.finalizedBy(finish)
|
2018-05-12 07:30:23 -07:00
|
|
|
|
2018-07-26 14:19:58 -04:00
|
|
|
def comp = System.properties["release"] == null || System.properties["release"] == "false"
|
2018-07-26 15:17:23 -04:00
|
|
|
if(!comp) println("Note: Compiling release build.")
|
2017-12-24 20:50:00 -05:00
|
|
|
|
2018-05-09 09:46:24 -07:00
|
|
|
if(new File(projectDir.parent, '../uCore').exists() && comp){
|
2017-12-21 13:45:25 -08:00
|
|
|
compile project(":uCore")
|
|
|
|
}else{
|
2017-12-21 20:59:40 -05:00
|
|
|
compile "com.github.anuken:ucore:$uCoreVersion"
|
2017-12-21 13:45:25 -08:00
|
|
|
}
|
2017-12-24 20:50:00 -05:00
|
|
|
|
2018-05-15 20:03:03 -07:00
|
|
|
if(new File(projectDir.parent, '../GDXGifRecorder').exists() && comp) {
|
2017-12-21 21:56:01 -05:00
|
|
|
compile project(":GDXGifRecorder")
|
|
|
|
}
|
2018-05-12 07:30:23 -07:00
|
|
|
|
2017-04-29 21:25:59 -04:00
|
|
|
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
2017-12-22 18:10:34 -05:00
|
|
|
compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
|
2017-04-29 21:25:59 -04:00
|
|
|
}
|
2018-05-12 07:30:23 -07:00
|
|
|
|
2018-06-06 14:51:25 -04:00
|
|
|
compileJava.options.compilerArgs = [
|
2018-09-09 16:19:53 -04:00
|
|
|
"-processor", "io.anuke.annotations.RemoteMethodAnnotationProcessor,io.anuke.annotations.SerializeAnnotationProcessor"
|
2018-06-06 14:51:25 -04:00
|
|
|
]
|
2017-04-29 21:25:59 -04:00
|
|
|
}
|
|
|
|
|
2018-01-27 23:42:42 -05:00
|
|
|
project(":server") {
|
|
|
|
apply plugin: "java"
|
|
|
|
|
2018-07-14 10:02:13 +08:00
|
|
|
configurations {
|
2018-08-17 18:05:28 -04:00
|
|
|
if(findProject(":android") != null){
|
|
|
|
compile.exclude module: android
|
|
|
|
}
|
2018-07-14 10:02:13 +08:00
|
|
|
}
|
|
|
|
|
2018-01-27 23:42:42 -05:00
|
|
|
dependencies {
|
2018-06-14 17:11:38 -04:00
|
|
|
compileOnly project(":annotations")
|
|
|
|
|
2018-01-27 23:42:42 -05:00
|
|
|
compile project(":core")
|
|
|
|
compile project(":kryonet")
|
|
|
|
compile "com.badlogicgames.gdx:gdx-backend-headless:$gdxVersion"
|
2018-01-28 01:21:33 -05:00
|
|
|
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
2018-01-27 23:42:42 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-03 20:58:35 -04:00
|
|
|
project(":tests"){
|
|
|
|
apply plugin: "java"
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
testImplementation project(":core")
|
|
|
|
testImplementation('org.junit.jupiter:junit-jupiter-api:5.1.0')
|
|
|
|
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.1.0')
|
|
|
|
testImplementation "com.badlogicgames.gdx:gdx-backend-headless:$gdxVersion"
|
|
|
|
testImplementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
workingDir = new File("../core/assets")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-03 15:53:33 -04:00
|
|
|
project(":tools") {
|
2018-06-15 18:06:05 -04:00
|
|
|
apply plugin: "java"
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile project(":core")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-12 07:30:23 -07:00
|
|
|
project(":annotations") {
|
|
|
|
apply plugin: "java"
|
|
|
|
|
2018-05-13 16:41:50 -07:00
|
|
|
dependencies {
|
|
|
|
compile 'com.squareup:javapoet:1.11.0'
|
|
|
|
}
|
2018-05-12 07:30:23 -07:00
|
|
|
}
|
|
|
|
|
2018-01-01 13:32:18 -05:00
|
|
|
project(":kryonet") {
|
|
|
|
apply plugin: "java"
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile project(":core")
|
2018-09-08 17:07:25 -04:00
|
|
|
compile "org.lz4:lz4-java:1.4.1"
|
2018-09-09 17:44:10 -04:00
|
|
|
compile 'com.github.Anuken:kryonet:53b10247b1'
|
2018-08-30 21:39:27 -04:00
|
|
|
compile 'com.github.Anuken:WaifUPnP:05eb46bc577fd7674596946ba288c96c0cedd893'
|
2018-01-01 13:32:18 -05:00
|
|
|
}
|
2018-09-29 02:50:21 -07:00
|
|
|
}
|