Opened 14 months ago

Last modified 9 months ago

#6757 new change

Static assets automation in

Reported by: agiammarchi Assignee:
Priority: Unknown Milestone:
Module: Automation Keywords:
Cc: greiner, saroyanm, sebastian, tlucas, erikvold Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by agiammarchi)


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 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")
      echo "${path:($index + $length + 1)} = ${path:($index)}"
  cd - > /dev/null

strindex() { 
  [[ "$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, via:

./ ~/git/adblockplusui/skin adblockplus

passing where is the current/desired adblockplusui/skin folder, and outputting automatically the list of assets.

Change History (6)

comment:1 Changed 14 months ago by tlucas

  • Cc greiner saroyanm sebastian kzar tlucas added

comment:2 Changed 14 months ago by kzar

  • Cc kzar removed

comment:3 Changed 14 months ago by agiammarchi

  • Description modified (diff)

comment:4 Changed 14 months ago by agiammarchi

  • Description modified (diff)

comment:5 Changed 14 months ago by agiammarchi

  • Description modified (diff)

comment:6 Changed 9 months ago by erikvold

  • Cc erikvold added
Note: See TracTickets for help on using tickets.