forked from arturdm/jacoco-android-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
113 lines (95 loc) · 2.17 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
plugins {
id 'groovy'
id 'maven-publish'
id 'jacoco'
id 'pl.allegro.tech.build.axion-release' version '1.10.0'
id 'com.jfrog.artifactory' version '4.9.3'
id 'com.jfrog.bintray' version '1.8.4'
}
sourceCompatibility = JavaVersion.VERSION_1_5
configurations {
provided
}
repositories {
jcenter()
google()
}
dependencies {
implementation gradleApi()
implementation localGroovy()
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
testImplementation(group: 'org.spockframework', name: 'spock-core', version: '1.1-groovy-2.4') {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
testImplementation 'com.android.tools.build:gradle:3.3.1'
testImplementation 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21'
}
scmVersion {
tag {
prefix = 'jacoco-android-release'
}
versionCreator "versionWithBranch"
}
group = 'com.dicedmelon.gradle'
version = scmVersion.version
test {
testLogging {
exceptionFormat "full"
}
}
jacocoTestReport {
reports {
html.enabled false
xml.enabled true
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
publishing {
publications {
plugin(MavenPublication) {
from components.java
artifact sourcesJar
}
}
}
def credentials = (project.hasProperty('bintray.credentials') ?
project.property('bintray.credentials') :
System.getenv('BINTRAY_CREDENTIALS') ?: '').split(':')
bintray {
user = credentials.first()
key = credentials.last()
publications = ['plugin']
pkg {
repo = 'maven'
name = "$project.group:$project.name"
userOrg = 'dicedmelon'
version {
gpg {
sign = true
}
}
}
}
artifactory {
contextUrl = "http://oss.jfrog.org"
publish {
repository {
repoKey = "oss-snapshot-local"
username = credentials.first()
password = credentials.last()
}
defaults {
publications("plugin")
}
}
clientConfig.info.setBuildNumber(System.getProperty("build.number"))
}
task publishSnapshot() {
if (version.endsWith("-SNAPSHOT")) dependsOn "artifactoryPublish"
}
task publishRelease() {
if (!version.endsWith("-SNAPSHOT")) dependsOn "bintrayUpload"
}