forked from palantir/gradle-git-version
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
97 lines (79 loc) · 2.32 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
plugins {
id 'com.jfrog.bintray' version '1.5'
id 'com.gradle.plugin-publish' version '0.9.2'
id 'com.palantir.git-version' version '0.4.0'
id 'eclipse'
id 'groovy'
id 'idea'
id 'maven-publish'
}
task createClasspathManifest {
def outputDir = file("$buildDir/$name")
inputs.files sourceSets.main.runtimeClasspath
outputs.dir outputDir
doLast {
outputDir.mkdirs()
file("$outputDir/plugin-classpath.txt").text = sourceSets.main.runtimeClasspath.join("\n")
}
}
repositories {
jcenter()
}
dependencies {
compile gradleApi()
compile 'org.eclipse.jgit:org.eclipse.jgit:4.1.1.201511131810-r'
testCompile gradleTestKit()
testCompile('org.spockframework:spock-core:1.0-groovy-2.4') {
exclude module: 'groovy-all'
}
testCompile files(createClasspathManifest)
}
tasks.eclipse.dependsOn createClasspathManifest
if (System.env.CIRCLE_TEST_REPORTS) {
test.reports.junitXml.destination = new File(System.env.CIRCLE_TEST_REPORTS, getName())
}
group 'com.palantir.gradle.gitversion'
version gitVersion()
task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier 'sources'
}
publishing {
publications {
bintray(MavenPublication) {
from components.java
artifact(sourceJar)
artifact(publishPluginJavaDocsJar)
}
}
}
bintray {
user = System.env.BINTRAY_USER
key = System.env.BINTRAY_KEY
pkg {
repo = 'releases'
name = 'gradle-git-version'
userOrg = 'palantir'
licenses = ['Apache-2.0']
publications = ['bintray']
}
}
bintrayUpload.dependsOn 'generatePomFileForBintrayPublication', 'sourceJar', 'build'
bintrayUpload.onlyIf {
System.env.BINTRAY_USER && System.env.BINTRAY_KEY && project.version ==~ /\d+\.\d+\.\d+/
}
pluginBundle {
website = 'https://github.com/palantir/gradle-git-version'
vcsUrl = 'https://github.com/palantir/gradle-git-version'
description = 'Gradle Git-Version is a plugin that generates a version for use with Gradle by calling git-describe.'
tags = ['git', 'version']
plugins {
gitVersionPlugin {
id = 'com.palantir.git-version'
displayName = 'Palantir Gradle Git-Version'
}
}
}
publishPlugins.onlyIf {
project.version ==~ /\d+\.\d+\.\d+/
}