Class AndroidBuckConfig


  • public class AndroidBuckConfig
    extends Object
    • Field Detail

      • VALID_ABI_KEYS

        public static final com.google.common.collect.ImmutableSet<String> VALID_ABI_KEYS
    • Constructor Detail

      • AndroidBuckConfig

        public AndroidBuckConfig​(BuckConfig delegate,
                                 Platform platform)
    • Method Detail

      • getSkipCrunchPngsDefault

        public Optional<Boolean> getSkipCrunchPngsDefault()
        Whether to skip crunching pngs by default in aapt2 compile.
      • getFailOnLegacyAaptErrors

        public boolean getFailOnLegacyAaptErrors()
        Whether to fail (vs warn) on legacy aapt2 compile errors.
      • getAaptNoResourceRemoval

        public boolean getAaptNoResourceRemoval()
        Whether to disable resource removal in aapt2.
      • getAndroidCompileSdkVersion

        public Optional<String> getAndroidCompileSdkVersion()
      • getBuildToolsVersion

        public Optional<String> getBuildToolsVersion()
      • getAdbOverride

        public Optional<Path> getAdbOverride()
        Returns the path to the adb executable overridden by the current project. If not specified, the getAdbSearchOrder() will be used to find adb.
      • getAdbSearchOrder

        public com.google.common.collect.ImmutableList<String> getAdbSearchOrder()
        Defines the order to search for the adb executable: a list consisting of the elements '', representing the first adb on the system PATH, or '', representing the adb in the platform-tools directory of the currently configured Android SDK location.
      • getAdbTimeout

        public Integer getAdbTimeout()
      • getSdkPathSearchOrder

        public com.google.common.collect.ImmutableList<String> getSdkPathSearchOrder()
        Defines the order of search of the path to Android SDK.

        The order is the list of elements that can either be <CONFIG> (to indicate the entry from .buckconfig) or the name of an environment variable that contains path to Android SDK (for example, ANDROID_SDK).

        If nothing is specified in .buckconfig the default order is: ANDROID_SDK, ANDROID_HOME, ANDROID_SDK_ROOT, <CONFIG>

      • getSdkPathConfigOptionFromSearchOrderEntry

        public Optional<String> getSdkPathConfigOptionFromSearchOrderEntry​(String entry)
        Given the entry to from the order of search of the Android SDK location returns the name of the configuration option that contains SDK path if the entry instructs to get that value from .buckconfig (i.e. it's <CONFIG>) or Optional.empty() in other cases.
      • getNdkRepositoryPath

        public Optional<String> getNdkRepositoryPath()
      • getNdkSearchOrder

        public com.google.common.collect.ImmutableList<AndroidBuckConfig.NdkSearchOrderEntry> getNdkSearchOrder()
        Defines the order of search of the Android NDK.

        The order is the list of elements that can either be <NDK_REPOSITORY_CONFIG> to indicate the entry ndk.ndk_repo_path from .buckconfig, <NDK_DIRECTORY_CONFIG> to indicate the entry ndk.ndk_path from .buckconfig, or the name of an environment variable that contains path to Android NDK (ANDROID_NDK, NDK_HOME or ANDROID_NDK_REPOSITORY).

        If nothing is specified in .buckconfig the default order is: ANDROID_NDK_REPOSITORY, ANDROID_NDK, NDK_HOME, <NDK_REPOSITORY_CONFIG>, <NDK_DIRECTORY_CONFIG>

      • getNdkCpuAbiFallbackAppPlatform

        public Optional<String> getNdkCpuAbiFallbackAppPlatform()
      • getNdkCpuAbiAppPlatformMap

        public com.google.common.collect.ImmutableMap<String,​String> getNdkCpuAbiAppPlatformMap()
      • getExtraNdkCFlags

        public com.google.common.collect.ImmutableList<String> getExtraNdkCFlags()
      • getExtraNdkCxxFlags

        public com.google.common.collect.ImmutableList<String> getExtraNdkCxxFlags()
      • getExtraNdkLdFlags

        public com.google.common.collect.ImmutableList<String> getExtraNdkLdFlags()
      • isGrayscaleImageProcessingEnabled

        public boolean isGrayscaleImageProcessingEnabled()
      • getNdkAppPlatformForCpuAbi

        public Optional<String> getNdkAppPlatformForCpuAbi​(String cpuAbi)
        Returns the CPU specific app platform, or the fallback one if set. If neither are set, returns `Optional.empty` instead of a default value so callers can determine the difference between user-set and buck defaults.
      • getAaptOverride

        public Optional<java.util.function.Supplier<Tool>> getAaptOverride()
        Returns the path to the platform specific aapt executable that is overridden by the current project. If not specified, the Android platform aapt will be used.
      • getAapt2Override

        public Optional<ToolProvider> getAapt2Override()
        Returns the tool provider to the platform specific aapt2 executable that is overridden by the current project. If not specified, the Android platform aapt will be used.