-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkerbtier-defaults.gradle
78 lines (62 loc) · 1.77 KB
/
kerbtier-defaults.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
//Last update: Sun Jan 10 12:06:00 CET 2016
// kerbtier.ch defaults, do not change, will be overwritten
/*
* Gets the version name from the latest Git tag of the form V-X.Y where X and Y are version numbers
*/
def getVersionName = {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--match', 'V-*.*'
standardOutput = stdout
}
def v = stdout.toString().trim() =~ /V-(\d+)\.(\d+)(?:-(\d+)-)?/
return v[0][1] + "." + v[0][2] + "." + (v[0][3] == null ? 0 : v[0][3])
}
version = getVersionName()
jar {
manifest {
attributes 'Implementation-Title': project.name, 'Implementation-Version': version
}
}
task updateKerbtierDefaults << {
def url = 'https://gist.githubusercontent.com/creichlin/125a4387c15038b1672a/raw/kerbtier-default.gradle'
def f = new File('kerbtier-defaults.gradle')
new URL(url).withInputStream { i ->
f.withOutputStream {
it << "//Last update: " + new Date() + "\n"
it << i
}
}
}
group = 'ch.kerbtier.' + name
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
}
configurations {
pegdownDoclet
}
dependencies {
compile 'com.google.guava:guava:19.0'
compile 'commons-io:commons-io:2.4'
testCompile 'org.codehaus.groovy:groovy-all:2.4.5'
pegdownDoclet 'ch.raffael.pegdown-doclet:pegdown-doclet:1.2'
}
javadoc {
options.docletpath = configurations.pegdownDoclet.files.asType(List)
options.doclet = "ch.raffael.doclets.pegdown.PegdownDoclet"
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}