forked from mediathekview/MLib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
87 lines (73 loc) · 1.96 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
apply plugin: 'java'
apply plugin: 'application'
apply from: "${project.rootDir}/gradle/eclipse.gradle"
import java.nio.file.Files
sourceCompatibility = 1.8
targetCompatibility = 1.8
mainClassName = 'mSearch.Main'
version = '2.1.1'
compileJava {
options.encoding = "UTF-8"
options.compilerArgs = ['-Xlint:all']
}
compileTestJava {
options.encoding = "UTF-8"
options.compilerArgs = ['-Xlint:all']
}
task copyRuntimeLibs(type: Copy) {
into "libs"
from configurations.testRuntime - configurations.runtime
}
repositories {
maven {
url "https://repo.mediathekview.de/repository/maven-public/"
}
}
dependencies {
compile 'org.apache.commons:commons-lang3:3.5'
compile 'com.fasterxml.jackson.core:jackson-core:2.7.0'
compile 'com.jidesoft:jide-oss:3.6.16'
compile 'org.tukaani:xz:1.5'
}
ext {
propsFile = file('src/main/resources/version.properties').absoluteFile
if(!propsFile.exists()) {
Files.createFile(propsFile.toPath())
}
}
def loadVersionProperties() {
Properties props = new Properties()
props.load(propsFile.newDataInputStream())
return props
}
task updateVersion << {
Properties props = loadVersionProperties()
def oldVersion = props.getProperty('VERSION')
if(!oldVersion.equals(project.version)) {
logger.lifecycle "==msearch======================"
logger.lifecycle "Version: $project.version"
logger.lifecycle "==msearch======================"
props.setProperty('VERSION', project.version)
props.store(propsFile.newWriter(), null)
}
}
processResources.dependsOn updateVersion
distributions {
main {
baseName = 'MSearch'
contents {
from{'res'}
}
}
}
/**
* HOWTO debug:
* 1. run "gradle debug"
* 2. Call your IDE to connect to a remote java application on port 5005.
*/
task debug (type: JavaExec, dependsOn: classes){
main = 'mSearch.Main'
classpath = sourceSets.main.runtimeClasspath
args '-gui'
debug true
}