| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.base; | 5 package org.chromium.base; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Build configuration. Generated on a per-target basis. | 8 * Build configuration. Generated on a per-target basis. |
| 9 */ | 9 */ |
| 10 public class BuildConfig { | 10 public class BuildConfig { |
| 11 | 11 |
| 12 /** Whether multidex is enabled for this target. | 12 /** Whether multidex is enabled for this target. |
| 13 * | 13 * |
| 14 * This has to be a function instead of a static final boolean s.t. the ini
tial false value | 14 * This has to be a function instead of a static final boolean s.t. the ini
tial false value |
| 15 * doesn't get optimized into {@link ChromiumMultiDexInstaller} at base_jav
a compile time. | 15 * doesn't get optimized into {@link ChromiumMultiDexInstaller} at base_jav
a compile time. |
| 16 */ | 16 */ |
| 17 public static boolean isMultidexEnabled() { | 17 public static boolean isMultidexEnabled() { |
| 18 #if defined(ENABLE_MULTIDEX) | 18 #if defined(ENABLE_MULTIDEX) |
| 19 return true; | 19 return true; |
| 20 #else | 20 #else |
| 21 return false; | 21 return false; |
| 22 #endif | 22 #endif |
| 23 } | 23 } |
| 24 | 24 |
| 25 /** |
| 26 * Whether or not this target was built as part of an official build. |
| 27 * |
| 28 * This has to be a function instead of a static final boolean s.t. the init
ial false value |
| 29 * doesn't get optimized into {@link ChromeApplication} at base_java compile
time. |
| 30 */ |
| 31 public static boolean isOfficialBuild() { |
| 32 #if defined(IS_OFFICIAL_BUILD) |
| 33 return true; |
| 34 #else |
| 35 return false; |
| 36 #endif |
| 37 } |
| 38 |
| 25 // DCHECK_IS_ON does not change between targets, can be final and optimized
out. | 39 // DCHECK_IS_ON does not change between targets, can be final and optimized
out. |
| 26 #if defined(_DCHECK_IS_ON) | 40 #if defined(_DCHECK_IS_ON) |
| 27 public static final boolean DCHECK_IS_ON = true; | 41 public static final boolean DCHECK_IS_ON = true; |
| 28 #else | 42 #else |
| 29 public static final boolean DCHECK_IS_ON = false; | 43 public static final boolean DCHECK_IS_ON = false; |
| 30 #endif | 44 #endif |
| 31 | 45 |
| 32 // Sorted list of locales that have a compressed .pak within assets. | 46 // Sorted list of locales that have a compressed .pak within assets. |
| 33 // Stored as an array because AssetManager.list() is slow. | 47 // Stored as an array because AssetManager.list() is slow. |
| 34 public static final String[] COMPRESSED_LOCALES = | 48 public static final String[] COMPRESSED_LOCALES = |
| 35 #if defined(COMPRESSED_LOCALE_LIST) | 49 #if defined(COMPRESSED_LOCALE_LIST) |
| 36 COMPRESSED_LOCALE_LIST; | 50 COMPRESSED_LOCALE_LIST; |
| 37 #else | 51 #else |
| 38 {}; | 52 {}; |
| 39 #endif | 53 #endif |
| 40 | 54 |
| 41 // Sorted list of locales that have an uncompressed .pak within assets. | 55 // Sorted list of locales that have an uncompressed .pak within assets. |
| 42 // Stored as an array because AssetManager.list() is slow. | 56 // Stored as an array because AssetManager.list() is slow. |
| 43 public static final String[] UNCOMPRESSED_LOCALES = | 57 public static final String[] UNCOMPRESSED_LOCALES = |
| 44 #if defined(UNCOMPRESSED_LOCALE_LIST) | 58 #if defined(UNCOMPRESSED_LOCALE_LIST) |
| 45 UNCOMPRESSED_LOCALE_LIST; | 59 UNCOMPRESSED_LOCALE_LIST; |
| 46 #else | 60 #else |
| 47 {}; | 61 {}; |
| 48 #endif | 62 #endif |
| 63 |
| 64 // TODO(estevenson): comment. |
| 65 public static final String[] MAIN_DEX_CLASSES = |
| 66 #if defined(MAIN_DEX_CLASSES_LIST) |
| 67 MAIN_DEX_CLASSES_LIST; |
| 68 #else |
| 69 {}; |
| 70 #endif |
| 49 } | 71 } |
| OLD | NEW |