-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
150 lines (127 loc) · 4.28 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
/*
* Copyright 2015 by Rothmeyer Consulting (http://www.rothmeyer.com/)
* Author: Stefan Burnicki <stefan.burnicki@burnicki.net>
*
* This file is part of SQP.
*
* SQP is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License.
*
* SQP is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with SQP. If not, see <http://www.gnu.org/licenses/>.
*/
buildscript {
repositories { jcenter() }
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.1.1'
}
}
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '1.2.1'
id 'idea'
id 'eclipse'
id 'application'
}
def serverVerticle = 'io.sqp.proxy.ServerVerticle'
def serverConfig = 'config.json'
def transbaseJdbc = project.hasProperty('tbjdbc') ? project.getProperty('tbjdbc') : 'libs/tbjdbc.jar'
def includeTransbase = new File(transbaseJdbc).exists()
version = '1.0'
if (!JavaVersion.current().java8Compatible) {
throw new IllegalStateException('''A Haiku:
| This needs Java 8,
| You are using something else,
| Refresh. Try again.'''.stripMargin())
}
repositories {
mavenCentral()
maven {
url = 'http://oss.sonatype.org/content/repositories/snapshots/'
}
}
if (includeTransbase) {
println 'Using ' + transbaseJdbc + ' for Transbase backend'
} else {
// Otherwise exclude from source and test set
println 'Building without a Transbase backend'
sourceSets {
main {
java {
exclude 'transbase/**'
}
}
test {
java {
exclude 'transbase/**'
}
}
}
}
dependencies {
// platform of proxy
compile 'io.vertx:vertx-core:3.0.0'
// message decoding/encoding
compile 'com.fasterxml.jackson.core:jackson-core:2.5.3'
compile 'com.fasterxml.jackson.core:jackson-databind:2.5.3'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.5.3'
// binary protocol variant
compile 'org.msgpack:jackson-dataformat-msgpack:0.7.0-p9'
// java websocket implementation for client
compile 'org.glassfish.tyrus.bundles:tyrus-standalone-client:1.11'
// for validation custom type input
compile 'com.github.fge:json-schema-validator:2.2.6'
// postgreSQL database backend
compile 'org.postgresql:postgresql:9.4-1201-jdbc41'
if (includeTransbase) {
compile files(transbaseJdbc)
}
// test frameworks
testCompile 'org.testng:testng:6.9.4'
testCompile 'org.hamcrest:hamcrest-all:1.3'
testCompile 'org.mockito:mockito-all:1.10.19'
}
test {
useTestNG {
parallel 'instances'
suites 'src/test/resources/testng-common.xml' // backend independent unit tests
suites 'src/test/resources/testng-native-postgres.xml' // integration tests with PostgreSQL backend
suites 'src/test/resources/testng-jdbc-postgres.xml' // integration tests with JDBC backend
if (includeTransbase) {
suites 'src/test/resources/testng-common-transbase.xml' // common Transbase related test
suites 'src/test/resources/testng-native-transbase.xml' // integration tests with Transbase backend
}
}
// always run tests
outputs.upToDateWhen { false }
testLogging.showStandardStreams = true
testLogging { exceptionFormat "full" }
}
jar {
manifest {
attributes 'Main-Verticle': serverVerticle
}
}
shadowJar {
classifier = 'fat'
manifest {
attributes 'Main-Class': 'io.vertx.core.Starter'
attributes 'Main-Verticle': serverVerticle
}
mergeServiceFiles {
include 'META-INF/services/io.vertx.core.spi.VerticleFactory'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.2'
}
mainClassName = "io.vertx.core.Starter"
run {
args = ["run", serverVerticle, "-conf", serverConfig]
}