-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
106 lines (83 loc) · 2.1 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
apply plugin: 'java'
apply plugin: 'edu.sc.seis.launch4j'
apply plugin: 'antlr'
apply plugin: 'jacoco'
apply plugin: 'maven'
// variables
group = 'info.iconmaster'
version = '0.4.0'
def mainClass = 'info.iconmaster.typhon.Typhon'
def processedSrcDir = "${buildDir}/generated-src/java/main"
// define sources
repositories {
jcenter()
mavenCentral()
}
dependencies {
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"
}
// define ANTLR settings
generateGrammarSource {
arguments += ["-visitor", "-package", "info.iconmaster.typhon.antlr"]
}
// 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/typhon/;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
}