-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
112 lines (100 loc) · 3.14 KB
/
build.gradle.kts
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
plugins {
java
`maven-publish`
signing
id("io.github.gradle-nexus.publish-plugin") version "1.0.0"
idea
}
group = "net.sf.robocode"
description = "Codesize is a tool for calculating the bytecode size of a Java class file, ZIP/JAR archive"
version = "1.3.0"
val ossrhUsername: String by project
val ossrhPassword: String by project
repositories {
mavenCentral()
}
dependencies {
implementation("org.apache.bcel:bcel:6.7.0")
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
}
jar {
manifest {
attributes["Main-Class"] = "codesize.Codesize"
attributes["Implementation-Title"] = "Codesize"
attributes["Implementation-Version"] = archiveVersion
attributes["Implementation-Vendor"] = "robocode.dev"
attributes["Package"] = project.group
}
archiveFileName.set("codesize.jar")
}
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))//staging/deploy/maven2/
snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/"))
stagingProfileId.set("c7f511545ccf8")
username.set(ossrhUsername)
password.set(ossrhPassword)
}
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
pom {
name.set("Codesize")
description.set(project.description)
url.set("https://robocode.sourceforge.io/")
licenses {
license {
name.set("Eclipse Public License v1.0 (EPL)")
url.set("https://robocode.sourceforge.io/license/epl-v10.html")
}
}
developers {
developer {
name.set("Christian D. Schnell")
}
developer {
id.set("flemming-n-larsen")
name.set("Flemming N. Larsen")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:[email protected]:robo-code/robocode.git")
developerConnection.set("scm:git:ssh:[email protected]:robo-code/robocode.git")
url.set("https://github.com/robo-code/robocode")
}
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
val initializeSonatypeStagingRepository by tasks.existing
subprojects {
initializeSonatypeStagingRepository {
shouldRunAfter(tasks.withType<Sign>())
}
}