blob: 2ba5908686b49a76e092aacf404f75e6df6a9960 [file] [log] [blame] [view]
Clément Béra9e25c1e2020-04-30 08:28:50 +00001# Description of the desugared library configuration file
clementbera1764a862019-08-20 15:26:46 +02002
3## Version
4
Søren Gjesse6e5e5842019-09-03 08:48:30 +02005The first field `configuration_format_version` encodes a versioning number internal to R8/D8
6in the form of an unsigned integer. It allows R8/D8 to know if the file given is supported.
clementbera1764a862019-08-20 15:26:46 +02007Non-backward compatible changes to the desugared library increase the version number, and such
8library cannot be compiled without upgrading R8/D8 to the latest version.
9
Clément Béra9e25c1e2020-04-30 08:28:50 +000010The fields `group_id` and `artifact_id` are maven-coordinated ids for the desugared library
11configuration file.
12
13The field `version` holds the version of the content for the configuration. This number
Søren Gjesse6e5e5842019-09-03 08:48:30 +020014must be updated each time the configuration is changed.
15
Clément Béra9e25c1e2020-04-30 08:28:50 +000016A unique identifier is generated for the desugared library configuration using
17`group_id:artifact_id:version`.
18
clementbera1764a862019-08-20 15:26:46 +020019## Required compilation API level
20
Clément Béra9e25c1e2020-04-30 08:28:50 +000021The field `required_compilation_api_level` encodes the minimal Android API level required for
clementbera1764a862019-08-20 15:26:46 +020022the desugared library to be compiled correctly. If the API of library used for compilation of the
23library or a program using the library is lower than this level, one has to upgrade the SDK version
24used to be able to use desugared libraries.
25
26## Library and program flags
27
Clément Béra9e25c1e2020-04-30 08:28:50 +000028The fields `library_flags` and `program_flags` include the set of flags required for respectively
29the library and the program using the desugared library compilation. The sets of flags are
30different depending on the min API level used. The flags are in a list, where each list entry
31specifies up to which min API level the set of flags should be applied. During compilation,
32R8/D8 adds up all the required flags for the min API level specified at compilation.
clementbera1764a862019-08-20 15:26:46 +020033
Clément Béra9e25c1e2020-04-30 08:28:50 +000034For example, let's say the `program_flags` have entries for `api_level_below_or_equal` 20, 24 and
3526. If compiling the program for min API 24, R8/D8 will use both the set of flags for API 24 and
3626 (24 <= 24, 24 <= 26 but !(24 <= 20)).
clementbera1764a862019-08-20 15:26:46 +020037
clementbera3c2bf4f2019-11-08 09:55:40 +010038## Extra keep rules
39
40The last field is `extra_keep_rules`, it includes keep rules that are appended by L8 when shrinking
41the desugared library. It includes keep rules related to reflection inside the desugared library,
42related to enum to have EnumSet working and to keep the j$ prefix.
43
clementbera1764a862019-08-20 15:26:46 +020044## Copyright
45
46Copyright (c) 2019, the R8 project authors. Please see the AUTHORS file
47for details. All rights reserved. Use of this source code is governed by a
48BSD-style license that can be found in the LICENSE file.