This repository has been archived by the owner on Jul 14, 2018. It is now read-only.
/
build.gradle
134 lines (118 loc) · 3.3 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
buildscript {
repositories {
jcenter()
}
dependencies {
}
}
plugins {
id "com.gradle.plugin-publish" version "0.9.7"
id "com.jfrog.bintray" version "1.7.3"
}
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: "com.gradle.plugin-publish"
apply plugin: 'groovy'
apply plugin: 'idea'
dependencies {
repositories {
google()
jcenter()
}
compile gradleApi()
compile localGroovy()
compile 'com.android.tools.build:gradle:3.0.0-beta7'
}
group = GROUP_ID
version = VERSION
pluginBundle {
website = WEBSITE
vcsUrl = VCS_URL
description = DESCRIPTION
tags = TAGS.split(',')
plugins {
findbugsPlugin {
id = 'com.leinardi.android.findbugs'
displayName = 'Android FindBugs Plugin'
}
}
mavenCoordinates {
groupId = GROUP_ID
artifactId = ARTIFACT_ID
version = VERSION
}
}
// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// add javadoc/source jar tasks as artifacts
artifacts {
archives sourcesJar, javadocJar
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
publications = ['mavenJava']
dryRun = false //[Default: false] Whether to run this as dry-run, without deploying
publish = true //[Default: false] Whether version should be auto published after an upload
override = false //[Default: false] Whether to override version artifacts already published
pkg {
repo = 'generic'
name = ARTIFACT_ID
userOrg = user
licenses = ['Apache-2.0']
websiteUrl = WEBSITE
issueTrackerUrl = ISSUE_TRACKER_URL
vcsUrl = VCS_URL
labels = TAGS.split(',')
version {
name = VERSION
desc = DESCRIPTION
}
}
// Create the pom configuration:
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id user
name "Roberto Leinardi"
email "roberto@leinardi.com"
}
}
scm {
url VCS_URL
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId GROUP_ID
artifactId ARTIFACT_ID
version VERSION
pom.withXml {
def root = asNode()
root.appendNode('description', DESCRIPTION)
root.appendNode('name', ARTIFACT_ID)
root.appendNode('url', WEBSITE)
root.children().last() + pomConfig
}
}
}
}
}