All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mictaege.jitter.plugin.FlavourUtil Maven / Gradle / Ivy

Go to download

The jitter-plugin is a Gradle plugin to build and distribute different flavours of an application from a single source base.

There is a newer version: 2023.3
Show newest version
package com.github.mictaege.jitter.plugin;

import static java.lang.System.getProperty;
import static java.util.Optional.ofNullable;

final class FlavourUtil {

    static final String KEY = "jitter.active.flavour";

    private FlavourUtil() {
        super();
    }

    static boolean active(final String flavour) {
        return ofNullable(getProperty(KEY))
                .map(p -> p.length() == 0 || p.equalsIgnoreCase(flavour))
                .orElse(true);
    }

    static boolean anyVariant() {
        return ofNullable(getProperty("jitter.active.flavour"))
                .map(p -> p.length() > 0 )
                .orElse(false);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy