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_ASSERTS) 26 public static MAYBE_FINAL boolean ENABLE_ASSERTS = true; 27#else 28 public static MAYBE_FINAL boolean ENABLE_ASSERTS MAYBE_FALSE; 29#endif 30 31#if defined(_IS_UBSAN) 32 public static MAYBE_FINAL boolean IS_UBSAN = true; 33#else 34 public static MAYBE_FINAL boolean IS_UBSAN MAYBE_FALSE; 35#endif 36 37#if defined(_IS_CHROME_BRANDED) 38 public static MAYBE_FINAL boolean IS_CHROME_BRANDED = true; 39#else 40 public static MAYBE_FINAL boolean IS_CHROME_BRANDED MAYBE_FALSE; 41#endif 42 43 // The ID of the android string resource that stores the product version. 44 // This layer of indirection is necessary to make the resource dependency 45 // optional for android_apk targets/base_java (ex. for cronet). 46#if defined(_RESOURCES_VERSION_VARIABLE) 47 public static MAYBE_FINAL int R_STRING_PRODUCT_VERSION = _RESOURCES_VERSION_VARIABLE; 48#else 49 // Default value, do not use. 50 public static MAYBE_FINAL int R_STRING_PRODUCT_VERSION MAYBE_ZERO; 51#endif 52 53 // Minimum SDK Version supported by this apk. 54 // Be cautious when using this value, as it can happen that older apks get 55 // installed on newer Android version (e.g. when a device goes through a 56 // system upgrade). It is also convenient for developing to have all 57 // features available through a single APK. 58 // However, it's pretty safe to assument that a feature specific to KitKat 59 // will never be needed in an APK with MIN_SDK_VERSION = Oreo. 60#if defined(_MIN_SDK_VERSION) 61 public static MAYBE_FINAL int MIN_SDK_VERSION = _MIN_SDK_VERSION; 62#else 63 public static MAYBE_FINAL int MIN_SDK_VERSION = 1; 64#endif 65 66 // Value of android:versionCode. 67#if defined(_VERSION_CODE) 68 public static MAYBE_FINAL long VERSION_CODE = _VERSION_CODE; 69#else 70 public static MAYBE_FINAL long VERSION_CODE = 1; 71#endif 72 73#if defined(_BUNDLES_SUPPORTED) 74 public static MAYBE_FINAL boolean BUNDLES_SUPPORTED = true; 75#else 76 public static MAYBE_FINAL boolean BUNDLES_SUPPORTED MAYBE_FALSE; 77#endif 78 79#if defined(_IS_INCREMENTAL_INSTALL) 80 public static MAYBE_FINAL boolean IS_INCREMENTAL_INSTALL = true; 81#else 82 public static MAYBE_FINAL boolean IS_INCREMENTAL_INSTALL MAYBE_FALSE; 83#endif 84 85#if defined(_ISOLATED_SPLITS_ENABLED) 86 public static MAYBE_FINAL boolean ISOLATED_SPLITS_ENABLED = true; 87#else 88 public static MAYBE_FINAL boolean ISOLATED_SPLITS_ENABLED MAYBE_FALSE; 89#endif 90 91#if defined(_IS_FOR_TEST) 92 public static MAYBE_FINAL boolean IS_FOR_TEST = true; 93#else 94 public static MAYBE_FINAL boolean IS_FOR_TEST MAYBE_FALSE; 95#endif 96 97#if defined(_WRITE_CLANG_PROFILING_DATA) 98 public static MAYBE_FINAL boolean WRITE_CLANG_PROFILING_DATA = true; 99#else 100 public static MAYBE_FINAL boolean WRITE_CLANG_PROFILING_DATA MAYBE_FALSE; 101#endif 102} 103