Clément Béra | 9e25c1e | 2020-04-30 08:28:50 +0000 | [diff] [blame] | 1 | # Description of the desugared library configuration file |
clementbera | 1764a86 | 2019-08-20 15:26:46 +0200 | [diff] [blame] | 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 | |
Clément Béra | 9e25c1e | 2020-04-30 08:28:50 +0000 | [diff] [blame] | 10 | The fields `group_id` and `artifact_id` are maven-coordinated ids for the desugared library |
| 11 | configuration file. |
| 12 | |
| 13 | The field `version` holds the version of the content for the configuration. This number |
Søren Gjesse | 6e5e584 | 2019-09-03 08:48:30 +0200 | [diff] [blame] | 14 | must be updated each time the configuration is changed. |
| 15 | |
Clément Béra | 9e25c1e | 2020-04-30 08:28:50 +0000 | [diff] [blame] | 16 | A unique identifier is generated for the desugared library configuration using |
| 17 | `group_id:artifact_id:version`. |
| 18 | |
clementbera | 1764a86 | 2019-08-20 15:26:46 +0200 | [diff] [blame] | 19 | ## Required compilation API level |
| 20 | |
Clément Béra | 9e25c1e | 2020-04-30 08:28:50 +0000 | [diff] [blame] | 21 | The field `required_compilation_api_level` encodes the minimal Android API level required for |
clementbera | 1764a86 | 2019-08-20 15:26:46 +0200 | [diff] [blame] | 22 | the desugared library to be compiled correctly. If the API of library used for compilation of the |
| 23 | library or a program using the library is lower than this level, one has to upgrade the SDK version |
| 24 | used to be able to use desugared libraries. |
| 25 | |
| 26 | ## Library and program flags |
| 27 | |
Clément Béra | 9e25c1e | 2020-04-30 08:28:50 +0000 | [diff] [blame] | 28 | The fields `library_flags` and `program_flags` include the set of flags required for respectively |
| 29 | the library and the program using the desugared library compilation. The sets of flags are |
| 30 | different depending on the min API level used. The flags are in a list, where each list entry |
| 31 | specifies up to which min API level the set of flags should be applied. During compilation, |
| 32 | R8/D8 adds up all the required flags for the min API level specified at compilation. |
clementbera | 1764a86 | 2019-08-20 15:26:46 +0200 | [diff] [blame] | 33 | |
Clément Béra | 9e25c1e | 2020-04-30 08:28:50 +0000 | [diff] [blame] | 34 | For example, let's say the `program_flags` have entries for `api_level_below_or_equal` 20, 24 and |
| 35 | 26. If compiling the program for min API 24, R8/D8 will use both the set of flags for API 24 and |
| 36 | 26 (24 <= 24, 24 <= 26 but !(24 <= 20)). |
clementbera | 1764a86 | 2019-08-20 15:26:46 +0200 | [diff] [blame] | 37 | |
clementbera | 3c2bf4f | 2019-11-08 09:55:40 +0100 | [diff] [blame] | 38 | ## Extra keep rules |
| 39 | |
| 40 | The last field is `extra_keep_rules`, it includes keep rules that are appended by L8 when shrinking |
| 41 | the desugared library. It includes keep rules related to reflection inside the desugared library, |
| 42 | related to enum to have EnumSet working and to keep the j$ prefix. |
| 43 | |
clementbera | 1764a86 | 2019-08-20 15:26:46 +0200 | [diff] [blame] | 44 | ## Copyright |
| 45 | |
| 46 | Copyright (c) 2019, the R8 project authors. Please see the AUTHORS file |
| 47 | for details. All rights reserved. Use of this source code is governed by a |
| 48 | BSD-style license that can be found in the LICENSE file. |