18034727885
2026-03-17 9e86c5336bf05c824d4cf9fc31b3286b45189944
优化编译打包
4个文件已添加
2个文件已修改
79 ■■■■■ 已修改文件
.gitignore 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/.name 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/deviceManager.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/markdown.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/vcs.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/build.gradle 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -14,3 +14,4 @@
.cxx
/app/release/
/.idea/
.idea/.name
New file
@@ -0,0 +1 @@
GOPOSTUser
.idea/deviceManager.xml
New file
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="DeviceTable">
    <option name="columnSorters">
      <list>
        <ColumnSorterState>
          <option name="column" value="Name" />
          <option name="order" value="ASCENDING" />
        </ColumnSorterState>
      </list>
    </option>
  </component>
</project>
.idea/markdown.xml
New file
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="MarkdownSettings">
    <option name="previewPanelProviderInfo">
      <ProviderInfo name="Compose (experimental)" className="com.intellij.markdown.compose.preview.ComposePanelProvider" />
    </option>
  </component>
</project>
.idea/vcs.xml
New file
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="VcsDirectoryMappings">
    <mapping directory="" vcs="Git" />
  </component>
</project>
app/build.gradle
@@ -32,12 +32,6 @@
            zipAlignEnabled true
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            applicationVariants.all { variant ->
                // 更新至Android Studio 3.3 gradle 4.10.1
                variant.outputs.all {
                    outputFileName = "GoPost_user-${defaultConfig.versionName}-${new Date().format("yyyy-MM-dd" , TimeZone.getTimeZone("GMT+08")) }.apk"
                }
            }
        }
        debug {
            minifyEnabled false
@@ -76,14 +70,52 @@
    }
}
// 在文件末尾添加
afterEvaluate {
    android.applicationVariants.all { variant ->
        def variantName = variant.name
        // 找到对应变体的bundle任务
        def bundleTask = tasks.findByName("bundle${variantName.capitalize()}")
        if (bundleTask != null) {
            bundleTask.doLast {
                // 输出目录
                def outputDir = file("${rootDir}/app/${variantName}/")
                if (outputDir.exists()) {
                    outputDir.listFiles().each { file ->
                        if (file.name.endsWith('.aab') || file.name.endsWith('.apk')) {
                            // 获取当前时间戳
                            def timestamp = new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+08"))
                            // 构建新的文件名
                            def newName = file.name.replace("app-${variantName}", "GoPost_user-${variant.versionName}-${timestamp}")
                            // 重命名文件
                            def newFile = new File(file.parentFile, newName)
                            if (file.renameTo(newFile)) {
                                println "✅ 文件重命名成功: ${file.name} -> ${newFile.name}"
                                println "📁 文件路径: ${newFile.absolutePath}"
                            } else {
                                println "❌ 文件重命名失败: ${file.name}"
                            }
                        }
                    }
                } else {
                    println "⚠️ 目录不存在: ${outputDir.absolutePath}"
                }
            }
        } else {
            println "⚠️ 未找到任务: ${bundleTaskName}"
        }
    }
}
repositories {
    flatDir {
        dirs 'libs'
    }
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar','*.aar'])
    implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    api "androidx.appcompat:appcompat:$support_version"
    implementation 'androidx.core:core-ktx:1.3.0'
@@ -94,8 +126,8 @@
    implementation("androidx.activity:activity-ktx:1.7.2")
    implementation 'com.google.android.gms:play-services-recaptcha:17.1.0'
    testImplementation 'junit:junit:4.12'
  //  androidTestImplementation 'androidx.test.ext:junit:1.1.1'
   // androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    //  androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    // androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation project(path: ':xldutils-kotlin')
    implementation 'com.google.android.material:material:1.3.0-alpha01'
    implementation project(path: ':rxnetty')