Skip to content

Commit a2cb910

Browse files
authored
Added Docs For Updating to a New Java Version in CI (flutter#166159)
Added docs for updating to a new Java version in CI. Also added instructions on uploading new Java version pacakges to CIPD. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 30e53b0 commit a2cb910

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

docs/platforms/android/New-Android-version.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,19 @@ In the engine, you may follow [Upgrading Engine's Android API version](https://g
6666
- Example Framework PR: <https://github.com/flutter/flutter/pull/152498>.
6767
- Example Engine PR: <https://github.com/flutter/engine/pull/54186>.
6868

69+
##### Update Java Version in CI (Only for Java LTS Release)
70+
71+
Every few years Java releases a new Java LTS (long-term support) version, which typically
72+
becomes the industry standard for a few years. As users adopt the new Java LTS version, either
73+
directly or as part of the latest Android SDK, we want to update our CI to test against the new Java version
74+
to identify and address potential compatibility issues.
75+
76+
Upload the new Java Version package to CIPD following the instructions [here](/docs/platforms/android/Uploading-New-Java-Version-to-CIPD.md).
77+
78+
Update the usages of the current Java version to the new Java version in CI.
79+
80+
- Example PR: <https://github.com/flutter/flutter/pull/165210>.
81+
6982
#### Update documentation
7083

7184
Update documentation page to indicate the new API is tested
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Uploading New Java Version to CIPD
2+
3+
We store the Java Version package on CIPD for use on CI. For more information read the internal
4+
docs [here](http://go/luci-cipd).
5+
6+
Some links in the instructions below are Google-internal.
7+
8+
## Steps
9+
10+
### Request Access to CIPD
11+
12+
1. Request temporary write access to upload packages to CIPD
13+
via http://go/flutter-luci-cipd#requesting-write-read-access-to-cipd-packages.
14+
15+
2. Wait about 5-30 minutes for access rights to sync. To check if your rights have synced, see if
16+
you are a member of this
17+
group [here](https://chrome-infra-auth.appspot.com/auth/groups/google%[email protected]).
18+
19+
### Download the New Java Version and Set Up for CIPD Upload
20+
21+
3. Download the new Java version via OpenJDK (not Oracle's Java for licensing/legal
22+
reasons) [here](https://openjdk.org/projects/jdk/) for the following platforms:
23+
linux-amd64(aka x64), mac-arm64, mac-amd64, and windows-amd64.
24+
25+
4. Download the latest Java version from
26+
CIPD [here](https://chrome-infra-packages.appspot.com/p/flutter/java/openjdk) for the following
27+
platforms: linux-amd64(aka x64), mac-arm64, mac-amd64, and windows-amd64.
28+
29+
5. Unzip the new Java version and the latest version.
30+
31+
6. Add a file titled `openjdk.cipd.yaml` at the top-level directory. Copy the contents below into
32+
the file and replace contents in <> for your new Java version package:
33+
```sh
34+
package: flutter/java/openjdk/<platform-architecture>
35+
description: OpenJDK <java_version> for <platform>
36+
install_mode: copy
37+
data:
38+
# This directory contains Java <platform-architecture> to be used in automated tests.
39+
- dir: .
40+
```
41+
42+
Note: `linux-amd64` is an example of `<platform-architecture>`
43+
44+
7. Ensure the file/directory structure of the new Java version package to be uploaded is the same as
45+
the structure at the top-level of the latest from CIPD.
46+
This involves potentially deleting contents of the top-level directory.
47+
48+
### Upload to CIPD
49+
50+
8. To run CIPD commands, please run this command:
51+
52+
```sh
53+
cipd auth-login
54+
```
55+
56+
9. To upload the new Java version to CIPD, please run this command:
57+
58+
```sh
59+
cipd create -in <path_to_new_java_version_package> -name flutter/java/openjdk/<platform-architecture> -tag version:<java_version>
60+
```
61+
62+
Note: Please check you have the correct name, tags, package structure before uploading to CIPD
63+
because deleting the package on CIPD is difficult.
64+
65+
10. Check to see if your new Java version has successfully uploaded to CIPD by clicking on the
66+
relevant platform [here](https://chrome-infra-packages.appspot.com/p/flutter/java/openjdk).
67+
68+
### Troubleshooting CIPD (Optional)
69+
70+
If you accidentally uploaded the incorrect package to CIPD, you can delete the tag using these
71+
instructions [here](go/flutter-luci-playbook#remove-duplicated-cipd-tags).
72+
Then, re-upload the correct Java version pacakge to CIPD.

0 commit comments

Comments
 (0)