From 219e6e24e0f83bf78f20564889c760e82febc969 Mon Sep 17 00:00:00 2001 From: zhangqin Date: Mon, 30 Aug 2021 17:22:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96=E3=80=81?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=E5=88=B0mavenCentral?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 22 +++--- app-kt/build.gradle | 5 +- app/build.gradle | 5 +- build.gradle | 31 +------- config.gradle | 19 ++--- gradle/deploy.gradle | 78 ++++++++----------- gradle/wrapper/gradle-wrapper.properties | 2 +- imageloader/build.gradle | 10 +-- paylib/build.gradle | 9 ++- quicklib/build.gradle | 13 ++-- .../layout/quick_activity_image_preview.xml | 3 +- sampleCommonLibrary/build.gradle | 7 +- .../base/SampleApplication.java | 9 +-- settings.gradle | 14 ++++ widget/build.gradle | 14 ++-- 15 files changed, 105 insertions(+), 136 deletions(-) diff --git a/README.md b/README.md index bcf7792..6658532 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,8 @@ > 开发环境 - AndroidStudio 4.1.+ - Gradle 6.5 + AndroidStudio 2020.3.1 + Gradle 7.0.2 ## 必读事项 @@ -70,8 +70,8 @@ ``` groovy buildFeatures { - viewBinding = true - dataBinding = true + viewBinding true + dataBinding true } ``` @@ -90,7 +90,7 @@ dirs '../libs' } - // ... jcenter() 等其他仓库 + // ... mavenCentral() 等其他仓库 } } ``` @@ -114,18 +114,18 @@ # 导入指南 ``` groovy -def quicklib = "4.5.0" +def quicklib = "4.6.0" // quicklib(Base) -implementation "com.sdwfqin.quicklib:quicklib:$quicklib" -annotationProcessor "com.qmuiteam:arch-compiler:2.0.0-alpha10" +implementation "io.github.sdwfqin.android:quicklib:$quicklib" +annotationProcessor "com.qmuiteam:arch-compiler:2.0.1" annotationProcessor "com.alibaba:arouter-compiler:1.2.2" // 支付模块 -implementation "com.sdwfqin.quicklib:paylib:$quicklib" +implementation "io.github.sdwfqin.android:paylib:$quicklib" // Android 图片加载库(Glide封装) -implementation "com.sdwfqin.quicklib:imageloader:$quicklib" +implementation "io.github.sdwfqin.android:imageloader:$quicklib" // Android 自定义View组件 -implementation "com.sdwfqin.quicklib:widget:$quicklib" +implementation "io.github.sdwfqin.android:widget:$quicklib" ``` # 目录介绍 diff --git a/app-kt/build.gradle b/app-kt/build.gradle index ee5bd15..08207c0 100644 --- a/app-kt/build.gradle +++ b/app-kt/build.gradle @@ -15,7 +15,6 @@ android { } compileSdkVersion rootProject.ext.androidVersion.compileSdkVersion - buildToolsVersion rootProject.ext.androidVersion.buildToolsVersion defaultConfig { applicationId "io.github.sdwfqin.app_kt" @@ -57,8 +56,8 @@ android { } buildFeatures { - viewBinding = true - dataBinding = true + viewBinding true + dataBinding true } } diff --git a/app/build.gradle b/app/build.gradle index 486bf27..39f7ccb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,7 +12,6 @@ android { } compileSdkVersion rootProject.ext.androidVersion.compileSdkVersion - buildToolsVersion rootProject.ext.androidVersion.buildToolsVersion defaultConfig { applicationId "com.sdwfqin.quickseed" @@ -53,8 +52,8 @@ android { } buildFeatures { - viewBinding = true - dataBinding = true + viewBinding true + dataBinding true } } diff --git a/build.gradle b/build.gradle index 5123739..1bea514 100644 --- a/build.gradle +++ b/build.gradle @@ -3,20 +3,18 @@ apply from: "config.gradle" buildscript { ext { - kotlin_version = '1.5.10' - hilt_version = '2.36' + kotlin_version = '1.5.30' + hilt_version = '2.38.1' } repositories { google() - jcenter() mavenCentral() maven { url 'https://jitpack.io' } + jcenter() // Warning: this repository is going to shut down soon } dependencies { - classpath 'com.android.tools.build:gradle:4.2.1' - // bintray上传发布 - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5' + classpath 'com.android.tools.build:gradle:7.0.1' // kotlin classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // hilt @@ -25,27 +23,6 @@ buildscript { } } -allprojects { - repositories { - flatDir { - dirs '../libs' - } - google() - jcenter() - mavenCentral() - maven { url "https://jitpack.io" } - } - - tasks.withType(Javadoc) { - options.addStringOption('Xdoclint:none', '-quiet') //忽略javadoc错误 - options { - encoding "UTF-8" - charSet 'UTF-8' - links "http://docs.oracle.com/javase/7/docs/api" - } - } -} - task clean(type: Delete) { delete rootProject.buildDir } diff --git a/config.gradle b/config.gradle index 500d295..58e75b8 100644 --- a/config.gradle +++ b/config.gradle @@ -1,9 +1,9 @@ ext { - versionCode = 202008171 - versionName = "4.5.0" + versionCode = 202108301 + versionName = "4.6.0" - qmui = "2.0.0-alpha11" + qmui = "2.0.1" okhttp = "4.9.0" retrofit = "2.9.0" glide = "4.12.0" @@ -20,12 +20,9 @@ ext { ] googleDependencies = [ - "appcompat" : "androidx.appcompat:appcompat:1.3.0", - "annotation" : "androidx.annotation:annotation:1.2.0", - "vectordrawable-animated": "androidx.vectordrawable:vectordrawable-animated:1.1.0", + "appcompat" : "androidx.appcompat:appcompat:1.3.1", "constraintlayout" : "androidx.constraintlayout:constraintlayout:2.0.4", - "multidex" : "androidx.multidex:multidex:2.0.1", - "material" : "com.google.android.material:material:1.2.1", + "material" : "com.google.android.material:material:1.4.0", ] eventDependencies = [ @@ -74,11 +71,11 @@ ext { ] utilsDependencies = [ - "permissionx": "com.permissionx.guolindev:permissionx:1.4.0", + "permissionx": "com.guolindev.permissionx:permissionx:1.5.0", // utils "utilcodex" : "com.blankj:utilcodex:1.30.6", // agentweb - "agentweb" : "com.just.agentweb:agentweb:4.1.4", + "agentweb" : "com.github.Justson.AgentWeb:agentweb-core:v4.1.9-androidx", // arouter "arouter" : "com.alibaba:arouter-api:$arouter", "gson" : "com.google.code.gson:gson:2.8.6", @@ -87,7 +84,7 @@ ext { thirdDependencies = [ // 微信 - "wechat-sdk-mta" : "com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.6.4", + "wechat-sdk-mta" : "com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.7.9", // bugly "crashreport_upgrade": "com.tencent.bugly:crashreport_upgrade:1.5.23", ] diff --git a/gradle/deploy.gradle b/gradle/deploy.gradle index 681a6cf..7f9b7b8 100644 --- a/gradle/deploy.gradle +++ b/gradle/deploy.gradle @@ -1,11 +1,5 @@ apply plugin: 'maven-publish' -apply plugin: 'com.jfrog.bintray' - -def siteUrl = 'https://github.com/sdwfqin/AndroidQuick' // 项目的主页 -def gitUrl = 'https://github.com/sdwfqin/AndroidQuick.git' // Git仓库的url - -group = "com.sdwfqin.quicklib" -version = rootProject.ext.versionName +apply plugin: 'signing' Properties properties = new Properties() File projectPropertiesFile = rootProject.file("gradle/deploy.properties") @@ -15,6 +9,10 @@ if (projectPropertiesFile.exists()) { throw new Error("Cannot find deploy.properties file in gradle folder") } +ext["signing.keyId"] = properties.getProperty('signing.keyId') +ext["signing.password"] = properties.getProperty('signing.password') +ext["signing.secretKeyRingFile"] = properties.getProperty('signing.secretKeyRingFile') + def isAndroidLib = project.getPlugins().hasPlugin('com.android.application') || project.getPlugins().hasPlugin('com.android.library') @@ -46,30 +44,37 @@ if (isAndroidLib) { } def pomConfig = { + name "${properties.getProperty('group_id')}:${project.name}" + url properties.getProperty('git_url') licenses { license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + name properties.getProperty("license.name") + url properties.getProperty("license.url") } } developers { developer { - id 'sdwfqin' - name 'qinzhang' - email 'sdwfqin@icloud.com' + id properties.getProperty("developer.id") + name properties.getProperty("developer.name") + email properties.getProperty("developer.email") } } scm { - connection gitUrl - developerConnection gitUrl - url siteUrl + connection properties.getProperty('git_url') + developerConnection properties.getProperty('git_url') + url properties.getProperty('site_url') } } +signing { + sign publishing.publications +} + publishing { publications { mavenjava(MavenPublication) { - groupId project.group + groupId properties.getProperty('group_id') + artifactId project.name version project.version if (isAndroidLib) { artifact file("$buildDir/outputs/aar/${project.name}-release.aar") @@ -77,6 +82,9 @@ publishing { artifact androidJavadocJar pom.withXml { def root = asNode() + + root.appendNode('description', '做外包用的快速开发库--微信、支付宝支付(含签名,下单)、自定义View(验证码/密码,九宫格图片上传等)、换肤、图片预览、RxJava、EventBus、JetPack、CameraX、base层封装等') + final dependenciesNode = root.appendNode('dependencies') ext.addDependency = { dep, String scope -> @@ -105,13 +113,6 @@ publishing { } } - // List all "compile" dependencies (for old Gradle) - configurations.compile.getDependencies().each { dep -> addDependency(dep, "compile") } - // List all "implementation" dependencies (for new Gradle) as "runtime" dependencies - configurations.implementation.getDependencies().each { dep -> addDependency(dep, "runtime") } - // List all "api" dependencies (for new Gradle) as "compile" dependencies - configurations.api.getDependencies().each { dep -> addDependency(dep, "compile") } - root.children().last() + pomConfig } } else { @@ -121,33 +122,20 @@ publishing { pom.withXml { def root = asNode() + root.appendNode('description', '做外包用的快速开发库--微信、支付宝支付(含签名,下单)、自定义View(验证码/密码,九宫格图片上传等)、换肤、图片预览、RxJava、EventBus、JetPack、CameraX、base层封装等') root.children().last() + pomConfig } } } } -// repositories { -// maven { -// url properties.getProperty("maven.url") -// credentials { -// username properties.getProperty("maven.username") -// password properties.getProperty("maven.password") -// } -// } -// } -} - -bintray { - user = properties.getProperty("bintray.user") - key = properties.getProperty("bintray.apikey") - publications = ['mavenjava'] - pkg { - repo = 'quicklib' - name = project.name - websiteUrl = siteUrl - vcsUrl = gitUrl - licenses = ["Apache-2.0"] - publish = true + repositories { + maven { + url properties.getProperty("maven.url") + credentials { + username properties.getProperty("maven.username") + password properties.getProperty("maven.password") + } + } } } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 23b24f4..f4e2bf6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip diff --git a/imageloader/build.gradle b/imageloader/build.gradle index 3072daa..ff0ced3 100644 --- a/imageloader/build.gradle +++ b/imageloader/build.gradle @@ -1,16 +1,17 @@ apply plugin: 'com.android.library' -// ./gradlew clean build bintrayUpload +version = rootProject.ext.versionName android { compileSdkVersion rootProject.ext.androidVersion.compileSdkVersion - buildToolsVersion rootProject.ext.androidVersion.buildToolsVersion + + lintOptions { + abortOnError false + } defaultConfig { minSdkVersion rootProject.ext.androidVersion.minSdkVersion targetSdkVersion rootProject.ext.androidVersion.targetSdkVersion - versionCode rootProject.ext.versionCode - versionName rootProject.ext.versionName } buildTypes { @@ -27,7 +28,6 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation googleDependencies["annotation"] api imageDependencies["glide"] api imageDependencies["glide-integration"] api imageDependencies["androidsvg"] diff --git a/paylib/build.gradle b/paylib/build.gradle index 0170756..aff3be1 100644 --- a/paylib/build.gradle +++ b/paylib/build.gradle @@ -1,16 +1,17 @@ apply plugin: 'com.android.library' -// ./gradlew clean build bintrayUpload +version = rootProject.ext.versionName android { compileSdkVersion rootProject.ext.androidVersion.compileSdkVersion - buildToolsVersion rootProject.ext.androidVersion.buildToolsVersion + + lintOptions { + abortOnError false + } defaultConfig { minSdkVersion rootProject.ext.androidVersion.minSdkVersion targetSdkVersion rootProject.ext.androidVersion.targetSdkVersion - versionCode rootProject.ext.versionCode - versionName rootProject.ext.versionName } buildTypes { diff --git a/quicklib/build.gradle b/quicklib/build.gradle index e833730..a9b4bcd 100644 --- a/quicklib/build.gradle +++ b/quicklib/build.gradle @@ -1,16 +1,17 @@ apply plugin: 'com.android.library' -// ./gradlew clean build bintrayUpload +version = rootProject.ext.versionName android { compileSdkVersion rootProject.ext.androidVersion.compileSdkVersion - buildToolsVersion rootProject.ext.androidVersion.buildToolsVersion + + lintOptions { + abortOnError false + } defaultConfig { minSdkVersion rootProject.ext.androidVersion.minSdkVersion targetSdkVersion rootProject.ext.androidVersion.targetSdkVersion - versionCode rootProject.ext.versionCode - versionName rootProject.ext.versionName javaCompileOptions { annotationProcessorOptions { @@ -31,7 +32,7 @@ android { } buildFeatures { - viewBinding = true + viewBinding true } } @@ -39,8 +40,6 @@ dependencies { api fileTree(include: ['*.jar'], dir: 'libs') api googleDependencies["appcompat"] - api googleDependencies["annotation"] - api googleDependencies["vectordrawable-animated"] api googleDependencies["constraintlayout"] api googleDependencies["material"] diff --git a/quicklib/src/main/res/layout/quick_activity_image_preview.xml b/quicklib/src/main/res/layout/quick_activity_image_preview.xml index 96b74d9..e79cdb6 100644 --- a/quicklib/src/main/res/layout/quick_activity_image_preview.xml +++ b/quicklib/src/main/res/layout/quick_activity_image_preview.xml @@ -1,8 +1,7 @@ + android:layout_height="match_parent">