forked from sbglasius/external-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
63 lines (53 loc) · 1.91 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
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
mavenCentral()
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath "io.github.gradle-nexus:publish-plugin:1.1.0"
}
}
allprojects {
apply plugin: 'groovy'
version "$version"
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
tasks.withType(Test) {
useJUnitPlatform()
}
tasks.withType(GroovyCompile) {
configure(groovyOptions) {
forkOptions.jvmArgs = ['-Xmx1024m']
}
}
}
if (project.hasProperty('release')) {
apply plugin: 'io.github.gradle-nexus.publish-plugin'
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
}
}
}
}
task snapshotVersion {
doLast {
if (!project.version.endsWith('-SNAPSHOT')) {
ant.propertyfile(file: "gradle.properties") {
entry(key: "version", value: "${project.version}-SNAPSHOT")
}
}
}
}