@@ -10,6 +10,7 @@ plugins {
10
10
id(" org.spongepowered.gradle.sponge.dev" ) apply false // for version json generation
11
11
id(" implementation-structure" )
12
12
id(" org.jetbrains.gradle.plugin.idea-ext" )
13
+ id(" com.palantir.git-version" ) version " 0.12.3"
13
14
}
14
15
15
16
val commonProject = project
@@ -25,13 +26,15 @@ val guavaVersion: String by project
25
26
val junitVersion: String by project
26
27
val timingsVersion: String by project
27
28
29
+ val gitVersion: groovy.lang.Closure <String > by extra
30
+
28
31
val commonManifest = the<JavaPluginConvention >().manifest {
29
32
attributes(
30
33
" Specification-Title" to " Sponge" ,
31
34
" Specification-Vendor" to " SpongePowered" ,
32
35
" Specification-Version" to apiVersion,
33
36
" Implementation-Title" to project.name,
34
- " Implementation-Version" to spongeImpl.generateImplementationVersionString(apiVersion, minecraftVersion, recommendedVersion ),
37
+ " Implementation-Version" to gitVersion( ),
35
38
" Implementation-Vendor" to " SpongePowered"
36
39
)
37
40
}
@@ -71,7 +74,7 @@ tasks {
71
74
72
75
}
73
76
74
- version = spongeImpl.generateImplementationVersionString(apiVersion, minecraftVersion, recommendedVersion )
77
+ version = gitVersion( )
75
78
76
79
// Configurations
77
80
val applaunchConfig by configurations.register(" applaunch" )
@@ -280,18 +283,6 @@ allprojects {
280
283
}
281
284
options.annotationProcessorPath = emptyAnnotationProcessors // hack so IntelliJ doesn't try to run Mixin AP
282
285
}
283
-
284
- withType(PublishToMavenRepository ::class ).configureEach {
285
- onlyIf {
286
- (repository == publishing.repositories[" GitHubPackages" ] &&
287
- ! (rootProject.version as String ).endsWith(" -SNAPSHOT" )) ||
288
- (! spongeSnapshotRepo.isNullOrBlank()
289
- && ! spongeReleaseRepo.isNullOrBlank()
290
- && repository == publishing.repositories[" spongeRepo" ]
291
- && publication == publishing.publications[" sponge" ])
292
-
293
- }
294
- }
295
286
}
296
287
sourceSets.configureEach {
297
288
val sourceSet = this
@@ -308,26 +299,12 @@ allprojects {
308
299
repositories {
309
300
maven {
310
301
name = " GitHubPackages"
311
- this .url = uri(" https://maven.pkg.github.com/SpongePowered/ ${rootProject.name }" )
302
+ this .url = uri(" https://maven.pkg.github.com/${ System .getenv( " GITHUB_REPOSITORY " ) }" )
312
303
credentials {
313
- username = project.findProperty(" gpr.user" ) as String? ? : System .getenv(" GITHUB_USERNAME " )
304
+ username = project.findProperty(" gpr.user" ) as String? ? : System .getenv(" GITHUB_ACTOR " )
314
305
password = project.findProperty(" gpr.key" ) as String? ? : System .getenv(" GITHUB_TOKEN" )
315
306
}
316
307
}
317
- // Set by the build server
318
- maven {
319
- name = " spongeRepo"
320
- val repoUrl = if ((version as String ).endsWith(" -SNAPSHOT" )) spongeSnapshotRepo else spongeReleaseRepo
321
- repoUrl?.apply {
322
- url = uri(this )
323
- }
324
- val spongeUsername: String? by project
325
- val spongePassword: String? by project
326
- credentials {
327
- username = spongeUsername ? : " "
328
- password = spongePassword ? : " "
329
- }
330
- }
331
308
}
332
309
}
333
310
}
0 commit comments