From e37c82119687d74e174eb671affc34192868e881 Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 1 Jul 2024 00:54:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83apk=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 4be26b7..5625daa 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -36,6 +36,20 @@ android { version '3.18.1' } } + + android.applicationVariants.all { variant -> + variant.outputs.all { output -> + if (outputFileName.endsWith('.apk')) { + def buildTypeFlag = "dbg" + if(variant.buildType.name.equals('release')) { + buildTypeFlag = "rel" + } + def fileName = "mprmt_v${defaultConfig.versionName}_${buildTypeFlag}_${new Date(System.currentTimeMillis()).format("yyyyMMdd")}.apk" + outputFileName = fileName + } + } + } + buildFeatures { viewBinding true }