Skip to content

Commit

Permalink
Use bintray plugin for publishing
Browse files Browse the repository at this point in the history
- Makes it easy to configure
- Changed groupId
  • Loading branch information
marcelpinto committed Jan 4, 2021
1 parent 19f277f commit 65b32e5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# permissions-ktx

[ ![Download](https://api.bintray.com/packages/skimarxall/maven/permissions-ktx/images/download.svg?version=0.4) ](https://bintray.com/skimarxall/maven/permissions-ktx/0.4/link)

Kotlin Lightweight Android permissions library that follows the permission request principles
and it's Jetpack Compose friendly.

Expand Down Expand Up @@ -42,14 +44,14 @@ Add custom maven url repository (publishing to JCentral is in progress)
allprojects {
repositories {
// ...
maven { url "https://dl.bintray.com/skimarxall/maven" }
jcenter()
}
}
```

```groovy
dependencies {
implementation 'dev.marcelpinto:permissions-ktx:0.2'
implementation 'dev.marcelpinto.permissions:permissions-ktx:0.4'
}
```

Expand Down
3 changes: 0 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ buildscript {
dependencies {
classpath("com.android.tools.build:gradle:7.0.0-alpha03")
classpath(kotlin("gradle-plugin", version = "1.4.21"))

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

Expand Down
45 changes: 29 additions & 16 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
kotlin("android")
id("org.jetbrains.dokka") version "1.4.20"
`maven-publish`
id("com.jfrog.bintray") version "1.8.5"
}

android {
Expand Down Expand Up @@ -54,13 +55,14 @@ dependencies {
api("androidx.fragment:fragment-ktx:1.3.0-rc01")
}

group = "dev.marcelpinto"
version = android.defaultConfig.versionName.toString()
val libraryName = "permissions-ktx"
val libraryGroup = "dev.marcelpinto.permissions"
val libraryVersion = android.defaultConfig.versionName.toString()

tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets {
named("main") {
displayName.set("permissions-ktx")
displayName.set(libraryName)
//includes.from("../README.md")
sourceLink {
localDirectory.set(file("src/main/java"))
Expand Down Expand Up @@ -92,16 +94,18 @@ val androidSourcesJar by tasks.register<Jar>("androidSourcesJar") {

publishing {
publications {
register<MavenPublication>("mavenAndroid") {
artifactId = "permissions-ktx"
register<MavenPublication>("release") {
artifactId = libraryName
groupId = libraryGroup
version = libraryVersion

afterEvaluate { artifact(tasks.getByName("bundleReleaseAar")) }
artifact(tasks.getByName("androidJavadocJar"))
artifact(tasks.getByName("androidHtmlJar"))
artifact(tasks.getByName("androidSourcesJar"))

pom {
name.set("permissions-ktx")
name.set(libraryName)
description.set("Kotlin Lightweight Android permissions library that follows the best practices.")
url.set("https://github.com/marcelpinto/permissions-ktx")

Expand Down Expand Up @@ -148,16 +152,25 @@ publishing {
}
}
}
}

repositories {
maven {
name = "bintray"
credentials {
val properties = gradleLocalProperties(rootDir)
username = properties.getProperty("bintray.username")
password = properties.getProperty("bintray.password")
}
url = uri("https://api.bintray.com/maven/skimarxall/maven/permissions-ktx/;publish=1")
bintray {
val properties = gradleLocalProperties(rootDir)
user = properties.getProperty("bintray.username")
key = properties.getProperty("bintray.password")
setPublications("release")
publish = true
override = true
pkg = PackageConfig().apply {
repo = "maven"
name = libraryName
desc =
"Kotlin Lightweight Android permissions library that follows the permissions best practices"
setLicenses("Apache-2.0")
vcsUrl = "https://github.com/marcelpinto/permissions-ktx.git"
publicDownloadNumbers = true
version = VersionConfig().apply {
name = libraryVersion
}
}
}
}

0 comments on commit 65b32e5

Please sign in to comment.