-
Notifications
You must be signed in to change notification settings - Fork 92
/
build.gradle
110 lines (94 loc) · 2.29 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
109
110
buildscript {
repositories {
mavenLocal()
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
}
dependencies {
classpath "io.github.gradle-nexus:publish-plugin:1.3.0"
}
}
plugins {
id 'java'
id 'groovy'
id 'java-library'
id 'signing'
id 'idea'
id 'maven-publish'
}
ext {
isBuildSnapshot = version.endsWith('-SNAPSHOT')
isReleaseVersion = !isBuildSnapshot
}
group = 'com.bertramlabs.plugins'
repositories {
mavenCentral()
}
java {
withJavadocJar()
withSourcesJar()
}
if (isReleaseVersion) {
apply plugin: "io.github.gradle-nexus.publish-plugin"
nexusPublishing {
repositories {
sonatype {
if(project.hasProperty('mavenUser')) {
username = mavenUser
password = mavenPassword
}
}
}
}
} else {
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
maven {
url = project.hasProperty('labsNexusUrl') ? labsNexusUrl : "https://nexus.bertramlabs.com/content/repositories/snapshots"
if(project.hasProperty('labsNexusUser')) {
credentials {
username = labsNexusUser
password = labsNexusPassword
}
}
}
}
}
}
subprojects { project ->
if (project.name != 'asset-pipeline-classpath-test' && project.name != 'asset-pipeline-docs' && project.name != 'asset-pipeline-site') {
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'signing'
afterEvaluate {
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
sign publishing.publications.maven
}
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
//do not generate extra load on Nexus with new staging repository if signing fails
tasks.withType(io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository).configureEach {
shouldRunAfter(tasks.withType(Sign))
}
}
}
dependencies {
api 'org.codehaus.groovy:groovy:3.0.20'
api 'org.codehaus.groovy:groovy-templates:3.0.20'
api 'org.mozilla:rhino:1.7R4'
testImplementation 'org.spockframework:spock-core:2.3-groovy-3.0'
}
test {
testLogging {
exceptionFormat = 'full'
showStandardStreams = true
}
}