From 8232c8d9a90413686df73a2f59247a8c83e51878 Mon Sep 17 00:00:00 2001 From: AI <132525856+LZX284@users.noreply.github.com> Date: Wed, 15 Nov 2023 17:08:07 +0800 Subject: [PATCH] =?UTF-8?q?Assets=E5=AE=9E=E7=8E=B0=E6=8C=89flavors?= =?UTF-8?q?=E5=88=86=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assets按flavors分化为三个目录 --- app/build.gradle.kts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 79158a85..a4b89880 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -409,6 +409,21 @@ android { } + sourceSets { + // @Hint by LZX284 on Nov 15, 2023. + // ! The assets file is divided into three directories according to different flavors. + // ! But the files are not actually moved to avoid conflicts with the latest modifications. + getByName("main"){ + assets.srcDirs("src/main/assets") + } + getByName(flavorNameApp){ + assets.srcDirs("src/main/assets_$flavorNameApp") + } + getByName(flavorNameInrt){ + assets.srcDirs("src/main/assets_$flavorNameInrt") + } + } + compileOptions { isCoreLibraryDesugaringEnabled = true sourceCompatibility = versions.javaVersion