1// Copyright 2015 The Chromium Authors 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5package org.chromium.build; 6 7#define Q(x) #x 8#define QUOTE(x) Q(x) 9 10#if defined(USE_FINAL) 11#define MAYBE_FINAL final 12#define MAYBE_ZERO = 0 13#define MAYBE_FALSE = false 14#else 15#define MAYBE_FINAL 16#define MAYBE_ZERO 17#define MAYBE_FALSE 18#endif 19 20/** 21 * Build configuration. Generated on a per-target basis. 22 */ 23public class BuildConfig { 24 25#if defined(ENABLE_MULTIDEX) 26 public static MAYBE_FINAL boolean IS_MULTIDEX_ENABLED = true; 27#else 28 public static MAYBE_FINAL boolean IS_MULTIDEX_ENABLED MAYBE_FALSE; 29#endif 30 31#if defined(_ENABLE_ASSERTS) 32 public static MAYBE_FINAL boolean ENABLE_ASSERTS = true; 33#else 34 public static MAYBE_FINAL boolean ENABLE_ASSERTS MAYBE_FALSE; 35#endif 36 37#if defined(_IS_UBSAN) 38 public static MAYBE_FINAL boolean IS_UBSAN = true; 39#else 40 public static MAYBE_FINAL boolean IS_UBSAN MAYBE_FALSE; 41#endif 42 43#if defined(_IS_CHROME_BRANDED) 44 public static MAYBE_FINAL boolean IS_CHROME_BRANDED = true; 45#else 46 public static MAYBE_FINAL boolean IS_CHROME_BRANDED MAYBE_FALSE; 47#endif 48 49 // The ID of the android string resource that stores the product version. 50 // This layer of indirection is necessary to make the resource dependency 51 // optional for android_apk targets/base_java (ex. for cronet). 52#if defined(_RESOURCES_VERSION_VARIABLE) 53 public static MAYBE_FINAL int R_STRING_PRODUCT_VERSION = _RESOURCES_VERSION_VARIABLE; 54#else 55 // Default value, do not use. 56 public static MAYBE_FINAL int R_STRING_PRODUCT_VERSION MAYBE_ZERO; 57#endif 58 59 // Minimum SDK Version supported by this apk. 60 // Be cautious when using this value, as it can happen that older apks get 61 // installed on newer Android version (e.g. when a device goes through a 62 // system upgrade). It is also convenient for developing to have all 63 // features available through a single APK. 64 // However, it's pretty safe to assument that a feature specific to KitKat 65 // will never be needed in an APK with MIN_SDK_VERSION = Oreo. 66#if defined(_MIN_SDK_VERSION) 67 public static MAYBE_FINAL int MIN_SDK_VERSION = _MIN_SDK_VERSION; 68#else 69 public static MAYBE_FINAL int MIN_SDK_VERSION = 1; 70#endif 71 72#if defined(_BUNDLES_SUPPORTED) 73 public static MAYBE_FINAL boolean BUNDLES_SUPPORTED = true; 74#else 75 public static MAYBE_FINAL boolean BUNDLES_SUPPORTED MAYBE_FALSE; 76#endif 77 78#if defined(_IS_INCREMENTAL_INSTALL) 79 public static MAYBE_FINAL boolean IS_INCREMENTAL_INSTALL = true; 80#else 81 public static MAYBE_FINAL boolean IS_INCREMENTAL_INSTALL MAYBE_FALSE; 82#endif 83 84#if defined(_ISOLATED_SPLITS_ENABLED) 85 public static MAYBE_FINAL boolean ISOLATED_SPLITS_ENABLED = true; 86#else 87 public static MAYBE_FINAL boolean ISOLATED_SPLITS_ENABLED MAYBE_FALSE; 88#endif 89 90#if defined(_IS_FOR_TEST) 91 public static MAYBE_FINAL boolean IS_FOR_TEST = true; 92#else 93 public static MAYBE_FINAL boolean IS_FOR_TEST MAYBE_FALSE; 94#endif 95} 96