This repository has been archived by the owner on Feb 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
163 lines (141 loc) · 6.15 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
allprojects {
repositories {
mavenCentral()
}
}
// ignore "modules" module
gradle.taskGraph.whenReady {
gradle.taskGraph.allTasks.each {
if(it.project.name == "modules") {
it.onlyIf {false}
}
}
}
subprojects {
apply plugin: 'application'
apply plugin: 'signing'
apply plugin: 'maven-publish'
sourceCompatibility = gradle.sourceCompatibility
targetCompatibility = gradle.targetCompatibility
version = gradle.ext.version
group 'de.wuespace.telestion'
javadoc {
options.addBooleanOption('html5', true)
}
tasks.withType(JavaExec) {
systemProperties System.properties
systemProperties "hazelcast.logging.type": "slf4j"
// enable modules for hazelcast
jvmArgs += ["--add-modules", "java.se",
"--add-exports", "java.base/jdk.internal.ref=ALL-UNNAMED",
"--add-opens", "java.base/java.lang=ALL-UNNAMED",
"--add-opens", "java.base/java.nio=ALL-UNNAMED",
"--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED",
"--add-opens", "java.management/sun.management=ALL-UNNAMED",
"--add-opens", "jdk.management/com.sun.management.internal=ALL-UNNAMED"]
}
jar {
metaInf {
from("$projectDir/../../LICENSE")
}
afterEvaluate {
manifest {
var description = Objects.nonNull(project.description) ? project.description : 'No description'
var specTitle = project.extensions.extraProperties.has('prettyName')
? project.extensions.extraProperties.get('prettyName')
: 'Telestion Terminal Client Module'
attributes(
'Build-Timestamp': new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
'Created-By': "Gradle ${gradle.gradleVersion}",
'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-Jdk-Spec': "${System.properties['java.version']}",
'Build-OS': "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}",
'Specification-Title': specTitle,
'Specification-Version': project.version,
'Specification-Vendor': 'WueSpace e.V.',
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Implementation-Vendor': 'de.wuespace.telestion',
'X-Compile-Target-JDK': gradle.ext.targetCompatibility,
'X-Compile-Source-JDK': gradle.ext.sourceCompatibility,
'Description': description
)
}
}
}
publishing {
afterEvaluate {
publications {
maven(MavenPublication) {
from components.java
pom {
name = project.name
description = project.description
url = 'https://telestion.wuespace.de/'
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
id = 'fussel178'
name = 'Ludwig Richter'
email = '[email protected]'
url = 'https://github.com/fussel178'
organization = 'WüSpace e. V.'
organizationUrl = 'https://www.wuespace.de/'
}
}
scm {
connection = 'scm:git:git://github.com/wuespace/telestion-terminal-client.git'
developerConnection = 'scm:git:ssh://[email protected]:wuespace/telestion-terminal-client.git'
url = 'https://github.com/wuespace/telestion-terminal-client/tree/main'
}
}
}
}
}
repositories {
maven {
url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = System.getenv('OSSRH_USERNAME')
password = System.getenv('OSSRH_PASSWORD')
}
}
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/wuespace/telestion-terminal-client"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
signing {
afterEvaluate {
required { gradle.forceSign || gradle.taskGraph.hasTask('publish') }
// get key + key-id + password
def signingKeyId = findProperty('signingKeyId') as String
def signingKey = findProperty('signingKey') as String
def signingPassword = findProperty('signingPassword') as String
// decrypt key
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
// sign
sign publishing.publications.maven
}
}
}
task alljavadoc(type: Javadoc) {
def subProjects = gradle.rootProject.subprojects
source subProjects.collect { Project project -> project.sourceSets.main.allJava }
classpath = files(subProjects.collect { Project project -> project.sourceSets.main.compileClasspath })
destinationDir = file("${buildDir}/docs/javadoc")
}
configure(alljavadoc) {
group = 'documentation'
description = 'Generates Javadoc API for all subprojects into one destination.'
}