From f5f88a61b0599c8c1c95a86fcbdac423787137ec Mon Sep 17 00:00:00 2001 From: ZhanGSKen Date: Wed, 12 Mar 2025 02:27:08 +0800 Subject: [PATCH] =?UTF-8?q?AndroidX=20Demo=20=E8=B0=83=E8=AF=95=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- androidxdemo/app_update_description.txt | 0 androidxdemo/build.gradle | 62 +++++++++++++++++-- androidxdemo/build.properties | 8 +++ androidxdemo/src/beta/AndroidManifest.xml | 12 ++++ androidxdemo/src/beta/res/values/strings.xml | 6 ++ .../src/main/res/layout/activity_main.xml | 22 ++++++- androidxdemo/src/main/res/values/strings.xml | 4 +- androidxdemo/src/stage/AndroidManifest.xml | 12 ++++ androidxdemo/src/stage/res/values/strings.xml | 6 ++ gradle.properties-androidx-demo | 2 +- 10 files changed, 122 insertions(+), 12 deletions(-) create mode 100644 androidxdemo/app_update_description.txt create mode 100644 androidxdemo/build.properties create mode 100644 androidxdemo/src/beta/AndroidManifest.xml create mode 100644 androidxdemo/src/beta/res/values/strings.xml create mode 100644 androidxdemo/src/stage/AndroidManifest.xml create mode 100644 androidxdemo/src/stage/res/values/strings.xml diff --git a/androidxdemo/app_update_description.txt b/androidxdemo/app_update_description.txt new file mode 100644 index 0000000..e69de29 diff --git a/androidxdemo/build.gradle b/androidxdemo/build.gradle index 5ce4c89..fcf214f 100644 --- a/androidxdemo/build.gradle +++ b/androidxdemo/build.gradle @@ -1,16 +1,47 @@ apply plugin: 'com.android.application' +apply from: '../.winboll/winboll_app_build.gradle' +apply from: '../.winboll/winboll_lint_build.gradle' + +def genVersionName(def versionName){ + // 检查编译标志位配置 + assert (winbollBuildProps['stageCount'] != null) + assert (winbollBuildProps['baseVersion'] != null) + // 保存基础版本号 + winbollBuildProps.setProperty("baseVersion", "${versionName}"); + //保存编译标志配置 + FileOutputStream fos = new FileOutputStream(winbollBuildPropsFile) + winbollBuildProps.store(fos, "${winbollBuildPropsDesc}"); + fos.close(); + + // 返回编译版本号 + return "${versionName}." + winbollBuildProps['stageCount'] +} android { + productFlavors { + beta { + } + stage { + } + } + compileSdkVersion 30 - buildToolsVersion "33.0.0" + buildToolsVersion "30.0.3" defaultConfig { applicationId "cc.winboll.studio.androidxdemo" - minSdkVersion 16 - targetSdkVersion 26 + minSdkVersion 26 + targetSdkVersion 29 versionCode 1 + // versionName 更新后需要手动设置 + // .winboll/winbollBuildProps.properties 文件的 stageCount=0 + // Gradle编译环境下合起来的 versionName 就是 "${versionName}.0" versionName "1.0" + if(true) { + versionName = genVersionName("${versionName}") + } } + buildTypes { release { minifyEnabled false @@ -20,7 +51,26 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.0.0' - implementation 'com.google.android.material:material:1.0.0' - implementation fileTree(dir: 'libs', include: ['*.jar']) + api fileTree(dir: 'libs', include: ['*.jar']) + + // SSH + implementation 'com.jcraft:jsch:0.1.55' + // Html 解析 + implementation 'org.jsoup:jsoup:1.13.1' + // 二维码类库 + implementation 'com.google.zxing:core:3.4.1' + implementation 'com.journeyapps:zxing-android-embedded:3.6.0' + // 应用介绍页类库 + implementation 'io.github.medyo:android-about-page:2.0.0' + // 吐司类库 + implementation 'com.github.getActivity:ToastUtils:10.5' + // 网络连接类库 + implementation 'com.squareup.okhttp3:okhttp:4.4.1' + // Android 类库 + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.viewpager:viewpager:1.0.0' + implementation 'androidx.vectordrawable:vectordrawable:1.1.0' + implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0' + implementation 'androidx.fragment:fragment:1.1.0' + implementation 'com.google.android.material:material:1.4.0' } diff --git a/androidxdemo/build.properties b/androidxdemo/build.properties new file mode 100644 index 0000000..8d115d9 --- /dev/null +++ b/androidxdemo/build.properties @@ -0,0 +1,8 @@ +#Created by .winboll/winboll_app_build.gradle +#Tue Mar 11 18:25:43 GMT 2025 +stageCount=0 +libraryProject= +baseVersion=1.0 +publishVersion=1.0.0 +buildCount=4 +baseBetaVersion=1.0.1 diff --git a/androidxdemo/src/beta/AndroidManifest.xml b/androidxdemo/src/beta/AndroidManifest.xml new file mode 100644 index 0000000..ee78d9f --- /dev/null +++ b/androidxdemo/src/beta/AndroidManifest.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/androidxdemo/src/beta/res/values/strings.xml b/androidxdemo/src/beta/res/values/strings.xml new file mode 100644 index 0000000..bf50bcf --- /dev/null +++ b/androidxdemo/src/beta/res/values/strings.xml @@ -0,0 +1,6 @@ + + + + AndroidX Demo + + + diff --git a/androidxdemo/src/main/res/layout/activity_main.xml b/androidxdemo/src/main/res/layout/activity_main.xml index 9e910fa..034ba40 100644 --- a/androidxdemo/src/main/res/layout/activity_main.xml +++ b/androidxdemo/src/main/res/layout/activity_main.xml @@ -10,13 +10,29 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> - + + app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/> - \ No newline at end of file + + + + + + + + diff --git a/androidxdemo/src/main/res/values/strings.xml b/androidxdemo/src/main/res/values/strings.xml index 2103c3a..6aea12c 100644 --- a/androidxdemo/src/main/res/values/strings.xml +++ b/androidxdemo/src/main/res/values/strings.xml @@ -1,4 +1,4 @@ - AndroidXDemo + AndroidX Demo - \ No newline at end of file + diff --git a/androidxdemo/src/stage/AndroidManifest.xml b/androidxdemo/src/stage/AndroidManifest.xml new file mode 100644 index 0000000..ee78d9f --- /dev/null +++ b/androidxdemo/src/stage/AndroidManifest.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/androidxdemo/src/stage/res/values/strings.xml b/androidxdemo/src/stage/res/values/strings.xml new file mode 100644 index 0000000..ace0c41 --- /dev/null +++ b/androidxdemo/src/stage/res/values/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/gradle.properties-androidx-demo b/gradle.properties-androidx-demo index daf2619..2f26404 100644 --- a/gradle.properties-androidx-demo +++ b/gradle.properties-androidx-demo @@ -16,4 +16,4 @@ org.gradle.jvmargs=-Xmx2048m # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX -android.enableJetifier=false +android.enableJetifier=true