Opened on 06/21/2018 at 04:28:11 PM
Closed on 08/30/2019 at 05:03:00 PM
#6757 closed change (rejected)
Static assets automation in metadata.chrome
| Reported by: | agiammarchi | Assignee: | |
|---|---|---|---|
| Priority: | Unknown | Milestone: | |
| Module: | Automation | Keywords: | |
| Cc: | greiner, saroyanm, sebastian, tlucas, erikvold, geo | Blocked By: | |
| Blocking: | Platform: | Unknown / Cross platform | |
| Ready: | no | Confidential: | no |
| Tester: | Unknown | Verified working: | no |
| Review URL(s): | |||
Description (last modified by agiammarchi)
Background
Beside logic oriented files such .js, .css, or even .html, we are manually maintaining, and updating, with needs for synchronization, all static assets that ABP web extension needs to publish.
Not only this is potentially error prone (forgotten asset, not caught by the meta file but failing in production), this also requires needlessly more effort.
What to change
Generate the metadata.chrome file on features freeze through a template and an automation for at least ABP UI assets.
Example, given the following bash script:
#!/usr/bin/env bash
outputMeta() {
local file
local index
local path
local folder="$1"
local startfrom="$2"
local length=${#startfrom}
cd $folder > /dev/null
for file in $(ls $folder); do
if [ -d $folder/$file ]; then
outputMeta $folder/$file $startfrom
elif [[ ! "$file" =~ \.js$|\.css$|\.html$ ]]; then
index=$(strindex "$folder/$file" "$startfrom")
path="$folder/$file"
echo "${path:($index + $length + 1)} = ${path:($index)}"
fi
done
cd - > /dev/null
}
strindex() {
x="${1%%$2*}"
[[ "$x" = "$1" ]] && echo -1 || echo "${#x}"
}
# outputMeta ~/git/adblockplusui/skin adblockplusui
outputMeta $1 $2
it is possible to generate all skin related assets in output, after a chmod a+x skin.sh, via:
./skin.sh ~/git/adblockplusui/skin adblockplus
passing where is the current/desired adblockplusui/skin folder, and outputting automatically the list of assets.
Attachments (0)
Change History (7)
comment:1 Changed on 06/21/2018 at 04:31:09 PM by tlucas
- Cc greiner saroyanm sebastian kzar tlucas added
comment:2 Changed on 06/21/2018 at 04:37:11 PM by kzar
- Cc kzar removed
comment:6 Changed on 11/15/2018 at 03:25:25 AM by erikvold
- Cc erikvold added
comment:7 Changed on 08/30/2019 at 05:03:00 PM by sebastian
- Cc geo added
- Resolution set to rejected
- Status changed from new to closed

Maybe we can discover assets in automatically with our new build suite, Geo is working on. But as our legacy buildtools are on the way out, we won't address it there for the time being.