2018-12-13 18:01:51 -05:00
|
|
|
buildscript{
|
2020-01-22 19:16:56 -05:00
|
|
|
ext{
|
2020-01-24 10:23:48 -05:00
|
|
|
getArcHash = {
|
|
|
|
return new Properties().with{ p -> p.load(file('gradle.properties').newReader()); return p }["archash"]
|
|
|
|
}
|
|
|
|
|
|
|
|
arcHash = getArcHash()
|
2020-01-22 19:16:56 -05:00
|
|
|
}
|
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
repositories{
|
2017-04-29 21:25:59 -04:00
|
|
|
mavenLocal()
|
|
|
|
mavenCentral()
|
2017-12-19 20:51:46 -05:00
|
|
|
google()
|
2018-12-13 18:01:51 -05:00
|
|
|
maven{ url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
2019-10-22 18:45:05 -04:00
|
|
|
maven{ url 'https://jitpack.io' }
|
2017-04-29 21:25:59 -04:00
|
|
|
}
|
2018-12-29 15:58:11 -05:00
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
dependencies{
|
2020-10-28 10:29:32 -04:00
|
|
|
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.11'
|
2020-01-24 10:23:48 -05:00
|
|
|
classpath "com.github.Anuken.Arc:packer:$arcHash"
|
|
|
|
classpath "com.github.Anuken.Arc:arc-core:$arcHash"
|
2017-04-29 21:25:59 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-03 00:59:57 -04:00
|
|
|
plugins{
|
2021-04-02 17:25:07 -07:00
|
|
|
id 'org.jetbrains.kotlin.jvm' version '1.4.32'
|
|
|
|
id "org.jetbrains.kotlin.kapt" version "1.4.32"
|
|
|
|
}
|
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
allprojects{
|
2021-06-02 11:08:08 -04:00
|
|
|
apply plugin: 'maven-publish'
|
2020-04-29 19:54:20 -04:00
|
|
|
|
|
|
|
version = 'release'
|
2019-08-28 22:07:08 -04:00
|
|
|
group = 'com.github.Anuken'
|
2018-02-21 19:50:27 -05:00
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
ext{
|
2021-06-02 11:08:08 -04:00
|
|
|
versionNumber = '7'
|
2021-06-02 11:30:13 -04:00
|
|
|
if(!project.hasProperty("versionModifier")) versionModifier = 'dev'
|
2018-12-13 18:01:51 -05:00
|
|
|
if(!project.hasProperty("versionType")) versionType = 'official'
|
2018-02-08 23:41:07 -05:00
|
|
|
appName = 'Mindustry'
|
2021-06-02 11:08:08 -04:00
|
|
|
steamworksVersion = '0b86023401880bb5e586bc404bedbaae9b1f1c94'
|
2021-06-09 08:32:09 -04:00
|
|
|
rhinoVersion = '55bf0dac1cfa7770672fd26112512c733ca9d5dc'
|
2019-04-08 09:03:18 -04:00
|
|
|
|
2019-11-19 19:08:41 -05:00
|
|
|
loadVersionProps = {
|
|
|
|
return new Properties().with{p -> p.load(file('../core/assets/version.properties').newReader()); return p }
|
|
|
|
}
|
|
|
|
|
2019-02-07 23:06:43 -05:00
|
|
|
debugged = {
|
2019-09-21 16:44:47 -04:00
|
|
|
return new File(projectDir.parent, '../Mindustry-Debug').exists() && !project.hasProperty("release") && project.hasProperty("args")
|
2019-02-07 23:06:43 -05:00
|
|
|
}
|
2018-12-29 12:22:41 -05:00
|
|
|
|
|
|
|
localArc = {
|
2019-09-13 13:05:10 -04:00
|
|
|
return !project.hasProperty("release") && new File(projectDir.parent, '../Arc').exists()
|
2018-12-29 12:22:41 -05:00
|
|
|
}
|
|
|
|
|
2018-12-29 11:59:43 -05:00
|
|
|
arcModule = { String name ->
|
2018-12-29 12:22:41 -05:00
|
|
|
if(localArc()){
|
2018-12-29 11:59:43 -05:00
|
|
|
return project(":Arc:$name")
|
|
|
|
}else{
|
2018-12-29 12:22:41 -05:00
|
|
|
//skip to last submodule
|
2018-12-29 11:59:43 -05:00
|
|
|
if(name.contains(':')) name = name.split(':').last()
|
2018-12-29 12:22:41 -05:00
|
|
|
return "com.github.Anuken.Arc:$name:${getArcHash()}"
|
2018-12-29 11:59:43 -05:00
|
|
|
}
|
|
|
|
}
|
2018-02-08 23:41:07 -05:00
|
|
|
|
2019-08-16 11:00:15 -04:00
|
|
|
generateDeployName = { String platform ->
|
|
|
|
if(platform == "windows"){
|
|
|
|
platform += "64"
|
|
|
|
}
|
|
|
|
platform = platform.capitalize()
|
|
|
|
|
|
|
|
if(platform.endsWith("64") || platform.endsWith("32")){
|
|
|
|
platform = "${platform.substring(0, platform.length() - 2)}-${platform.substring(platform.length() - 2)}bit"
|
|
|
|
}
|
|
|
|
|
2019-08-16 11:14:18 -04:00
|
|
|
return "[${platform}]${getModifierString()}[${getNeatVersionString()}]${appName}"
|
2019-08-16 11:00:15 -04:00
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2019-08-16 11:00:15 -04:00
|
|
|
getNeatVersionString = {
|
|
|
|
String buildVersion = getBuildVersion()
|
|
|
|
return "v$buildVersion"
|
|
|
|
}
|
|
|
|
|
2020-12-15 15:24:09 -05:00
|
|
|
hasSprites = {
|
2021-06-02 11:08:08 -04:00
|
|
|
return new File(rootDir, "core/assets/sprites/sprites.aatls").exists()
|
2020-12-15 15:24:09 -05:00
|
|
|
}
|
|
|
|
|
2019-08-16 11:00:15 -04:00
|
|
|
getModifierString = {
|
2021-06-02 11:08:08 -04:00
|
|
|
if(versionModifier != "release") return "[${versionModifier.toUpperCase()}]"
|
2019-08-16 11:00:15 -04:00
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2020-11-20 12:38:16 -05:00
|
|
|
findSdkDir = {
|
|
|
|
//null because IntelliJ doesn't get env variables
|
|
|
|
def v = System.getenv("ANDROID_HOME")
|
|
|
|
if(v != null) return v
|
|
|
|
//rootDir is null here, amazing. brilliant.
|
2021-06-02 11:08:08 -04:00
|
|
|
def file = new File(rootDir, "local.properties")
|
2020-11-20 12:38:16 -05:00
|
|
|
def props = new Properties().with{p -> p.load(file.newReader()); return p }
|
|
|
|
return props.get("sdk.dir")
|
|
|
|
}
|
|
|
|
|
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-12-13 18:01:51 -05: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
|
2020-06-05 10:45:57 -04:00
|
|
|
new File(project(':core').projectDir, 'assets/basepartnames').text = new File(project(':core').projectDir, 'assets/baseparts/').list().join("\n")
|
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()
|
2019-04-08 09:03:18 -04:00
|
|
|
}catch(Exception ignored){
|
|
|
|
}
|
2018-05-03 13:04:30 -04:00
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
if(pfile.exists()){
|
2018-05-03 13:04:30 -04:00
|
|
|
props.load(new FileInputStream(pfile))
|
|
|
|
|
2018-09-04 12:10:48 -04:00
|
|
|
String buildid = getBuildVersion()
|
2019-08-25 22:02:00 -04:00
|
|
|
println("Compiling with build: '$buildid'")
|
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.")
|
|
|
|
}
|
|
|
|
}
|
2020-01-24 18:31:54 -05:00
|
|
|
|
|
|
|
writeProcessors = {
|
2020-01-26 13:16:42 -05:00
|
|
|
new File(rootDir, "annotations/src/main/resources/META-INF/services/").mkdirs()
|
2020-01-24 18:31:54 -05:00
|
|
|
def processorFile = new File(rootDir, "annotations/src/main/resources/META-INF/services/javax.annotation.processing.Processor")
|
|
|
|
def text = new StringBuilder()
|
|
|
|
def files = new File(rootDir, "annotations/src/main/java")
|
|
|
|
files.eachFileRecurse(groovy.io.FileType.FILES){ file ->
|
|
|
|
if(file.name.endsWith(".java") && (file.text.contains(" extends BaseProcessor") || (file.text.contains(" extends AbstractProcessor") && !file.text.contains("abstract class")))){
|
|
|
|
text.append(file.path.substring(files.path.length() + 1)).append("\n")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
processorFile.text = text.toString().replace(".java", "").replace("/", ".").replace("\\", ".")
|
|
|
|
}
|
2020-05-27 18:11:42 -04:00
|
|
|
|
|
|
|
writePlugins = {
|
|
|
|
new File(rootDir, "annotations/src/main/resources/META-INF/services/").mkdirs()
|
|
|
|
def processorFile = new File(rootDir, "annotations/src/main/resources/META-INF/services/com.sun.source.util.Plugin")
|
|
|
|
def text = new StringBuilder()
|
|
|
|
def files = new File(rootDir, "annotations/src/main/java")
|
|
|
|
files.eachFileRecurse(groovy.io.FileType.FILES){ file ->
|
|
|
|
if(file.name.endsWith(".java") && (file.text.contains(" implements Plugin"))){
|
|
|
|
text.append(file.path.substring(files.path.length() + 1)).append("\n")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
processorFile.text = text.toString().replace(".java", "").replace("/", ".").replace("\\", ".")
|
|
|
|
}
|
2017-04-29 21:25:59 -04:00
|
|
|
}
|
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
repositories{
|
2017-04-29 21:25:59 -04:00
|
|
|
mavenLocal()
|
|
|
|
mavenCentral()
|
2018-12-13 18:01:51 -05: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-29 21:25:59 -04:00
|
|
|
}
|
2019-06-12 14:03:50 -04:00
|
|
|
|
2020-11-09 14:33:28 -05:00
|
|
|
task clearCache{
|
|
|
|
doFirst{
|
|
|
|
delete{
|
|
|
|
delete "$rootDir/core/assets/cache"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-15 21:52:51 -04:00
|
|
|
tasks.withType(JavaCompile){
|
2020-09-29 23:55:55 -04:00
|
|
|
targetCompatibility = 8
|
2021-06-15 19:29:12 -04:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_16
|
2020-06-15 21:52:51 -04:00
|
|
|
options.encoding = "UTF-8"
|
2020-06-26 14:27:26 -04:00
|
|
|
options.compilerArgs += ["-Xlint:deprecation"]
|
2020-11-09 14:33:28 -05:00
|
|
|
dependsOn clearCache
|
2021-06-02 11:08:08 -04:00
|
|
|
|
|
|
|
options.forkOptions.jvmArgs.addAll([
|
|
|
|
'--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED',
|
|
|
|
'--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED'
|
|
|
|
])
|
2020-06-15 21:52:51 -04:00
|
|
|
}
|
2017-04-29 21:25:59 -04:00
|
|
|
}
|
|
|
|
|
2020-09-29 23:55:55 -04:00
|
|
|
configure(project(":annotations")){
|
|
|
|
tasks.withType(JavaCompile){
|
|
|
|
targetCompatibility = 8
|
|
|
|
sourceCompatibility = 8
|
2021-06-02 11:08:08 -04:00
|
|
|
options.fork = true
|
2020-09-29 23:55:55 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//compile with java 8 compatibility for everything except the annotation project
|
2020-08-14 19:45:22 -04:00
|
|
|
configure(subprojects - project(":annotations")){
|
|
|
|
tasks.withType(JavaCompile){
|
2021-06-15 19:29:12 -04:00
|
|
|
options.compilerArgs.addAll(['--release', '8'])
|
2020-08-14 19:45:22 -04:00
|
|
|
}
|
2020-08-23 12:02:45 -04:00
|
|
|
|
|
|
|
tasks.withType(Javadoc){
|
2020-10-02 12:06:16 -04:00
|
|
|
options{
|
|
|
|
addStringOption('Xdoclint:none', '-quiet')
|
2021-06-15 19:29:12 -04:00
|
|
|
addStringOption('-release', '16')
|
2020-10-02 12:06:16 -04:00
|
|
|
}
|
2020-08-23 12:02:45 -04:00
|
|
|
}
|
2020-08-14 19:45:22 -04:00
|
|
|
}
|
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
project(":desktop"){
|
2017-04-29 21:25:59 -04:00
|
|
|
apply plugin: "java"
|
|
|
|
|
2020-02-07 10:47:58 -05:00
|
|
|
compileJava.options.fork = true
|
|
|
|
|
2019-07-25 11:45:49 -04:00
|
|
|
dependencies{
|
2020-05-12 12:31:09 -04:00
|
|
|
implementation project(":core")
|
2021-06-02 11:08:08 -04:00
|
|
|
implementation arcModule("extensions:discord")
|
2020-05-12 12:31:09 -04:00
|
|
|
implementation arcModule("natives:natives-desktop")
|
|
|
|
implementation arcModule("natives:natives-freetype-desktop")
|
2019-07-25 11:45:49 -04:00
|
|
|
|
2020-05-12 12:31:09 -04:00
|
|
|
if(debugged()) implementation project(":debug")
|
2019-07-25 11:45:49 -04:00
|
|
|
|
2020-05-12 12:31:09 -04:00
|
|
|
implementation "com.github.Anuken:steamworks4j:$steamworksVersion"
|
2019-08-18 15:26:06 -04:00
|
|
|
|
2020-05-12 12:31:09 -04:00
|
|
|
implementation arcModule("backends:backend-sdl")
|
2019-07-25 11:45:49 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
project(":ios"){
|
2018-04-27 16:01:37 -04:00
|
|
|
apply plugin: "java"
|
|
|
|
apply plugin: "robovm"
|
|
|
|
|
2018-11-20 19:28:26 -05:00
|
|
|
task incrementConfig{
|
|
|
|
def vfile = file('robovm.properties')
|
2020-12-02 13:51:05 -05:00
|
|
|
def bversion = getBuildVersion()
|
2018-11-20 19:28:26 -05:00
|
|
|
def props = new Properties()
|
2018-11-21 11:00:50 -05:00
|
|
|
if(vfile.exists()){
|
|
|
|
props.load(new FileInputStream(vfile))
|
2019-10-20 17:08:54 -04:00
|
|
|
}else{
|
|
|
|
props['app.id'] = 'io.anuke.mindustry'
|
2020-12-02 13:51:05 -05:00
|
|
|
props['app.version'] = '6.0'
|
2019-12-25 12:06:19 -05:00
|
|
|
props['app.mainclass'] = 'mindustry.IOSLauncher'
|
2019-10-20 17:08:54 -04:00
|
|
|
props['app.executable'] = 'IOSLauncher'
|
|
|
|
props['app.name'] = 'Mindustry'
|
2018-11-21 11:00:50 -05:00
|
|
|
}
|
2019-10-20 17:08:54 -04:00
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
props['app.build'] = (!props.containsKey("app.build") ? 40 : props['app.build'].toInteger() + 1) + ""
|
2020-12-02 13:51:05 -05:00
|
|
|
if(bversion != "custom build"){
|
2020-12-02 14:14:42 -05:00
|
|
|
props['app.version'] = versionNumber + "." + bversion + (bversion.contains(".") ? "" : ".0")
|
2020-12-02 13:51:05 -05:00
|
|
|
}
|
2018-11-20 19:28:26 -05:00
|
|
|
props.store(vfile.newWriter(), null)
|
|
|
|
}
|
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
dependencies{
|
2020-05-12 12:31:09 -04:00
|
|
|
implementation project(":core")
|
2019-04-08 09:03:18 -04:00
|
|
|
|
2020-05-12 12:31:09 -04:00
|
|
|
implementation arcModule("natives:natives-ios")
|
|
|
|
implementation arcModule("natives:natives-freetype-ios")
|
|
|
|
implementation arcModule("backends:backend-robovm")
|
2019-04-08 09:03:18 -04:00
|
|
|
|
2020-04-29 18:29:19 -04:00
|
|
|
compileOnly project(":annotations")
|
2018-04-27 16:01:37 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
project(":core"){
|
2020-05-12 12:31:09 -04:00
|
|
|
apply plugin: "java-library"
|
2021-04-02 17:25:07 -07:00
|
|
|
apply plugin: "kotlin"
|
|
|
|
apply plugin: "kotlin-kapt"
|
|
|
|
|
2021-04-03 00:59:57 -04:00
|
|
|
kapt{
|
|
|
|
javacOptions{
|
2021-06-15 19:29:12 -04:00
|
|
|
option("-source", "16")
|
2021-04-02 17:25:07 -07:00
|
|
|
option("-target", "1.8")
|
|
|
|
}
|
|
|
|
}
|
2017-04-29 21:25:59 -04:00
|
|
|
|
2020-10-18 21:15:30 +08:00
|
|
|
compileJava.options.fork = true
|
|
|
|
|
2019-06-23 10:52:03 -04:00
|
|
|
task preGen{
|
2019-10-20 17:05:23 -04:00
|
|
|
outputs.upToDateWhen{ false }
|
2018-07-21 00:44:13 -04:00
|
|
|
generateLocales()
|
2019-08-25 22:02:00 -04:00
|
|
|
writeVersion()
|
2020-01-24 18:31:54 -05:00
|
|
|
writeProcessors()
|
2020-05-27 18:11:42 -04:00
|
|
|
writePlugins()
|
2018-07-21 00:44:13 -04:00
|
|
|
}
|
|
|
|
|
2019-11-19 19:08:41 -05:00
|
|
|
task copyChangelog{
|
|
|
|
doLast{
|
|
|
|
def props = loadVersionProps()
|
|
|
|
def androidVersion = props['androidBuildCode'].toInteger() - 2
|
|
|
|
def loglines = file("../changelog").text.split("\n")
|
2020-11-30 18:58:20 -05:00
|
|
|
def notice = "[This is a truncated changelog, see Github for full notes]"
|
2019-11-19 19:08:41 -05:00
|
|
|
def maxLength = 460
|
|
|
|
|
2020-11-30 18:58:20 -05:00
|
|
|
def androidLogList = [notice] + loglines.findAll{ line -> !line.endsWith("]") || line.endsWith("[Mobile]") || line.endsWith("[Android]")}
|
2019-11-19 19:08:41 -05:00
|
|
|
def result = ""
|
2020-05-18 15:38:56 -04:00
|
|
|
androidLogList.forEach{line ->
|
2019-11-19 19:08:41 -05:00
|
|
|
if(result.length() + line.length() + 1 < maxLength){
|
|
|
|
result += line + "\n"
|
|
|
|
}
|
2020-05-18 15:38:56 -04:00
|
|
|
}
|
2019-11-19 19:08:41 -05:00
|
|
|
def changelogs = file("../fastlane/metadata/android/en-US/changelogs/")
|
|
|
|
new File(changelogs, androidVersion + ".txt").text = (result)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-08 23:59:11 +09:00
|
|
|
task sourcesJar(type: Jar, dependsOn: classes){
|
2021-03-24 12:41:50 -04:00
|
|
|
archiveClassifier = 'sources'
|
2021-02-08 23:59:11 +09:00
|
|
|
from sourceSets.main.allSource
|
|
|
|
}
|
2021-03-25 00:38:02 +08:00
|
|
|
|
|
|
|
task assetsJar(type: Jar, dependsOn: ":tools:pack"){
|
2021-03-24 12:41:50 -04:00
|
|
|
archiveClassifier = 'assets'
|
2021-03-25 00:38:02 +08:00
|
|
|
from files("assets"){
|
2021-03-24 12:41:50 -04:00
|
|
|
exclude "config", "cache", "music", "sounds"
|
2021-03-25 00:38:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task musicJar(type: Jar){
|
2021-03-24 12:41:50 -04:00
|
|
|
archiveClassifier = 'music'
|
2021-03-25 00:38:02 +08:00
|
|
|
from files("assets"){
|
2021-03-24 12:41:50 -04:00
|
|
|
include "music/*", "sounds/*"
|
2021-03-25 00:38:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-10 23:37:47 +09:00
|
|
|
artifacts{
|
|
|
|
archives sourcesJar
|
2021-03-25 00:38:02 +08:00
|
|
|
archives assetsJar
|
2021-02-10 23:37:47 +09:00
|
|
|
}
|
2021-02-08 23:59:11 +09:00
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
dependencies{
|
2019-06-23 10:52:03 -04:00
|
|
|
compileJava.dependsOn(preGen)
|
2019-05-05 11:36:38 -04:00
|
|
|
|
2021-06-02 11:08:08 -04:00
|
|
|
api "org.lz4:lz4-java:1.7.1"
|
2020-05-12 12:31:09 -04:00
|
|
|
api arcModule("arc-core")
|
2021-06-02 11:08:08 -04:00
|
|
|
api arcModule("extensions:flabel")
|
2020-05-12 12:31:09 -04:00
|
|
|
api arcModule("extensions:freetype")
|
|
|
|
api arcModule("extensions:g3d")
|
|
|
|
api arcModule("extensions:fx")
|
|
|
|
api arcModule("extensions:arcnet")
|
2020-06-15 23:22:14 -04:00
|
|
|
api "com.github.Anuken:rhino:$rhinoVersion"
|
2020-05-12 12:31:09 -04:00
|
|
|
if(localArc() && debugged()) api arcModule("extensions:recorder")
|
2021-06-02 11:08:08 -04:00
|
|
|
if(localArc()) api arcModule(":extensions:packer")
|
2018-05-12 07:30:23 -07:00
|
|
|
|
2020-10-18 11:53:36 -04:00
|
|
|
annotationProcessor 'com.github.Anuken:jabel:34e4c172e65b3928cd9eabe1993654ea79c409cd'
|
2021-04-02 17:25:07 -07:00
|
|
|
compileOnly project(":annotations")
|
|
|
|
kapt project(":annotations")
|
2017-04-29 21:25:59 -04:00
|
|
|
}
|
2021-02-05 11:21:27 -05:00
|
|
|
|
|
|
|
afterEvaluate{
|
|
|
|
task mergedJavadoc(type: Javadoc){
|
2021-02-06 08:43:15 -05:00
|
|
|
def blacklist = [project(":ios"), project(":desktop"), project(":server"), project(":annotations")]
|
|
|
|
if(findProject(":android") != null){
|
|
|
|
blacklist += project(":android")
|
|
|
|
}
|
2021-02-05 11:21:27 -05:00
|
|
|
|
|
|
|
source rootProject.subprojects.collect{ project ->
|
|
|
|
if(!blacklist.contains(project) && project.hasProperty("sourceSets")){
|
|
|
|
return project.sourceSets.main.allJava
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
classpath = files(rootProject.subprojects.collect { project ->
|
|
|
|
if(!blacklist.contains(project) && project.hasProperty("sourceSets")){
|
|
|
|
return project.sourceSets.main.compileClasspath
|
|
|
|
}
|
|
|
|
})
|
|
|
|
destinationDir = new File(buildDir, 'javadoc')
|
|
|
|
}
|
|
|
|
}
|
2021-04-03 11:15:41 -04:00
|
|
|
|
|
|
|
//comp** classes are only used for code generation
|
|
|
|
jar{
|
|
|
|
exclude("mindustry/entities/comp/**")
|
|
|
|
}
|
2017-04-29 21:25:59 -04:00
|
|
|
}
|
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
project(":server"){
|
2018-01-27 23:42:42 -05:00
|
|
|
apply plugin: "java"
|
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
dependencies{
|
2020-05-12 12:31:09 -04:00
|
|
|
implementation project(":core")
|
|
|
|
implementation arcModule("backends:backend-headless")
|
2018-01-27 23:42:42 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-03 20:58:35 -04:00
|
|
|
project(":tests"){
|
|
|
|
apply plugin: "java"
|
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
dependencies{
|
2018-10-03 20:58:35 -04:00
|
|
|
testImplementation project(":core")
|
2021-04-08 11:25:48 -03:00
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-params:5.7.1"
|
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-api:5.7.1"
|
2020-05-12 12:31:09 -04:00
|
|
|
testImplementation arcModule("backends:backend-headless")
|
2021-04-08 11:25:48 -03:00
|
|
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.7.1"
|
2018-10-03 20:58:35 -04:00
|
|
|
}
|
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
test{
|
2021-06-15 19:29:12 -04:00
|
|
|
//fork every test so mods don't interact with each other
|
|
|
|
forkEvery = 1
|
2018-10-03 20:58:35 -04:00
|
|
|
useJUnitPlatform()
|
|
|
|
workingDir = new File("../core/assets")
|
2021-06-02 11:08:08 -04:00
|
|
|
testLogging{
|
2020-05-07 14:35:24 -04:00
|
|
|
exceptionFormat = 'full'
|
2020-08-13 20:28:36 -04:00
|
|
|
showStandardStreams = true
|
2020-05-07 14:35:24 -04:00
|
|
|
}
|
2018-10-03 20:58:35 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
project(":tools"){
|
2018-06-15 18:06:05 -04:00
|
|
|
apply plugin: "java"
|
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
dependencies{
|
2020-05-12 12:31:09 -04:00
|
|
|
implementation project(":core")
|
2019-06-20 16:27:57 -04:00
|
|
|
|
2020-05-12 12:31:09 -04:00
|
|
|
implementation arcModule("natives:natives-desktop")
|
|
|
|
implementation arcModule("natives:natives-freetype-desktop")
|
|
|
|
implementation arcModule("backends:backend-headless")
|
2018-06-15 18:06:05 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
project(":annotations"){
|
2020-05-12 12:31:09 -04:00
|
|
|
apply plugin: "java-library"
|
2018-05-12 07:30:23 -07:00
|
|
|
|
2018-12-13 18:01:51 -05:00
|
|
|
dependencies{
|
2020-05-12 12:31:09 -04:00
|
|
|
implementation 'com.squareup:javapoet:1.12.1'
|
|
|
|
implementation "com.github.Anuken.Arc:arc-core:$arcHash"
|
2018-05-13 16:41:50 -07:00
|
|
|
}
|
2018-05-12 07:30:23 -07:00
|
|
|
}
|
|
|
|
|
2021-06-02 11:08:08 -04:00
|
|
|
configure([":core", ":desktop", ":server", ":tools"].collect{project(it)}){
|
|
|
|
java{
|
|
|
|
withJavadocJar()
|
|
|
|
withSourcesJar()
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing{
|
|
|
|
publications{
|
|
|
|
maven(MavenPublication){
|
|
|
|
from components.java
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-21 14:46:36 -04:00
|
|
|
task deployAll{
|
|
|
|
task cleanDeployOutput{
|
|
|
|
doFirst{
|
2020-05-12 12:32:53 -04:00
|
|
|
if(getBuildVersion() == "custom build" || getBuildVersion() == "") throw new IllegalArgumentException("----\n\nSET A BUILD NUMBER FIRST!\n\n----")
|
2019-08-21 14:46:36 -04:00
|
|
|
if(!project.hasProperty("release")) throw new IllegalArgumentException("----\n\nSET THE RELEASE PROJECT PROPERTY FIRST!\n\n----")
|
|
|
|
|
|
|
|
delete{
|
|
|
|
delete "deploy/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependsOn cleanDeployOutput
|
2019-08-21 15:41:38 -04:00
|
|
|
dependsOn "desktop:packrLinux64"
|
|
|
|
dependsOn "desktop:packrWindows64"
|
|
|
|
dependsOn "desktop:packrWindows32"
|
|
|
|
dependsOn "desktop:packrMacOS"
|
2019-08-21 14:46:36 -04:00
|
|
|
dependsOn "server:deploy"
|
|
|
|
dependsOn "android:deploy"
|
2019-09-02 12:40:52 -04:00
|
|
|
}
|
2021-01-10 21:39:50 +01:00
|
|
|
|
|
|
|
task resolveDependencies{
|
|
|
|
doLast{
|
2021-01-10 16:33:20 -05:00
|
|
|
rootProject.allprojects{ project ->
|
2021-01-10 21:39:50 +01:00
|
|
|
Set<Configuration> configurations = project.buildscript.configurations + project.configurations
|
2021-01-10 16:33:20 -05:00
|
|
|
configurations.findAll{c -> c.canBeResolved}.forEach{c -> c.resolve()}
|
2021-01-10 21:39:50 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|