From 9a5d85a8538ccc486090802fd1e5a6d81bb7375d Mon Sep 17 00:00:00 2001 From: qingmei2 Date: Wed, 24 Jan 2018 19:45:04 +0800 Subject: [PATCH] Configrate the Jcenter repositories. --- build.gradle | 4 +- rximagepicker/bintray.gradle | 86 +++++++++++++++++++ rximagepicker/build.gradle | 6 +- .../di/scheduler/RxImagePickerSchedulers.java | 5 -- .../RxImagePickerTestSchedulers.java | 5 -- .../ui/camera/RxSystemCameraPickerView.java | 4 - .../ui/gallery/RxSystemGalleryPickerView.java | 4 - 7 files changed, 92 insertions(+), 22 deletions(-) create mode 100644 rximagepicker/bintray.gradle diff --git a/build.gradle b/build.gradle index fa2b111..1302e72 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,6 @@ apply from: "config.gradle" buildscript { ext.kotlin_version = '1.2.20' - ext.kotlin_version = '1.2.10' repositories { jcenter() mavenCentral() @@ -13,6 +12,9 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:3.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/rximagepicker/bintray.gradle b/rximagepicker/bintray.gradle new file mode 100644 index 0000000..94fbe24 --- /dev/null +++ b/rximagepicker/bintray.gradle @@ -0,0 +1,86 @@ +apply plugin: 'com.jfrog.bintray' +apply plugin: 'com.github.dcendents.android-maven' + +Properties properties = new Properties() +properties.load(project.rootProject.file('local.properties').newDataInputStream()) + +def siteUrl = 'https://github.com/qingmei2/RxImagePicker' +def gitUrl = 'https://github.com/qingmei2/RxImagePicker.git' + +group = "com.github.qingmei2" +def libName = "RxImagePicker" +version = "0.1.0-alpha" + +bintray { + user = properties.getProperty("bintray.user") + key = properties.getProperty("bintray.apikey") + configurations = ['archives'] + pkg { + repo = 'maven' + name = libName + licenses = ["MIT"] + websiteUrl = siteUrl + vcsUrl = gitUrl + publish = true + + version { + name = rootProject.ext.android["versionName"] + desc = 'A common Architecture for Android Applications developing based on MVP,integrates many Open Source Projects( like Dagger2,RxJava,Retrofit... ),to make your developing quicker and easier.' + released = new Date() + vcsTag = 'v' + rootProject.ext.android["versionName"] + attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin'] + } + } +} + +install { + repositories.mavenInstaller { + // This generates POM.xml with proper parameters + pom { + project { + packaging 'aar' + // Add your description here + name libName + description 'The library which choosing pictures from camera or gallery in Android.' + url siteUrl + // Set your license + licenses { + license { + name 'The MIT License' + url 'https://github.com/qingmei2/RxImagePicker/blob/master/LICENSE' + } + } + developers { + developer { + id 'qingmei2' + name 'qingmei2' + email 'mq2553299@gmail.com' + } + } + scm { + connection gitUrl + developerConnection gitUrl + url siteUrl + } + } + } + } +} + +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} +task javadoc(type: Javadoc) { + failOnError false + 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 +} +artifacts { + archives javadocJar + archives sourcesJar +} diff --git a/rximagepicker/build.gradle b/rximagepicker/build.gradle index 4a51d9a..4176a35 100644 --- a/rximagepicker/build.gradle +++ b/rximagepicker/build.gradle @@ -25,10 +25,10 @@ android { } dependencies { - implementation rootProject.ext.dependencies["appcompat-v7"] + api rootProject.ext.dependencies["appcompat-v7"] api rootProject.ext.dependencies["rxJava2"] api rootProject.ext.dependencies["rxandroid"] - implementation rootProject.ext.dependencies["dagger"] + api rootProject.ext.dependencies["dagger"] annotationProcessor rootProject.ext.dependencies["dagger-compiler"] testImplementation rootProject.ext.dependencies["junit"] testImplementation rootProject.ext.dependencies["kotlin-android"] @@ -37,4 +37,4 @@ dependencies { repositories { mavenCentral() } - +apply from: 'bintray.gradle' \ No newline at end of file diff --git a/rximagepicker/src/main/java/com/qingmei2/rximagepicker/di/scheduler/RxImagePickerSchedulers.java b/rximagepicker/src/main/java/com/qingmei2/rximagepicker/di/scheduler/RxImagePickerSchedulers.java index afd5bfc..2ec94c9 100644 --- a/rximagepicker/src/main/java/com/qingmei2/rximagepicker/di/scheduler/RxImagePickerSchedulers.java +++ b/rximagepicker/src/main/java/com/qingmei2/rximagepicker/di/scheduler/RxImagePickerSchedulers.java @@ -1,13 +1,9 @@ package com.qingmei2.rximagepicker.di.scheduler; -import android.support.annotation.RestrictTo; - import io.reactivex.Scheduler; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; -import static android.support.annotation.RestrictTo.Scope.LIBRARY; - /** * An extra layer of packaging, using {@link IRxImagePickerSchedulers} for control thread switch. *

@@ -15,7 +11,6 @@ * conducive to unit testing, you should use {@link RxImagePickerTestSchedulers} for inject {@link Scheduler} * in the testing. */ -@RestrictTo(LIBRARY) public class RxImagePickerSchedulers implements IRxImagePickerSchedulers { @Override diff --git a/rximagepicker/src/main/java/com/qingmei2/rximagepicker/di/scheduler/RxImagePickerTestSchedulers.java b/rximagepicker/src/main/java/com/qingmei2/rximagepicker/di/scheduler/RxImagePickerTestSchedulers.java index fba1e17..935137b 100644 --- a/rximagepicker/src/main/java/com/qingmei2/rximagepicker/di/scheduler/RxImagePickerTestSchedulers.java +++ b/rximagepicker/src/main/java/com/qingmei2/rximagepicker/di/scheduler/RxImagePickerTestSchedulers.java @@ -1,16 +1,11 @@ package com.qingmei2.rximagepicker.di.scheduler; -import android.support.annotation.RestrictTo; - import io.reactivex.Scheduler; import io.reactivex.schedulers.Schedulers; -import static android.support.annotation.RestrictTo.Scope.TESTS; - /** * An extra layer of packaging, using {@link RxImagePickerTestSchedulers} for easier testing. */ -@RestrictTo(TESTS) public class RxImagePickerTestSchedulers implements IRxImagePickerSchedulers { @Override diff --git a/rximagepicker/src/main/java/com/qingmei2/rximagepicker/ui/camera/RxSystemCameraPickerView.java b/rximagepicker/src/main/java/com/qingmei2/rximagepicker/ui/camera/RxSystemCameraPickerView.java index ac8f61b..afaeaaa 100644 --- a/rximagepicker/src/main/java/com/qingmei2/rximagepicker/ui/camera/RxSystemCameraPickerView.java +++ b/rximagepicker/src/main/java/com/qingmei2/rximagepicker/ui/camera/RxSystemCameraPickerView.java @@ -6,7 +6,6 @@ import android.content.Intent; import android.net.Uri; import android.provider.MediaStore; -import android.support.annotation.RestrictTo; import com.qingmei2.rximagepicker.ui.BaseSystemPickerView; import com.qingmei2.rximagepicker.ui.ICameraPickerView; @@ -17,9 +16,6 @@ import io.reactivex.Observable; -import static android.support.annotation.RestrictTo.Scope.LIBRARY; - -@RestrictTo(LIBRARY) public final class RxSystemCameraPickerView extends BaseSystemPickerView implements ICameraPickerView { private static final String TAG = RxSystemCameraPickerView.class.getSimpleName(); diff --git a/rximagepicker/src/main/java/com/qingmei2/rximagepicker/ui/gallery/RxSystemGalleryPickerView.java b/rximagepicker/src/main/java/com/qingmei2/rximagepicker/ui/gallery/RxSystemGalleryPickerView.java index 0485848..c34392c 100644 --- a/rximagepicker/src/main/java/com/qingmei2/rximagepicker/ui/gallery/RxSystemGalleryPickerView.java +++ b/rximagepicker/src/main/java/com/qingmei2/rximagepicker/ui/gallery/RxSystemGalleryPickerView.java @@ -4,16 +4,12 @@ import android.content.Intent; import android.net.Uri; import android.os.Build; -import android.support.annotation.RestrictTo; import com.qingmei2.rximagepicker.ui.BaseSystemPickerView; import com.qingmei2.rximagepicker.ui.IGalleryPickerView; import io.reactivex.Observable; -import static android.support.annotation.RestrictTo.Scope.LIBRARY; - -@RestrictTo(LIBRARY) public final class RxSystemGalleryPickerView extends BaseSystemPickerView implements IGalleryPickerView { private static final String TAG = RxSystemGalleryPickerView.class.getSimpleName();