File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,13 @@ private object Api29Impl {
56
56
```
57
57
58
58
When developing against pre-release SDKs where the ` SDK_INT ` has not been
59
- finalized, SDK checks ** must** use ` BuildCompat.isAtLeastX() ` methods.
59
+ finalized, SDK checks ** must** use ` BuildCompat.isAtLeastX() ` methods and
60
+ ** must** use a tip-of-tree ` project ` dependency to ensure that the
61
+ implementation of ` BuildCompat ` stays up-to-date when the SDK is finalized.
62
+
63
+ ** Do not** assume that the next SDK release's ` SDK_INT ` will be N+1. The value
64
+ is not finalized until SDK finalization happens, at which point the ` isAtLeast `
65
+ check will be updated. ** Never** write your own check for a pre-release SDK.
60
66
61
67
``` java {.good}
62
68
@NonNull
@@ -68,6 +74,12 @@ public static List<Window> getAllWindows() {
68
74
}
69
75
```
70
76
77
+ ``` kotlin {.good}
78
+ dependencies {
79
+ api(project(" :core:core" ))
80
+ }
81
+ ```
82
+
71
83
##### Preventing invalid casting {#compat-casting}
72
84
73
85
Even when a call to a new API is moved to a version-specific class, a class
You can’t perform that action at this time.
0 commit comments