1*8975f5c5SAndroid Build Coastguard Worker// Copyright 2015 The Chromium Authors 2*8975f5c5SAndroid Build Coastguard Worker// Use of this source code is governed by a BSD-style license that can be 3*8975f5c5SAndroid Build Coastguard Worker// found in the LICENSE file. 4*8975f5c5SAndroid Build Coastguard Worker 5*8975f5c5SAndroid Build Coastguard Workerpackage org.chromium.build; 6*8975f5c5SAndroid Build Coastguard Worker 7*8975f5c5SAndroid Build Coastguard Worker#define Q(x) #x 8*8975f5c5SAndroid Build Coastguard Worker#define QUOTE(x) Q(x) 9*8975f5c5SAndroid Build Coastguard Worker 10*8975f5c5SAndroid Build Coastguard Worker/** 11*8975f5c5SAndroid Build Coastguard Worker * Build configuration. Generated on a per-target basis. 12*8975f5c5SAndroid Build Coastguard Worker */ 13*8975f5c5SAndroid Build Coastguard Workerpublic class BuildConfig { 14*8975f5c5SAndroid Build Coastguard Worker 15*8975f5c5SAndroid Build Coastguard Worker#if defined(_ENABLE_ASSERTS) 16*8975f5c5SAndroid Build Coastguard Worker public static boolean ENABLE_ASSERTS = true; 17*8975f5c5SAndroid Build Coastguard Worker#else 18*8975f5c5SAndroid Build Coastguard Worker public static boolean ENABLE_ASSERTS; 19*8975f5c5SAndroid Build Coastguard Worker#endif 20*8975f5c5SAndroid Build Coastguard Worker 21*8975f5c5SAndroid Build Coastguard Worker#if defined(_IS_UBSAN) 22*8975f5c5SAndroid Build Coastguard Worker public static boolean IS_UBSAN = true; 23*8975f5c5SAndroid Build Coastguard Worker#else 24*8975f5c5SAndroid Build Coastguard Worker public static boolean IS_UBSAN; 25*8975f5c5SAndroid Build Coastguard Worker#endif 26*8975f5c5SAndroid Build Coastguard Worker 27*8975f5c5SAndroid Build Coastguard Worker#if defined(_IS_CHROME_BRANDED) 28*8975f5c5SAndroid Build Coastguard Worker public static boolean IS_CHROME_BRANDED = true; 29*8975f5c5SAndroid Build Coastguard Worker#else 30*8975f5c5SAndroid Build Coastguard Worker public static boolean IS_CHROME_BRANDED; 31*8975f5c5SAndroid Build Coastguard Worker#endif 32*8975f5c5SAndroid Build Coastguard Worker 33*8975f5c5SAndroid Build Coastguard Worker // The ID of the android string resource that stores the product version. 34*8975f5c5SAndroid Build Coastguard Worker // This layer of indirection is necessary to make the resource dependency 35*8975f5c5SAndroid Build Coastguard Worker // optional for android_apk targets/base_java (ex. for cronet). 36*8975f5c5SAndroid Build Coastguard Worker#if defined(_RESOURCES_VERSION_VARIABLE) 37*8975f5c5SAndroid Build Coastguard Worker public static int R_STRING_PRODUCT_VERSION = _RESOURCES_VERSION_VARIABLE; 38*8975f5c5SAndroid Build Coastguard Worker#else 39*8975f5c5SAndroid Build Coastguard Worker public static int R_STRING_PRODUCT_VERSION; 40*8975f5c5SAndroid Build Coastguard Worker#endif 41*8975f5c5SAndroid Build Coastguard Worker 42*8975f5c5SAndroid Build Coastguard Worker // Minimum SDK Version supported by this apk. 43*8975f5c5SAndroid Build Coastguard Worker // Be cautious when using this value, as it can happen that older apks get 44*8975f5c5SAndroid Build Coastguard Worker // installed on newer Android version (e.g. when a device goes through a 45*8975f5c5SAndroid Build Coastguard Worker // system upgrade). It is also convenient for developing to have all 46*8975f5c5SAndroid Build Coastguard Worker // features available through a single APK. 47*8975f5c5SAndroid Build Coastguard Worker // However, it's pretty safe to assument that a feature specific to KitKat 48*8975f5c5SAndroid Build Coastguard Worker // will never be needed in an APK with MIN_SDK_VERSION = Oreo. 49*8975f5c5SAndroid Build Coastguard Worker#if defined(_MIN_SDK_VERSION) 50*8975f5c5SAndroid Build Coastguard Worker public static int MIN_SDK_VERSION = _MIN_SDK_VERSION; 51*8975f5c5SAndroid Build Coastguard Worker#else 52*8975f5c5SAndroid Build Coastguard Worker public static int MIN_SDK_VERSION = 1; 53*8975f5c5SAndroid Build Coastguard Worker#endif 54*8975f5c5SAndroid Build Coastguard Worker 55*8975f5c5SAndroid Build Coastguard Worker // Value of android:versionCode. 56*8975f5c5SAndroid Build Coastguard Worker#if defined(_VERSION_CODE) 57*8975f5c5SAndroid Build Coastguard Worker public static long VERSION_CODE = _VERSION_CODE; 58*8975f5c5SAndroid Build Coastguard Worker#else 59*8975f5c5SAndroid Build Coastguard Worker public static long VERSION_CODE = 1; 60*8975f5c5SAndroid Build Coastguard Worker#endif 61*8975f5c5SAndroid Build Coastguard Worker 62*8975f5c5SAndroid Build Coastguard Worker#if defined(_IS_BUNDLE) 63*8975f5c5SAndroid Build Coastguard Worker public static boolean IS_BUNDLE = true; 64*8975f5c5SAndroid Build Coastguard Worker#else 65*8975f5c5SAndroid Build Coastguard Worker public static boolean IS_BUNDLE; 66*8975f5c5SAndroid Build Coastguard Worker#endif 67*8975f5c5SAndroid Build Coastguard Worker 68*8975f5c5SAndroid Build Coastguard Worker#if defined(_IS_INCREMENTAL_INSTALL) 69*8975f5c5SAndroid Build Coastguard Worker public static boolean IS_INCREMENTAL_INSTALL = true; 70*8975f5c5SAndroid Build Coastguard Worker#else 71*8975f5c5SAndroid Build Coastguard Worker public static boolean IS_INCREMENTAL_INSTALL; 72*8975f5c5SAndroid Build Coastguard Worker#endif 73*8975f5c5SAndroid Build Coastguard Worker 74*8975f5c5SAndroid Build Coastguard Worker#if defined(_IS_FOR_TEST) 75*8975f5c5SAndroid Build Coastguard Worker public static boolean IS_FOR_TEST = true; 76*8975f5c5SAndroid Build Coastguard Worker#else 77*8975f5c5SAndroid Build Coastguard Worker public static boolean IS_FOR_TEST; 78*8975f5c5SAndroid Build Coastguard Worker#endif 79*8975f5c5SAndroid Build Coastguard Worker 80*8975f5c5SAndroid Build Coastguard Worker#if defined(_IS_CRONET_BUILD) 81*8975f5c5SAndroid Build Coastguard Worker public static boolean IS_CRONET_BUILD = true; 82*8975f5c5SAndroid Build Coastguard Worker#else 83*8975f5c5SAndroid Build Coastguard Worker public static boolean IS_CRONET_BUILD; 84*8975f5c5SAndroid Build Coastguard Worker#endif 85*8975f5c5SAndroid Build Coastguard Worker 86*8975f5c5SAndroid Build Coastguard Worker#if defined(_WRITE_CLANG_PROFILING_DATA) 87*8975f5c5SAndroid Build Coastguard Worker public static boolean WRITE_CLANG_PROFILING_DATA = true; 88*8975f5c5SAndroid Build Coastguard Worker#else 89*8975f5c5SAndroid Build Coastguard Worker public static boolean WRITE_CLANG_PROFILING_DATA; 90*8975f5c5SAndroid Build Coastguard Worker#endif 91*8975f5c5SAndroid Build Coastguard Worker 92*8975f5c5SAndroid Build Coastguard Worker#if defined(_DISABLE_DEBUG_LOGS) 93*8975f5c5SAndroid Build Coastguard Worker public static boolean ENABLE_DEBUG_LOGS; 94*8975f5c5SAndroid Build Coastguard Worker#else 95*8975f5c5SAndroid Build Coastguard Worker public static boolean ENABLE_DEBUG_LOGS = true; 96*8975f5c5SAndroid Build Coastguard Worker#endif 97*8975f5c5SAndroid Build Coastguard Worker 98*8975f5c5SAndroid Build Coastguard Worker#if defined(_APK_ASSETS_SUFFIXED_LIST) 99*8975f5c5SAndroid Build Coastguard Worker public static String[] APK_ASSETS_SUFFIXED_LIST = {_APK_ASSETS_SUFFIXED_LIST}; 100*8975f5c5SAndroid Build Coastguard Worker public static String APK_ASSETS_SUFFIX = QUOTE(_APK_ASSETS_SUFFIX); 101*8975f5c5SAndroid Build Coastguard Worker#else 102*8975f5c5SAndroid Build Coastguard Worker public static String[] APK_ASSETS_SUFFIXED_LIST = {}; 103*8975f5c5SAndroid Build Coastguard Worker public static String APK_ASSETS_SUFFIX = null; 104*8975f5c5SAndroid Build Coastguard Worker#endif 105*8975f5c5SAndroid Build Coastguard Worker 106*8975f5c5SAndroid Build Coastguard Worker // Enable features that are more typically available on desktop. 107*8975f5c5SAndroid Build Coastguard Worker#if defined(_IS_DESKTOP_ANDROID) 108*8975f5c5SAndroid Build Coastguard Worker public static boolean IS_DESKTOP_ANDROID = true; 109*8975f5c5SAndroid Build Coastguard Worker#else 110*8975f5c5SAndroid Build Coastguard Worker public static boolean IS_DESKTOP_ANDROID; 111*8975f5c5SAndroid Build Coastguard Worker#endif 112*8975f5c5SAndroid Build Coastguard Worker 113*8975f5c5SAndroid Build Coastguard Worker // Controls whether or not StrictModeContext is a no-op. 114*8975f5c5SAndroid Build Coastguard Worker#if defined(_DISABLE_STRICT_MODE_CONTEXT) 115*8975f5c5SAndroid Build Coastguard Worker public static boolean DISABLE_STRICT_MODE_CONTEXT = true; 116*8975f5c5SAndroid Build Coastguard Worker#else 117*8975f5c5SAndroid Build Coastguard Worker public static boolean DISABLE_STRICT_MODE_CONTEXT; 118*8975f5c5SAndroid Build Coastguard Worker#endif 119*8975f5c5SAndroid Build Coastguard Worker 120*8975f5c5SAndroid Build Coastguard Worker public static final String LOGTAG_PREFIX = QUOTE(_LOGTAG_PREFIX); 121*8975f5c5SAndroid Build Coastguard Worker} 122