| // Copyright 2015 The Chromium Authors | |
| // Use of this source code is governed by a BSD-style license that can be | |
| // found in the LICENSE file. | |
| package org.chromium.build; | |
| #define Q(x) #x | |
| #define QUOTE(x) Q(x) | |
| /** | |
| * Build configuration. Generated on a per-target basis. | |
| */ | |
| public class BuildConfig { | |
| #if defined(_ENABLE_ASSERTS) | |
| public static boolean ENABLE_ASSERTS = true; | |
| #else | |
| public static boolean ENABLE_ASSERTS; | |
| #endif | |
| #if defined(_IS_UBSAN) | |
| public static boolean IS_UBSAN = true; | |
| #else | |
| public static boolean IS_UBSAN; | |
| #endif | |
| #if defined(_IS_CHROME_BRANDED) | |
| public static boolean IS_CHROME_BRANDED = true; | |
| #else | |
| public static boolean IS_CHROME_BRANDED; | |
| #endif | |
| // The ID of the android string resource that stores the product version. | |
| // This layer of indirection is necessary to make the resource dependency | |
| // optional for android_apk targets/base_java (ex. for cronet). | |
| #if defined(_RESOURCES_VERSION_VARIABLE) | |
| public static int R_STRING_PRODUCT_VERSION = _RESOURCES_VERSION_VARIABLE; | |
| #else | |
| public static int R_STRING_PRODUCT_VERSION; | |
| #endif | |
| // Minimum SDK Version supported by this apk. | |
| // Be cautious when using this value, as it can happen that older apks get | |
| // installed on newer Android version (e.g. when a device goes through a | |
| // system upgrade). It is also convenient for developing to have all | |
| // features available through a single APK. | |
| // However, it's pretty safe to assument that a feature specific to KitKat | |
| // will never be needed in an APK with MIN_SDK_VERSION = Oreo. | |
| #if defined(_MIN_SDK_VERSION) | |
| public static int MIN_SDK_VERSION = _MIN_SDK_VERSION; | |
| #else | |
| public static int MIN_SDK_VERSION = 1; | |
| #endif | |
| // Value of android:versionCode at compile time. | |
| // Use ApkInfo.getPackageVersionCode() instead of this because this will not reflect any | |
| // version code updates made by patching tools. | |
| #if defined(_VERSION_CODE) | |
| public static long ORIGINAL_VERSION_CODE = _VERSION_CODE; | |
| #else | |
| public static long ORIGINAL_VERSION_CODE = 1; | |
| #endif | |
| #if defined(_IS_INCREMENTAL_INSTALL) | |
| public static boolean IS_INCREMENTAL_INSTALL = true; | |
| #else | |
| public static boolean IS_INCREMENTAL_INSTALL; | |
| #endif | |
| #if defined(_IS_FOR_TEST) | |
| public static boolean IS_FOR_TEST = true; | |
| #else | |
| public static boolean IS_FOR_TEST; | |
| #endif | |
| #if defined(_IS_ROBOLECTRIC) | |
| public static boolean IS_ROBOLECTRIC = true; | |
| #else | |
| public static boolean IS_ROBOLECTRIC; | |
| #endif | |
| #if defined(_IS_CRONET_BUILD) | |
| public static boolean IS_CRONET_BUILD = true; | |
| #else | |
| public static boolean IS_CRONET_BUILD; | |
| #endif | |
| #if defined(_CRONET_FOR_AOSP_BUILD) | |
| public static boolean CRONET_FOR_AOSP_BUILD = true; | |
| #else | |
| public static boolean CRONET_FOR_AOSP_BUILD; | |
| #endif | |
| #if defined(_WRITE_CLANG_PROFILING_DATA) | |
| public static boolean WRITE_CLANG_PROFILING_DATA = true; | |
| #else | |
| public static boolean WRITE_CLANG_PROFILING_DATA; | |
| #endif | |
| #if defined(_DISABLE_DEBUG_LOGS) | |
| public static boolean ENABLE_DEBUG_LOGS; | |
| #else | |
| public static boolean ENABLE_DEBUG_LOGS = true; | |
| #endif | |
| #if defined(_APK_ASSETS_SUFFIXED_LIST) | |
| public static String[] APK_ASSETS_SUFFIXED_LIST = {_APK_ASSETS_SUFFIXED_LIST}; | |
| public static String APK_ASSETS_SUFFIX = QUOTE(_APK_ASSETS_SUFFIX); | |
| #else | |
| public static String[] APK_ASSETS_SUFFIXED_LIST = {}; | |
| public static String APK_ASSETS_SUFFIX = null; | |
| #endif | |
| // Use in conjunction with FEATURE_PC check to limit desktop-only | |
| // features to devices with build flag. Should only be used in | |
| // DeviceInfo.java since this is the source of truth for isDesktop check. | |
| // (TODO: crbug.com/430983585) Clean up this flag once the desktop | |
| // build is fully functional. | |
| #if defined(_IS_DESKTOP_ANDROID) | |
| public static boolean IS_DESKTOP_ANDROID = true; | |
| #else | |
| public static boolean IS_DESKTOP_ANDROID; | |
| #endif | |
| // Use to check if proguard is enabled for the current build. | |
| #if defined(_IS_PROGUARD_ENABLED) | |
| public static boolean IS_PROGUARD_ENABLED = true; | |
| #else | |
| public static boolean IS_PROGUARD_ENABLED = false; | |
| #endif | |
| // Controls whether or not StrictModeContext is a no-op. | |
| #if defined(_DISABLE_STRICT_MODE_CONTEXT) | |
| public static boolean DISABLE_STRICT_MODE_CONTEXT = true; | |
| #else | |
| public static boolean DISABLE_STRICT_MODE_CONTEXT; | |
| #endif | |
| public static final String LOGTAG_PREFIX = QUOTE(_LOGTAG_PREFIX); | |
| } |