-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
145 lines (121 loc) · 4.39 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
buildscript {
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.+',
'org.kordamp.gradle:stats-gradle-plugin:0.2.+'
}
}
plugins {
id 'groovy'
id 'distribution'
id 'com.github.johnrengelman.shadow' version '2.0.3'
id "org.kordamp.gradle.stats" version "0.2.2"
}
def projectName = 'VSphere2Metrics'
description = "$projectName - ESXi Performance Metric Integration with Graphite & InfluxDB"
group = 'com.allthingsmonitoring.vmware.VSphere2Metrics'
archivesBaseName = projectName.toLowerCase()
distsDirName = 'dist'
version = '1.6.2'
def authorString = 'Sebastian YEPES FERNANDEZ ([email protected])'
def copyrightString = 'Copyright © 2017 – Sebastian YEPES FERNANDEZ All Rights Reserved.'
defaultTasks 'clean','shadowJar','groovydoc','distZip'
configurations {
groovyDoc
}
configure([compileGroovy, compileTestGroovy]) {
//groovyOptions.useAnt = true
//compileGroovy.groovyOptions.fork = true
groovyOptions.fork(memoryInitialSize: '128M', memoryMaximumSize: '1G')
groovyOptions.encoding = 'UTF-8'
//groovyOptions.optimizationOptions.indy = true
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
//configurations.compile.transitive = false
compileJava {
options.encoding = 'UTF-8'
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
compile 'org.codehaus.groovy:groovy:2.4.+',
'org.codehaus.groovy:groovy-json:2.4.+',
'commons-cli:commons-cli:1.+',
'org.slf4j:slf4j-api:1.7.+',
'ch.qos.logback:logback-core:1.2.+',
'ch.qos.logback:logback-classic:1.2.+',
'org.fusesource.jansi:jansi:1.+',
'net.sf.opencsv:opencsv:2.+',
'com.xlson.groovycsv:groovycsv:1.+',
'dom4j:dom4j:1.6.+',
'com.github.syepes:MetricClient:master-SNAPSHOT',
'com.github.yavijava:yavijava:6.+',
fileTree(dir: 'libs', include: '*.jar')
compile 'org.codehaus.jsr166-mirror:jsr166y:1.7.+'
compile 'org.codehaus.gpars:gpars:1.+', {
exclude module: "groovy-all"
}
groovyDoc 'org.codehaus.groovy:groovy-groovydoc:2.4.+',
'org.codehaus.groovy:groovy-json:2.4.+',
'org.codehaus.groovy:groovy-ant:2.4.+'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4', {
exclude module: 'groovy-all'
}
}
groovydoc {
classpath -= configurations.groovyDoc
groovyClasspath = configurations.groovyDoc
destinationDir = new File(( System.getProperty( 'groovydocDir' ) ?: project.buildDir.path + '/docs' ), ( project.version.contains( '-SNAPSHOT' ) ? '' : project.version ))
includePrivate = true
windowTitle = "$projectName"
docTitle = "$projectName - v$project.version"
header = ""
footer = copyrightString
link 'http://download.oracle.com/javase/7/docs/api/', 'java.'
link 'http://www.groovy-lang.org/api/', 'groovy.', 'org.codehaus.groovy.'
link 'http://commons.apache.org/net/apidocs/', 'org.apache.commons.net.'
}
shadowJar {
zip64 true
group = 'shadow'
classifier = null
version = null
exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA'
exclude 'META-INF/*.txt', 'META-INF/*.properties', '*.htm*', '*.properties'
exclude 'META-INF/INDEX.LIST', 'META-INF/DEPENDENCIES*', 'META-INF/LICENSE*', 'META-INF/README*','META-INF/NOTICE*', 'META-INF/DISC*'
exclude 'META-INF/licenses/**', 'META-INF/maven/**'
mergeServiceFiles()
mergeGroovyExtensionModules()
manifest {
attributes 'Implementation-Title': project.description,
'Implementation-Version': project.version,
'Specification-Title': project.description,
'Specification-Version': project.version,
'Built-By': System.properties['user.name'],
'Built-JDK': System.properties['java.version'] +' ('+ System.properties['java.vm.vendor'] +')',
'Built-Date': new Date(),
'Author': authorString,
'Main-Class': project.group
}
}
distributions {
main {
baseName = archivesBaseName
contents {
from { 'build/libs' }
from { 'src/dist' }
from { 'README.md' }
from { 'CHANGELOG.md' }
from { 'LICENSE.md' }
}
}
}
distZip.dependsOn('shadowJar')
distTar.dependsOn('shadowJar')
distTar.compression = Compression.GZIP