forked from robo-code/robocode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
95 lines (84 loc) · 2.67 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
95 lines (84 loc) · 2.67 KB
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
/**
* To build Robocode, you need to run this command:
* ./gradlew build
*
* To clean the build, to run this command:
* ./gradlew clean
*
* To run Robocode you need to build Robocode and do a `cd .sandbox` and write `robocode.bat` or `robocode.sh`
*
* The distribution file for Robocode is put into /build and named `robocode.x.x.x.x-setup.jar`
* The x.x.x.x is a version number like e.g. 1.9.5.4
*
* You can run the distribution file with hava like this:
* java -jar robocode.x.x.x.x-setup.jar
*/
plugins {
`java-library`
idea
alias(libs.plugins.nexus.publish)
alias(libs.plugins.ben.manes.versions)
}
description = "Robocode - Build the best - destroy the rest!"
val ossrhUsername: String by project
val ossrhPassword: String by project
subprojects {
apply(plugin = "java")
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
}
tasks {
named("clean") {
delete(".sandbox")
}
}
nexusPublishing {
repositories {
sonatype {
// Publishing By Using the Portal OSSRH Staging API:
// https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
stagingProfileId.set("c7f511545ccf8")
username.set(ossrhUsername)
password.set(ossrhPassword)
}
}
}
val initializeSonatypeStagingRepository by tasks.existing
subprojects {
initializeSonatypeStagingRepository {
shouldRunAfter(tasks.withType<Sign>())
}
// Apply common signing configuration to all subprojects
plugins.withId("signing") {
configure<SigningExtension> {
useGpgCmd() // Use GPG agent instead of key file
}
}
// Include Tank.ico in the published artifacts
plugins.withId("maven-publish") {
configure<PublishingExtension> {
publications.withType<MavenPublication> {
artifact(file("${rootProject.projectDir}/gfx/Tank/Tank.ico")) {
classifier = "icon"
extension = "ico"
}
}
}
}
// Include robocode.ico in the published artifacts
plugins.withId("maven-publish") {
configure<PublishingExtension> {
publications.withType<MavenPublication> {
artifact(file("${rootProject.projectDir}/robocode.content/src/main/resources/robocode.ico")) {
classifier = "icon"
extension = "ico"
}
}
}
}
}