-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
234 lines (199 loc) · 8.42 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath group: 'org.junit.platform', name: 'junit-platform-gradle-plugin', version: '1.0.0-RC3'
classpath group: 'com.github.jengelman.gradle.plugins', name: 'shadow', version: '1.2.4'
classpath group: 'com.netflix.nebula', name: 'gradle-ospackage-plugin', version: '4.4.0'
}
}
plugins {
id 'de.fuerstenau.buildconfig' version '1.1.8'
}
repositories {
mavenCentral()
jcenter()
}
ext.junitPlatformVersion = '1.0.0-RC3'
ext.junitJupiterVersion = '5.0.0-RC3'
ext.log4jVersion = '2.7'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: "nebula.deb"
apply plugin: 'nebula.rpm'
project.version = '1.0.0-alpha.7'
project.group = 'com.domhauton.membrane'
jar {
baseName = 'membrane-daemon'
version = project.version
manifest {
attributes 'Implementation-Title': 'Membrane Daemon',
'Implementation-Version': project.version,
'Main-Class': project.group + '.Main'
}
}
task buildDeb(type: Deb) {
packageName 'membrane'
version project.version
release '1'
maintainer 'Dominic Hauton'
uploaders 'Dominic Hauton'
preInstall file('scripts/deb/preInstall.sh')
postInstall file('scripts/deb/postInstall.sh')
postUninstall file('scripts/deb/postUninstall.sh')
requires('default-jre-headless', '>= 1.8').or("default-jre", '>= 1.8')
into '/usr/share/membrane'
from('build/libs') {
into 'lib'
}
from('scripts/bin') {
into 'bin'
fileMode 0555
}
link('/usr/bin/membraned', '/usr/share/membrane/bin/membraned', 555)
link('/usr/bin/membrane', '/usr/share/membrane/bin/membrane', 555)
link('/usr/bin/membrane-gui', '/usr/share/membrane/bin/membrane-gui', 555)
}
task buildRpm(type: Rpm) {
packageName 'membrane'
version '1.0.0.alpha.7'
release '1'
os LINUX
user 'root'
permissionGroup 'root'
preInstall file('scripts/rpm/preInstall.sh')
postInstall file('scripts/rpm/postInstall.sh')
postUninstall file('scripts/rpm/postUninstall.sh')
into '/usr/share/membrane'
from('build/libs') {
into 'lib'
}
from('scripts/bin') {
into 'bin'
fileMode 0555
}
link('/usr/bin/membraned', '/usr/share/membrane/bin/membraned', 555)
link('/usr/bin/membrane', '/usr/share/membrane/bin/membrane', 555)
link('/usr/bin/membrane-gui', '/usr/share/membrane/bin/membrane-gui', 555)
}
compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
options.compilerArgs += '-parameters'
}
junitPlatform {
platformVersion '1.0.0-RC3'
filters {
engines {
include 'junit-jupiter'
}
tags {
// include 'fast'
exclude 'slow'
}
}
reportsDir file('build/test-results')
enableStandardTestTask false
}
project.afterEvaluate {
def junitPlatformTestTask = project.tasks.getByName('junitPlatformTest')
// configure jacoco to analyze the junitPlatformTest task
jacoco {
// this tool version is compatible with
toolVersion = "0.7.9"
applyTo junitPlatformTestTask
}
// create junit platform jacoco task
project.task(type: JacocoReport, "junitPlatformJacocoReport",
{
sourceDirectories = files("./src/main")
classDirectories = files("$buildDir/classes/main")
executionData junitPlatformTestTask
reports {
xml.enabled true
xml.destination "${buildDir}/jacoco/report.xml"
html.enabled true
html.destination "${buildDir}/jacoco/html"
}
doLast {
println "Jacoco report for client created: file://${reports.xml.destination.toURI().path}"
}
})
}
project.ext {
nettyVersion = "4.1.15.Final"
bouncyCastleVersion = "1.58"
}
dependencies{
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.8.2'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.9.0'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.0'
// https://mvnrepository.com/artifact/com.google.guava/guava
compile group: 'com.google.guava', name: 'guava', version: '23.0'
// https://mvnrepository.com/artifact/joda-time/joda-time
compile group: 'joda-time', name: 'joda-time', version: '2.9.9'
// https://mvnrepository.com/artifact/org.apache.commons/commons-collections4
compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.1'
// https://mvnrepository.com/artifact/io.vertx/vertx-core
compile group: 'io.vertx', name: 'vertx-core', version: '3.4.2'
// https://mvnrepository.com/artifact/io.vertx/vertx-web
compile group: 'io.vertx', name: 'vertx-web', version: '3.4.2'
// https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on
compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: bouncyCastleVersion
// https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk15on
compile group: 'org.bouncycastle', name: 'bcpkix-jdk15on', version: bouncyCastleVersion
// https://mvnrepository.com/artifact/org.bitlet/weupnp
compile group: 'org.bitlet', name: 'weupnp', version: '0.1.4'
// https://mvnrepository.com/artifact/org.xerial.snappy/snappy-java
compile group: 'org.xerial.snappy', name: 'snappy-java', version: '1.1.4-M3'
// https://mvnrepository.com/artifact/net.jpountz.lz4/lz4
compile group: 'net.jpountz.lz4', name: 'lz4', version: '1.3.0'
// https://mvnrepository.com/artifact/javax.jmdns/jmdns
// compile group: 'javax.jmdns', name: 'jmdns', version: '3.4.1'
// https://mvnrepository.com/artifact/com.google.jimfs/jimfs
// compile group: 'com.google.jimfs', name: 'jimfs', version: '1.1'
// https://bintray.com/serce/maven/jnr-fuse
// compile 'com.github.serceman:jnr-fuse:0.3.1'
// BUMP NETTY VERSION TO FIX BUG FOR VERTX
// https://mvnrepository.com/artifact/io.netty
compile group: 'io.netty', name: 'netty-common', version: nettyVersion
compile group: 'io.netty', name: 'netty-buffer', version: nettyVersion
compile group: 'io.netty', name: 'netty-transport', version: nettyVersion
compile group: 'io.netty', name: 'netty-handler', version: nettyVersion
compile group: 'io.netty', name: 'netty-handler-proxy', version: nettyVersion
compile group: 'io.netty', name: 'netty-codec-http', version: nettyVersion
compile group: 'io.netty', name: 'netty-codec-http2', version: nettyVersion
compile group: 'io.netty', name: 'netty-resolver', version: nettyVersion
compile group: 'io.netty', name: 'netty-resolver-dns', version: nettyVersion
compile group: 'io.netty', name: 'netty-handler-proxy', version: nettyVersion
}
dependencies {
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.0.0-RC3'
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine
testRuntime group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.0.0-RC3'
// https://mvnrepository.com/artifact/org.junit.platform/junit-platform-gradle-plugin
testCompile group: 'org.junit.platform', name: 'junit-platform-gradle-plugin', version: '1.0.0-RC3'
// https://mvnrepository.com/artifact/org.mockito/mockito-core
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.9.0'
// https://mvnrepository.com/artifact/io.vertx/vertx-codegen
testCompile group: 'io.vertx', name: 'vertx-codegen', version: '3.4.2'
}
buildConfig {
appName = project.name // sets value of NAME field
version = project.version // sets value of VERSION field
packageName = project.group
clsName = 'MembraneBuild' // sets the name of the BuildConfig class
}