-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
80 lines (70 loc) · 2.82 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
plugins {
id 'java'
id 'maven-publish'
}
group = 'net.phoenix'
version = '1.0.3'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.jetbrains:annotations:24.0.0'
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
implementation files("${System.properties['java.home']}/lib/tools.jar")
implementation 'com.google.auto.service:auto-service:1.1.1'
annotationProcessor('com.google.auto.service:auto-service:1.1.1')
}
test {
useJUnitPlatform()
}
compileJava {
options.fork = true
options.forkOptions.with {
jvmArgs = [
'--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
]
}
options.compilerArgs += [
'--add-exports', 'jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED',
'--add-exports', 'jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED',
'--add-exports', 'jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED',
'--add-exports', 'jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED',
'--add-exports', 'jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED',
'--add-exports', 'jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED',
'--add-exports', 'jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED',
'--add-exports', 'jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED',
'--add-exports', 'jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
]
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
version = '1.0.' + project.properties['VERSION_CODE']
}
}
repositories {
mavenLocal()
}
}
tasks.register('incrementVersion') {
doLast {
def propsFile = file('gradle.properties')
def props = new Properties()
propsFile.withInputStream { props.load(it) }
def versionCode = props['VERSION_CODE'].toInteger()
versionCode++
props['VERSION_CODE'] = versionCode.toString()
propsFile.withWriter { props.store(it, null) }
}
}
tasks.getByName('publish').dependsOn('incrementVersion')