Skip to content

Commit

Permalink
Add library publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
ted-prnd committed May 7, 2019
1 parent 90e9c1c commit a93ff62
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 3 deletions.
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@ buildscript {
repositories {
google()
jcenter()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
}
}

allprojects {
repositories {
google()
jcenter()

}
group = GROUP
version = VERSION_NAME
}

task clean(type: Delete) {
Expand Down
14 changes: 14 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,17 @@ android.enableJetifier=true

# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official

GROUP=kr.co.prnd
VERSION_NAME=1.0.0-alpha1
POM_ARTIFACT_ID=stepprogressbar
POM_NAME=StepProgressBar

ORGANIZATION=prnd
DEVELOPER_ID=prnd
DEVELOPER_NAME='PRND'

SITE_URL = 'https://github.com/PRNDcompany/StepProgressBar'
GIT_URL = 'https://github.com/PRNDcompany/StepProgressBar.git'
ISSUE_URL='https://github.com/PRNDcompany/StepProgressBar/issues'
LIBRARY_DESCRIPTION = 'Easy display steps in ProgressBar'
94 changes: 94 additions & 0 deletions publish.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'


Properties properties = new Properties()
try {
properties.load(project.rootProject.file('local.properties').newDataInputStream())
} catch (FileNotFoundException ignore) {
}


bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")

configurations = ['archives']

pkg {
repo = 'maven'
name = POM_ARTIFACT_ID
userOrg = ORGANIZATION
desc = LIBRARY_DESCRIPTION
websiteUrl = SITE_URL
vcsUrl = GIT_URL
issueTrackerUrl = ISSUE_URL
version {
name = VERSION_NAME
vcsTag = VERSION_NAME
}
licenses = ['Apache-2.0']

publish = true
publicDownloadNumbers = true
}
}

install {
repositories.mavenInstaller {
pom.project {
packaging 'aar'

groupId = GROUP
artifactId = POM_ARTIFACT_ID
version = VERSION_NAME

name POM_NAME
description LIBRARY_DESCRIPTION
url SITE_URL

licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id DEVELOPER_ID
name DEVELOPER_NAME
}
}
scm {
url SITE_URL
connection GIT_URL
developerConnection GIT_URL
}
}
}
}

task javadoc(type: Javadoc) {
excludes = ['**/*.kt']
source = android.sourceSets.main.java.source
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))

if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

artifacts {
archives javadocJar
archives sourcesJar
}
4 changes: 3 additions & 1 deletion stepprogressbar/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28
Expand All @@ -25,3 +25,5 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
}

apply from: rootProject.file('publish.gradle')

0 comments on commit a93ff62

Please sign in to comment.