-
Notifications
You must be signed in to change notification settings - Fork 29
/
build.gradle
94 lines (78 loc) · 3.35 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
buildscript{
dependencies{
classpath "com.github.Anuken.MindustryJitpack:core:$mindustryVersion"
classpath "com.squareup:javapoet:$javapoetVersion"
classpath "com.github.Anuken:jabel:$jabelVersion"
}
repositories{
mavenCentral()
maven{ url "https://raw.githubusercontent.com/Zelaux/MindustryRepo/master/repository" }
maven{ url 'https://jitpack.io' }
}
}
allprojects{
apply plugin: 'java'
apply plugin: 'maven-publish'
group = 'com.github.AvantTeam'
version = modVersion
ext{
sdkRoot = System.getenv('ANDROID_HOME') ?: System.getenv('ANDROID_SDK_ROOT')
windows = System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')
taskNames = gradle.startParameter.taskNames
assetsDir = new File(project(':main').projectDir, 'assets/')
assetsRawDir = new File(project(':main').projectDir, 'assets-raw/')
spritesDir = new File(assetsDir, 'sprites/')
spritesRawDir = new File(assetsRawDir, 'sprites/')
// `-Pmain.dev` will initiate a development build. Default is `false`.
devBuild = project.hasProperty('main.dev') && Boolean.parseBoolean(project.property('main.dev') as String)
// `-Ptools.recompile` will force the :main project to recompile. Default is `false`.
toolRecompile = project.hasProperty('tools.recompile') && Boolean.parseBoolean(project.property('tools.recompile') as String)
// `-Ptools.rearch` will make the .jar file resulted from :main:deploy and/or :main:deployDex also include the generated
// assets, without recompiling. Default is `true`.
// See also :tools:rearchive
toolRearchive = !project.hasProperty('tools.rearch') || Boolean.parseBoolean(project.property('tools.rearch') as String)
}
repositories{
mavenCentral()
maven{ url "https://raw.githubusercontent.com/Zelaux/MindustryRepo/master/repository" }
maven{ url "https://jitpack.io" }
}
task sourcesJar(type: Jar, dependsOn: classes){
archiveClassifier.set 'sources'
from sourceSets.main.allSource
}
artifacts{
archives sourcesJar
}
java{
withJavadocJar()
withSourcesJar()
}
publishing{
publications{
maven(MavenPublication){
from components.java
}
}
}
tasks.withType(JavaCompile){
options.incremental = true
options.encoding = 'UTF-8'
options.compilerArgs += '-Xlint:deprecation'
options.fork = true
options.forkOptions.jvmArgs += [
'--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED',
'--add-opens=java.base/sun.reflect.annotation=ALL-UNNAMED'
]
}
tasks.withType(Javadoc){
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('-release', '16')
}
}