-
-
Save kishannareshpal/2c3e3ac25c23d23f363bcb2edf94e3f2 to your computer and use it in GitHub Desktop.
Revisions
-
gsavvid revised this gist
Jul 9, 2019 . No changes.There are no files selected for viewing
-
gsavvid revised this gist
Jul 9, 2019 . No changes.There are no files selected for viewing
-
Georgios Savvidis revised this gist
Jul 9, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -98,9 +98,9 @@ project.afterEvaluate { publishing { publications { Production(MavenPublication) { groupId "YOUR GROUP ID" // If you publish to Bintray, make sure that this is the same as the "group" field at the top of this file. artifactId "YOUR ARTIFACT ID" version = "YOUR ARTIFACT VERSION" // If you publish to Bintray, make sure that this is the same as the "version" field at the top of this file. artifact bundleReleaseAar artifact androidJavadocsJar -
Georgios Savvidis renamed this gist
Jul 9, 2019 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,8 +30,8 @@ apply plugin: 'com.jfrog.bintray' group = 'YOUR BINTRAY GROUP ID' version = 'YOUR BINTRAY ARTIFACT VERSION' // For more details on Bintray's configuration, see https://github.com/bintray/gradle-bintray-plugin. bintray { user = "YOUR BINTRAY USERNAME" key = "YOUR BINTRAY API KEY" publications = ['Production'] @@ -54,9 +54,8 @@ bintray { } } // For more details on Dokka's configuration, see https://github.com/Kotlin/dokka. dokka { // Minimal configuration. outputFormat = 'javadoc' outputDirectory = "$buildDir/javadoc" -
Georgios Savvidis revised this gist
Jul 9, 2019 . 1 changed file with 84 additions and 23 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,32 +1,93 @@ /** * Publish Android Kotlin Library Helper * * This Gradle script is based on https://gist.github.com/Robyer/a6578e60127418b380ca133a1291f017. * The difference is that: * 1. It uses Dokka for generating Kotlin Javadoc. * 2. It uses Jfrog's plugin for publishing to Bintray. If you don't want to publish to Bintray, simply remove all the Bintray-related code. * * NOTE: You need to add Dokka and Bintray to your classpath for the two plugins to work. * Update the buildscript in your project's build.gradle with the following: * * buildscript { * dependencies { * classpath 'org.jetbrains.dokka:dokka-android-gradle-plugin:0.9.18' * classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' * } * } * * @See https://github.com/Kotlin/dokka * @See https://github.com/bintray/gradle-bintray-plugin * * @Author Georgios Savvidis * @Version 1.0 * @Date 9.7.2019 */ apply plugin: 'maven-publish' apply plugin: 'org.jetbrains.dokka-android' apply plugin: 'com.jfrog.bintray' group = 'YOUR BINTRAY GROUP ID' version = 'YOUR BINTRAY ARTIFACT VERSION' bintray { // For more details on Bintray's configuration, see https://github.com/bintray/gradle-bintray-plugin user = "YOUR BINTRAY USERNAME" key = "YOUR BINTRAY API KEY" publications = ['Production'] configurations = ['archives'] pkg { repo = "YOUR BINTRAY REPO" userOrg = "YOUR BINTRAY ORG" name = "YOUR BINTRAY PACKAGE NAME" dryRun = false publish = true override = false publicDownloadNumbers = false version { gpg { sign = true passphrase = "YOUR BINTRAY GPG PASSPHRASE" } } } } dokka { // For more details on Dokka's configuration, see https://github.com/Kotlin/dokka. // Minimal configuration. outputFormat = 'javadoc' outputDirectory = "$buildDir/javadoc" // Use to include or exclude non public members. includeNonPublic = false // Do not output deprecated members. Applies globally, can be overridden by packageOptions. skipDeprecated = false // Emit warnings about not documented members. Applies globally, also can be overridden by packageOptions. reportUndocumented = true // Do not create index pages for empty packages skipEmptyPackages = true // Example of how to link to external documentation. // The following links to AndroidX. // Repeat for multiple links. externalDocumentationLink { // Root URL of the generated documentation to link with. The trailing slash is required! url = new URL("https://developer.android.com/reference/") // If package-list file located in non-standard location packageListUrl = new URL("https://developer.android.com/reference/androidx/package-list") } } task androidJavadocsJar(type: Jar, dependsOn: dokka) { classifier = 'javadoc' from dokka.outputDirectory } task androidSourcesJar(type: Jar) { @@ -37,10 +98,10 @@ task androidSourcesJar(type: Jar) { project.afterEvaluate { publishing { publications { Production(MavenPublication) { groupId "YOUR GROUP ID" // If you publish to Bintray, make sure that this is the same as the "group" field at the top of this file. artifactId "YOUR ARTIFACT ID" version = "YOUR ARTIFACT VERSION" // If you publish to Bintray, make sure that this is the same as the "version" field at the top of this file. artifact bundleReleaseAar artifact androidJavadocsJar @@ -85,4 +146,4 @@ project.afterEvaluate { } } } } -
Robyer revised this gist
Jun 28, 2019 . 1 changed file with 55 additions and 39 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,24 @@ /** * Publish Local Helper * * @Author Robert Pösel * @Version 1.4 * @Date 24.4.2019 */ apply plugin: 'maven-publish' task androidJavadocs(type: Javadoc) { source = android.sourceSets.main.java.srcDirs classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) android.libraryVariants.all { variant -> if (variant.name == 'release') { if (variant.hasProperty('javaCompileProvider')) { // Android 3.3.0+ owner.classpath += variant.javaCompileProvider.get().classpath } else { owner.classpath += variant.javaCompile.classpath } } } exclude '**/R.html', '**/R.*.html', '**/index.html' @@ -21,52 +34,55 @@ task androidSourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs } project.afterEvaluate { publishing { publications { maven(MavenPublication) { //groupId 'cz.example' //artifactId 'custom-artifact' //version = android.defaultConfig.versionName artifact bundleReleaseAar artifact androidJavadocsJar artifact androidSourcesJar pom.withXml { final dependenciesNode = asNode().appendNode('dependencies') ext.addDependency = { dep, String scope -> if (dep.group == null || dep.version == null || dep.name == null || dep.name == "unspecified") return // ignore invalid dependencies final dependencyNode = dependenciesNode.appendNode('dependency') dependencyNode.appendNode('groupId', dep.group) dependencyNode.appendNode('artifactId', dep.name) dependencyNode.appendNode('version', dep.version) dependencyNode.appendNode('scope', scope) if (!dep.transitive) { // If this dependency is not transitive, we should force exclude all its dependencies from the POM final exclusionNode = dependencyNode.appendNode('exclusions').appendNode('exclusion') exclusionNode.appendNode('groupId', '*') exclusionNode.appendNode('artifactId', '*') } else if (!dep.properties.excludeRules.empty) { // Otherwise add specified exclude rules final exclusionsNode = dependencyNode.appendNode('exclusions') dep.properties.excludeRules.each { rule -> final exclusionNode = exclusionsNode.appendNode('exclusion') exclusionNode.appendNode('groupId', rule.group ?: '*') exclusionNode.appendNode('artifactId', rule.module ?: '*') } } } // List all "compile" dependencies (for old Gradle) configurations.compile.getDependencies().each { dep -> addDependency(dep, "compile") } // List all "api" dependencies (for new Gradle) as "compile" dependencies configurations.api.getDependencies().each { dep -> addDependency(dep, "compile") } // List all "implementation" dependencies (for new Gradle) as "runtime" dependencies configurations.implementation.getDependencies().each { dep -> addDependency(dep, "runtime") } } } } } } -
Robyer revised this gist
Nov 23, 2018 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -61,11 +61,11 @@ publishing { } // List all "compile" dependencies (for old Gradle) configurations.compile.getDependencies().each { dep -> addDependency(dep, "compile") } // List all "api" dependencies (for new Gradle) as "compile" dependencies configurations.api.getDependencies().each { dep -> addDependency(dep, "compile") } // List all "implementation" dependencies (for new Gradle) as "runtime" dependencies configurations.implementation.getDependencies().each { dep -> addDependency(dep, "runtime") } } } } -
Robyer revised this gist
Nov 23, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,7 +28,7 @@ publishing { //artifactId 'custom-artifact' //version = android.defaultConfig.versionName artifact bundleReleaseAar artifact androidJavadocsJar artifact androidSourcesJar -
Robyer revised this gist
Mar 27, 2018 . 1 changed file with 54 additions and 50 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,68 +1,72 @@ apply plugin: 'maven-publish' task androidJavadocs(type: Javadoc) { source = android.sourceSets.main.java.srcDirs classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) android.libraryVariants.all { variant -> if (variant.name == 'release') { owner.classpath += variant.javaCompile.classpath } } exclude '**/R.html', '**/R.*.html', '**/index.html' } task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { classifier = 'javadoc' from androidJavadocs.destinationDir } task androidSourcesJar(type: Jar) { classifier = 'sources' from android.sourceSets.main.java.srcDirs } publishing { publications { maven(MavenPublication) { //groupId 'cz.example' //artifactId 'custom-artifact' //version = android.defaultConfig.versionName artifact bundleRelease artifact androidJavadocsJar artifact androidSourcesJar pom.withXml { final dependenciesNode = asNode().appendNode('dependencies') ext.addDependency = { Dependency dep, String scope -> if (dep.group == null || dep.version == null || dep.name == null || dep.name == "unspecified") return // ignore invalid dependencies final dependencyNode = dependenciesNode.appendNode('dependency') dependencyNode.appendNode('groupId', dep.group) dependencyNode.appendNode('artifactId', dep.name) dependencyNode.appendNode('version', dep.version) dependencyNode.appendNode('scope', scope) if (!dep.transitive) { // If this dependency is transitive, we should force exclude all its dependencies them from the POM final exclusionNode = dependencyNode.appendNode('exclusions').appendNode('exclusion') exclusionNode.appendNode('groupId', '*') exclusionNode.appendNode('artifactId', '*') } else if (!dep.properties.excludeRules.empty) { // Otherwise add specified exclude rules final exclusionNode = dependencyNode.appendNode('exclusions').appendNode('exclusion') dep.properties.excludeRules.each { ExcludeRule rule -> exclusionNode.appendNode('groupId', rule.group ?: '*') exclusionNode.appendNode('artifactId', rule.module ?: '*') } } } // List all "compile" dependencies (for old Gradle) configurations.compile.getAllDependencies().each { dep -> addDependency(dep, "compile") } // List all "api" dependencies (for new Gradle) as "compile" dependencies configurations.api.getAllDependencies().each { dep -> addDependency(dep, "compile") } // List all "implementation" dependencies (for new Gradle) as "runtime" dependencies configurations.implementation.getAllDependencies().each { dep -> addDependency(dep, "runtime") } } } } } -
Robyer revised this gist
Mar 27, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,7 +31,7 @@ publishing { pom.withXml { def dependenciesNode = asNode().appendNode('dependencies') def dependencies = [] // List all "compile" dependencies (for old Gradle) dependencies.addAll(configurations.compile.getAllDependencies()) // List all "api" dependencies (for new Gradle) -
Robyer revised this gist
Mar 27, 2018 . 1 changed file with 14 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,18 @@ apply plugin: 'maven-publish' task androidJavadocs(type: Javadoc) { source = android.sourceSets.main.java.srcDirs classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) } task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { classifier = 'javadoc' from androidJavadocs.destinationDir } task androidSourcesJar(type: Jar) { classifier = 'sources' from android.sourceSets.main.java.srcDirs } publishing { @@ -31,8 +31,14 @@ publishing { pom.withXml { def dependenciesNode = asNode().appendNode('dependencies') dependencies = [] // List all "compile" dependencies (for old Gradle) dependencies.addAll(configurations.compile.getAllDependencies()) // List all "api" dependencies (for new Gradle) dependencies.addAll(configurations.api.getAllDependencies()) // Write dependencies to POM dependencies.each { Dependency dep -> if (dep.group == null || dep.version == null || dep.name == null || dep.name == "unspecified") return // ignore invalid dependencies -
Robyer revised this gist
Mar 2, 2017 . 1 changed file with 43 additions and 42 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,46 +16,47 @@ task androidSourcesJar(type: Jar) { } publishing { publications { maven(MavenPublication) { groupId 'com.example' artifactId 'custom-artifact' version '1.0' // Or use same version as in android branch // version = android.defaultConfig.versionName artifact bundleRelease artifact androidJavadocsJar artifact androidSourcesJar pom.withXml { def dependenciesNode = asNode().appendNode('dependencies') // List all compile dependencies and write to POM configurations.compile.getAllDependencies().each { Dependency dep -> if (dep.group == null || dep.version == null || dep.name == null || dep.name == "unspecified") return // ignore invalid dependencies def dependencyNode = dependenciesNode.appendNode('dependency') dependencyNode.appendNode('groupId', dep.group) dependencyNode.appendNode('artifactId', dep.name) dependencyNode.appendNode('version', dep.version) if (!dep.transitive) { // If this dependency is transitive, we should force exclude all its dependencies them from the POM def exclusionNode = dependencyNode.appendNode('exclusions').appendNode('exclusion') exclusionNode.appendNode('groupId', '*') exclusionNode.appendNode('artifactId', '*') } else if (!dep.properties.excludeRules.empty) { // Otherwise add specified exclude rules def exclusionsNode = dependencyNode.appendNode('exclusions') dep.properties.excludeRules.each { ExcludeRule rule -> def exclusionNode = exclusionsNode.appendNode('exclusion') exclusionNode.appendNode('groupId', rule.group ?: '*') exclusionNode.appendNode('artifactId', rule.module ?: '*') } } } } } } } -
Robyer revised this gist
Feb 10, 2017 . 1 changed file with 16 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,18 +32,27 @@ publishing { def dependenciesNode = asNode().appendNode('dependencies') // List all compile dependencies and write to POM configurations.compile.getAllDependencies().each { Dependency dep -> if (dep.group == null || dep.version == null || dep.name == null || dep.name == "unspecified") return // ignore invalid dependencies def dependencyNode = dependenciesNode.appendNode('dependency') dependencyNode.appendNode('groupId', dep.group) dependencyNode.appendNode('artifactId', dep.name) dependencyNode.appendNode('version', dep.version) if (!dep.transitive) { // If this dependency is transitive, we should force exclude all its dependencies them from the POM def exclusionNode = dependencyNode.appendNode('exclusions').appendNode('exclusion') exclusionNode.appendNode('groupId', '*') exclusionNode.appendNode('artifactId', '*') } else if (!dep.properties.excludeRules.empty) { // Otherwise add specified exclude rules def exclusionNode = dependencyNode.appendNode('exclusions').appendNode('exclusion') dep.properties.excludeRules.each { ExcludeRule rule -> exclusionNode.appendNode('groupId', rule.group ?: '*') exclusionNode.appendNode('artifactId', rule.module ?: '*') } } } } -
Robyer revised this gist
Feb 10, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,7 +20,7 @@ publishing { maven(MavenPublication) { groupId 'com.example' artifactId 'custom-artifact' version '1.0' // Or use same version as in android branch // version = android.defaultConfig.versionName -
Robyer created this gist
Feb 10, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ apply plugin: 'maven-publish' task androidJavadocs(type: Javadoc) { source = android.sourceSets.main.java.srcDirs classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) } task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { classifier = 'javadoc' from androidJavadocs.destinationDir } task androidSourcesJar(type: Jar) { classifier = 'sources' from android.sourceSets.main.java.srcDirs } publishing { publications { maven(MavenPublication) { groupId 'com.example' artifactId 'custom-artifact' version '1.0 // Or use same version as in android branch // version = android.defaultConfig.versionName artifact bundleRelease artifact androidJavadocsJar artifact androidSourcesJar pom.withXml { def dependenciesNode = asNode().appendNode('dependencies') // List all compile dependencies and write to POM configurations.compile.getResolvedConfiguration().firstLevelModuleDependencies.each { ResolvedDependency dep -> def dependencyNode = dependenciesNode.appendNode('dependency') dependencyNode.appendNode('groupId', dep.moduleGroup) dependencyNode.appendNode('artifactId', dep.moduleName) dependencyNode.appendNode('version', dep.moduleVersion) // If this dependency has no transitive dependencies (perhaps it specified "@aar" or "transitive: false"), // we should force exclude them from the POM if (dep.children.empty) { def exclusionNode = dependencyNode.appendNode('exclusions').appendNode('exclusion') exclusionNode.appendNode('groupId', '*') exclusionNode.appendNode('artifactId', '*') } } } } } }