-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
150 lines (121 loc) · 3.92 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
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
jcenter()
}
dependencies {
classpath "gradle.plugin.org.gradle.api.plugins:gradle-gaelyk-plugin:0.7.1"
}
}
apply from: 'https://raw.github.com/gaelyk/gaelyk/master/common.gradle'
apply plugin: 'war'
apply plugin: 'org.gaelyk'
apply plugin: 'maven'
def pluginName = "gaelyk-resources"
version = ext.gaelykLatestVersion
group = 'org.gaelyk'
repositories {
mavenCentral()
}
dependencies {
compile "org.codehaus.groovy:groovy-all:${project.ext.gaelykGroovyVersion}"
compile "org.gaelyk:gaelyk:${project.ext.gaelykLatestVersion}", {
changing = true
}
testCompile "org.gaelyk:gaelyk-spock:${project.ext.gaelykSpockLatestVersion}", {
changing = true
}
testCompile "com.google.appengine:appengine-api-stubs:${project.ext.gaelykAppEngineVersion}"
testCompile "com.google.appengine:appengine-testing:${project.ext.gaelykAppEngineVersion}"
appengineSdk "com.google.appengine:appengine-java-sdk:${project.ext.gaelykAppEngineVersion}"
testCompile files('src/test/resources/WEB-INF/lib/test-gaelyk-resources-plugin.jar')
}
jar {
baseName pluginName
}
jar.dependsOn gaelykPrecompileTemplates
task javadocJar(type: Jar, dependsOn: javadoc) {
baseName = pluginName
from "${project.docsDir}/javadoc"
classifier = 'javadoc'
}
task sourcesJar(type: Jar) {
baseName = pluginName
from sourceSets.main.allSource
classifier = 'sources'
}
configurations {
gaelykPlugin.extendsFrom signatures
}
artifacts {
gaelykPlugin jar
gaelykPlugin javadocJar
gaelykPlugin sourcesJar
}
boolean signingEnabled = !hasProperty('skipSigning') || skipSigning != 'true'
println "Signing is ${signingEnabled ? 'enabled' : 'disabled'}"
if(hasProperty('nexusUsername') && hasProperty('nexusPassword')){
if(signingEnabled){
apply plugin: 'signing'
signing {
sign configurations.gaelykPlugin
}
uploadGaelykPlugin.dependsOn signGaelykPlugin
}
uploadGaelykPlugin {
repositories {
mavenDeployer {
if(signingEnabled){
beforeDeployment { MavenDeployment deployment ->
signing.signPom(deployment)
}
}
def auth = {
authentication(userName: nexusUsername, password: nexusPassword)
}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/", auth)
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots", auth)
pom.project {
name 'Gaelyk Resources Plugin'
packaging 'jar'
description 'Gaelyk Resources Plugin allows other binary plugin to provide additoinal static resources.'
url 'https://github.com/musketyr/gaelyk-resources-plugin'
scm {
url 'scm:[email protected]:musketyr/gaelyk-resources-plugin.git'
connection 'scm:[email protected]:musketyr/gaelyk-resources-plugin.git'
developerConnection 'scm:[email protected]:musketyr/gaelyk-resources-plugin.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'vladimirorany'
name 'Vladimir Orany'
}
}
}
//mess with the generated pom to set the 'packaging' tag
pom.withXml { XmlProvider xmlProvider ->
def xml = xmlProvider.asString()
def pomXml = new XmlParser().parse(new ByteArrayInputStream(xml.toString().bytes))
pomXml.version[0] + { packaging('jar') }
def newXml = new StringWriter()
def printer = new XmlNodePrinter(new PrintWriter(newXml))
printer.preserveWhitespace = true
printer.print(pomXml)
xml.setLength(0)
xml.append(newXml.toString())
}
}
}
}
}
jar.enabled = true