-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
114 lines (90 loc) · 2.27 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
apply plugin: 'java'
apply plugin: 'edu.sc.seis.launch4j'
apply plugin: 'jacoco'
apply plugin: 'maven'
apply plugin: 'antlr'
// variables
group = 'info.iconmaster'
version = '0.2.0'
def mainClass = 'info.iconmaster.tnbox.TnBox'
def processedSrcDir = "${buildDir}/generated-src/java/main"
def typhonVersion = '0.4.0'
def typhonJar
if (hasProperty('fromMaven')) {
typhonJar = "info.iconmaster:typhon:${typhonVersion}"
} else {
typhonJar = files("../Typhon/build/libs/typhon-${typhonVersion}.jar")
}
// define sources
repositories {
jcenter()
mavenCentral()
maven {
url 'http://dl.bintray.com/iconmaster5326/maven'
}
}
dependencies {
compile typhonJar
compile 'org.reflections:reflections:0.9.11'
testCompile "junit:junit:4.12"
antlr "org.antlr:antlr4:4.5"
}
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'gradle.plugin.edu.sc.seis.gradle:launch4j:1.6.1'
classpath 'org.apache.maven.wagon:wagon-http:2.2'
}
}
// define Launch4J settings
launch4j {
mainClassName = mainClass
headerType = "console"
}
// add code coverage support
jacocoTestReport {
group = "Reporting"
reports {
xml.enabled true
csv.enabled false
html.destination "${buildDir}/reports/coverage"
}
}
// add Bintray support
uploadArchives {
repositories.mavenDeployer {
repository(url: "https://api.bintray.com/maven/iconmaster5326/maven/tnbox/;publish=1") {
authentication(userName: project.hasProperty('bintrayUser') ? project.property('bintrayUser') : '', password: project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : '')
}
}
}
// define artifacts - the .class and .java JARS
jar {
manifest {
attributes 'Main-Class': mainClass
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
manifest {
attributes 'Main-Class': mainClass
}
classifier = 'sources'
from sourceSets.main.allSource
}
task completeJar(type: Jar, dependsOn: classes) {
manifest {
attributes 'Main-Class': mainClass
}
classifier = 'complete'
from configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }
with jar
}
artifacts {
archives jar
archives sourcesJar
archives completeJar
}