We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flavorDimensions "mode" productFlavors { aaa { dimension "mode" applicationId "com.example.aaa" signingConfig signingConfigs.aaa } bbb{ dimension "mode" applicationId "com.example.bbb" signingConfig signingConfigs.bbb } ccc{ dimension "mode" applicationId "com.example.ccc" signingConfig signingConfigs.ccc } }
def getCurrentFlavorName= "${getCurrentFlavorName()}" apkNameFormat = getCurrentFlavorName + '-${buildType}-V${versionName}-C${versionCode}-${buildTime}-${flavorName}'
import java.util.regex.Matcher import java.util.regex.Pattern def getCurrentFlavorName() { Gradle gradle = getGradle() String tskReqStr = gradle.getStartParameter().getTaskRequests().toString() Pattern pattern; if( tskReqStr.contains( "assemble" ) ) pattern = Pattern.compile("assemble(\\w+)(Release|Debug)") else if(tskReqStr.contains( "channel" )) pattern = Pattern.compile("channel(\\w+)(Release|Debug)") else pattern = Pattern.compile("generate(\\w+)(Release|Debug)") Matcher matcher = pattern.matcher( tskReqStr ) if( matcher.find() ) return matcher.group(1).toLowerCase() else { println "NO MATCH FOUND" return ""; } }
def keyValue = [ 'appName' : project.name, 'flavorName' : channel, //----------->channelName 'buildType' : mVariant.buildType.name, 'versionName': mVariant.versionName, 'versionCode': mVariant.versionCode, 'appId' : mVariant.applicationId, 'buildTime' : buildTime 'mVariant' : mVariant, // add 'flavorName' : mVariant.name, //add ]
The text was updated successfully, but these errors were encountered:
嗯,感谢建议,我尽快实现哈
Sorry, something went wrong.
嗯,感谢建议,我尽快实现哈 哪个版本会实现?我也有这样的需要,感谢
No branches or pull requests
当前项目有生成aaa, bbb, ccc三个不同产品的配置
多渠道包的命名规则,默认为:${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}
现需求为
现在获取getCurrentFlavorName 比较麻烦,希望提供简易方法获取mVariant,并将 apkNameFormat 中flavorName改名为channelName
多次执行生成渠道包,会将前一次生成的渠道包删除,可有设置不删除的配置?
The text was updated successfully, but these errors were encountered: