Fixed
Status Update
Comments
al...@google.com <al...@google.com> #2
Some things to work out before making the annotations type-use:
- Determine guidelines for type nullability in public API
- Determine rules for when type nullability can change in public API
- Confirm that intellij nullability lint works as expected for type-use nullability annotations
- Test what the impact would be on existing arrays (due to ambiguities of type-use annotations on arrays)
- Confirm usage of type-use
androidx.annotation.NonNull/Nullable
in metalava won't break anything for platform
al...@google.com <al...@google.com> #4
al...@google.com <al...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit 558f17c6f9e237897fcc87fa556ca4af5c1808c6
Author: Julia McClellan <juliamcclellan@google.com>
Date: Thu Sep 19 14:50:25 2024
Add JSpecify to list of Dackka allowed nullness annotations
Test: Compared the output of `./gradlew docs-tip-of-tree:docs` with the current codebase and aosp/3190072, which switches all nullness annotations to jspecify. Only observed changes were updated nullness annotation links and additional copies of some inherited methods when a parent used a different nullness annotation (similar to b/280845383 )
Bug: 326456246
Change-Id: I40ede9c84dbae3a1ac7d3d4e98f77a56e119caaa
M buildSrc/private/src/main/kotlin/androidx/build/docs/AndroidXDocsImplPlugin.kt
https://android-review.googlesource.com/3272873
Branch: androidx-main
commit 558f17c6f9e237897fcc87fa556ca4af5c1808c6
Author: Julia McClellan <juliamcclellan@google.com>
Date: Thu Sep 19 14:50:25 2024
Add JSpecify to list of Dackka allowed nullness annotations
Test: Compared the output of `./gradlew docs-tip-of-tree:docs` with the current codebase and aosp/3190072, which switches all nullness annotations to jspecify. Only observed changes were updated nullness annotation links and additional copies of some inherited methods when a parent used a different nullness annotation (similar to
Bug: 326456246
Change-Id: I40ede9c84dbae3a1ac7d3d4e98f77a56e119caaa
M buildSrc/private/src/main/kotlin/androidx/build/docs/AndroidXDocsImplPlugin.kt
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit c8f5025ba9bf1deb5effbebb7e79683ee7ff9f50
Author: Julia McClellan <juliamcclellan@google.com>
Date: Fri Sep 20 12:31:45 2024
Add JSpecify package-list
Bug: 326456246
Test: checking links in output of `./gradlew docs-tip-of-tree:docs` with aosp/3190072 which switches annotations to jspecify
Change-Id: Ic52ecc37cfb84002ba830dfca6186db2dc5bae67
M buildSrc/private/src/main/kotlin/androidx/build/dackka/DackkaTask.kt
A docs-public/package-lists/jspecify/package-list
https://android-review.googlesource.com/3275171
Branch: androidx-main
commit c8f5025ba9bf1deb5effbebb7e79683ee7ff9f50
Author: Julia McClellan <juliamcclellan@google.com>
Date: Fri Sep 20 12:31:45 2024
Add JSpecify package-list
Bug: 326456246
Test: checking links in output of `./gradlew docs-tip-of-tree:docs` with aosp/3190072 which switches annotations to jspecify
Change-Id: Ic52ecc37cfb84002ba830dfca6186db2dc5bae67
M buildSrc/private/src/main/kotlin/androidx/build/dackka/DackkaTask.kt
A docs-public/package-lists/jspecify/package-list
al...@google.com <al...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
commit b05578cabee04fdccd2f24c7e2d6a8b25b94a97a
Author: Julia McClellan <juliamcclellan@google.com>
Date: Mon Sep 23 11:21:48 2024
Add java format task
Will be used by the jspecify update script
Bug: 326456246
Test: `./gradlew core:core:javaFormat`, `./gradlew core:core:javaFormat --fix-imports-only` to check java diffs. `./gradlew paging:paging-guava:javaFormat` to check the task succeeds for a project with no java files
Change-Id: I6027419d4ad520a4bd82decd009d252b7077d8a6
M buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt
A buildSrc/private/src/main/kotlin/androidx/build/JavaFormat.kt
M gradle/libs.versions.toml
https://android-review.googlesource.com/3277031
Branch: androidx-main
commit b05578cabee04fdccd2f24c7e2d6a8b25b94a97a
Author: Julia McClellan <juliamcclellan@google.com>
Date: Mon Sep 23 11:21:48 2024
Add java format task
Will be used by the jspecify update script
Bug: 326456246
Test: `./gradlew core:core:javaFormat`, `./gradlew core:core:javaFormat --fix-imports-only` to check java diffs. `./gradlew paging:paging-guava:javaFormat` to check the task succeeds for a project with no java files
Change-Id: I6027419d4ad520a4bd82decd009d252b7077d8a6
M buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt
A buildSrc/private/src/main/kotlin/androidx/build/JavaFormat.kt
M gradle/libs.versions.toml
al...@google.com <al...@google.com>
bu...@google.com <bu...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
commit 7d0e9ad06dd1a8372872053b882be71ec2208df7
Author: Julia McClellan <juliamcclellan@google.com>
Date: Fri Sep 20 13:55:03 2024
Add script to migrate projects to JSpecify
This script runs lint to update usage of AndroidX nullness annotations to type-use position, switches the imports to point to JSpecify, and adds a dependency in each build.gradle file.
Bug: 326456246
Test: `development/jspecify_update.py` runs over all projects and created aosp/3190072. Tested `development/jspecify_update.py cursoradapter` to run over a specific directory.
Change-Id: Id0b0620d4d2dd12f88bdd6ece6885b8abb7b7843
A development/jspecify_update.py
https://android-review.googlesource.com/3275093
Branch: androidx-main
commit 7d0e9ad06dd1a8372872053b882be71ec2208df7
Author: Julia McClellan <juliamcclellan@google.com>
Date: Fri Sep 20 13:55:03 2024
Add script to migrate projects to JSpecify
This script runs lint to update usage of AndroidX nullness annotations to type-use position, switches the imports to point to JSpecify, and adds a dependency in each build.gradle file.
Bug: 326456246
Test: `development/jspecify_update.py` runs over all projects and created aosp/3190072. Tested `development/jspecify_update.py cursoradapter` to run over a specific directory.
Change-Id: Id0b0620d4d2dd12f88bdd6ece6885b8abb7b7843
A development/jspecify_update.py
ap...@google.com <ap...@google.com> #9
Project: platform/frameworks/support
Branch: androidx-main
commit 619650cc911ddda040d11f5162d6cdd3bcd48b04
Author: Julia McClellan <juliamcclellan@google.com>
Date: Mon Sep 23 11:38:03 2024
Add kotlin compiler args for JSpecify
These arguments make the kotlin compiler enforce correct usage of jspecify nullness annotations. They will become default in language version 2.1 but are needed until then.
Bug: 326456246
Test: Local testing of running `compileKotlin` when using jspecify nullness incorrectly
Change-Id: I635baf825df0e67d489879dcb2e812b3ee3cffb4
M buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt
https://android-review.googlesource.com/3277032
Branch: androidx-main
commit 619650cc911ddda040d11f5162d6cdd3bcd48b04
Author: Julia McClellan <juliamcclellan@google.com>
Date: Mon Sep 23 11:38:03 2024
Add kotlin compiler args for JSpecify
These arguments make the kotlin compiler enforce correct usage of jspecify nullness annotations. They will become default in language version 2.1 but are needed until then.
Bug: 326456246
Test: Local testing of running `compileKotlin` when using jspecify nullness incorrectly
Change-Id: I635baf825df0e67d489879dcb2e812b3ee3cffb4
M buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt
ap...@google.com <ap...@google.com> #10
Project: platform/frameworks/support
Branch: androidx-main
Author: Julia McClellan <
Link:
Migrate cursoradapter to use JSpecify annotations
Expand for full commit details
Migrate cursoradapter to use JSpecify annotations
CL created by running `development/jspecify_update.py cursoradapter`
This is the first test of switching to JSpecify annotations. cursoradapter was chosen to check that google3 drops go smoothly because:
* Only a few files need updating
* There have been no recent code updates so merge conflicts are unlikely
* There are usages of it in google3
* No other libraries have a tip-of-tree dependency on it
Bug: 326456246
Test: `checkApi`, `lint`, `runErrorProne` for `cursoradapter:cursoradapter`
Relnote: "This library now uses [JSpecify nullness annotations](https://jspecify.dev/), which are type-use. Kotlin developers should use the following compiler arguments to enforce correct usage: -Xjspecify-annotations=strict, -Xtype-enhancement-improvements-strict-mode"
Change-Id: I02c0c11b0cd80d4a725dc78bb1cff0de937927cf
Files:
- M
cursoradapter/cursoradapter/build.gradle
- M
cursoradapter/cursoradapter/src/main/java/androidx/cursoradapter/widget/CursorAdapter.java
- M
cursoradapter/cursoradapter/src/main/java/androidx/cursoradapter/widget/CursorFilter.java
- M
cursoradapter/cursoradapter/src/main/java/androidx/cursoradapter/widget/ResourceCursorAdapter.java
- M
cursoradapter/cursoradapter/src/main/java/androidx/cursoradapter/widget/SimpleCursorAdapter.java
Hash: 7be429cb0f283d0ba3f2dfcc3355e7a5eea47a6c
Date: Mon Sep 23 12:09:09 2024
Description
The conditional compatibility checking based on experimental annotations only checks if an API is currently experimental, and raises compatibility errors if a previously experimental API changes. This creates compatibility errors that weren't present before.
As an example:
androidx.benchmark.macro.junit4.BaselineProfileRule
was experimental in 1.1.0-beta05 with a method namedcollectBaselineProfile
.public_plus_experimental_1.1.0-beta05.txt
but not1.1.0-beta05.txt
.BaselineProfileRule
had the experimental annotation removed, and thecollectBaselineProfile
method was renamed tocollect
.BaselineProfileRule
was previously experimental and not present in1.1.0-beta05.txt
, renaming thecollect
method did not cause a compatibility error.1.1.0-beta05.txt
adds an entry forBaselineProfileRule
with the experimental annotation since experimental APIs are now tracked in the main API file.checkApi
for1.1.0-beta05.txt
andcurrent.txt
now raises a compatibility error saying the methodcollectBaselineProfile
was removed.