-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
153 lines (123 loc) · 4.16 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
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-console'
version = ext.gaelykLatestVersion
group = 'org.gaelyk'
dependencies {
compile "org.codehaus.groovy:groovy-all:${project.ext.gaelykGroovyVersion}"
compile "com.google.appengine:appengine-api-1.0-sdk:${project.ext.gaelykAppEngineVersion}",
"com.google.appengine:appengine-api-labs:${project.ext.gaelykAppEngineVersion}"
compile "org.gaelyk:gaelyk:${project.ext.gaelykLatestVersion}"
compile "org.gaelyk:gaelyk-resources:${project.ext.gaelykLatestVersion}"
compile "org.gaelyk:gaelyk-bootstrap-resources:${project.ext.gaelykLatestVersion}"
testCompile "org.gaelyk:gaelyk-spock:${project.ext.gaelykSpockLatestVersion}",
"com.google.appengine:appengine-api-stubs:${project.ext.gaelykAppEngineVersion}",
"com.google.appengine:appengine-testing:${project.ext.gaelykAppEngineVersion}"
appengineSdk "com.google.appengine:appengine-java-sdk:${project.ext.gaelykAppEngineVersion}"
}
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 {
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 Console Plugin'
packaging 'jar'
description 'Gaelyk Console Plugin adds simple console which can execute groovlet like code.'
url 'https://github.com/gaelyk/gaelyk-console-plugin'
scm {
url 'scm:git@github.com:gaelyk/gaelyk-console-plugin.git'
connection 'scm:git@github.com:gaelyk/gaelyk-console-plugin.git'
developerConnection 'scm:git@github.com:gaelyk/gaelyk-console-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