File tree Expand file tree Collapse file tree 3 files changed +42
-15
lines changed
Expand file tree Collapse file tree 3 files changed +42
-15
lines changed Original file line number Diff line number Diff line change 11apply plugin : ' com.android.application'
2+ apply from : ' ../common.gradle'
23
34android {
4- compileSdkVersion 33
55
66 defaultConfig {
77 applicationId " com.hjq.device.compat.demo"
8- minSdkVersion 16
9- targetSdkVersion 33
10- versionCode 10
11- versionName " 1.0"
8+ minSdk 16
129 testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
1310 }
1411
15- // 支持 JDK 1.8
16- compileOptions {
17- targetCompatibility JavaVersion . VERSION_1_8
18- sourceCompatibility JavaVersion . VERSION_1_8
19- }
20-
2112 // Apk 签名的那些事:https://www.jianshu.com/p/a1f8e5896aa2
2213 signingConfigs {
2314 config {
Original file line number Diff line number Diff line change 1+ // 通用配置
2+ android {
3+
4+ // 编译源码版本
5+ compileSdk 34
6+ defaultConfig {
7+ // 最低安装版本
8+ minSdk 14
9+ // Android 版本适配指南:https://github.com/getActivity/AndroidVersionAdapter
10+ targetSdk 34
11+ versionCode 10
12+ versionName " 1.0"
13+ }
14+
15+ // 支持 Java JDK 8
16+ compileOptions {
17+ targetCompatibility JavaVersion . VERSION_1_8
18+ sourceCompatibility JavaVersion . VERSION_1_8
19+ }
20+
21+ // 读取 local.properties 文件配置
22+ def properties = new Properties ()
23+ def localPropertiesFile = rootProject. file(" local.properties" )
24+ if (localPropertiesFile. exists()) {
25+ localPropertiesFile. withInputStream { inputStream ->
26+ properties. load(inputStream)
27+ }
28+ }
29+
30+ String buildDirPath = properties. getProperty(" build.dir" )
31+ if (buildDirPath != null && buildDirPath != " " ) {
32+ // 将构建文件统一输出到指定的目录下
33+ setBuildDir(new File (buildDirPath, rootProject. name + " /build/${ path.replaceAll(':', '/')} " ))
34+ } else {
35+ // 将构建文件统一输出到项目根目录下的 build 文件夹
36+ setBuildDir(new File (rootDir, " build/${ path.replaceAll(':', '/')} " ))
37+ }
38+ }
Original file line number Diff line number Diff line change 11apply plugin : ' com.android.library'
2+ apply from : ' ../common.gradle'
23
34android {
4- compileSdkVersion 26
55
66 resourcePrefix " demo_"
77
88 defaultConfig {
9- minSdkVersion 14
10- versionCode 10
11- versionName " 1.0"
9+ minSdk 14
1210 }
1311
1412 android. libraryVariants. configureEach { variant ->
You can’t perform that action at this time.
0 commit comments