Skip to content

Commit

Permalink
1.[ADD]support upload to jcenter
Browse files Browse the repository at this point in the history
  • Loading branch information
soulqw committed Sep 20, 2019
1 parent 18e4e49 commit ed81b46
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 5 deletions.
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'

classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -18,7 +19,10 @@ allprojects {
repositories {
google()
jcenter()

maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}

Expand Down
98 changes: 95 additions & 3 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ android {
targetSdkVersion 28
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

}

buildTypes {
Expand All @@ -26,3 +23,98 @@ android {
dependencies {
compileOnly 'androidx.appcompat:appcompat:1.0.2'
}

apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

def siteUrl = 'https://github.com/soulqw/Curtain'

def gitUrl = 'https://github.com/soulqw/Curtain.git'

def libName = "curtain"
group = "com.qw"
version = "0.0.1"

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

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

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

task copyDoc(type: Copy) {
from "${buildDir}/docs/"
into "docs"
}

artifacts {
archives javadocJar
archives sourcesJar
}

install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
name 'is permission tool for android'
url siteUrl
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'soulqw'
name 'qinwei'
email '[email protected]'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = "AndroidFrame"
name = libName
desc = 'a better guideView lib for android'
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}

javadoc {
options {
encoding "UTF-8"
charSet 'UTF-8'
author true
version true
links "http://docs.oracle.com/javase/7/docs/api"
}
}

0 comments on commit ed81b46

Please sign in to comment.