forked from lexica/lexica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
81 lines (69 loc) · 2.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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'java'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
allprojects {
repositories {
jcenter()
}
}
// NOTE: The below tasks are a little bit hacky. The optimal solution would be to have a nice
// gradle plugin whose source lives in the libraries/ directory, and which the app/ project
// depends on. However, I couldn't figure out how to have a gradle plugin in the same project
// as another gradle build which depended on that plugin.
task buildLanguageAnalysis(type: GradleBuild) {
buildFile = file('libraries/language-analysis/build.gradle')
tasks = ['build']
}
task buildTrieBuilder(type: GradleBuild) {
buildFile = file('libraries/trie-builder/build.gradle')
tasks = ['build']
}
task buildTrieLib(type: GradleBuild) {
buildFile = file('libraries/trie/build.gradle')
tasks = ['build']
}
task buildDictionaries
def languages = [
"en_US",
"en_GB",
"de_DE",
"fr_FR",
"ca",
"es",
"fa",
"it",
"nl",
"jp",
"ru",
]
languages.each { lang ->
def langTask = task "buildDictionary_${lang}"(dependsOn: buildTrieBuilder, type: JavaExec) {
main = 'com.serwylo.lexica.trie.TrieBuilderApp'
classpath 'libraries/trie/build/libs/trie.jar', 'libraries/trie-builder/build/libs/trie-builder.jar'
args = [
lang,
file('assets/dictionaries/'),
file('app/src/main/res/raw/'),
file('app/src/test/resources/'),
]
outputs.dir("assets/dictionaries/dictionary_${lang}.txt")
}
buildDictionaries.dependsOn << langTask
task "analyseLanguage_${lang}"(dependsOn: [buildLanguageAnalysis, langTask], type: JavaExec) {
main = 'com.serwylo.lexica.language.LanguageAnalysisApp'
classpath 'libraries/language-analysis/build/libs/language-analysis.jar'
args = [
lang,
file('app/src/main/res/raw/'),
file('assets/dictionaries/'),
file('/tmp/'),
]
}
}