-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
102 lines (91 loc) · 2.78 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
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'jacoco'
ext.artifactId = 'gradle-artifactid'
group 'com.nicholasworkshop'
version '1.0.0'
repositories {
jcenter()
}
dependencies {
compile gradleApi()
compile localGroovy()
testCompile 'com.android.tools.build:gradle:1.5.0'
}
jacocoTestReport {
name 'jacoco'
group 'report'
dependsOn test
reports.xml.enabled = true
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
archives javadocJar
}
signing {
sign configurations.archives
}
install {
group 'publish'
repositories.mavenInstaller {
pom.artifactId = artifactId
}
}
uploadArchives {
group 'publish'
repositories {
mavenDeployer {
pom.groupId = project.group
pom.artifactId = artifactId
pom.version = project.version
pom.project {
name 'Artifact ID Plugin'
packaging 'jar'
url 'https://github.com/nickwph/artifactid-gradle'
scm {
url 'https://github.com/nickwph/artifactid-gradle'
connection 'scm:[email protected]:nickwph/artifactid-gradle.git'
developerConnection 'scm:[email protected]:nickwph/artifactid-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 ->
project.signing.signPom(deployment)
}
String packageName = 'artifactid-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) : ""
}