Skip to content

Commit

Permalink
更新依赖、迁移到mavenCentral
Browse files Browse the repository at this point in the history
  • Loading branch information
sdwfqin committed Aug 30, 2021
1 parent 3e1b3ed commit 219e6e2
Show file tree
Hide file tree
Showing 15 changed files with 105 additions and 136 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

> 开发环境
AndroidStudio 4.1.+
Gradle 6.5
AndroidStudio 2020.3.1
Gradle 7.0.2

## 必读事项

Expand Down Expand Up @@ -70,8 +70,8 @@
``` groovy
buildFeatures {
viewBinding = true
dataBinding = true
viewBinding true
dataBinding true
}
```
Expand All @@ -90,7 +90,7 @@
dirs '../libs'
}
// ... jcenter() 等其他仓库
// ... mavenCentral() 等其他仓库
}
}
```
Expand All @@ -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"
```

# 目录介绍
Expand Down
5 changes: 2 additions & 3 deletions app-kt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ android {
}

compileSdkVersion rootProject.ext.androidVersion.compileSdkVersion
buildToolsVersion rootProject.ext.androidVersion.buildToolsVersion

defaultConfig {
applicationId "io.github.sdwfqin.app_kt"
Expand Down Expand Up @@ -57,8 +56,8 @@ android {
}

buildFeatures {
viewBinding = true
dataBinding = true
viewBinding true
dataBinding true
}
}

Expand Down
5 changes: 2 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ android {
}

compileSdkVersion rootProject.ext.androidVersion.compileSdkVersion
buildToolsVersion rootProject.ext.androidVersion.buildToolsVersion

defaultConfig {
applicationId "com.sdwfqin.quickseed"
Expand Down Expand Up @@ -53,8 +52,8 @@ android {
}

buildFeatures {
viewBinding = true
dataBinding = true
viewBinding true
dataBinding true
}
}

Expand Down
31 changes: 4 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
19 changes: 8 additions & 11 deletions config.gradle
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 = [
Expand Down Expand Up @@ -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",
Expand All @@ -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",
]
Expand Down
78 changes: 33 additions & 45 deletions gradle/deploy.gradle
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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')

Expand Down Expand Up @@ -46,37 +44,47 @@ 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 '[email protected]'
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")
artifact androidSourcesJar
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 ->
Expand Down Expand Up @@ -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 {
Expand All @@ -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")
}
}
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions imageloader/build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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"]
Expand Down
9 changes: 5 additions & 4 deletions paylib/build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Loading

0 comments on commit 219e6e2

Please sign in to comment.