1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-09-11 08:15:35 +03:00
Mindustry/build.gradle

246 lines
6.9 KiB
Groovy
Raw Normal View History

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