-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
139 lines (116 loc) · 3.65 KB
/
Copy pathbuild.gradle
File metadata and controls
139 lines (116 loc) · 3.65 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
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
plugins {
id("io.github.gradle-nexus.publish-plugin").version("2.0.0")
}
allprojects {
project.group = "de.hhu.stups"
// IMPORTANT: Before releasing the ProB Java API, remember to set probcli and all dependencies to release versions, not nightly/SNAPSHOT!
// IMPORTANT: Check the variables parserVersion and cliDownloadURL inside prob-java/build.gradle, and the dependencies {...} blocks in all build.gradle files.
project.version = "4.16.1-SNAPSHOT"
project.ext.isSnapshot = project.version.endsWith("-SNAPSHOT")
}
final bomProject = project(":prob-java-bom")
final snapshotsRepoUrl = "https://central.sonatype.com/repository/maven-snapshots/"
final releasesStagingRepoUrl = "https://ossrh-staging-api.central.sonatype.com/service/local/"
nexusPublishing {
repositories {
mavenCentral {
snapshotRepositoryUrl.set(uri(snapshotsRepoUrl))
nexusUrl.set(uri(releasesStagingRepoUrl))
}
}
}
subprojects {
apply(plugin: "maven-publish")
apply(plugin: "signing")
project.ext.SOURCE_ENCODING = "UTF-8"
repositories {
mavenCentral()
if (isSnapshot) {
maven {
name = "Sonatype snapshots"
url = snapshotsRepoUrl
}
}
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
if (project == bomProject) {
// Necessary so that the publishing block below can find components.javaPlatform.
apply(plugin: "java-platform")
} else {
// The java-platform and java plugins cannot be applied at the same time,
// so this part must be skipped for the BOM subproject.
apply(plugin: "java")
dependencies {
// The BOM subproject is pulled in by all other subprojects.
implementation(platform(bomProject))
}
if (project.hasProperty("probHome")) {
tasks.withType(JavaForkOptions) {
systemProperties["prob.home"] = project.probHome
}
}
java {
// sourceCompatibility is superseded by options.release on JavaCompile tasks,
// but GroovyCompile tasks don't support options.release
// and only respect java.sourceCompatibility.
// https://github.com/gradle/gradle/issues/15703
sourceCompatibility = JavaVersion.VERSION_17
withSourcesJar()
withJavadocJar()
if (project.hasProperty("javaToolchainVersion")) {
toolchain {
languageVersion = JavaLanguageVersion.of(project.javaToolchainVersion)
}
}
}
tasks.withType(JavaCompile) {
options.encoding = SOURCE_ENCODING
options.release = Integer.parseInt(java.sourceCompatibility.getMajorVersion())
}
tasks.withType(Javadoc) {
options.encoding = SOURCE_ENCODING
}
javadoc {
options {
// silence warnings on missing javadoc
addBooleanOption('Xdoclint:all,-missing', true)
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
// Unfortunately, the java-platform and java plugins use different component names...
from(components.findByName("javaPlatform") ?: components.java)
pom {
name = project.name
url = 'http://www.prob2.de'
licenses {
license {
name = 'Eclipse Public License, Version 1.0'
url = 'http://www.eclipse.org/org/documents/epl-v10.html'
}
}
scm {
connection = 'scm:git:https://github.com/hhu-stups/prob2_kernel.git'
developerConnection = 'scm:git:git@gitlab.cs.uni-duesseldorf.de:stups/prob/prob2_kernel.git'
url = 'https://github.com/hhu-stups/prob2_kernel'
}
developers {
developer {
id = 'bendisposto'
name = 'Jens Bendisposto'
email = 'jens@bendisposto.de'
}
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
ext."signing.secretKeyRingFile" = rootProject.file("secring.gpg").absolutePath
}