Skip to content

Simplify our dependency creation by using plugin #804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 8 additions & 23 deletions Parse/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_API_KEY')

publications = ["MyPublication"]
publications = ["mavenAar"]

publish = true
pkg {
Expand All @@ -244,35 +244,20 @@ bintray {
}

// Create the publication with the pom configuration:
apply plugin: 'maven-publish'
apply plugin: 'digital.wup.android-maven-publish'

publishing {
publications {
MyPublication(MavenPublication) {
mavenAar(MavenPublication) {
from components.android
groupId group
// We have to specify it here because otherwise Bintray's plugin will assume the artifact's name is Parse
artifactId artifact
artifacts = [androidSourcesJar, javadocJarRelease, bundleRelease]
version version
pom.withXml {
def root = asNode()
root.appendNode('description', projDescription)
root.appendNode('name', projName)
root.appendNode('url', gitLink)
root.children().last() + pomConfig

// maven-publish workaround to include dependencies
def dependenciesNode = asNode().appendNode('dependencies')

//Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
configurations.implementation.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}

}

}

}
}

Expand All @@ -292,7 +277,7 @@ artifactory {
}
defaults {
publishArtifacts = true
publications('MyPublication')
publications('mavenAar')
}
}
}
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ plugins {
id "com.jfrog.artifactory" version "4.4.18"
id "com.jfrog.bintray" version "1.7.3"
id 'com.github.ben-manes.versions' version '0.17.0'
id 'digital.wup.android-maven-publish' version '3.2.0' // tweak depending on Gradle version
}

allprojects {
Expand Down
2 changes: 2 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
# Make sure to update the version of android-maven-publish if you bump the Gradle version
# See: https://github.com/wupdigital/android-maven-publish
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip