From dea8b6cce48f29d098dfc51df580a6c4a05a055d Mon Sep 17 00:00:00 2001 From: brianwernick Date: Sat, 17 Nov 2018 17:35:27 -0700 Subject: [PATCH] Updated version to `4.3.0` --- README.md | 2 +- library/build.gradle | 4 ++-- library/gradle/publish.gradle | 45 +++++++++++++++++++++++++---------- 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index c6d429ba..45721b77 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ repositories { } dependencies { - implementation 'com.devbrackets.android:exomedia:4.2.3' + implementation 'com.devbrackets.android:exomedia:4.3.0' } ``` diff --git a/library/build.gradle b/library/build.gradle index 566b2d23..8b5c1d43 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -6,8 +6,8 @@ apply plugin: 'com.android.library' */ class LibraryInfo { static Integer versionMajor = 4 - static Integer versionMinor = 2 - static Integer versionPatch = 3 + static Integer versionMinor = 3 + static Integer versionPatch = 0 static String artifactId = 'exomedia' static String groupId = 'com.devbrackets.android' diff --git a/library/gradle/publish.gradle b/library/gradle/publish.gradle index f3b9ac58..674efaab 100644 --- a/library/gradle/publish.gradle +++ b/library/gradle/publish.gradle @@ -22,12 +22,12 @@ task androidJavaDocJar(type: Jar, dependsOn: androidJavaDoc) { task androidSourcesJar(type: Jar) { classifier = 'sources' - from android.sourceSets.main.java.sourceFiles + from android.sourceSets.main.java.srcDirs } /** * Bintray Deploy - * `$ ./gradlew clean build bintrayUpload` + * `$ ./gradlew clean library:assembleRelease androidJavaDocJar androidSourcesJar generatePomFileForJcenterPublication bintrayUpload` */ publishing { publications { @@ -37,22 +37,41 @@ publishing { version project.getLibraryInfo().versionName artifact bundleReleaseAar - artifact androidSourcesJar artifact androidJavaDocJar + artifact androidSourcesJar // The generated POM doesn't include dependencies when building Android artifacts, so we manually // add the dependencies to the POM here pom.withXml { - def dependenciesNode = asNode().appendNode('dependencies') + def rootNode = asNode().appendNode('dependencies') - // Iterate over the implementation dependencies, adding a node for each - configurations.implementation.allDependencies.each { - if (it.name != 'unspecified') { - def dependencyNode = dependenciesNode.appendNode('dependency') - dependencyNode.appendNode('groupId', it.group) - dependencyNode.appendNode('artifactId', it.name) - dependencyNode.appendNode('version', it.version) + /** + * Helper method to add dependencies to the POM node + */ + ext.addDependency = { Node dependenciesNode, Dependency dependency, String dependencyScope-> + // We don't add incomplete dependencies + if (dependency.name == null || + dependency.name == 'unspecified' || + dependency.group == null || + dependency.version == null) { + return } + + def dependencyNode = dependenciesNode.appendNode('dependency') + dependencyNode.appendNode('groupId', dependency.group) + dependencyNode.appendNode('artifactId', dependency.name) + dependencyNode.appendNode('version', dependency.version) + dependencyNode.appendNode('scope', dependencyScope) + } + + // Iterate over the implementation dependencies, adding a node for each + configurations.implementation.dependencies.each { + addDependency(rootNode, it, "runtime") + } + + // Iterate over the api dependencies, adding a node for each + configurations.api.dependencies.each { + addDependency(rootNode, it, "compile") } } } @@ -66,10 +85,10 @@ publishing { bintray { user = System.getenv('BINTRAY_USER') key = System.getenv('BINTRAY_KEY') - publications = ['jcenter'] + setPublications('jcenter') pkg { - userOrg = '' + userOrg = 'brianwernick' repo = 'maven' name = 'ExoMedia' licenses = ['Apache-2.0']