This repository has been archived by the owner on Apr 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.gradle
105 lines (92 loc) · 3.45 KB
/
publish.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
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
version '1.0.0'
group 'org.openftc'
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// Create the pom configuration:
def pomConfig = {
licenses {
license {
name "MIT License"
url "http://www.opensource.org/licenses/mit-license.php"
// distribution "repo"
}
}
developers {
developer {
name "OpenFTC Team"
email "[email protected]"
organization "OpenFTC"
organizationUrl "https://github.com/OpenFTC"
}
}
scm {
url "https://github.com/OpenFTC/RevExtensions"
}
}
publishing {
publications {
Production(MavenPublication) {
artifact("$buildDir/outputs/aar/app-release.aar")
artifact sourcesJar
artifact javadocJar
groupId 'org.openftc'
artifactId 'revextensions'
version this.version
pom.withXml {
def root = asNode()
root.appendNode('description', 'Rev Expansion Hub extensions for FTC, adding functionality not exposed in the core ftc_app SDK. Compatible with both OpenRC and ftc_app.')
root.appendNode('name', 'RevExtensions')
root.appendNode('url', 'https://openftc.org')
root.children().last() + pomConfig
def dependenciesNode = root.appendNode('dependencies')
// The above line may need to be: def dependenciesNode = root.getAt("dependencies")[0]
// as per: https://discuss.gradle.org/t/maven-publish-doesnt-include-dependencies-in-the-project-pom-file/8544/3
// Iterate over the implementation dependencies (we don't want the test ones), adding a <dependency> node for each
configurations.implementation.allDependencies.each {
// Ensure dependencies such as fileTree are not included in the pom.
if (it.name != 'unspecified') {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}
bintray {
user = project.hasProperty('bintrayUser') ?: System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ?: System.getenv('BINTRAY_API_KEY')
publications = ['Production']
// configurations = ['archives']
override = true
pkg {
repo = 'maven'
name = 'RevExtensions'
description = "An example of using the bintray plugin with gradle plugin 3.0.0"
publish = true
publicDownloadNumbers = true
licenses = ['MIT']
vcsUrl = 'https://github.com/OpenFTC/RevExtensions.git'
dryRun = true
version {
name = this.version
desc = "RevExtensions ${this.version}"
released = new Date()
vcsTag = this.version
}
}
}