1. android {
    2. // ...
    3. defaultConfig {
    4. minSdkVersion 22
    5. targetSdkVersion 33
    6. multiDexEnabled true
    7. applicationId 'com.xxx.xxxx'
    8. ndk {
    9. abiFilters 'armeabi-v7a', 'arm64-v8a'
    10. }
    11. versionCode 119
    12. versionName '1.1.9'
    13. setProperty("archivesBaseName","${getAppName()}_${defaultConfig.versionName}_${defaultConfig.versionCode}_${releaseTime()}")
    14. }
    15. // ...
    16. }
    17. def releaseTime() {
    18. return new Date().format("yyyy_MM_dd", TimeZone.getTimeZone("UTC"))
    19. }
    20. def getUnityProjectPath() {
    21. return "file:///F:/WorkProject2/juicedrinkdiy-MainIOS".replace("\\", "/");
    22. }
    23. def getAppName() {
    24. def stringsFile = android.sourceSets.main.res.sourceFiles.find { it.name.equals 'strings.xml' }
    25. String s = new XmlParser().parse(stringsFile).string.find { it.@name.equals 'app_name' }.text();
    26. return s.replaceAll("\"", "").replace(" ","").replace(":","");
    27. }