|
1 | 1 | # Update License Files |
2 | 2 |
|
3 | 3 | ## Apply patch generated by CI |
4 | | -If you're not working on a Linux box then you can't auto-generate license files. A workaround is provided via CI. |
5 | | - |
6 | | -Your build will fail one or more CI checks if your license files are not correct. Open the failing CI check. In the CI output you will find a patch diff that represents the changes that need to be made to your license files. |
| 4 | +If you're not working on a Linux box then you can't auto-generate license |
| 5 | +files. A workaround is provided via CI. |
| 6 | + |
| 7 | +Your build will fail one or more CI checks if your license files are not |
| 8 | +correct. Open the failing CI check. In the CI output you will find a |
| 9 | +patch diff that represents the changes that need to be made to your |
| 10 | +license files. |
| 11 | + |
| 12 | +> [!WARNING] |
| 13 | +> Do this only if the diff does not change _which_ licenses are being |
| 14 | +> included, but affects just the `FILE:` metadata and so forth in the |
| 15 | +> golden files. If the actual content of the licenses has changed, you |
| 16 | +> will need to rerun the script from a Linux box to update the actual |
| 17 | +> LICENSE file, as described below. |
| 18 | +
|
| 19 | +```sh |
| 20 | +cd flutter/ci/licenses_golden |
| 21 | +``` |
7 | 22 |
|
8 | | -IF (and only if!) the diff does not change _which_ licenses are being included, but only affects the `FILE:` metadata and so forth in the golden files, then you can click `Download full logs` (Github removes lines with only whitespaces, which invalidates the diff), copy this patch to a temporary patch file wherever you'd like, and then apply the patch to your repo: |
| 23 | +If the file is to `my/patch/file` locally. The `-p2` strips two path |
| 24 | +components from the file paths in the diff. Adjust as necessary. |
9 | 25 |
|
10 | | -``` |
11 | | -cd flutter/ci/licenses_golden |
| 26 | +```sh |
12 | 27 | patch -p2 < my/patch/file |
13 | 28 | ``` |
14 | 29 |
|
15 | | -HOWEVER, if the actual content of the licenses changed then you will need to rerun the script from a Linux box to update the actual LICENSE file, as described below. |
| 30 | +If the patch file is copied in your clipboard. On Mac, you may apply the patch from there. |
| 31 | + |
| 32 | +```sh |
| 33 | +pbpaste | patch -p2 |
| 34 | +``` |
| 35 | + |
| 36 | +## Check for license changes |
16 | 37 |
|
17 | | -## Check for license changes (Only works on Linux) |
| 38 | +> [!WARNING] |
| 39 | +> Only works on Linux. |
18 | 40 |
|
19 | 41 | This script has two sets of output files: "goldens", which describe |
20 | 42 | the current license state of the repository, and the actual real |
@@ -46,11 +68,12 @@ cp ../../../out/licenses/* ../../ci/licenses_golden |
46 | 68 | git diff |
47 | 69 | ``` |
48 | 70 |
|
49 | | -If the only changes are to what files are included, then you're good |
50 | | -to go. However, if any of the _licenses_ changed, whether new licenses |
51 | | -are added, old ones removed, or any have their content changed in |
52 | | -_any_ way (including, e.g., whitespace changes), or if the affected |
53 | | -libraries change, **you must update the actual license file**. |
| 71 | +> [!IMPORTANT] |
| 72 | +> If the only changes are to what files are included, then you're good |
| 73 | +> to go. However, if any of the _licenses_ changed, whether new licenses |
| 74 | +> are added, old ones removed, or any have their content changed in |
| 75 | +> _any_ way (including, e.g., whitespace changes), or if the affected |
| 76 | +> libraries change, **you must update the actual license file**. |
54 | 77 |
|
55 | 78 | The `sky/packages/sky_engine/LICENSE` file is the one actually |
56 | 79 | included in product releases and the one that should be updated any |
|
0 commit comments