-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
70 lines (54 loc) · 1.6 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'de.undercouch:gradle-download-task:0.4'
}
}
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'eclipse'
apply plugin: 'idea'
mainClassName = 'gui.GuiCtrl'
repositories {
mavenCentral()
}
dependencies {
compile 'com.intellij:forms_rt:7.0.3'
compile 'org.hsqldb:hsqldb:1.8.0.10'
testCompile 'junit:junit:4.+'
}
sourceCompatibility = '1.5'
targetCompatibility = '1.5'
// IDE-specific settings
idea.project.ipr {
withXml { provider ->
provider.node.appendNode('component', [name: 'uidesigner-configuration']).appendNode('option', [name: 'INSTRUMENT_CLASSES', value: 'false'])
}
}
// DB management tasks
import de.undercouch.gradle.tasks.download.Download
task downloadDb(type: Download) {
src 'https://s3-eu-west-1.amazonaws.com/cmcmsuai/paronym-dictionary/db/paronym.zip'
dest 'db'
onlyIfNewer true
}
task extractDb(type: Sync, dependsOn: 'downloadDb') {
from zipTree('db/paronym.zip')
into 'db/paronym'
}
run.dependsOn extractDb
distTar.dependsOn extractDb
distZip.dependsOn extractDb
applicationDistribution.from('db/paronym') {
into 'db/paronym'
}
tasks.startScripts {
doLast {
def unixScriptFile = file "${outputDir}/${applicationName}"
def windowsScriptFile = file "${outputDir}/${applicationName}.bat"
unixScriptFile.text = unixScriptFile.text.replace("\nexec \"\$JAVACMD\"", "\ncd \"\$APP_HOME\"\nexec \"\$JAVACMD\"")
windowsScriptFile.text = windowsScriptFile.text.replace("\n\"%JAVA_EXE%\"", "\ncd \"%APP_HOME%\"\n\"%JAVA_EXE%\"")
}
}