Opened 2 years ago

Closed 13 months ago

#6757 closed change (rejected)

Static assets automation in

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)


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 (7)

comment:1 Changed 2 years ago by tlucas

  • Cc greiner saroyanm sebastian kzar tlucas added

comment:2 Changed 2 years ago by kzar

  • Cc kzar removed

comment:3 Changed 2 years ago by agiammarchi

  • Description modified (diff)

comment:4 Changed 2 years ago by agiammarchi

  • Description modified (diff)

comment:5 Changed 2 years ago by agiammarchi

  • Description modified (diff)

comment:6 Changed 23 months ago by erikvold

  • Cc erikvold added

comment:7 Changed 13 months ago 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.

Note: See TracTickets for help on using tickets.