/
build.gradle
78 lines (66 loc) · 1.43 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '4.0.0.201505050340-m2'
classpath group: 'org.ajoberstar', name: 'gradle-git', version: '1.3.0'
}
}
import org.ajoberstar.grgit.*
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.+'
}
sourceSets {
main {
java {
srcDir 'src'
}
}
test {
java {
srcDir 'test'
}
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext.repo = Grgit.open(file('.'))
file('src/de/doerl/hqm/hqm.properties').withReader { reader ->
Properties props = new Properties()
props.load(reader)
project.ext.myProps = props
}
group = "de.doerl.hqm"
archivesBaseName = "hqm_offline"
version = ${ext.myProps['build.number']}
title = ${ext.myProps['build.title']}
jar {
manifest {
attributes(
'Main-Class' : 'de.doerl.hqm.ui.EditMain',
'Git-Revision' : repo.head().id,
'Implementation-Title': title
)
}
}
task srcZip(type: Zip) {
classifier = 'src'
from sourceSets.main.allSource
}
task distZip(type: Zip, dependsOn: 'srcZip') {
archiveName = "$archivesBaseName-$version.zip"
from jar.outputs.files
from (project.rootDir) {
include '*.bat'
include '*.sh'
include '*.txt'
exclude 'gradle*.*'
}
from srcZip.archivePath
}
build.dependsOn distZip