in three lines: 1. Branches are hard to manage in a large application 2. Enables/disables features in a property file 3. Implemented as a Gradle plugin Slides: in English Talk: in Japanese
release schedule from the development progress ‣ Disables features if critical issues found on the release branch ‣ Shares the halfway features to other members
release schedule from the development progress ‣ Disables features if critical issues found on the release branch ‣ Shares the halfway features to other members
release schedule from the development progress ‣ Disables features if critical issues found on the release branch ‣ Shares the halfway features to other members
release schedule from the development progress ‣ Disables features if critical issues found on the release branch ‣ Shares the halfway features to other members
release schedule from the development progress ‣ Disables features if critical issues found on the release branch ‣ Shares the halfway features to other members
2. Write the property content to BuildConfig public static final boolean FEATURE_STICKER = true; public static final boolean FEATURE_THEME = false; BuildConfig.java (output)
a literal for release to help ProGuard) val isRelease = variant.buildType.name == "release" val valueString = if (isRelease) "$value" else "Boolean.valueOf($value)" FeatureFlagPlugin.kt (Gradle plugin)
val availableFlagValues = BUILD_TYPE_TO_FLAG_LIST_MAP[buildTypeName] .orEmpty() val isEnabled = availableFlagValues.contains(flagValue) // WHERE, flagValue is "debug" or "release" FeatureFlagPlugin.kt (Gradle plugin)
reflection - Create a flag list with supplier/consumer pair public static final Map<...> FEATURE_FLAG_ACCESSOR_MAP = new HashMap<>() {{ put( "FEATURE_STICKER", ) ... BuildConfig.java (output, pseudocode)
reflection - Create a flag list with supplier/consumer pair public static final Map<...> FEATURE_FLAG_ACCESSOR_MAP = new HashMap<>() {{ put( "FEATURE_STICKER", new Pair<>( () -> FEATURE_STICKER, (b) -> FEATURE_STICKER = b) ) ... BuildConfig.java (output, pseudocode)
feature flag - Replace a class, layout file, or value ‣ Hard to apply a feature flag - Update API, library, or SDK version ‣ Enough to use a branch - Make a prototype or trial implementation