-
Notifications
You must be signed in to change notification settings - Fork 198
/
Copy pathbuild.gradle
66 lines (58 loc) · 2.27 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
io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository
buildscript {
repositories {
maven { url = 'https://repo.grails.org/grails/core' }
}
dependencies {
classpath 'io.github.gradle-nexus:publish-plugin:2.0.0'
}
}
ext {
isCiBuild = System.getenv().get("CI") as Boolean
isSnapshot = project.projectVersion.endsWith("-SNAPSHOT")
isReleaseVersion = !isSnapshot
}
group = "org.grails"
version = project.projectVersion
allprojects {
repositories {
mavenCentral()
maven { url = 'https://repo.grails.org/grails/core' }
// mavenLocal() // Keep, this will be uncommented and used by CI (groovy-joint-workflow)
if (findProperty('groovyVersion')?.endsWith('-SNAPSHOT')) {
maven {
name = 'ASF Snapshot repo'
url = 'https://repository.apache.org/content/repositories/snapshots'
}
}
if (System.getenv('GITHUB_MAVEN_PASSWORD') && !grailsVersion.endsWith('-SNAPSHOT')) {
System.out.println("Adding Grails Core Staging Repo for project: $name")
maven {
url = 'https://maven.pkg.github.com/grails/grails-core'
credentials {
username = 'DOES_NOT_MATTER'
password = System.getenv('GITHUB_MAVEN_PASSWORD')
}
}
}
}
}
if (isReleaseVersion) {
apply plugin: 'io.github.gradle-nexus.publish-plugin'
nexusPublishing {
repositories {
sonatype {
nexusUrl = uri('https://s01.oss.sonatype.org/service/local')
username = System.getenv('SONATYPE_USERNAME') ?: project.findProperty('sonatypeOssUsername') ?: ''
password = System.getenv('SONATYPE_PASSWORD') ?: project.findProperty('sonatypeOssPassword') ?: ''
stagingProfileId = System.getenv('SONATYPE_STAGING_PROFILE_ID') ?: project.findProperty('sonatypeOssStagingProfileId') ?: ''
}
}
}
//do not generate extra load on Nexus with new staging repository if signing fails
tasks.withType(InitializeNexusStagingRepository).configureEach {
shouldRunAfter = tasks.withType(Sign)
}
}
apply from: "gradle/idea.gradle"
apply from: "gradle/aggregate-test-report.gradle"