-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·130 lines (104 loc) · 2.98 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
buildscript {
repositories {
mavenLocal()
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:+'
classpath 'com.ofg:uptodate-gradle-plugin:+'
}
}
apply plugin: 'groovy'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'uptodate'
sourceCompatibility = 1.7
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
ext {
versionPrefix = "CD"
buildNrLoc = project.hasProperty('buildNr') ? "${buildNr}" : "000"
currentVersion = "${versionPrefix}-${buildNrLoc}"
mainClass = 'com.ofg.BootMicroserviceStubApplication'
curatorVersion = '2.6.0'
groovyVersion = '2.3.6'
spockVersion = '0.7-groovy-2.0'
}
group = 'pl.microhackaton'
description = 'Twitter Places Analyzer Microservice Stub'
version = currentVersion
dependencies {
compile "org.apache.curator:curator-x-discovery:$curatorVersion"
compile "org.apache.curator:curator-test:$curatorVersion"
compile "org.codehaus.groovy:groovy-all:$groovyVersion:indy"
compile 'org.reflections:reflections:0.9.8'
compile 'com.github.tomakehurst:wiremock:1.47'
testCompile("org.spockframework:spock-core:$spockVersion") {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact fatJar {
classifier "shadow"
}
artifact fatJarWithoutGroovy {
classifier "groovyless-shadow"
}
}
}
repositories {
maven {
credentials {
username 'deployment'
password 'deployment123'
}
url "http://nexus.microhackathon.pl/content/repositories/releases/"
}
}
}
task sourcesJar(type: Jar, dependsOn: build) {
classifier = 'sources'
from sourceSets.main.allSource
}
task fatJar(type: Jar, dependsOn: build) {
classifier = "shadow"
from files(sourceSets.main.output.classesDir)
from configurations.runtime.asFileTree.files.collect { zipTree(it) }
manifest {
attributes 'Main-Class': mainClass
}
}
configurations {
groovyless
groovyless {
extendsFrom runtime
exclude([group: 'org.codehaus.groovy', name: 'groovy-all'])
}
}
task fatJarWithoutGroovy(type: Jar, dependsOn: build) {
classifier "groovyless-shadow"
from files(sourceSets.main.output.classesDir)
from configurations.groovyless.asFileTree.files.collect {
zipTree(it)
}
manifest {
attributes 'Main-Class': mainClass
}
}
[sourcesJar, fatJar, fatJarWithoutGroovy]*.onlyIf { artifactTask ->
project.gradle.startParameter.taskNames.any {
it == artifactTask.name || project.tasks.findByName(it).group == 'publishing'
}
}