From 3cc48d33e6ed2ec5b2a355a9d816beffaae0255f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E8=80=81=E7=99=BD=E5=85=94?= Date: Fri, 1 Aug 2025 11:14:33 +0800 Subject: [PATCH] =?UTF-8?q?FEAT=20=3D>=20=E6=9C=AC=E6=AC=A1=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=A1=B9=E7=9B=AE=E4=B8=BA=EF=BC=9A=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nkebao/android/.idea/misc.xml | 2 +- nkebao/android/app/build.gradle | 19 ++++++++++++------- nkebao/android/app/gradle.properties | 8 ++++++++ nkebao/android/gradle.properties | 5 +++++ 4 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 nkebao/android/app/gradle.properties diff --git a/nkebao/android/.idea/misc.xml b/nkebao/android/.idea/misc.xml index 3040d03e..74dd639e 100644 --- a/nkebao/android/.idea/misc.xml +++ b/nkebao/android/.idea/misc.xml @@ -1,7 +1,7 @@ - + diff --git a/nkebao/android/app/build.gradle b/nkebao/android/app/build.gradle index 715a26a3..689775cc 100644 --- a/nkebao/android/app/build.gradle +++ b/nkebao/android/app/build.gradle @@ -9,7 +9,6 @@ android { targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61 @@ -22,12 +21,21 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + + // 完全禁用测试 + testOptions { + unitTests.all { + enabled = false + } + } } repositories { - flatDir{ - dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs' - } + // 移除 flatDir,使用标准的 maven 仓库 + google() + mavenCentral() + maven { url 'https://maven.aliyun.com/repository/public' } + maven { url 'https://maven.aliyun.com/repository/google' } } dependencies { @@ -36,9 +44,6 @@ dependencies { implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion" implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion" implementation project(':capacitor-android') - testImplementation "junit:junit:$junitVersion" - androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" - androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" implementation project(':capacitor-cordova-android-plugins') } diff --git a/nkebao/android/app/gradle.properties b/nkebao/android/app/gradle.properties new file mode 100644 index 00000000..43ebbdf4 --- /dev/null +++ b/nkebao/android/app/gradle.properties @@ -0,0 +1,8 @@ +# 禁用所有测试 +android.enableUnitTestBinaryResources=false +android.enableAndroidTestBinaryResources=false +android.testInstrumentationRunner=androidx.test.runner.AndroidJUnitRunner + +# 跳过测试任务 +android.testOptions.unitTests.all.enabled=false +android.testOptions.androidTest.enabled=false \ No newline at end of file diff --git a/nkebao/android/gradle.properties b/nkebao/android/gradle.properties index 2e87c52f..4de7c2a4 100644 --- a/nkebao/android/gradle.properties +++ b/nkebao/android/gradle.properties @@ -20,3 +20,8 @@ org.gradle.jvmargs=-Xmx1536m # Android operating system, and which are packaged with your app's APK # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true + +# 禁用测试 +android.testInstrumentationRunner=androidx.test.runner.AndroidJUnitRunner +android.enableUnitTestBinaryResources=false +android.enableAndroidTestBinaryResources=false