diff --git a/build.gradle b/build.gradle index 02199bb..89f0882 100644 --- a/build.gradle +++ b/build.gradle @@ -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 } @@ -18,7 +19,10 @@ allprojects { repositories { google() jcenter() - + maven { + url 'https://maven.google.com/' + name 'Google' + } } } diff --git a/lib/build.gradle b/lib/build.gradle index 900998c..101979d 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -9,9 +9,6 @@ android { targetSdkVersion 28 versionCode 1 versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } buildTypes { @@ -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 'cd5160866@gmail.com' + } + } + 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" + } +}