-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
108 lines (97 loc) · 3.02 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
plugins {
id 'java'
id 'signing'
id 'maven-publish'
}
group = 'dev.ursinn.schule'
version = '1.0-SNAPSHOT'
description = 'M120'
repositories {
mavenCentral()
}
dependencies {
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
testCompileOnly 'org.projectlombok:lombok:1.18.30'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.30'
}
def targetJavaVersion = 17
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
}
// Javadoc
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
// Publishing Stack - Start
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'm120'
from components.java
pom {
packaging = 'jar'
name = 'M120'
description = 'Modul 120'
url = 'https://github.com/ursinn/schule-m120'
licenses {
license {
name = 'Unlicense License'
url = 'https://github.com/ursinn/schule-m120/blob/main/LICENSE'
}
}
developers {
developer {
id = 'ursinn'
name = 'Ursin Filli'
email = 'mail@ursinn.dev'
timezone = '+1'
url = 'https://ursinn.dev'
}
}
scm {
connection = 'scm:git:git://github.com/ursinn/schule-m120.git'
developerConnection = 'scm:git:git@github.com:ursinn/schule-m120.git'
url = 'https://github.com/ursinn/schule-m120'
}
issueManagement {
system = 'GitHub Issues'
url = 'https://github.com/ursinn/schule-m120/issues'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2'
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username ossrhS01Username
password ossrhS01Password
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.mavenJava
}
// Publishing Stack - End