-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
136 lines (115 loc) · 3.07 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
plugins {
id "us.kirchmeier.capsule" version "1.0.2"
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'eclipse-wtp'
apply plugin: 'maven'
group = "com.github.CherokeeLanguage"
version = '20191007'
sourceCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
repositories {
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
}
configurations {
provided
}
dependencies {
compile 'commons-io:commons-io:+'
compile 'org.apache.commons:commons-text:+'
// https://mvnrepository.com/artifact/org.testng/testng
testCompile group: 'org.testng', name: 'testng', version: '7.0.0'
}
sourceSets {
main {
compileClasspath += configurations.provided
}
test {
compileClasspath += configurations.provided
runtimeClasspath += configurations.provided
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
javadoc.failOnError=false
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
eclipseJdt << {
File f = file('.settings/org.eclipse.core.resources.prefs')
f.write('eclipse.preferences.version=1\n')
f.append('encoding/<project>=utf-8')
f = file('.settings/org.eclipse.core.runtime.prefs')
f.write('eclipse.preferences.version=1\n')
f.append('line.separator=\\n\n')
}
task fatjar(type: FatCapsule) {
archiveName 'CherokeeLemmatizer.jar'
applicationClass 'com.cherokeelessons.lemmatizer.Main'
capsuleManifest {
jvmArgs = ['-Dfile.encoding=UTF-8']
}
}
project.afterEvaluate {
// use jre lib matching version used by project, not the workspace default
if (sourceCompatibility != null) {
def target = project.sourceCompatibility.toString()
def containerPrefix = "org.eclipse.jdt.launching.JRE_CONTAINER"
def containerSuffix
if (target =~ /1.[4-5]/) {
containerSuffix = '/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-' + target
} else if (target =~ /1.[6-8]/) {
containerSuffix = '/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-' + target
}
if (containerSuffix != null) {
project.eclipse.classpath {
containers.removeAll { it.startsWith(containerPrefix) }
containers.add(containerPrefix + containerSuffix)
}
}
}
}
eclipse {
project {
name = 'CherokeeLemmatizer'
referencedProjects
natures 'org.eclipse.buildship.core.gradleprojectnature'
}
classpath {
plusConfigurations += [configurations.provided]
containers += ['org.springsource.ide.eclipse.gradle.classpathcontainer']
downloadSources = true
downloadJavadoc = true
}
jdt {
sourceCompatibility=1.8
targetCompatibility=1.8
}
wtp {
facet {
facets = []
facet name: 'jst.java', version: '1.8'
//facet name: 'jst.web', version: '3.0'
}
}
}
task "create-dirs" << {
sourceSets*.java.srcDirs*.each { it.mkdirs() }
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
}
test {
// enable TestNG support (default is JUnit)
useTestNG()
testLogging.showStandardStreams = true
failFast = true
}