-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
101 lines (86 loc) · 3.09 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
plugins {
id 'com.github.johnrengelman.shadow' version '4.0.3'
}
group = 'com.asteroid.duck'
version = '0.0.3'
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
mainClassName = 'com.asteroid.duck.velociwraptor.Main'
repositories {
mavenCentral()
jcenter()
}
dependencies {
// JMTE is our template engine
compile group: 'com.floreysoft', name: 'jmte', version: '5.0.0'
// JSON API for parsing project.json
compile 'javax.json:javax.json-api:1.0'
// JANSI makes the interactive console pretty colours
compile 'org.fusesource.jansi:jansi:1.17.1'
// download, copy files etc.
compile group: 'commons-io', name: 'commons-io', version: '2.6'
// command line parser
compile group: 'commons-cli', name: 'commons-cli', version: '1.4'
// logging
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
// runtime JSON Lib
runtime 'org.glassfish:javax.json:1.0.4'
// no-op logging for runtime
runtime 'ch.qos.logback:logback-classic:1.2.3'
// test dependencies...
testCompile 'junit:junit:4.11'
testCompile 'org.mockito:mockito-all:1.10.19'
// min web server for tests
testCompile 'com.sparkjava:spark-core:2.7.2'
// logging
runtime 'ch.qos.logback:logback-classic:1.2.3'
}
// generate version number resource
ext.genOutputDir = file("$buildDir/generated-resources")
task generatePropInfo {
ext.outputFile = file("$genOutputDir/project-info.properties")
outputs.file(outputFile)
doLast {
outputFile.text = "version=${project.version}"
}
}
sourceSets.main.output.dir genOutputDir, builtBy: generatePropInfo
task downloadTemplate {
description "Downloads the latest version of the template from github"
group "verification"
doLast {
def jar = new File(buildDir, "tmp/template.zip")
jar.withOutputStream {
out -> new URL("https://github.com/duckAsteroid/velociwraptor/archive/template.zip").withInputStream {
from -> out << from
}
}
}
}
task copyAndRenameZip(type: Copy) {
group "verification"
from zipTree("${buildDir}/tmp/template.zip")
into "${buildDir}/explodedZip/"
}
task createTemplate(type: Zip) {
description "Modifies the downloaded ZIP into a JAR"
group "verification"
destinationDir = file("${projectDir}/src/test/resources/com/asteroid/duck/velociwraptor")
archiveName = "template.jar"
from "${buildDir}/explodedZip/velociwraptor-template/"
}
task extractDistribution(type: Copy) {
description 'Extracts the distribution ZIP into a temp dir; ready for InnoSetup to consume'
group 'distribution'
from(zipTree("${buildDir}/distributions/velociwraptor-${project.version}.zip"))
into "${buildDir}/distributions/"
}
task innoSetup (type: Exec){
description "Creates an installer using InnoSetup"
group "distribution"
workingDir 'src/main/inno-setup'
commandLine "c:\\Program Files (x86)\\Inno Setup 6\\iscc.exe", 'velociwraptor.iss'
}
innoSetup.dependsOn extractDistribution
extractDistribution.dependsOn distZip