forked from lexica/lexica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
120 lines (103 loc) · 2.85 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'java'
apply plugin: 'kotlin'
buildscript {
ext.kotlin_version = '1.4.30'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.bjoernq:unmockplugin:0.7.6'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
// 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 = ['shadowJar']
}
task buildTrieBuilder(type: GradleBuild) {
buildFile = file('libraries/trie-builder/build.gradle')
tasks = ['shadowJar']
}
task buildTrieLib(type: GradleBuild) {
buildFile = file('libraries/trie/build.gradle')
tasks = ['build']
}
task buildDictionaries
def languages = [
"ca",
"de_DE",
"de_DE_no_diacritics",
"en_US",
"en_GB",
"es",
"es_solo_enne",
"fa",
"fr_FR",
"fr_FR_no_diacritics",
"hu",
"it",
"ja",
"nl",
"pl",
"pt_BR",
"pt_BR_no_diacritics",
"ru",
"ru_extended",
"uk",
]
languages.each { lang ->
def langTask = task "buildDictionary_${lang}"(dependsOn: buildTrieBuilder, type: JavaExec) {
main = 'com.serwylo.lexica.trie.TrieBuilderApp'
classpath 'libraries/trie-builder/build/libs/trie-builder-all.jar'
args = [
lang,
file('assets/dictionaries/'),
file('app/src/main/res/raw/'),
file('app/src/test/resources/'),
]
outputs.files([
"app/src/main/res/raw/words_${lang}.bin",
"app/src/test/resources/words_${lang}.bin",
])
}
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-all.jar'
args = [
lang,
file('app/src/main/res/raw/'),
file('assets/dictionaries/'),
file('/tmp/'),
]
}
}
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}