Skip to content

Commit

Permalink
Prepare for release 0.10.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers committed Jun 9, 2021
1 parent de41153 commit 53569ae
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 19 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Changelog
=========

0.10.0
------

_2021-06-09_

* Core Library Desugaring is now fully supported. See its
[section](https://slackhq.github.io/keeper/#core-library-desugaring-l8-support) in on the project
site for more details!
* The `keeper.enableL8RuleSharing` Gradle API is now deprecated and does nothing. L8 support is
automatically enabled if `android.compileOptions.coreLibraryDesugaringEnabled` is true in AGP.

0.9.0
-----

Expand Down
18 changes: 0 additions & 18 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,24 +133,6 @@ keeper {
}
```

## Core Library Desugaring (L8) Support

Library Desugaring (L8) was introduced in Android Gradle Plugin 4.0. To make this work, the R8 task
will generate proguard rules indicating which `j$` types are used in source, which the `L8DexDesugarLibTask`
then uses to know which desugared APIs to keep. This approach can have flaws at runtime though, as the
classpath of the test APK may not have the right `j$` classes available on its classpath to run app
code it is invoking. To work around this, Keeper does two things:

1. Keeper merges generated L8 rules from both the androidTest and target app to ensure they cover all
used APIs. These merged rules are given to the target app `L8DexDesugarLibTask`.
2. L8 will still, by default, generate a dex file of backported APIs into both the test app and target
app, which can cause confusing runtime classpath issues due to L8 generating different implementations
in each app. Keeper works around this by forcing the use of a single dex file in the target app and
preventing the inclusion of a backport dex file in the test app.

This L8 support is automatically enabled if `android.compileOptions.coreLibraryDesugaringEnabled` is
true in AGP.

## TraceReferences

!!! warning "Heads up!"
Expand Down
18 changes: 18 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,24 @@ automatically run as part of the target app variant's full minified APK.
The tasks themselves take roughly ~20 seconds total extra work in our Slack android app, with the
infer and app jar tasks each taking around 8-10 seconds and the androidTest jar taking around 2 seconds.

## Core Library Desugaring (L8) Support

Library Desugaring (L8) was introduced in Android Gradle Plugin 4.0. To make this work, the R8 task
will generate proguard rules indicating which `j$` types are used in source, which the `L8DexDesugarLibTask`
then uses to know which desugared APIs to keep. This approach can have flaws at runtime though, as the
classpath of the test APK may not have the right `j$` classes available on its classpath to run app
code it is invoking. To work around this, Keeper does two things:

1. Keeper merges generated L8 rules from both the androidTest and target app to ensure they cover all
used APIs. These merged rules are given to the target app `L8DexDesugarLibTask`.
2. L8 will still, by default, generate a dex file of backported APIs into both the test app and target
app, which can cause confusing runtime classpath issues due to L8 generating different implementations
in each app. Keeper works around this by forcing the use of a single dex file in the target app and
preventing the inclusion of a backport dex file in the test app.

This L8 support is automatically enabled if `android.compileOptions.coreLibraryDesugaringEnabled` is
true in AGP.

License
-------

Expand Down
2 changes: 1 addition & 1 deletion keeper-gradle-plugin/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ POM_NAME=Keeper
POM_ARTIFACT_ID=keeper
POM_PACKAGING=jar
GROUP=com.slack.keeper
VERSION_NAME=0.10.0-SNAPSHOT
VERSION_NAME=0.10.0
POM_DESCRIPTION=A Gradle plugin that infers Proguard/R8 keep rules for androidTest sources.
POM_URL=https://github.com/slackhq/keeper/
POM_SCM_URL=https://github.com/slackhq/keeper/
Expand Down

0 comments on commit 53569ae

Please sign in to comment.