-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathbuild.gradle
71 lines (58 loc) · 2.04 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
plugins {
id 'java'
id 'groovy'
id "io.github.gradle-nexus.publish-plugin"
}
ext {
isBuildSnapshot = version.toString().endsWith("-SNAPSHOT")
isReleaseVersion = !isBuildSnapshot
}
allprojects {
repositories {
mavenCentral()
maven { url "https://repo.grails.org/grails/core/" }
}
java {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
ext {
isBuildSnapshot = version.toString().endsWith("-SNAPSHOT")
isReleaseVersion = !isBuildSnapshot
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
tasks.withType(GroovyCompile).configureEach {
configure(groovyOptions) {
forkOptions.jvmArgs = ['-Xmx1024m']
}
}
}
import io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository
tasks.withType(InitializeNexusStagingRepository).configureEach {
shouldRunAfter(tasks.withType(Sign))
}
nexusPublishing {
repositories {
sonatype {
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileIdExternalConfig") ? project.sonatypeOssStagingProfileIdExternalConfig : ''
nexusUrl = uri("https://oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
}
}
}
tasks.register('snapshotVersion') {
doLast {
if (!isBuildSnapshot) {
ant.propertyfile(file: "gradle.properties") {
entry(key: "version", value: "${project.version}-SNAPSHOT")
}
}
}
}