forked from bobbylight/AutoComplete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
224 lines (208 loc) · 6.54 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
['java', 'distribution', 'maven', 'signing'].each { apply plugin: it }
group = 'com.fifesoft'
archivesBaseName = 'autocomplete'
dependencies {
testCompile( [ 'junit:junit:4.11' ] )
}
// Regenerate local gradlew
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}
compileJava {
sourceCompatibility javaVersion
targetCompatibility javaVersion
classpath += files("${projectDir.absolutePath}/../RSyntaxTextArea/build/classes/main")
options.debug = true
options.debugOptions.debugLevel = 'source,vars,lines'
// Most folks will compile with the latest JDK available, but official builds
// use a Java 5 JDK. Add this property to gradle.properties for boot classpath
if (project.hasProperty('java5CompileBootClasspath')) {
if (new File(java5CompileBootClasspath).isFile()) {
println "Bootstrap classpath when compiling Java: ${java5CompileBootClasspath}"
options.bootClasspath = java5CompileBootClasspath
}
else {
println "Warning: Specified java5CompileBootClasspath does not exist: ${java5CompileBootClasspath}"
}
}
options.compilerArgs << '-Xlint:deprecation' << '-Xlint:unchecked'
}
ext.sharedManifest = manifest {
attributes('Class-Path': 'rsyntaxtextarea.jar',
'Specification-Title': 'AutoComplete',
'Specification-Version': version,
'Implementation-Title': 'org.fife.ui',
'Implementation-Version': version)
}
jar {
manifest { from sharedManifest }
}
// We use "distributions" to create the zip files uploaded to SourceForge
distributions {
main {
baseName = 'autocomplete'
contents {
from { [ 'build/libs' ] }
rename 'AutoComplete-.*\\.jar', 'autocomplete.jar'
}
}
src {
baseName = 'autocomplete'
}
}
distZip.classifier = null
distZip.dependsOn jar
srcDistZip.classifier = 'src'
srcDistZip {
from projectDir
include 'src/**/*'
include 'build.gradle'
include '.classpath'
include '.project'
include 'gradle.properties'
include 'gradle/**/*'
include 'gradlew*'
include 'README.md'
include '.settings/**'
}
task buildSourceForgeZips << {
println "Building zip files for SourceForge"
}
buildSourceForgeZips.dependsOn clean, jar, distZip, srcDistZip
// Stuff to generate and upload Maven artifacts
javadoc {
classpath += files("${projectDir.absolutePath}/../RSyntaxTextArea/build/classes/main")
}
task javadocJar (type: Jar, dependsOn: javadoc) {
manifest { from sharedManifest }
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourceJar (type: Jar) {
manifest { from sharedManifest }
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar, javadocJar, sourceJar
}
signing {
// Don't require signing for e.g. ./gradlew install
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
repositories {
mavenCentral()
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
if (project.hasProperty('upload') && Boolean.parseBoolean(upload)) { // gradlew -Pupload=true
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
}
else {
repository(url: 'file:///' + projectDir + '/../localMavenRepo')
}
pom {
groupId = 'com.fifesoft'
name = 'autocomplete'
project {
parent {
groupId 'org.sonatype.oss'
artifactId 'oss-parent'
version '7'
relativePath ''
}
groupId 'com.fifesoft'
artifactId 'autocomplete'
packaging 'jar'
name 'autocomplete'
description 'AutoComplete is a library allowing you to add IDE-like auto-completion ' +
'(aka "code completion" or "Intellisense") to any Swing JTextComponent. Special integration ' +
'is added for RSyntaxTextArea, since this feature is commonly needed when editing source code. ' +
'Features include: Drop-down completion choice list. Optional companion "description" window, ' +
'complete with full HTML support and navigable with hyperlinks. Optional parameter completion ' +
'assistance for functions and methods, ala Eclipse and NetBeans. Completion information is ' +
'typically specified in an XML file, but can even be dynamic.'
inceptionYear '2003'
url 'http://www.fifesoft.com/rsyntaxtextarea/'
licenses {
license {
name 'Modified BSD License'
url 'http://fifesoft.com/rsyntaxtextarea/RSyntaxTextArea.License.txt'
distribution 'repo'
}
}
scm {
url 'https://github.com/bobbylight/AutoComplete'
connection 'scm:git:git://github.com/bobbylight/AutoComplete'
developerConnection 'scm:git:git@github.com:bobbylight/AutoComplete'
if (!project.version.endsWith('-SNAPSHOT')) {
tag project.version
}
}
developers {
developer {
name 'Robert Futrell'
url 'http://www.fifesoft.com'
organization = 'Fifesoft' /* https://issues.gradle.org/browse/GRADLE-1200 */
organizationUrl 'http://www.fifesoft.com/'
roles {
role 'architect'
role 'developer'
}
timezone '0'
}
}
// Manually add runtime dependencies since we don't have
// a multi-project build set up properly
dependencies {
dependency {
groupId 'com.fifesoft'
artifactId 'rsyntaxtextarea'
version project.version
}
}
// Says to enforce 1.5 compatibility when building
// Doesn't work as of Gradle 2.0 due to a Groovy bug; see
// http://jira.codehaus.org/browse/GROOVY-7023
// For now, append it via XML directly
/*
build {
plugins {
plugin {
artifactId 'maven-compiler-plugin'
version '2.3.2'
executions {
execution {
id 'default-compile'
configuration {
source '1.5'
target '1.5'
}
}
}
}
}
}
*/
withXml {
def pluginNode = asNode().appendNode('build').appendNode('plugins').appendNode('plugin')
pluginNode.appendNode('artifactId', 'maven-compiler-plugin')
pluginNode.appendNode('version', '2.3.2')
def executionNode = pluginNode.appendNode('executions').appendNode('execution')
executionNode.appendNode('id', 'default-compile')
executionNode.appendNode('configuration').appendNode('source', '1.5').
parent().appendNode('target', '1.5')
}
}
}
}
}
}