-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
159 lines (142 loc) · 5.47 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
buildscript {
repositories {
// mavenLocal()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath "org.graceframework:grace-gradle-plugin:$graceVersion"
classpath "io.github.gradle-nexus:publish-plugin:2.0.0"
}
}
ext."signing.keyId" = project.hasProperty("signing.keyId") ? project.getProperty('signing.keyId') : System.getenv('SIGNING_KEY')
ext."signing.password" = project.hasProperty("signing.password") ? project.getProperty('signing.password') : System.getenv('SIGNING_PASSPHRASE')
ext."signing.secretKeyRingFile" = project.hasProperty("signing.secretKeyRingFile") ? project.getProperty('signing.secretKeyRingFile') : ("${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg")
ext.isReleaseVersion = !projectVersion.endsWith("SNAPSHOT")
version project.projectVersion
group "org.graceframework.plugins"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "java-library"
apply plugin: "org.graceframework.grace-plugin"
apply plugin: "io.github.gradle-nexus.publish-plugin"
apply plugin: "maven-publish"
apply plugin: "signing"
repositories {
// mavenLocal()
mavenCentral()
}
configurations {
documentation
}
dependencies {
compileOnly "org.graceframework:grace-core"
api "org.gebish:geb-spock:$gebSpock", {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
compileOnly "org.graceframework:grace-boot"
documentation "org.fusesource.jansi:jansi:1.18"
documentation "org.apache.groovy:groovy:$groovyVersion"
documentation "org.apache.groovy:groovy-ant:$groovyVersion"
documentation "org.apache.groovy:groovy-templates:$groovyVersion"
documentation "com.github.javaparser:javaparser-core:3.15.14"
}
bootJar.enabled = false
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
withJavadocJar()
withSourcesJar()
}
jar {
enabled = true
archiveClassifier.set('plugin')
includeEmptyDirs = false
}
publishing {
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = project.name
version = project.version
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
from components.java
afterEvaluate {
artifact source: "${project.sourceSets.main.groovy.classesDirectory.get()}/META-INF/grails-plugin.xml",
classifier: "plugin",
extension: 'xml'
}
pom {
name = "Grace Geb Plugin"
description = "Provides Integration with Geb for Functional Testing"
url = 'https://github.com/graceframework/grace-geb'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'rainboyan'
name = 'Michael Yan'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/graceframework/grace-geb.git'
developerConnection = 'scm:git:ssh://github.com:graceframework/grace-geb.git'
url = 'https://github.com/graceframework/grace-geb'
}
}
pom.withXml {
def pomNode = asNode()
try {
pomNode.dependencyManagement.replaceNode {}
} catch (Throwable e) {
// ignore
}
// simply remove dependencies without a version
// version-less dependencies are handled with dependencyManagement
// see https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/8 for more complete solutions
pomNode.dependencies.dependency.findAll {
it.version.text().isEmpty()
}.each {
try {
it.replaceNode {}
} catch (Throwable e) {
// ignore
}
}
}
}
}
}
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("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
}
}
}
afterEvaluate {
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
sign publishing.publications.maven
}
}