|
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:$grailsVersion"
|
7 | 8 | classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.0.10"
|
8 | 9 | classpath "org.grails.plugins:hibernate5:7.0.4"
|
| 10 | + classpath "io.github.gradle-nexus:publish-plugin:1.0.0" |
9 | 11 | }
|
10 | 12 | }
|
11 | 13 |
|
12 |
| -version "3.0.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 |
| -apply plugin:"org.grails.grails-plugin-publish" |
19 | 19 | apply plugin:"asset-pipeline"
|
20 | 20 | apply plugin:"org.grails.grails-gsp"
|
| 21 | +apply plugin: "maven-publish" |
| 22 | +apply plugin: "signing" |
| 23 | +apply plugin: "io.github.gradle-nexus.publish-plugin" |
21 | 24 |
|
22 | 25 | repositories {
|
23 | 26 | maven { url "https://repo.grails.org/grails/core" }
|
@@ -89,34 +92,139 @@ tasks.withType(GroovyCompile) {
|
89 | 92 | }
|
90 | 93 | // enable if you wish to package this plugin as a standalone application
|
91 | 94 | bootJar.enabled = false
|
92 |
| -grailsPublish { |
93 |
| - userOrg = 'kefirsf' |
94 |
| - license { |
95 |
| - name = 'Apache-2.0' |
96 |
| - } |
97 |
| - websiteUrl = 'https://grails.org/plugins.html#plugin/asynchronous-mail' |
98 |
| - issueTrackerUrl = 'https://github.com/kefirfromperm/grails-asynchronous-mail/issues' |
99 |
| - vcsUrl = 'https://github.com/kefirfromperm/grails-asynchronous-mail.git' |
100 |
| - title = "Grails Asynchronous Mail plugin" |
101 |
| - desc = "The plugin realises asynchronous mail sending. It stores messages in a DB and sends them asynchronously by a quartz job." |
102 |
| - developers = [ |
103 |
| - kefirfromperm:"Vitalii Samolovskikh", |
104 |
| - stokito:"Sergey Ponomarev", |
105 |
| - ilopmar:"Iván López", |
106 |
| - burtbeckwith:"Burt Beckwith", |
107 |
| - puneetbehl:"Puneet Behl", |
108 |
| - aberbenni:"Alessandro Berbenni", |
109 |
| - dpcasady:"Danny Casady", |
110 |
| - SAgrawal14:"Shashank Agrawal", |
111 |
| - visheshd:"Vishesh", |
112 |
| - 'micke-a':"Mikael Andersson", |
113 |
| - pgdoval:"Pablo González Doval", |
114 |
| - Uniqen:"Magnus Dalin", |
115 |
| - demon101:"Demon", |
116 |
| - matrei:"Mattias Reichel" |
117 |
| - ] |
118 |
| -} |
119 | 95 |
|
120 | 96 | assets {
|
121 | 97 | packagePlugin = true
|
122 | 98 | }
|
| 99 | + |
| 100 | +publishing { |
| 101 | + publications { |
| 102 | + maven(MavenPublication) { |
| 103 | + groupId = project.group |
| 104 | + artifactId = 'asynchronous-mail' |
| 105 | + version = project.version |
| 106 | + |
| 107 | + from components.java |
| 108 | + artifact sourcesJar |
| 109 | + artifact javadocJar |
| 110 | + |
| 111 | + pom { |
| 112 | + name = 'Grails Asynchronous Mail Plugin' |
| 113 | + description = 'The plugin realises asynchronous mail sending. It stores messages in a DB and sends them asynchronously by a quartz job.' |
| 114 | + url = 'https://github.com/gpc/grails-asynchronous-mail' |
| 115 | + licenses { |
| 116 | + license { |
| 117 | + name = 'The Apache License, Version 2.0' |
| 118 | + url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' |
| 119 | + } |
| 120 | + } |
| 121 | + developers { |
| 122 | + developer { |
| 123 | + id = 'kefirfromperm' |
| 124 | + name = 'Vitalii Samolovskikh' |
| 125 | + } |
| 126 | + developer { |
| 127 | + id = 'stokito' |
| 128 | + name = 'Sergey Ponomarev' |
| 129 | + } |
| 130 | + developer { |
| 131 | + id = 'ilopmar' |
| 132 | + name = 'Iván López' |
| 133 | + } |
| 134 | + developer { |
| 135 | + id = 'burtbeckwith' |
| 136 | + name = 'Burt Beckwith' |
| 137 | + } |
| 138 | + developer { |
| 139 | + id = 'puneetbehl' |
| 140 | + name = 'Puneet Behl' |
| 141 | + } |
| 142 | + developer { |
| 143 | + id = 'aberbenni' |
| 144 | + name = 'Alessandro Berbenni' |
| 145 | + } |
| 146 | + developer { |
| 147 | + id = 'dpcasady' |
| 148 | + name = 'Danny Casady' |
| 149 | + } |
| 150 | + developer { |
| 151 | + id = 'SAgrawal14' |
| 152 | + name = 'Shashank Agrawal' |
| 153 | + } |
| 154 | + developer { |
| 155 | + id = 'visheshd' |
| 156 | + name = 'Vishesh' |
| 157 | + } |
| 158 | + developer { |
| 159 | + id = 'micke-a' |
| 160 | + name = 'Mikael Andersson' |
| 161 | + } |
| 162 | + developer { |
| 163 | + id = 'pgdoval' |
| 164 | + name = 'Pablo González Doval' |
| 165 | + } |
| 166 | + developer { |
| 167 | + id = 'Uniqen' |
| 168 | + name = 'Magnus Dalin' |
| 169 | + } |
| 170 | + developer { |
| 171 | + id = 'demon101' |
| 172 | + name = 'Demon' |
| 173 | + } |
| 174 | + developer { |
| 175 | + id = 'matrei' |
| 176 | + name = 'Mattias Reichel' |
| 177 | + } |
| 178 | + } |
| 179 | + scm { |
| 180 | + connection = 'scm:git:git://github.com/gpc/grails-asynchronous-mail.git' |
| 181 | + developerConnection = 'scm:git:ssh://github.com:gpc/grails-asynchronous-mail.git' |
| 182 | + url = 'https://github.com/gpc/grails-asynchronous-mail' |
| 183 | + } |
| 184 | + } |
| 185 | + } |
| 186 | + } |
| 187 | +} |
| 188 | + |
| 189 | +ext."signing.keyId" = project.findProperty('signing.keyId') ?: System.getenv('SIGNING_KEY_ID') |
| 190 | +ext."signing.password" = project.findProperty('signing.password') ?: System.getenv('SIGNING_PASSPHRASE') |
| 191 | +ext."signing.secretKeyRingFile" = project.findProperty('signing.secretKeyRingFile') ?: (System.getenv('SIGNING_PASSPHRASE') ?: "${System.getProperty('user.home')}/.gnupg/secring.gpg") |
| 192 | + |
| 193 | +ext.isReleaseVersion = !version.endsWith("SNAPSHOT") |
| 194 | + |
| 195 | +afterEvaluate { |
| 196 | + signing { |
| 197 | + required { isReleaseVersion } |
| 198 | + sign publishing.publications.maven |
| 199 | + } |
| 200 | +} |
| 201 | + |
| 202 | +tasks.withType(Sign) { |
| 203 | + onlyIf { isReleaseVersion } |
| 204 | +} |
| 205 | + |
| 206 | +nexusPublishing { |
| 207 | + repositories { |
| 208 | + sonatype { |
| 209 | + def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.findProperty('sonatypeOss2Username') ?: '' |
| 210 | + def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.findProperty("sonatypeOss2Password") ?: '' |
| 211 | + def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.findProperty("sonatypeOssStagingProfileIdJms") ?: '' |
| 212 | + |
| 213 | + nexusUrl = uri("https://s01.oss.sonatype.org/service/local/") |
| 214 | + snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") |
| 215 | + username = ossUser |
| 216 | + password = ossPass |
| 217 | + stagingProfileId = ossStagingProfileId |
| 218 | + } |
| 219 | + } |
| 220 | +} |
| 221 | + |
| 222 | +task snapshotVersion { |
| 223 | + doLast { |
| 224 | + if(!project.version.endsWith('-SNAPSHOT')) { |
| 225 | + ant.propertyfile(file: "gradle.properties") { |
| 226 | + entry(key: "version", value: "${project.version}-SNAPSHOT") |
| 227 | + } |
| 228 | + } |
| 229 | + } |
| 230 | +} |
0 commit comments