This repository was archived by the owner on Aug 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.gradle
More file actions
178 lines (151 loc) · 5.5 KB
/
build.gradle
File metadata and controls
178 lines (151 loc) · 5.5 KB
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
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2016 Lee Collins
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
// Apply the java plugin to add support for Java
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'application'
apply plugin: 'maven'
defaultTasks 'test', 'integrationTest'
mainClassName = 'io.github.javaconductor.gserv.Main'
group = "io.github.javaconductor"
version = "1.0.0"
sourceCompatibility = 1.7
targetCompatibility = 1.7
task wrapper(type: Wrapper) {
gradleVersion = '2.12'
}
sourceSets {
integrationTest {
java.srcDir file('src/integrationTest/groovy')
resources.srcDir file('src/integrationTest/resources')
}
test {
java.srcDir file('src/integrationTest/groovy')
resources.srcDir file('src/integrationTest/resources')
}
}
task integrationTest(type: Test) {
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
}
check.dependsOn integrationTest
repositories {
mavenCentral()
//mavenLocal()
}
// In this section you declare the dependencies for your production and test code
dependencies {
// The production code uses the SLF4J logging API at compile time
compile 'log4j:log4j:1.2.17'
compile 'org.slf4j:slf4j-api:1.7.7'
compile 'org.slf4j:log4j-over-slf4j:1.7.7'
compile 'ch.qos.logback:logback-classic:1.0.13'
/// groovy stuff
compile 'org.codehaus.groovy:groovy-all:2.4.1'
compile('org.codehaus.gpars:gpars:1.1.0')
/// apache commons
compile('commons-io:commons-io:2.4')
compile 'commons-cli:commons-cli:1.2'
/// needed for Grab/Grape
compile 'org.apache.ivy:ivy:2.2.0'
/// http builder
compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
/// Google Guava
compile 'com.google.guava:guava:18.0'
/// Test deps
testCompile 'com.github.rest-driver:rest-server-driver:1.1.42'
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
testCompile 'cglib:cglib-nodep:3.1'
testCompile 'org.objenesis:objenesis:1.2'
testCompile "junit:junit:4.11"
integrationTestCompile sourceSets.main.output
integrationTestCompile configurations.testCompile
integrationTestCompile sourceSets.test.output
integrationTestRuntime configurations.testRuntime
}
task integration(type: Test) {
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
}
groovydoc {
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task groovydocJar(type: Jar, dependsOn: groovydoc) {
classifier = 'groovydoc'
from groovydoc.destinationDir
}
jar {
manifest {
attributes(["Main-Class": "io.github.javaconductor.gserv.Main"])
attributes(["Specification-Title": "gServ"])
attributes(["Specification-Version": "$version"])
attributes(["Specification-Vendor": "Lee Collins"])
attributes(["Implementation-Title": "gServ"])
attributes(["Implementation-Version": "$version"])
attributes(["Implementation-Vendor": "Lee Collins"])
}
}
task standaloneJar(type: Jar, dependsOn: classes) {
from sourceSets.main.output.classesDir
from {
sourceSets.main.output.collect {
println it
it.isDirectory() ? it : zipTree(it)
}
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
configurations.runtime.collect {
it.isDirectory() ? it : zipTree(it)
}
}
// include sourceSets.main.output.classesDir.name
manifest {
attributes(["Main-Class": "io.github.javaconductor.gserv.Main"])
attributes(["Specification-Title": "gServ"])
attributes(["Specification-Version": "$version"])
attributes(["Specification-Vendor": "Lee Collins"])
attributes(["Implementation-Title": "gServ"])
attributes(["Implementation-Version": "$version-${new Date().time}"])
attributes(["Implementation-Vendor": "Lee Collins"])
}
archiveName = "gservApp-${version}.jar"
}
task createDist(type: Copy, dependsOn: standaloneJar) {
from('build/libs') {
include "gservApp-${version}.jar"
rename "gservApp-${version}.jar", 'gserv.jar'
}
into 'dist'
}
createDist.mustRunAfter(standaloneJar)
artifacts {
archives standaloneJar
archives sourcesJar
archives groovydocJar
}