-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
108 lines (96 loc) · 2.86 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
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'jacoco'
apply plugin: 'signing'
ext.artifactId = "gradle-publish"
group 'com.nicholasworkshop'
version '1.0.1'
repositories {
jcenter()
}
dependencies {
compile gradleApi()
compile localGroovy()
compile 'com.android.tools.build:gradle:1.5.0'
testCompile 'org.mockito:mockito-core:1.10.19'
}
jacocoTestReport {
name 'jacoco'
group 'report'
dependsOn test
reports.xml.enabled = true
}
install {
group 'publish'
repositories.mavenInstaller {
pom.artifactId = artifactId
}
}
test {
useTestNG()
}
task jarSources(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task jarJavadoc(type: Jar) {
classifier = 'javadoc'
from javadoc
}
artifacts {
archives jarSources
archives jarJavadoc
}
signing {
sign configurations.archives
}
uploadArchives {
group 'publish'
repositories {
mavenDeployer {
pom.groupId = project.group
pom.artifactId = artifactId
pom.version = project.version
pom.project {
name 'Publish Gradle Plugin'
packaging 'jar'
description 'N/A'
url 'https://github.com/nickwph/publish-gradle'
scm {
url 'https://github.com/nickwph/publish-gradle'
connection 'scm:git@github.com:nickwph/publish-gradle.git'
developerConnection 'scm:git@github.com:nickwph/publish-gradle.git'
}
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 'nickwph'
name 'Nicholas Wong'
}
}
}
beforeDeployment { MavenDeployment deployment ->
signing.signPom(deployment)
}
String packageName = 'publish-gradle'
String username = getGradleProperty('publish.maven.bintray.username');
String password = getGradleProperty('publish.maven.bintray.apiKey')
String id = "bintray-$username-maven"
repository(id: id, url: "https://api.bintray.com/maven/$username/maven/$packageName") {
authentication(userName: username, password: password)
}
snapshotRepository(id: id, url: 'https://oss.jfrog.org/artifactory/list/oss-snapshot-local') {
authentication(userName: username, password: password)
}
}
}
}
def getGradleProperty(String name) {
return hasProperty(name) ? getProperty(name) : ""
}