From bdae0da9e8089c23c0c7f0110c5bc22f715deb8a Mon Sep 17 00:00:00 2001 From: Sum-sdl <1079569023@qq.com> Date: Wed, 21 Nov 2018 11:00:15 +0800 Subject: [PATCH] update gradle --- AdapterLibrary/build.gradle | 2 + AdapterLibrary/upload.gradle | 84 ++++++++++++++++++++++++++++++++++++ README.md | 16 ++----- build.gradle | 4 +- gradlew | 0 5 files changed, 92 insertions(+), 14 deletions(-) create mode 100644 AdapterLibrary/upload.gradle mode change 100644 => 100755 gradlew diff --git a/AdapterLibrary/build.gradle b/AdapterLibrary/build.gradle index 08d236f..03e9ae3 100644 --- a/AdapterLibrary/build.gradle +++ b/AdapterLibrary/build.gradle @@ -23,3 +23,5 @@ android { dependencies { api "com.android.support:recyclerview-v7:28.0.0" } + +apply from: 'upload.gradle' \ No newline at end of file diff --git a/AdapterLibrary/upload.gradle b/AdapterLibrary/upload.gradle new file mode 100644 index 0000000..8ee6f66 --- /dev/null +++ b/AdapterLibrary/upload.gradle @@ -0,0 +1,84 @@ +apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'com.jfrog.bintray' + +def GROUP_ID = 'com.github.Sum-sdl' +def ARTIFACT_ID = 'RvAdapter' + +def siteUrl = 'https://github.com/Sum-sdl/RvAdapter' // 项目的主页 +def gitUrl = 'https://github.com/Sum-sdl/RvAdapter.git' // Git仓库的url + +group = GROUP_ID +archivesBaseName = ARTIFACT_ID + +//./gradlew install 本地构建 +//./gradlew bintrayUpload 上传代码到远程仓库 +//远程仓库版本 +version = "2.1.0" + +install { + repositories.mavenInstaller { + // This generates POM.xml with proper parameters + pom { + artifactId = ARTIFACT_ID + + project { + packaging 'aar' + // Add your description here + url siteUrl + // Set your license + licenses { + license { + name 'Apache License 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0' + } + } + developers { + developer { + id 'sum-sdl' //填写的一些基本信息 + name 'sdl' + email '1079569023@qq.com' + } + } + scm { + connection gitUrl + developerConnection gitUrl + url siteUrl + } + } + } + } +} + +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 +} +artifacts { + archives javadocJar + archives sourcesJar +} + +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 = "AndroidDevLibrary"//JCenter上创建的仓库名字 + name = ARTIFACT_ID //发布到JCenter上仓库中的项目名字 + websiteUrl = siteUrl + vcsUrl = gitUrl + licenses = ["Apache-2.0"] + publish = true + } + +} \ No newline at end of file diff --git a/README.md b/README.md index 75b7f9f..02e9a2c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # RvAdapter RecyclerView 通用适配器框架结构封装 -[![](https://jitpack.io/v/Sum-sdl/RvAdapter.svg)](https://jitpack.io/#Sum-sdl/RvAdapter) +[![JitPack](https://jitpack.io/v/Sum-sdl/RvAdapter.svg)](https://jitpack.io/#Sum-sdl/RvAdapter) [Demo Apk 点击下载](https://raw.githubusercontent.com/Sum-sdl/AndriodDevelopLibrary/master/sample/other/sample-debug.apk) @@ -27,21 +27,13 @@ RecyclerView 通用适配器框架结构封装 Add this in your root `build.gradle` file (**not** your module `build.gradle` file): - ```gradle - allprojects { - repositories { - maven { url "https://jitpack.io" } - } - } - ``` - Then, add the library to your module `build.gradle` ```gradle dependencies { - implementation 'com.github.Sum-sdl:RvAdapter:2.0.2' + implementation 'com.github.Sum-sdl:RvAdapter:2.1.0' } ``` -**2.0.0版本后基础目录结构调整** +**2.0.0 版本后基础目录结构调整** -2.0.2:整理代码,发布文章介绍一下 +**2.1.0 发布到JCenter仓库** diff --git a/build.gradle b/build.gradle index e34b58c..b97e896 100644 --- a/build.gradle +++ b/build.gradle @@ -9,8 +9,8 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:3.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' - + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + 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 } diff --git a/gradlew b/gradlew old mode 100644 new mode 100755