forked from palantir/sls-packaging
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
115 lines (100 loc) · 2.96 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
plugins {
id 'com.gradle.plugin-publish' version '0.9.2'
id 'com.jfrog.bintray' version '1.5'
id 'com.jfrog.artifactory' version '4.0.0'
id 'com.palantir.git-version' version '0.4.0'
id 'com.github.kt3k.coveralls' version '2.6.3'
id 'eclipse'
id 'groovy'
id 'idea'
id 'jacoco'
id 'java-gradle-plugin'
id 'maven-publish'
}
apply from: "${rootDir}/gradle/idea-test-kit-fix.gradle"
repositories {
jcenter()
}
dependencies {
compile gradleApi()
testCompile('org.spockframework:spock-core:1.0-groovy-2.4') {
exclude module: 'groovy-all'
}
}
if (System.env.CIRCLE_TEST_REPORTS) {
test.reports.junitXml.destination = new File(System.env.CIRCLE_TEST_REPORTS, getName())
}
group 'com.palantir.gradle.javadist'
version gitVersion()
task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier 'sources'
}
publishing {
publications {
bintray(MavenPublication) {
from components.java
artifact(sourceJar)
artifact(publishPluginJavaDocsJar)
}
jfrog(MavenPublication) {
from components.java
artifact(sourceJar)
artifact(publishPluginJavaDocsJar)
// required pattern for OJO
version project.version.replaceAll(/-.*/, '-SNAPSHOT')
}
}
}
artifactory {
publish {
contextUrl = 'https://oss.jfrog.org/artifactory'
repository {
repoKey = (project.version =~ /-/ ? 'oss-snapshot-local' : 'oss-release-local')
username = System.env.BINTRAY_USER
password = System.env.BINTRAY_KEY
maven = true
}
defaults {
publications (publishing.publications.jfrog)
properties = ['git': project.version]
}
}
}
artifactoryPublish.dependsOn 'generatePomFileForJfrogPublication', 'sourceJar', 'build'
bintray {
user = System.env.BINTRAY_USER
key = System.env.BINTRAY_KEY
publish = true
pkg {
repo = 'releases'
name = 'gradle-java-distribution'
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-java-distribution'
vcsUrl = 'https://github.com/palantir/gradle-java-distribution'
description = 'Creates a distributable package containing libraries and scripts necessary to easily deploy and run a Java project.'
tags = ['distribution', 'application']
plugins {
distributionPlugin {
id = 'com.palantir.java-distribution'
displayName = 'Palantir Java Distribution'
}
}
}
publishPlugins.onlyIf {
project.version ==~ /\d+\.\d+\.\d+/
}
jacocoTestReport {
reports {
xml.enabled true
}
}