-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
141 lines (117 loc) · 4.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
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: 'groovy'
apply plugin: 'maven'
apply plugin: 'signing'
group = "ch.petikoch.libs"
archivesBaseName = "jtwfg"
version = '2.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 {
testCompile 'org.codehaus.groovy:groovy-all:2.5.14'
testCompile('org.spockframework:spock-core:1.3-groovy-2.5') {
exclude group: 'org.codehaus.groovy'
}
testCompile 'com.google.guava:guava:30.1.1-jre' // provides e.g. nice Multimap
}
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
}
}
test {
systemProperty 'file.encoding', project.fileEncoding
}
sourceSets.main.java.srcDirs = ['src/main/java']
sourceSets.test.java.srcDirs = []
sourceSets.main.groovy.srcDirs = []
sourceSets.test.groovy.srcDirs = ['src/test/groovy']
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(GroovyCompile) {
groovyOptions.encoding = project.fileEncoding
options.encoding = project.fileEncoding
}
tasks.withType(JavaCompile) {
options.encoding = project.fileEncoding
}
// 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')
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 using a task wait for graph model to detect deadlocks'
url 'https://github.com/Petikoch/jtwfg'
scm {
connection = 'https://github.com/Petikoch/jtwfg.git'
developerConnection = 'https://github.com/Petikoch/jtwfg.git'
url = 'https://github.com/Petikoch/jtwfg'
}
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 'petikoch@gmail.com'
}
developer {
name 'Adrian Elsener'
}
}
}
}
}
}