-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
130 lines (108 loc) · 3.84 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
plugins {
id 'nu.studer.credentials' version '2.1' // https://github.com/etiennestuder/gradle-credentials-plugin
id 'com.github.hierynomus.license' version '0.15.0' // https://github.com/hierynomus/license-gradle-plugin
id "com.github.ben-manes.versions" version "0.38.0"
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
group = "ch.petikoch.libs"
archivesBaseName = project.name
version = '3.0.1-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext["fileEncoding"] = 'UTF-8'
ext["signing.keyId"] = credentials.gpgKeyId
ext["signing.password"] = credentials.gpgKeyPassword
ext["signing.secretKeyRingFile"] = credentials.gpgKeyFile
ext["ossrhUsername"] = credentials.ossrhUsername
ext["ossrhPassword"] = credentials.ossrhPassword
repositories {
mavenCentral()
}
dependencies {
testImplementation(platform('org.junit:junit-bom:5.7.1'))
testImplementation('org.junit.jupiter:junit-jupiter')
testImplementation('org.assertj:assertj-core:3.19.0')
testImplementation('org.awaitility:awaitility:4.0.3')
}
jar {
manifest {
attributes 'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Built-Gradle': gradle.gradleVersion
}
}
task javadocJar(type: Jar, dependsOn: classes) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
sign configurations.archives
}
tasks.withType(JavaCompile) {
options.encoding = project.fileEncoding
}
test {
systemProperty 'file.encoding', project.fileEncoding
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
// http://forums.gradle.org/gradle/topics/set_maxparallelforks_to_number_of_cores_on_the_current_machine
tasks.withType(Test) {
maxParallelForks = Runtime.getRuntime().availableProcessors()
}
license {
header = rootProject.file('config/HEADER_apache2.txt')
strictCheck = true
}
// https://central.sonatype.org/pages/gradle.html
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name project.archivesBaseName
packaging 'jar'
description 'A small java 8+ standalone library to implement feedback control'
url 'https://github.com/Petikoch/feedbackcontrol4j'
scm {
connection = 'https://github.com/Petikoch/feedbackcontrol4j.git'
developerConnection = 'https://github.com/Petikoch/feedbackcontrol4j.git'
url = 'https://github.com/Petikoch/feedbackcontrol4j'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'petikoch'
name 'Peti Koch'
email '[email protected]'
}
}
}
}
}
}