@@ -6,17 +6,22 @@ buildscript {
66 dependencies {
77 classpath " org.grails:grails-gradle-plugin:$grailsVersion "
88 classpath " com.bertramlabs.plugins:asset-pipeline-gradle:2.14.2"
9+ classpath " com.gorylenko.gradle-git-properties:com.gorylenko.gradle-git-properties.gradle.plugin:1.5.2"
910 }
1011}
1112
12- version " 2.0.2 "
13+ version " 2.0.3 "
1314group " org.grails.plugins"
1415
16+ sourceCompatibility = 1.8
17+
1518apply plugin : ' idea'
1619apply plugin :" org.grails.grails-plugin"
1720apply plugin :" org.grails.grails-plugin-publish"
1821apply plugin :" org.grails.grails-gsp"
1922apply plugin :" asset-pipeline"
23+ apply plugin : " com.gorylenko.gradle-git-properties"
24+ apply plugin : ' maven-publish'
2025
2126ext {
2227 grailsVersion = project. grailsVersion
@@ -60,6 +65,44 @@ task wrapper(type: Wrapper) {
6065 gradleVersion = gradleWrapperVersion
6166}
6267
68+ task sourceJar (type : Jar ) {
69+ classifier = ' sources'
70+ from sourceSets. main. allSource
71+ }
72+
73+ task packageJavadoc (type : Jar ) {
74+ from javadoc
75+ classifier = ' javadoc'
76+ }
77+
78+ task packageGroovydoc (type : Jar ) {
79+ from groovydoc
80+ classifier = ' groovydoc'
81+ }
82+
83+
84+ gitProperties {
85+ keys = [' git.branch' , ' git.commit.id' , ' git.commit.time' , ' git.commit.id.abbrev' ]
86+ failOnNoGitDirectory = true
87+ extProperty = ' gitProps' // git properties will be put in a map at project.ext.gitProps
88+ }
89+
90+ generateGitProperties. outputs. upToDateWhen { false } // make sure the generateGitProperties task always executes (even when git.properties is not changed)
91+
92+ jar {
93+ dependsOn generateGitProperties
94+ manifest {
95+ attributes(" Built-By" : System . getProperty(" user.name" ))
96+ attributes([" Plugin-Version" : version,
97+ " Plugin-Title" : project. name,
98+ " Plugin-Build-Timestamp" : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" ),
99+ " Git-Commit" : " ${ -> project.ext.gitProps['git.commit.id.abbrev']} " ,
100+ " Git-Branch" : " ${ -> project.ext.gitProps['git.branch']} " ])
101+ }
102+ from sourceSets. main. output
103+ exclude ' git.properties'
104+ }
105+
63106grailsPublish {
64107 userOrg = ' kefirsf'
65108 license {
@@ -71,18 +114,54 @@ grailsPublish {
71114 title = " Grails Asynchronous Mail plugin"
72115 desc = " The plugin realises asynchronous mail sending. It stores messages in a DB and sends them asynchronously by a quartz job."
73116 developers = [
74- kefirfromperm :" Vitalii Samolovskikh" ,
75- stokito :" Sergey Ponomarev" ,
76- ilopmar :" Iván López" ,
77- burtbeckwith :" Burt Beckwith" ,
78- puneetbehl :" Puneet Behl" ,
79- aberbenni :" Alessandro Berbenni" ,
80- dpcasady :" Danny Casady" ,
81- SAgrawal14 :" Shashank Agrawal" ,
82- visheshd :" Vishesh" ,
83- ' micke-a' :" Mikael Andersson" ,
84- pgdoval :" Pablo González Doval" ,
85- Uniqen :" Magnus Dalin" ,
86- demon101 :" Demon"
117+ kefirfromperm : " Vitalii Samolovskikh" ,
118+ stokito : " Sergey Ponomarev" ,
119+ ilopmar : " Iván López" ,
120+ burtbeckwith : " Burt Beckwith" ,
121+ puneetbehl : " Puneet Behl" ,
122+ aberbenni : " Alessandro Berbenni" ,
123+ dpcasady : " Danny Casady" ,
124+ SAgrawal14 : " Shashank Agrawal" ,
125+ visheshd : " Vishesh" ,
126+ ' micke-a' : " Mikael Andersson" ,
127+ pgdoval : " Pablo González Doval" ,
128+ Uniqen : " Magnus Dalin" ,
129+ demon101 : " Demon" ,
130+ vsachinv : " Sachin Verma"
87131 ]
88132}
133+
134+
135+ javadoc {
136+ source = sourceSets. main. allJava
137+ classpath = configurations. compileClasspath
138+ options
139+ {
140+ setMemberLevel JavadocMemberLevel . PUBLIC
141+ setAuthor true
142+
143+ links " https://docs.oracle.com/javase/8/docs/api/"
144+ }
145+ }
146+
147+
148+ publishing {
149+ repositories {
150+ maven {
151+ name = " GitHubPackages"
152+ url = " https://maven.pkg.github.com/gpc/grails-asynchronous-mail"
153+ credentials {
154+ username = project. findProperty(" gpr.user" ) ?: System . getenv(" GITHUB_USERNAME" )
155+ password = project. findProperty(" gpr.key" ) ?: System . getenv(" GITHUB_TOKEN" )
156+ }
157+ }
158+ }
159+ publications {
160+ gpr(MavenPublication ) {
161+ from components. java
162+ artifact sourceJar
163+ artifact packageJavadoc
164+ artifact packageGroovydoc
165+ }
166+ }
167+ }
0 commit comments