forked from anyicomplex/gdx-svmhelper
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
199 lines (180 loc) · 5.86 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
ext {
isReleaseBuild = {
return project.hasProperty("RELEASE")
}
graalhelperVersion = "2.0.2" + (isReleaseBuild() ? "" : "-SNAPSHOT")
gdxVersion = '1.12.1'
gdxControllersVersion = '2.2.3'
graalvmVersion = '22.3.1'
}
allprojects {
apply plugin: "java-library"
group 'io.github.berstanio'
version graalhelperVersion
}
configure(allprojects - project(":annotations")) {
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
compileOnlyApi "org.graalvm.nativeimage:svm:$graalvmVersion"
}
}
dependencies {
api project(":annotations")
compileOnly "com.badlogicgames.gdx:gdx:$gdxVersion"
}
project(":annotations") {
java {
sourceCompatibility = "1.7"
targetCompatibility = "1.7"
}
}
project(":backends:lwjgl3") {
dependencies {
api project(":")
compileOnly "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
}
}
project(":backends:moe") {
dependencies {
api project(":")
}
}
project(":extensions:box2d") {
dependencies {
api project(":")
compileOnly "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
}
}
project(":extensions:bullet") {
dependencies {
api project(":")
compileOnly "com.badlogicgames.gdx:gdx-bullet:$gdxVersion"
}
}
project(":extensions:freetype") {
dependencies {
api project(":")
compileOnly "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
}
}
project(":extensions:controllers-lwjgl3") {
dependencies {
api project(":")
compileOnly "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:$gdxControllersVersion"
}
}
project(":extensions:controllers-moe") {
dependencies {
api project(":")
}
}
configure([
project(":"),
project(":annotations"),
project(":backends:lwjgl3"),
project(":backends:moe"),
project(":extensions:box2d"),
project(":extensions:bullet"),
project(":extensions:freetype"),
project(":extensions:controllers-lwjgl3"),
//project(":extensions:controllers-moe"),
]) {
apply plugin: 'maven-publish'
apply plugin: 'signing'
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
def idStr = rootProject.name
if (project.name != rootProject.name) {
idStr += "-"
if (project.parent.name != rootProject.name) {
idStr += project.parent.name.substring(0, project.parent.name.length() - 1)
idStr += "-"
}
idStr += project.name
}
artifactId = idStr
groupId = project.group
version = project.version
from components.java
pom {
def nameStr = "Gdx GraalVM Native Image Helper"
if (project.name != rootProject.name) {
nameStr += " ("
nameStr += project.parent.name.substring(0, 1).toUpperCase()
nameStr += project.parent.name.substring(1, project.parent.name.length() - 1)
nameStr += " "
nameStr += project.name.substring(0, 1).toUpperCase()
nameStr += project.name.substring(1, project.name.length())
nameStr += ")"
}
name = nameStr
description = 'Experimental helper for libGDX to build GraalVM Native Image.'
url = 'https://github.com/anyicomplex/gdx-svmhelper'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'anyicomplex'
name = 'Yi An'
email = 'anyicomplex@protonmail.com'
}
}
scm {
connection = 'scm:git:https://github.com/anyicomplex/gdx-svmhelper.git'
developerConnection = 'scm:git:git@github.com:anyicomplex/gdx-svmhelper.git'
url = 'https://github.com/anyicomplex/gdx-svmhelper/tree/main'
}
}
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
}
}
repositories {
maven {
name = "OSSRH"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
if (!isReleaseBuild()) {
url "https://s01.oss.sonatype.org/content/repositories/snapshots"
} else {
url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2"
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.mavenJava
}
//Simply using "required" in signing block doesn't work because taskGraph isn't ready yet.
gradle.taskGraph.whenReady {
tasks.withType(Sign) {
onlyIf { isReleaseBuild() }
}
}
}