]> git.wh0rd.org - chrome-ext/clearhistory-advance-fork.git/commitdiff
add files to help with making dists v1.5.3
authorMike Frysinger <vapier@gentoo.org>
Sat, 22 Mar 2014 08:58:16 +0000 (04:58 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sat, 22 Mar 2014 08:58:16 +0000 (04:58 -0400)
.gitignore [new file with mode: 0644]
Makefile [new file with mode: 0644]
makedist.sh [new file with mode: 0755]
manifest.files [new file with mode: 0644]
manifest.json

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..c4c4ffc
--- /dev/null
@@ -0,0 +1 @@
+*.zip
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..5e88047
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,23 @@
+CLOSURE = closure-compiler --language_in ECMASCRIPT5
+YUICOMPRESSOR = yuicompressor
+
+all:
+
+%.js.min: %.js
+       $(CLOSURE) $< > $@
+
+JS_FILES = $(shell grep '[.]js$$' manifest.files)
+js-min: $(JS_FILES:=.min)
+
+%.css.min: %.css
+       $(YUICOMPRESSOR) $< > $@
+
+CSS_FILES = $(shell grep '[.]css$$' manifest.files)
+css-min: $(CSS_FILES:=.min)
+
+check: css-min js-min
+
+dist:
+       ./makedist.sh
+
+.PHONY: all clean check css-min dist js-min
diff --git a/makedist.sh b/makedist.sh
new file mode 100755 (executable)
index 0000000..1b66c57
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/bash -e
+# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+case $1 in
+-h|--help)
+  echo "Usage: $0 [rev]"
+  exit 0
+  ;;
+esac
+
+json_value() {
+  local key=$1
+  sed -n -r \
+    -e '/^[[:space:]]*"'"${key}"'"/s|.*:[[:space:]]*"([^"]*)",?$|\1|p' \
+    manifest.json
+}
+
+PN=$(json_value name | sed 's:[[:space:]]:_:g' | tr '[:upper:]' '[:lower:]')
+if [[ ${PN} == "__msg_name__" ]] ; then
+       PN=$(basename "$(pwd)")
+fi
+PV=$(json_value version)
+rev=${1:-0}
+PVR="${PV}.${rev}"
+P="${PN}-${PVR}"
+
+rm -rf "${P}"
+mkdir "${P}"
+
+while read line ; do
+  [[ ${line} == */* ]] && mkdir -p "${P}/${line%/*}"
+  ln "${line}" "${P}/${line}"
+done < <(sed 's:#.*::' manifest.files)
+cp Makefile manifest.files manifest.json "${P}/"
+
+make -C "${P}" -j {css,js}-min
+while read line ; do
+       mv "${line}.min" "${line}"
+done < <(find "${P}" -name '*.js' -o -name '*.css')
+rm "${P}"/{manifest.files,Makefile}
+
+sed -i \
+  -e '/"version"/s:"[^"]*",:"'${PVR}'",:' \
+  "${P}/manifest.json"
+
+zip="${P}.zip"
+rm -f "${zip}"
+zip -r "${zip}" "${P}"
+rm -rf "${P}"
+du -b "${zip}"
diff --git a/manifest.files b/manifest.files
new file mode 100644 (file)
index 0000000..64a52ae
--- /dev/null
@@ -0,0 +1,12 @@
+_locales/en/messages.json
+chrome-bootstrap/chrome-bootstrap.css
+css/options.css
+images/icon16.png
+images/icon32.png
+images/icon48.png
+images/icon128.png
+javascript/background.js
+javascript/clearhistory.js
+javascript/options.js
+javascript/util.js
+views/options.html
index 9196f47f41918bbf397d209a6dd264eed7dc4a3e..ce21c70c1890bb5604f6cf83c7f3897631209fd8 100644 (file)
@@ -2,7 +2,7 @@
   "name": "__MSG_name__",
   "default_locale": "en",
   "manifest_version": 2,
-  "version": "1.5.0",
+  "version": "1.5.3",
   "description": "__MSG_description__",
   "permissions": [
     "alarms",