-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
135 lines (127 loc) · 3.82 KB
/
build.gradle
File metadata and controls
135 lines (127 loc) · 3.82 KB
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
plugins {
id 'java-library'
id 'com.diffplug.spotless' version '7.2.1'
id "com.vanniktech.maven.publish" version "0.34.0"
}
description = 'Java MYA API'
group = 'org.jlab'
version = new File("${projectDir}/VERSION").text.trim()
ext.version = project.version
ext.releaseDate = new Date().format('MMM dd yyyy')
tasks.withType(JavaCompile).configureEach {
options.release = 11
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
compileTestJava {
options.compilerArgs += ["-Xlint:deprecation", "-Xlint:unchecked"]
}
repositories {
mavenCentral()
}
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
}
dependencies {
implementation 'org.mariadb.jdbc:mariadb-java-client:3.0.8'
testImplementation 'junit:junit:4.13.2'
}
test {
testLogging {
events "passed", "skipped", "failed"
exceptionFormat = "full"
}
}
tasks.register('localhostIntegrationTest', Test) {
description = 'Runs integration tests on localhost.'
group = 'verification'
testClassesDirs = sourceSets.integration.output.classesDirs
classpath = sourceSets.integration.runtimeClasspath
testLogging {
showStandardStreams = true
}
environment 'JMYAPI_USE_PROXY', 'true'
}
tasks.register('integrationTest', Test) {
description = 'Runs integration tests.'
group = 'verification'
testClassesDirs = sourceSets.integration.output.classesDirs
classpath = sourceSets.integration.runtimeClasspath
testLogging {
showStandardStreams = true
}
}
tasks.register('hello', JavaExec) {
group = 'Application'
description = 'Hello World Test'
mainClass = 'org.jlab.mya.HelloWorld'
classpath = sourceSets.test.runtimeClasspath
}
tasks.register('config') {
doLast {
def console = System.console()
if (console) {
def username = console.readLine('> Please enter mya username: ')
def password = console.readPassword('> Please enter mya password: ')
new File("$projectDir/config/credentials.properties").text = """username=$username
password=$password
"""
} else {
logger.error "Cannot get console, try running as: 'gradlew -Dorg.gradle.daemon=false config'"
}
}
}
javadoc {
options.overview = "src/overview.html"
options.source = 11
options.with {
links 'https://docs.oracle.com/en/java/javase/11/docs/api'
}
}
spotless {
java {
googleJavaFormat()
}
}
mavenPublishing {
publishToMavenCentral(true)
signAllPublications()
coordinates("org.jlab", "jmyapi", version)
pom {
name = project.name
description = project.description
url = "https://github.com/JeffersonLab/jmyapi/"
licenses {
license {
name = "The MIT License"
url = "https://github.com/JeffersonLab/jmyapi/blob/master/LICENSE"
}
}
developers {
developer {
id = "slominskir"
name = "Ryan Slominski"
url = "https://github.com/slominskir/"
}
developer {
id = "apcarp"
name = "Adam Carpenter"
url = "https://github.com/apcarp/"
}
}
scm {
url = "https://github.com/JeffersonLab/jmyapi"
connection = "scm:git:git://github.com/JeffersonLab/jmyapi.git"
developerConnection = "scm:git:ssh://git@github.com/JeffersonLab/jmyapi.git"
}
}
}