This repository has been archived by the owner on Oct 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
126 lines (108 loc) · 3.51 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
apply plugin: "java"
ext {
jsword_project = System.env.JSWORD_PATH ?: "../../jsword"
jsword_src = "${jsword_project}/src/main/java"
jsword_resources = "${jsword_project}/src/main/resources"
tweaks_jsword_src = "tweaks-src/java"
tweaks_jsword_resources = "tweaks-src/resources"
tweaks_util_src = "src/util/java"
build_src = "src/jsword/java"
build_resources = "src/jsword/resources"
distribution = "distribution"
target_dir = System.env.TARGET_DIR ?: "../and-bible/app/libs"
jswordtweaks_home = "$rootDir"
}
allprojects {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
task clean_project {
outputs.upToDateWhen { false }
doFirst {
delete(build_src, build_resources, distribution)
}
}
task myinit() {
outputs.upToDateWhen { false }
doFirst {
mkdir build_src
mkdir build_resources
mkdir distribution
}
}
task mergeResources(type: Copy, dependsOn: myinit) {
outputs.upToDateWhen { false }
from(jsword_resources) {
exclude("org/crosswire/jsword/versification/**")
}
from(jsword_resources) {
include("org/crosswire/jsword/versification/**")
filter({String line -> if (line.contains('!zerosUnmapped')) '#!zerosUnmapped // commented out' else line})
}
// switch the Chinese localisation defaults around so default CN is simplified and TW is Traditional
from(jsword_resources) {
include("BibleNames_zh*.properties")
rename("BibleNames_zh.properties", "BibleNames_zh_TW.properties")
rename("BibleNames_zh_CN.properties", "BibleNames_zh.properties")
}
from(tweaks_jsword_resources) {
duplicatesStrategy DuplicatesStrategy.INCLUDE
}
into build_resources
}
task mergeCode(type: Copy, dependsOn: myinit) {
outputs.upToDateWhen { false }
from(jsword_src) {
exclude("org/crosswire/jsword/book/install/sword/FTPExample.java")
exclude("org/crosswire/jsword/examples/Bench.java")
}
from(tweaks_jsword_src){
duplicatesStrategy DuplicatesStrategy.INCLUDE
}
into build_src
}
sourceSets {
main {
java {
srcDir 'src/jsword/java'
}
resources {
srcDir 'src/jsword/resources'
}
output.resourcesDir = "build/classes/main"
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
outputs.upToDateWhen { false }
classifier = 'sources'
from sourceSets.main.allSource
}
clean.dependsOn clean_project, myinit
compileJava.dependsOn mergeResources, mergeCode
build.dependsOn sourcesJar, compileJava, jar
task installSources(type: Copy, dependsOn: build) {
from("build/libs/jsword-tweaks-sources.jar") {
rename("jsword-tweaks-sources.jar", "jsword-src.jar")
duplicatesStrategy DuplicatesStrategy.INCLUDE
}
into target_dir
}
task install(type: Copy, dependsOn: [build, installSources]) {
from("build/libs") {
rename("${project.name}.jar", "jsword.jar")
rename("${project.name}-sources.jar", "jsword-src.jar")
duplicatesStrategy DuplicatesStrategy.INCLUDE
}
into target_dir
}
repositories {
mavenCentral()
}
dependencies {
implementation "org.apache.commons:commons-compress:1.12"
implementation "com.chenlb.mmseg4j:mmseg4j-analysis:1.8.6"
implementation "org.jdom:jdom2:2.0.6"
implementation "org.apache.lucene:lucene-analyzers:3.6.2"
implementation "org.apache.lucene:lucene-smartcn:3.6.2"
implementation "org.slf4j:slf4j-api:1.7.6"
}