提交 eabfde2f 编写于 作者: 囧jt's avatar 囧jt

modify:

[Android]-优化打包参数
上级 3f5b6a75
......@@ -92,7 +92,6 @@ android {
}
packagingOptions {
//dokit ktor pickFirst
// pickFirst 'META-INF/io.netty.versions.properties'
......@@ -140,6 +139,7 @@ android {
// }
//}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation rootProject.ext.dependencies["junit"]
......@@ -148,10 +148,19 @@ dependencies {
implementation rootProject.ext.dependencies["flexbox"]
implementation rootProject.ext.dependencies["lifecycle-viewmodel-savedstate"]
implementation rootProject.ext.dependencies["appcompat"]
implementation rootProject.ext.dependencies["coroutines-core"]
implementation rootProject.ext.dependencies["coroutines-android"]
implementation rootProject.ext.dependencies["material"]
implementation rootProject.ext.dependencies["kotlin"]
if (needKotlinV14()) {
implementation rootProject.ext.dependencies["kotlin_v14"]
implementation rootProject.ext.dependencies["coroutines-core_v14"]
implementation rootProject.ext.dependencies["coroutines-android_v14"]
implementation rootProject.ext.dependencies["coil_v13"]
} else {
implementation rootProject.ext.dependencies["kotlin_v13"]
implementation rootProject.ext.dependencies["coroutines-core_v13"]
implementation rootProject.ext.dependencies["coroutines-android_v13"]
implementation rootProject.ext.dependencies["coil_v11"]
}
implementation rootProject.ext.dependencies["fragment"]
implementation rootProject.ext.dependencies["fragment-ktx"]
implementation rootProject.ext.dependencies["retrofit2"]
......@@ -162,7 +171,7 @@ dependencies {
implementation rootProject.ext.dependencies["glide"]
// implementation rootProject.ext.dependencies["glide_okhttp3"]
kapt rootProject.ext.dependencies["glide_compiler"]
implementation rootProject.ext.dependencies["coil"]
implementation rootProject.ext.dependencies["picasso"]
implementation rootProject.ext.dependencies["fresco"]
implementation rootProject.ext.dependencies["fresco-processors"]
......
package com.didichuxing.doraemondemo
import okio.ByteString
import okio.ByteString.Companion.encodeUtf8
import org.junit.Test
import java.lang.reflect.Proxy
import java.util.*
......@@ -28,6 +30,22 @@ class ExampleUnitTest {
}
@Test
@Throws(Exception::class)
fun hex() {
val originKey =
"method=POST&path=/gateway&fragment=null&query={\"api\":\"lj.u.d.changeOnline\",\"appKey\":\"b4f945fe780140d8a0d19d1f2d021db7\"}&contentType=application/json; charset=utf-8&requestBody={\"type\":1.0}"
val replace = originKey.replace("\\","")
println("replace===>${replace}")
val encodeUtf8 = originKey.replace("\\","").encodeUtf8().toString()
println("encodeUtf8===>${encodeUtf8}")
val md5 = originKey.replace("\\","").encodeUtf8().md5().toString()
println("md5===>${md5}")
val hex = originKey.replace("\\","").encodeUtf8().md5().hex()
println("hex===>${hex}")
}
@Test
fun testMapSort() {
val maps = mapOf(
......
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
apply from: "config.gradle"
def runType = rootProject.ext.publish_config["run_type"]
def dokitPluginVersion = rootProject.ext.publish_config["version"]
def kotlinVersion = rootProject.ext.android["kotlin_version"]
def kotlinVersion
if (needKotlinV14()) {
kotlinVersion = rootProject.ext.android["kotlin_version_v14"]
} else {
kotlinVersion = rootProject.ext.android["kotlin_version_v13"]
}
def gradlePluginVersion = rootProject.ext.android["agp_module_verson"]
......@@ -14,11 +22,11 @@ buildscript {
maven {
url "https://oss.sonatype.org/content/groups/public"
}
// maven { url 'https://artifactory.intra.xiaojukeji.com/artifactory/public' }
// maven {
// //本地插件地址
// url uri('/Users/didi/project/dokit_repo')
// }
maven { url 'https://artifactory.intra.xiaojukeji.com/artifactory/public' }
maven {
//本地插件地址
url uri('/Users/didi/project/dokit_repo')
}
}
dependencies {
classpath "com.android.tools.build:gradle:$gradlePluginVersion"
......@@ -44,11 +52,11 @@ allprojects {
maven {
url "https://oss.sonatype.org/content/groups/public"
}
// maven { url 'https://artifactory.intra.xiaojukeji.com/artifactory/public' }
// maven {
// //本地插件地址
// url uri('/Users/didi/project/dokit_repo')
// }
maven { url 'https://artifactory.intra.xiaojukeji.com/artifactory/public' }
maven {
//本地插件地址
url uri('/Users/didi/project/dokit_repo')
}
}
}
......@@ -157,3 +165,5 @@ task checkUploadConfig4Didi() {
}
}
buildscript {
apply from: "../config.gradle"
repositories {
mavenLocal()
mavenCentral()
......@@ -9,8 +10,11 @@ buildscript {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
dependencies {
//classpath 'com.android.tools.build:gradle:3.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProject.ext.android["kotlin_version"]}"
if (needKotlinV14()) {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProject.ext.android["kotlin_version_v14"]}"
} else {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProject.ext.android["kotlin_version_v13"]}"
}
}
}
//apply plugin: 'java-library'
......
......@@ -11,29 +11,29 @@ ext {
version : '3.4.3.110'
]
android = [compileSdkVersion : 29,
suppotrSdkVersion : "28.0.0",
applicationId : "com.didichuxing.doraemondemo",
minSdkVersion_16 : 16,
minSdkVersion_21 : 21,
targetSdkVersion : 29,
android = [compileSdkVersion : 29,
suppotrSdkVersion : "28.0.0",
applicationId : "com.didichuxing.doraemondemo",
minSdkVersion_16 : 16,
minSdkVersion_21 : 21,
targetSdkVersion : 29,
//app版本号
versionCode : 1,
versionName : "1.0.0",
glide_version : "4.9.0",
kotlin_version : "1.3.72",
// kotlin_version : "1.4.20",
// kotlin_version : "1.4.32",
kotlinx_coroutines_version: "1.3.7",
// kotlinx_coroutines_version : "1.4.2",
// kotlinx_coroutines_version : "1.4.3",
booster_version : "4.0.0",
agp_module_verson : "7.0.0",
agp_plugin_verson : "4.2.2",
ktor : "1.5.4",
okhttp_v2 : "2.7.5",
okhttp_v3 : "3.14.7",
okhttp_v4 : "4.7.0"
versionCode : 1,
versionName : "1.0.0",
glide_version : "4.9.0",
kotlin_version_v13 : "1.3.72",
kotlin_version_v14 : "1.4.32",
kotlinx_coroutines_version_v13: "1.3.7",
kotlinx_coroutines_version_v14: "1.4.3",
booster_version : "4.0.0",
agp_module_verson : "7.0.0",
agp_plugin_verson : "4.2.2",
ktor : "1.5.4",
okhttp_v2 : "2.7.5",
okhttp_v3 : "3.14.7",
okhttp_v4 : "4.7.0",
coil_v11 : "1.1.0",
coil_v13 : "1.3.2",
]
dependencies = [// ###### android library start ######
......@@ -43,9 +43,12 @@ ext {
"recyclerview" : 'androidx.recyclerview:recyclerview:1.1.0',
"material" : 'com.google.android.material:material:1.1.0',
"annotation" : "androidx.annotation:annotation:1.1.0",
"kotlin" : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${android["kotlin_version"]}",
"coroutines-core" : "org.jetbrains.kotlinx:kotlinx-coroutines-core:${android["kotlinx_coroutines_version"]}",
"coroutines-android" : "org.jetbrains.kotlinx:kotlinx-coroutines-android:${android["kotlinx_coroutines_version"]}",
"kotlin_v13" : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${android["kotlin_version_v13"]}",
"kotlin_v14" : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${android["kotlin_version_v14"]}",
"coroutines-core_v13" : "org.jetbrains.kotlinx:kotlinx-coroutines-core:${android["kotlinx_coroutines_version_v13"]}",
"coroutines-core_v14" : "org.jetbrains.kotlinx:kotlinx-coroutines-core:${android["kotlinx_coroutines_version_v14"]}",
"coroutines-android_v13" : "org.jetbrains.kotlinx:kotlinx-coroutines-android:${android["kotlinx_coroutines_version_v13"]}",
"coroutines-android_v14" : "org.jetbrains.kotlinx:kotlinx-coroutines-android:${android["kotlinx_coroutines_version_v14"]}",
"core-ktx" : "androidx.core:core-ktx:1.3.0",
"activity-ktx" : "androidx.activity:activity-ktx:1.2.3",
"webkit" : "androidx.webkit:webkit:1.3.0",
......@@ -95,7 +98,8 @@ ext {
"glide_v3" : 'com.github.bumptech.glide:glide:3.8.0',
"glide_okhttp3" : "com.github.bumptech.glide:okhttp3-integration:${android["glide_version"]}",
"glide_compiler" : "com.github.bumptech.glide:compiler:${android["glide_version"]}",
"coil" : 'io.coil-kt:coil:1.3.2',
"coil_v11" : "io.coil-kt:coil:${android["coil_v11"]}",
"coil_v13" : "io.coil-kt:coil:${android["coil_v13"]}",
"picasso" : 'com.squareup.picasso:picasso:2.71828',
"fresco" : 'com.facebook.fresco:fresco:1.13.0',
"fresco-processors" : "jp.wasabeef:fresco-processors:2.1.0",
......@@ -147,4 +151,11 @@ ext {
"hummer" : 'io.github.didi.hummer:hummer:0.3.23',
]
//定义全局方法
needKotlinV14 = {
String version = publish_config["version"]
//分割字符串
String[] vs = version.split("\\.")
return vs.length == 3
}
}
......@@ -39,15 +39,19 @@ android {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation rootProject.ext.dependencies["kotlin"]
if (needKotlinV14()) {
implementation rootProject.ext.dependencies["kotlin_v14"]
} else {
implementation rootProject.ext.dependencies["kotlin_v13"]
}
implementation rootProject.ext.dependencies["appcompat"]
implementation rootProject.ext.dependencies["activity-ktx"]
//sql
implementation rootProject.ext.dependencies["wcdb"]
// implementation rootProject.ext.dependencies["core-ktx"]
implementation rootProject.ext.dependencies["kotlin"]
implementation rootProject.ext.dependencies["auto_service"]
kapt rootProject.ext.dependencies["auto_service"]
//ktor
......
......@@ -41,11 +41,16 @@ android {
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
androidTestImplementation 'junit:junit:4.12'
implementation rootProject.ext.dependencies["kotlin"]
if (needKotlinV14()) {
implementation rootProject.ext.dependencies["kotlin_v14"]
} else {
implementation rootProject.ext.dependencies["kotlin_v13"]
}
implementation rootProject.ext.dependencies["core-ktx"]
implementation rootProject.ext.dependencies["fragment-ktx"]
implementation rootProject.ext.dependencies["appcompat"]
......@@ -53,7 +58,6 @@ dependencies {
implementation rootProject.ext.dependencies["recyclerview"]
implementation rootProject.ext.dependencies["fragment"]
implementation rootProject.ext.dependencies["zxing"]
implementation rootProject.ext.dependencies["kotlin"]
implementation rootProject.ext.dependencies["epic"]
implementation rootProject.ext.dependencies["volley"]
implementation rootProject.ext.dependencies["ktor_server_websockets"]
......
......@@ -32,11 +32,17 @@ android {
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//implementation rootProject.ext.dependencies["appcompat"]
//compileOnly rootProject.ext.dependencies["okio"]
compileOnly rootProject.ext.dependencies["kotlin"]
if (needKotlinV14()) {
compileOnly rootProject.ext.dependencies["kotlin_v14"]
} else {
compileOnly rootProject.ext.dependencies["kotlin_v13"]
}
compileOnly rootProject.ext.dependencies["okhttp_v3"]
//三大图片框架
compileOnly rootProject.ext.dependencies["glide"]
......
......@@ -32,9 +32,14 @@ android {
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation rootProject.ext.dependencies["kotlin"]
if (needKotlinV14()) {
implementation rootProject.ext.dependencies["kotlin_v14"]
} else {
implementation rootProject.ext.dependencies["kotlin_v13"]
}
implementation project(':dokit-okhttp-v3')
implementation project(':dokit-okhttp-v4')
compileOnly project(':dokit-util')
......
......@@ -32,9 +32,15 @@ android {
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation rootProject.ext.dependencies["kotlin"]
if (needKotlinV14()) {
implementation rootProject.ext.dependencies["kotlin_v14"]
} else {
implementation rootProject.ext.dependencies["kotlin_v13"]
}
//implementation rootProject.ext.dependencies["appcompat"]
//compileOnly rootProject.ext.dependencies["okio"]
api rootProject.ext.dependencies["okhttp_v3"]
......
......@@ -32,10 +32,17 @@ android {
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation rootProject.ext.dependencies["kotlin"]
implementation 'androidx.annotation:annotation:1.1.0'
if (needKotlinV14()) {
implementation rootProject.ext.dependencies["kotlin_v14"]
} else {
implementation rootProject.ext.dependencies["kotlin_v13"]
}
implementation rootProject.ext.dependencies["annotation"]
//implementation rootProject.ext.dependencies["appcompat"]
// compileOnly rootProject.ext.dependencies["okhttp_v4"]
compileOnly rootProject.ext.dependencies["okhttp_v4"]
......
......@@ -50,11 +50,18 @@ allprojects {
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly project(":dokit-util")
implementation rootProject.ext.dependencies["kotlin"]
implementation rootProject.ext.dependencies["coroutines-core"]
if (needKotlinV14()) {
implementation rootProject.ext.dependencies["kotlin_v14"]
implementation rootProject.ext.dependencies["coroutines-core_v14"]
} else {
implementation rootProject.ext.dependencies["kotlin_v13"]
implementation rootProject.ext.dependencies["coroutines-core_v13"]
}
//platform http
compileOnly rootProject.ext.dependencies["didi_http"]
compileOnly rootProject.ext.dependencies["hummer"]
......
......@@ -50,10 +50,16 @@ allprojects {
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly project(":dokit-util")
implementation rootProject.ext.dependencies["kotlin"]
if (needKotlinV14()) {
implementation rootProject.ext.dependencies["kotlin_v14"]
} else {
implementation rootProject.ext.dependencies["kotlin_v13"]
}
//platform http
compileOnly rootProject.ext.dependencies["didi_http"]
compileOnly rootProject.ext.dependencies["didi_rpc"]
......
......@@ -31,9 +31,16 @@ android {
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation rootProject.ext.dependencies["kotlin"]
if (needKotlinV14()) {
implementation rootProject.ext.dependencies["kotlin_v14"]
} else {
implementation rootProject.ext.dependencies["kotlin_v13"]
}
implementation rootProject.ext.dependencies["annotation"]
implementation rootProject.ext.dependencies["fragment"]
implementation rootProject.ext.dependencies["drawerlayout"]
......
......@@ -41,9 +41,15 @@ android {
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation rootProject.ext.dependencies["kotlin"]
if (needKotlinV14()) {
implementation rootProject.ext.dependencies["kotlin_v14"]
} else {
implementation rootProject.ext.dependencies["kotlin_v13"]
}
implementation rootProject.ext.dependencies["appcompat"]
implementation rootProject.ext.dependencies["constraintLayout"]
implementation rootProject.ext.dependencies["material"]
......
......@@ -57,12 +57,15 @@ android {
}
dependencies {
//implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
testImplementation 'junit:junit:4.12'
androidTestImplementation 'junit:junit:4.12'
implementation rootProject.ext.dependencies["kotlin"]
if (needKotlinV14()) {
implementation rootProject.ext.dependencies["kotlin_v14"]
} else {
implementation rootProject.ext.dependencies["kotlin_v13"]
}
implementation rootProject.ext.dependencies["lifecycle-comm"]
implementation rootProject.ext.dependencies["constraintLayout"]
......@@ -101,7 +104,11 @@ dependencies {
//三大图片框架
compileOnly rootProject.ext.dependencies["coil"]
if (needKotlinV14()) {
compileOnly rootProject.ext.dependencies["coil_v13"]
} else {
compileOnly rootProject.ext.dependencies["coil_v11"]
}
compileOnly rootProject.ext.dependencies["glide"]
compileOnly rootProject.ext.dependencies["picasso"]
compileOnly rootProject.ext.dependencies["fresco"]
......@@ -109,7 +116,6 @@ dependencies {
//腾讯x5
compileOnly rootProject.ext.dependencies["tbs"]
//高德地图
// implementation rootProject.ext.dependencies["amap_map3d"]
//高德地图定位
......
......@@ -9,5 +9,5 @@ include ':dokit-okhttp-api'
include ':dokit-weex'
include ':dokit-no-op'
include ':dokit-plugin'
//include ':dokit-rpc'
//include ':dokit-rpc-mc'
include ':dokit-rpc'
include ':dokit-rpc-mc'
......@@ -25,5 +25,4 @@ RES="\033[0m"
./gradlew :dokit-rpc-mc:publishReleasePublicationToMavenCentralRepository
./gradlew :dokit-util:publishReleasePublicationToMavenCentralRepository
./gradlew :dokit-weex:publishReleasePublicationToMavenCentralRepository
echo "打包上传到MavenCenter()仓库完成!!!"
echo -e "${GREEN_COLOR} 打包上传到MavenCenter()仓库完成!!! ${RES}"
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册