-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle
108 lines (88 loc) · 2.72 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
import java.time.Duration
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2' }
google()
mavenCentral()
}
}
plugins {
alias libs.plugins.gradle.nexus
}
apply from: file("${rootDir}/gradle/artifact-settings.gradle")
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs += ['-Xlint:all', '-Xlint:unchecked']
}
subprojects {
apply plugin: 'java'
apply plugin: 'idea'
apply from: "${rootDir}/gradle/checkstyle.gradle"
// Fixes issue with test resources not being found inside Intellij
idea {
module {
testOutputDir = file('build/resources/test')
}
}
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
repositories {
google()
mavenCentral()
}
dependencies {
// Test Dependencies
testImplementation libs.junit
testImplementation libs.hamcrestJunit
testImplementation libs.mockito
}
}
def TESTABLE_MODULES = ["services-geojson", "services-turf"]
def RELEASE_MODULES = ["services-geojson", "services-turf"]
subprojects { subproject ->
tasks.withType(Jar) { jarTask ->
if (!jarTask.name.endsWith("sourcesJar")) {
jarTask.exclude("**/*.java")
}
}
if (TESTABLE_MODULES.contains(subproject.name)) {
afterEvaluate { project ->
project.apply from: "${rootDir}/gradle/jacoco.gradle"
// project.apply from: "${rootDir}/gradle/checkstyle.gradle"
}
}
if (RELEASE_MODULES.contains(subproject.name)) {
project.logger.info("Applying gradle publish plugin to ${subproject.name}")
subproject.apply from: "${rootDir}/gradle/publish.gradle"
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
}
apply from: "${rootDir}/gradle/publish-root.gradle"
defaultTasks('clean', 'build')
nexusPublishing {
repositories {
sonatype {
useStaging = !project.ext.isSnapshot
stagingProfileId = sonatypeStagingProfileId
username = ossrhUsername
password = ossrhPassword
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
transitionCheckOptions {
maxRetries = 120
delayBetween = Duration.ofSeconds(10)
}
}