-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
163 lines (145 loc) · 4.73 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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
}
description = "Jefferson Lab logbook API"
group 'org.jlab'
version new File("${projectDir}/VERSION").text.trim()
ext.releaseDate = new Date().format('MMM dd yyyy')
tasks.withType(JavaCompile) {
options.release = 11
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
java {
withJavadocJar()
withSourcesJar()
}
sourceSets {
integration {
java.srcDir "${projectDir}/src/integration/java"
resources.srcDir "${projectDir}/src/integration/resources"
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}
configurations {
integrationImplementation.extendsFrom testImplementation
integrationRuntimeOnly.extendsFrom runtimeOnly
}
repositories {
mavenCentral()
}
dependencies {
testImplementation 'junit:junit:4.13'
}
processResources {
filesMatching('release.properties') {
filter {
String line -> line.replaceAll("@VERSION@", version)
}
filter {
String line -> line.replaceAll("@RELEASE_DATE@", releaseDate)
}
}
}
javadoc {
options.overview = "src/main/java/overview.html"
options.source = 8
options.with {
links 'https://devdocs.io/openjdk~8/'
}
failOnError = false // Inside acc network devdocs.io blocked
}
tasks.withType(Test) {
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
}
}
task integrationTest(type: Test) {
description = 'Runs integration tests.'
group 'verification'
testClassesDirs = sourceSets.integration.output.classesDirs
classpath = sourceSets.integration.runtimeClasspath
testLogging {
showStandardStreams = true
}
}
signing {
sign publishing.publications
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
}
publishing {
repositories {
maven {
name "OSSRH"
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = project.findProperty("ossrh.user") ?: System.getenv("OSSRH_USER")
password = project.findProperty("ossrh.token") ?: System.getenv("OSSRH_TOKEN")
}
}
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/JeffersonLab/jlog")
credentials {
username = project.findProperty("github.user") ?: System.getenv("GITHUB_USER")
password = project.findProperty("github.token") ?: System.getenv("GITHUB_TOKEN")
}
}
publications {
maven(MavenPublication) {
from(components.java)
pom {
name = project.name
description = project.description
url = "https://github.com/JeffersonLab/jlog"
licenses {
license {
name = "The MIT License"
url = "https://github.com/JeffersonLab/jlog/blob/master/LICENSE"
}
}
developers {
developer {
id = "slominskir"
name = "Ryan Slominski"
email = "[email protected]"
}
developer {
id = "dub357"
name = "Bobby Lawrence"
email = "[email protected]"
}
}
scm {
url = "https://github.com/JeffersonLab/jlog.git"
}
}
}
}
artifacts {
archives javadocJar, sourcesJar
}
}
}
task tlog(type: JavaExec, dependsOn: build) {
classpath = files('src/integration/resources')
classpath += sourceSets.integration.runtimeClasspath
mainClass.set('org.jlab.jlog.example.TLog')
systemProperties System.getProperties() // forward all; example: setenv JAVA_OPTS -Djavax.net.debug=ssl:handshake
//systemProperties = ['javax.net.debug': 'ssl:handshake']
}
nexusPublishing {
repositories {
sonatype { //only for users registered in Sonatype after 24 Feb 2021
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}