All Projects → line → feature-flag-android

line / feature-flag-android

Licence: Apache-2.0 License
A Gradle plugin to achieve feature flag based development for Android applications.

Programming Languages

kotlin
9241 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to feature-flag-android

laboratory
Feature flags for multi-module Kotlin Android projects
Stars: ✭ 71 (-13.41%)
Mutual labels:  android-development, feature-flags, gradle-plugin
YMFF
Feature management made easy.
Stars: ✭ 26 (-68.29%)
Mutual labels:  feature-flags, feature-toggles
CloudKitFeatureFlags
A library that lets you setup feature flagging for your iOS app using CloudKit
Stars: ✭ 91 (+10.98%)
Mutual labels:  feature-flags, feature-toggles
flagsmith-js-client
Javascript Client for Flagsmith. Ship features with confidence using feature flags and remote config. Host yourself or use our hosted version at https://www.flagsmith.com/
Stars: ✭ 42 (-48.78%)
Mutual labels:  feature-flags, feature-toggles
js-sdk
JavaScript frontend SDK for ConfigCat. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
Stars: ✭ 21 (-74.39%)
Mutual labels:  feature-flags, feature-toggles
flagsmith-java-client
Java Client for Flagsmith. Ship features with confidence using feature flags and remote config. Host yourself or use our hosted version at https://www.flagsmith.com/
Stars: ✭ 16 (-80.49%)
Mutual labels:  feature-flags, feature-toggles
ld-redux
A library to integrate launch darkly with react redux
Stars: ✭ 33 (-59.76%)
Mutual labels:  feature-flags, feature-toggles
doorkeeper
A Feature Toggle for PHP
Stars: ✭ 16 (-80.49%)
Mutual labels:  feature-flags, feature-toggles
unleash-docker
Docker container for unleash
Stars: ✭ 89 (+8.54%)
Mutual labels:  feature-flags, feature-toggles
PowerShell-FeatureFlags
PowerShell module containing a Feature Flags implementation based on a local config file.
Stars: ✭ 15 (-81.71%)
Mutual labels:  feature-flags, feature-toggles
laravel-rollout
A package to integrate rollout into your Laravel project.
Stars: ✭ 23 (-71.95%)
Mutual labels:  feature-flags, feature-toggles
ld-scheduler
Schedule Launch Darkly flags on or off
Stars: ✭ 14 (-82.93%)
Mutual labels:  feature-flags, feature-toggles
Toggler
Feature toggle library for PHP
Stars: ✭ 18 (-78.05%)
Mutual labels:  feature-flags, feature-toggles
ruby-client
Ruby SDK client for Split Software
Stars: ✭ 22 (-73.17%)
Mutual labels:  feature-flags, feature-toggles
pheature-flags
Pheature flags main repository
Stars: ✭ 75 (-8.54%)
Mutual labels:  feature-flags, feature-toggles
react-client
React JS SDK client for Split Software
Stars: ✭ 23 (-71.95%)
Mutual labels:  feature-flags, feature-toggles
js-client-sdk
LaunchDarkly Client-side SDK for Browser JavaScript
Stars: ✭ 93 (+13.41%)
Mutual labels:  feature-flags, feature-toggles
flipper
Feature Flipper, Feature Flags, Rollout Flags, Feature Toggles for Crystal
Stars: ✭ 21 (-74.39%)
Mutual labels:  feature-flags, feature-toggles
eight ball
Ruby gem for querying feature flags
Stars: ✭ 17 (-79.27%)
Mutual labels:  feature-flags, feature-toggles
nestjs-config
NestJS Module for Nonfig services. Nonfig combines Configurations and Features. So you change features, and release swiftly, and measure to digital impact.
Stars: ✭ 40 (-51.22%)
Mutual labels:  feature-flags, feature-toggles

feature-flag-android

Gradle Plugin Portal

A Gradle plugin to achieve feature flag based development for Android applications.

Overview

This plugin generates feature flags from a property file to achieve feature flag based development. The flag values are visible as boolean values in source code, and useful to enable or disable features. You can specify which feature is enabled by build variant, user name, application version, another flag value, and their combinations.

Getting started

Add library dependencies

The plugin is available on Gradle Plugin Portal. Add configurations in the build.gradle.kts file as follows.

// In your module's `build.gradle.kts`
plugins {
  id("com.linecorp.android.feature-flag") version "x.y.z"
}

Add configuration

We assume this project has two build types: debug and release as follows.

android {
    buildTypes {
        debug {
            // snip
        }
        release {
            // snip
        }
    }
}

We may define flag phases as follows, for example.

  • DEBUG: Enabled when the build type is debug.
  • RELEASE: Enabled when the build type is debug or release.

The following code is actuall configuration example.

featureFlag {
    sourceFile = file("FEATURE_FLAG")
    packageName = "com.example.featureflag"
    phases = mapOf(
        "DEBUG" to setOf(buildType("debug")),
        "RELEASE" to setOf(buildType("debug"), buildType("release"))
    )
    releasePhaseSet = setOf(buildType("release"))
}

Definition of each property is as follows.

  • sourceFile: A feature flag property File to read.

  • packageName: A package name of generated FeatureFlag class.

  • phases: A list of pairs of phase and the corresponding build variants.

  • releasePhaseSet: Build variants to allow using primitive boolean values as flag values. An optimizer may inline flag values with the variants. buildType or flavor can be specified as a variant.

  • versionName: (Optional) A version name which can override application version name.

    Also, this property can be assigned for library module since Android Gradle Plugin 7.0 or higher.

How to use

Create property files

Create a feature flag property file in your module. An example is as follows.

# Simple property
FLAG_1 = DEBUG              # Enabled when build in `DEBUG` phase.
FLAG_2 = 1.2.0~             # Enabled when module version is `1.2.0` or later.
FLAG_3 = @user              # Enabled if the username is `user`.
FLAG_4 = submodule:FLAG_A   # Delegates flag enability to `FLAG_A` in module `submodule`.

# Property with options
OVERRIDABLE FLAG_5 = DEBUG  # Makes the flag modifiable at runtime.
PRIVATE FLAG_6 = DEBUG      # Makes the flag not accessible from a flag property file in another module.
LITERALIZE FLAG_7 = DEBUG   # Try to use a primitive boolean as the flag value.
 
# Property combination
# Enabled if either of the following conditions satisfies
# 1. Built in `DEBUG` phase.
# 2. Built in `RELEASE` phase and version `1.3.0` or later.
FLAG_8 = DEBUG, RELEASE & 1.3.0~

PRIVATE FLAG_9_USERS = @user1, @user2  # Enabled if built by `user1` or `user2`
FLAG_9 = FLAG_9_USERS & DEBUG          # Enabled if `FLAG_9_USERS` is enabled and built in `DEBUG` phase.

Use flag value from application code

// Change view visibility
view.isVisible = FeatureFlag.FLAG_1

// Change activity
val targetActivityClass = if(FeatureFlag.FLAG_2) FooActivity::class.java else BarActivity::class.java
val intent = Intent(context, targetActivityClass)

// Change presenter
val presenter = if (FeatureFlag.FLAG_3) FooPresenter() else BarPresenter()
presenter.show()

// Modify the flag value programmatically (available when it's `OVERRIDABLE`)
FeatureFlag.FLAG_5 = false

How to contribute

See CONTRIBUTING.md.

If you believe you have discovered a vulnerability or have an issue related to security, please contact the maintainer directly or send us a email to [email protected] before sending a pull request.

LICENSE

Copyright 2019 LINE Corporation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

See LICENSE for more detail.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].