| 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 /** Whether this target was built for an official build or not. |
| 26 * |
| 27 * This has to be a function instead of a static final boolean s.t. the ini
tial false value |
| 28 * doesn't get optimized into {@link ChromeApplication} at base_java compil
e time. |
| 29 */ |
| 30 public static boolean isOfficialBuild() { |
| 31 #if defined(IS_OFFICIAL_BUILD) |
| 32 return true; |
| 33 #else |
| 34 return false; |
| 35 #endif |
| 36 } |
| 37 |
| 25 // DCHECK_IS_ON does not change between targets, can be final and optimized
out. | 38 // DCHECK_IS_ON does not change between targets, can be final and optimized
out. |
| 26 #if defined(_DCHECK_IS_ON) | 39 #if defined(_DCHECK_IS_ON) |
| 27 public static final boolean DCHECK_IS_ON = true; | 40 public static final boolean DCHECK_IS_ON = true; |
| 28 #else | 41 #else |
| 29 public static final boolean DCHECK_IS_ON = false; | 42 public static final boolean DCHECK_IS_ON = false; |
| 30 #endif | 43 #endif |
| 31 | 44 |
| 32 // Sorted list of locales that have a compressed .pak within assets. | 45 // Sorted list of locales that have a compressed .pak within assets. |
| 33 // Stored as an array because AssetManager.list() is slow. | 46 // Stored as an array because AssetManager.list() is slow. |
| 34 public static final String[] COMPRESSED_LOCALES = | 47 public static final String[] COMPRESSED_LOCALES = |
| 35 #if defined(COMPRESSED_LOCALE_LIST) | 48 #if defined(COMPRESSED_LOCALE_LIST) |
| 36 COMPRESSED_LOCALE_LIST; | 49 COMPRESSED_LOCALE_LIST; |
| 37 #else | 50 #else |
| 38 {}; | 51 {}; |
| 39 #endif | 52 #endif |
| 40 | 53 |
| 41 // Sorted list of locales that have an uncompressed .pak within assets. | 54 // Sorted list of locales that have an uncompressed .pak within assets. |
| 42 // Stored as an array because AssetManager.list() is slow. | 55 // Stored as an array because AssetManager.list() is slow. |
| 43 public static final String[] UNCOMPRESSED_LOCALES = | 56 public static final String[] UNCOMPRESSED_LOCALES = |
| 44 #if defined(UNCOMPRESSED_LOCALE_LIST) | 57 #if defined(UNCOMPRESSED_LOCALE_LIST) |
| 45 UNCOMPRESSED_LOCALE_LIST; | 58 UNCOMPRESSED_LOCALE_LIST; |
| 46 #else | 59 #else |
| 47 {}; | 60 {}; |
| 48 #endif | 61 #endif |
| 49 } | 62 } |
| OLD | NEW |