clementbera | 1764a86 | 2019-08-20 15:26:46 +0200 | [diff] [blame] | 1 | # Description of the core library configuration file |
| 2 | |
| 3 | ## Version |
| 4 | |
Søren Gjesse | 6e5e584 | 2019-09-03 08:48:30 +0200 | [diff] [blame] | 5 | The first field `configuration_format_version` encodes a versioning number internal to R8/D8 |
| 6 | in the form of an unsigned integer. It allows R8/D8 to know if the file given is supported. |
clementbera | 1764a86 | 2019-08-20 15:26:46 +0200 | [diff] [blame] | 7 | Non-backward compatible changes to the desugared library increase the version number, and such |
| 8 | library cannot be compiled without upgrading R8/D8 to the latest version. |
| 9 | |
Søren Gjesse | 6e5e584 | 2019-09-03 08:48:30 +0200 | [diff] [blame] | 10 | The second field `version` holds the version of the content for the configuration. This number |
| 11 | must be updated each time the configuration is changed. |
| 12 | |
clementbera | 1764a86 | 2019-08-20 15:26:46 +0200 | [diff] [blame] | 13 | ## Required compilation API level |
| 14 | |
Søren Gjesse | 6e5e584 | 2019-09-03 08:48:30 +0200 | [diff] [blame] | 15 | The third field `required_compilation_api_level` encodes the minimal Android API level required for |
clementbera | 1764a86 | 2019-08-20 15:26:46 +0200 | [diff] [blame] | 16 | the desugared library to be compiled correctly. If the API of library used for compilation of the |
| 17 | library or a program using the library is lower than this level, one has to upgrade the SDK version |
| 18 | used to be able to use desugared libraries. |
| 19 | |
| 20 | ## Library and program flags |
| 21 | |
clementbera | 3c2bf4f | 2019-11-08 09:55:40 +0100 | [diff] [blame] | 22 | The fourth and fifth fields are `library_flags` and `program_flags`. They include the set of flags |
clementbera | 1764a86 | 2019-08-20 15:26:46 +0200 | [diff] [blame] | 23 | required for respectively the library and the program using the desugared library compilation. The |
| 24 | sets of flags are different depending on the min API level used. The flags are in a list, where |
| 25 | each list entry specifies up to which min API level the set of flags should be applied. During |
| 26 | compilation, R8/D8 adds up all the required flags for the min API level specified at compilation. |
| 27 | |
| 28 | For example, let's say the `program_flags` have entries for `api_level_below_or_equal` 20, 24 and 26. |
| 29 | If compiling the program for min API 24, R8/D8 will use both the set of flags for API 24 and 26 |
| 30 | (24 <= 24, 24 <= 26 but !(24 <= 20)). |
| 31 | |
clementbera | 3c2bf4f | 2019-11-08 09:55:40 +0100 | [diff] [blame] | 32 | ## Extra keep rules |
| 33 | |
| 34 | The last field is `extra_keep_rules`, it includes keep rules that are appended by L8 when shrinking |
| 35 | the desugared library. It includes keep rules related to reflection inside the desugared library, |
| 36 | related to enum to have EnumSet working and to keep the j$ prefix. |
| 37 | |
clementbera | 1764a86 | 2019-08-20 15:26:46 +0200 | [diff] [blame] | 38 | ## Copyright |
| 39 | |
| 40 | Copyright (c) 2019, the R8 project authors. Please see the AUTHORS file |
| 41 | for details. All rights reserved. Use of this source code is governed by a |
| 42 | BSD-style license that can be found in the LICENSE file. |