You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Updated Icons from Acorn repo
* Update acorn icons script with single source of thruth
* Update sync acorn icons script to take into account ExtraSmall size
* Add documentation for sync_acorns_icons.py as file header
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Filippo <fzazzeroni@mozilla.com>
Copy file name to clipboardexpand all lines: sync_acorn_icons.py
+60-17
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,41 @@
4
4
importshutil
5
5
importsubprocess
6
6
7
+
"""
8
+
This script automates the process of fetching, syncing, and organizing Acorn icons for the Firefox iOS project.
9
+
It performs the following tasks:
10
+
1. Fetches the latest release of the Acorn icons repository from GitHub.
11
+
2. Saves the latest release information locally to detect if a new release needs to be synced.
12
+
3. Downloads the icons from the latest release and synchronizes them with the project's asset folder.
13
+
4. Sorts icons into categories based on their size (e.g., ExtraSmall, Small, Large, etc.).
14
+
5. Generates the StandardImageIdentifiers.swift from BrowserKit's Common package.
15
+
16
+
Important:
17
+
- If a new size needs to be added, modify the `TARGET_SIZES` list by adding the appropriate tuple item.
18
+
The tuple is composed of:
19
+
- The first item: the directory name where the Acorn icons for that size are stored (e.g., for the "ExtraSmall" category,
20
+
the icons are stored in `mobile/8`).
21
+
- The second item: the size category used in the file names and in the `StandardImageIdentifiers.swift` structures (e.g., "ExtraSmall").
22
+
23
+
Usage:
24
+
- This script is designed to be run periodically by a Github action.
25
+
- It will automatically detect and download new releases, update the asset folder, and regenerate the image identifiers.
26
+
27
+
If you want to test the script locally make sure to have all the required packages installed and remove the root json file `latest_acorn_release.json`.
28
+
Then run `python3 sync_acorn_icons.py`. All the time the script is run the `latest_acorn_release.json` is created so if you see nothing in the console
29
+
remove this file first.
30
+
"""
31
+
32
+
# List the target sizes that now are supported from FXIOS
0 commit comments