|
1 | 1 | buildscript { |
2 | 2 | repositories { |
3 | 3 | maven { url "https://repo.grails.org/grails/core" } |
| 4 | + maven { url "https://plugins.gradle.org/m2" } |
4 | 5 | } |
5 | 6 | dependencies { |
6 | 7 | classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" |
7 | 8 | classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.3.4" |
8 | 9 | classpath "org.grails.plugins:hibernate5:7.2.0" |
| 10 | + classpath "io.github.gradle-nexus:publish-plugin:1.0.0" |
9 | 11 | } |
10 | 12 | } |
11 | 13 |
|
12 | | -version "3.1.0" |
13 | | -group "org.grails.plugins" |
| 14 | +group "io.github.gpc" |
14 | 15 |
|
15 | 16 | apply plugin: "eclipse" |
16 | 17 | apply plugin: "idea" |
17 | 18 | apply plugin: "org.grails.grails-plugin" |
18 | 19 | apply plugin: "asset-pipeline" |
19 | 20 | apply plugin: "org.grails.grails-gsp" |
20 | 21 | apply plugin: "maven-publish" |
21 | | -//apply plugin: "signing" |
| 22 | +apply plugin: "signing" |
| 23 | +apply plugin: "io.github.gradle-nexus.publish-plugin" |
22 | 24 |
|
23 | 25 | repositories { |
24 | 26 | maven { url "https://repo.grails.org/grails/core" } |
@@ -121,7 +123,7 @@ publishing { |
121 | 123 | pom { |
122 | 124 | name = 'Grails Asynchronous Mail Plugin' |
123 | 125 | description = 'The plugin realises asynchronous mail sending. It stores messages in a DB and sends them asynchronously by a quartz job.' |
124 | | - url = 'https://github.com/matrei/grails-asynchronous-mail' |
| 126 | + url = 'https://github.com/gpc/grails-asynchronous-mail' |
125 | 127 | licenses { |
126 | 128 | license { |
127 | 129 | name = 'The Apache License, Version 2.0' |
@@ -187,11 +189,54 @@ publishing { |
187 | 189 | } |
188 | 190 | } |
189 | 191 | scm { |
190 | | - connection = 'scm:git:git://github.com/matrei/grails-asynchronous-mail.git' |
191 | | - developerConnection = 'scm:git:ssh://github.com:matrei/grails-asynchronous-mail.git' |
192 | | - url = 'https://github.com/matrei/grails-asynchronous-mail' |
| 192 | + connection = 'scm:git:git://github.com/gpc/grails-asynchronous-mail.git' |
| 193 | + developerConnection = 'scm:git:ssh://github.com:gpc/grails-asynchronous-mail.git' |
| 194 | + url = 'https://github.com/gpc/grails-asynchronous-mail' |
193 | 195 | } |
194 | 196 | } |
195 | 197 | } |
196 | 198 | } |
197 | 199 | } |
| 200 | + |
| 201 | +ext."signing.keyId" = project.findProperty('signing.keyId') ?: System.getenv('SIGNING_KEY_ID') |
| 202 | +ext."signing.password" = project.findProperty('signing.password') ?: System.getenv('SIGNING_PASSPHRASE') |
| 203 | +ext."signing.secretKeyRingFile" = project.findProperty('signing.secretKeyRingFile') ?: (System.getenv('SIGNING_PASSPHRASE') ?: "${System.getProperty('user.home')}/.gnupg/secring.gpg") |
| 204 | + |
| 205 | +ext.isReleaseVersion = !version.endsWith("SNAPSHOT") |
| 206 | + |
| 207 | +afterEvaluate { |
| 208 | + signing { |
| 209 | + required { isReleaseVersion } |
| 210 | + sign publishing.publications.maven |
| 211 | + } |
| 212 | +} |
| 213 | + |
| 214 | +tasks.withType(Sign) { |
| 215 | + onlyIf { isReleaseVersion } |
| 216 | +} |
| 217 | + |
| 218 | +nexusPublishing { |
| 219 | + repositories { |
| 220 | + sonatype { |
| 221 | + def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.findProperty('sonatypeOss2Username') ?: '' |
| 222 | + def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.findProperty("sonatypeOss2Password") ?: '' |
| 223 | + def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.findProperty("sonatypeOssStagingProfileIdJms") ?: '' |
| 224 | + |
| 225 | + nexusUrl = uri("https://s01.oss.sonatype.org/service/local/") |
| 226 | + snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") |
| 227 | + username = ossUser |
| 228 | + password = ossPass |
| 229 | + stagingProfileId = ossStagingProfileId |
| 230 | + } |
| 231 | + } |
| 232 | +} |
| 233 | + |
| 234 | +task snapshotVersion { |
| 235 | + doLast { |
| 236 | + if(!project.version.endsWith('-SNAPSHOT')) { |
| 237 | + ant.propertyfile(file: "gradle.properties") { |
| 238 | + entry(key: "version", value: "${project.version}-SNAPSHOT") |
| 239 | + } |
| 240 | + } |
| 241 | + } |
| 242 | +} |
0 commit comments