-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
172 lines (137 loc) · 4.78 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
160
161
162
163
164
165
166
167
168
169
170
171
172
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.gradle.api.plugins:gradle-gaelyk-plugin:0.4.1'
classpath 'org.gradle.api.plugins:gradle-gae-plugin:0.7.6'
}
}
apply from: 'https://raw.github.com/gaelyk/gaelyk/master/common.gradle'
apply plugin: 'maven'
apply plugin: 'gae'
apply plugin: 'gaelyk'
def pluginName = 'gaelyk-datastore-viewer'
version = ext.gaelykLatestVersion
group = 'org.gaelyk'
dependencies {
groovy "org.codehaus.groovy:groovy-all:${ext.gaelykGroovyVersion}"
compile "com.google.appengine:appengine-api-1.0-sdk:${ext.gaelykAppEngineVersion}",
"com.google.appengine:appengine-api-labs:${ext.gaelykAppEngineVersion}"
compile "org.gaelyk:gaelyk:${ext.gaelykLatestVersion}"
compile "org.gaelyk:gaelyk-resources:${ext.gaelykLatestVersion}"
compile "org.gaelyk:gaelyk-bootstrap-resources:${ext.gaelykLatestVersion}"
// for testing only
compile "org.gaelyk:gaelyk-console:${ext.gaelykLatestVersion}"
testCompile "org.gaelyk:gaelyk-spock:${ext.gaelykSpockLatestVersion}",
"com.google.appengine:appengine-api-stubs:${ext.gaelykAppEngineVersion}",
"com.google.appengine:appengine-testing:${ext.gaelykAppEngineVersion}"
gaeSdk "com.google.appengine:appengine-java-sdk:${ext.gaelykAppEngineVersion}"
}
gae {
optimizeWar = true
}
jar {
baseName pluginName
manifest {
attributes 'Implementation-Title': 'Gaelyk datastore viewer plugin',
'Implementation-Version': version,
'Built-By': System.getProperty("user.name"),
'Built-Date': new Date(),
'Built-JDK': System.getProperty("java.version")
}
}
jar.dependsOn gaelykPrecompileTemplate
jar.dependsOn gaelykPrecompileGroovlet
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 {
plugin.extendsFrom(signatures)
}
artifacts {
plugin jar
plugin javadocJar
plugin sourcesJar
}
task copyRuntimeLibraries {
def webAppLibDirName = 'src/main/webapp/WEB-INF/lib'
description = "Copies runtime libraries to $webAppLibDirName."
copy {
into webAppLibDirName
from configurations.runtime.files
}
}
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.plugin }
uploadPlugin.dependsOn signPlugin
}
uploadPlugin {
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 Datastore Viewer Plugin'
packaging 'jar'
description 'Gaelyk Datastore Viewer Plugin adds simple console which helps you manage App Engine Datastore.'
url 'https://github.com/gaelyk/gaelyk-datastore-viewer-plugin'
scm {
url 'scm:[email protected]:gaelyk/gaelyk-datastore-viewer-plugin.git'
connection 'scm:[email protected]:gaelyk/gaelyk-datastore-viewer-plugin.git'
developerConnection 'scm:[email protected]:gaelyk/gaelyk-datastore-viewer-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 'bmuschko'
name 'Benjamin Muschko'
}
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