How to set buildConfigField parameters dynamically while building an apk through Jenkins
问题 I have following fields in ProductFlavors of build.gradle, productFlavors { Flavor1 { applicationId "com.example.A" buildConfigField 'int', 'ID', '123' } } How can i update these 2 fields according to inputs given from Jenkins.? Thanks in advance!! 回答1: You can use following steps: In your app level build.gradle: buildscript { ext{ appId="com.example.A" Id=123 } ... } change your fields as follows: productFlavors { Flavor1 { applicationId appId buildConfigField 'int', 'ID', "$Id" } } From