forked from bobbylight/RSyntaxTextArea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
203 lines (188 loc) · 5.68 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
['java', 'distribution', 'maven', 'signing'].each { apply plugin: it }
archivesBaseName = 'rsyntaxtextarea'
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
}
// Regenerate local gradlew
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}
compileJava {
sourceCompatibility javaVersion
targetCompatibility javaVersion
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"
}
ext.sharedManifest = manifest {
attributes('Specification-Title': 'RSyntaxTextArea',
'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 = 'rsyntaxtextarea'
contents {
from { [ 'build/libs', 'distfiles' ] }
rename 'RSyntaxTextArea-.*\\.jar', 'rsyntaxtextarea.jar'
}
}
src {
baseName = 'rsyntaxtextarea'
}
}
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
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 {
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 = 'rsyntaxtextarea'
project {
parent {
groupId 'org.sonatype.oss'
artifactId 'oss-parent'
version '7'
relativePath ''
}
groupId 'com.fifesoft'
artifactId 'rsyntaxtextarea'
packaging 'jar'
name 'rsyntaxtextarea'
description 'RSyntaxTextArea is the syntax highlighting text editor used in RText, pulled out into its ' +
'own jar so it is easily usable in any application. Features include Syntax highlighting for 20+ ' +
'languages, Code completion, Regex find and replace, Macros, Code templates, Unlimited undo/red, ' +
'Line numbering and bracket matching.'
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/RSyntaxTextArea'
connection 'scm:git:git://github.com/bobbylight/RSyntaxTextArea'
developerConnection 'scm:git:[email protected]:bobbylight/RSyntaxTextArea'
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'
}
}
// 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')
}
}
}
}
}
}