所有项目统一版本管理

This commit is contained in:
xuhuixiang
2025-03-18 15:25:15 +08:00
parent a2d31a94fd
commit af9263d734
10 changed files with 124 additions and 6 deletions

View File

@@ -42,7 +42,7 @@ android {
applicationVariants.all { variant -> applicationVariants.all { variant ->
variant.outputs.all { variant.outputs.all {
def appName = "dn99" def appName = "candy916"
def outputDir = new File(rootProject.ext.outputPath) def outputDir = new File(rootProject.ext.outputPath)
// 创建输出目录 // 创建输出目录
outputDir.mkdirs() outputDir.mkdirs()

View File

@@ -42,7 +42,7 @@ android {
applicationVariants.all { variant -> applicationVariants.all { variant ->
variant.outputs.all { variant.outputs.all {
def appName = "dn99" def appName = "Kejapjudi"
def outputDir = new File(rootProject.ext.outputPath) def outputDir = new File(rootProject.ext.outputPath)
// 创建输出目录 // 创建输出目录
outputDir.mkdirs() outputDir.mkdirs()

View File

@@ -35,7 +35,9 @@
10.base module 实现所有的功能逻辑 软件app入口通过继承 base的 MainActivity2 扩展 10.base module 实现所有的功能逻辑 软件app入口通过继承 base的 MainActivity2 扩展
11.新增统一命令行打包、指定apk名字的路径配置 所有项目统一版本管理 ./gradlew assembleRelease 11.新增统一命令行打包、指定apk名字的路径配置 所有项目统一版本管理
12.打包命令 ./gradlew assembleRelease 或者 Gradle/Tasks/build/assemble

View File

@@ -42,7 +42,7 @@ android {
applicationVariants.all { variant -> applicationVariants.all { variant ->
variant.outputs.all { variant.outputs.all {
def appName = "dn99" def appName = "agn888new"
def outputDir = new File(rootProject.ext.outputPath) def outputDir = new File(rootProject.ext.outputPath)
// 创建输出目录 // 创建输出目录
outputDir.mkdirs() outputDir.mkdirs()

View File

@@ -41,7 +41,7 @@ android {
applicationVariants.all { variant -> applicationVariants.all { variant ->
variant.outputs.all { variant.outputs.all {
def appName = "dn99" def appName = "amb88"
def outputDir = new File(rootProject.ext.outputPath) def outputDir = new File(rootProject.ext.outputPath)
// 创建输出目录 // 创建输出目录
outputDir.mkdirs() outputDir.mkdirs()

View File

@@ -42,7 +42,7 @@ android {
applicationVariants.all { variant -> applicationVariants.all { variant ->
variant.outputs.all { variant.outputs.all {
def appName = "dn99" def appName = "cekap33"
def outputDir = new File(rootProject.ext.outputPath) def outputDir = new File(rootProject.ext.outputPath)
// 创建输出目录 // 创建输出目录
outputDir.mkdirs() outputDir.mkdirs()

2
we1win/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/build
/release

82
we1win/build.gradle Normal file
View File

@@ -0,0 +1,82 @@
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.web.we1win"
minSdkVersion 24
targetSdkVersion 31
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
debug {
storeFile file('ppn.jks')
storePassword "2014123456"
keyAlias 'key0'
keyPassword "2014123456"
}
release {
storeFile file('ppn.jks')
storePassword "2014123456"
keyAlias 'key0'
keyPassword "2014123456"
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
applicationVariants.all { variant ->
variant.outputs.all {
def appName = "we1win"
def outputDir = new File(rootProject.ext.outputPath)
// 创建输出目录
outputDir.mkdirs()
def outputFileName = "${appName}.apk"
// 设置输出文件名
setOutputFileName(outputFileName)
// 计算新的输出文件
def newOutputFile = new File(outputDir, outputFileName)
// 如果新的输出目录不存在,则创建它
newOutputFile.parentFile.mkdirs()
// 在构建完成后将 APK 复制到新位置
variant.assemble.doLast {
try {
java.nio.file.Files.copy(
outputFile.toPath(),
newOutputFile.toPath(),
java.nio.file.StandardCopyOption.REPLACE_EXISTING
)
println "Success to copy APK !!!"
} catch (java.io.IOException e) {
println "Failed to copy APK: ${e.message}"
}
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation project(path: ':base')
}

BIN
we1win/ppn.jks Normal file

Binary file not shown.

32
we1win/proguard-rules.pro vendored Normal file
View File

@@ -0,0 +1,32 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-dontwarn dalvik.**
-dontwarn com.tencent.smtt.**
-keep class com.tencent.smtt.** {
*;
}
-keep class com.tencent.tbs.** {
*;
}