不同产品的google-services.json我正在按照GoogleDevelopers页面的指南实现新的GoogleCloud消息传递这里我已经成功地运行并测试了它。但我现在的问题是,我有不同的产品口味,不同的应用程序ID/PackageName和不同的GoogleCloud消息传递项目ID。这个google-services.json必须放在/app/google-services.json不是口味文件夹。有没有办法google-services.json配置不同的不同口味?
3 回答
噜噜哒
TA贡献1784条经验 获得超7个赞
switchToDebug
switchToRelease
assembleRelease
switchToRelease
def appModuleRootFolder = '.'def srcDir = 'src'def googleServicesJson = 'google-services.json'task switchToDebug(type: Copy) { def buildType = 'debug' description = 'Switches to DEBUG google-services.json' from "${srcDir}/${buildType}" include "$googleServicesJson" into "$appModuleRootFolder"}task switchToRelease(type: Copy) { def buildType = 'release' description = 'Switches to RELEASE google-services.json' from "${srcDir}/${buildType}/" include "$googleServicesJson" into "$appModuleRootFolder"}afterEvaluate { processDebugGoogleServices.dependsOn switchToDebug processReleaseGoogleServices.dependsOn switchToRelease}
编辑:processDebugFlavorGoogleServices
/processReleaseFlavorGoogleServices
- 3 回答
- 0 关注
- 1014 浏览
添加回答
举报
0/150
提交
取消