From 51a19257c9c0ae1771132447042ac0b23dc21270 Mon Sep 17 00:00:00 2001 From: Rodrigo Orem Date: Thu, 27 Apr 2017 20:53:51 -0300 Subject: [PATCH] Melhora build script --- build.py | 35 +++++++++++++++++++++++++++++++++++ build.sh | 24 ++++++++++++++---------- src/manifest-chrome.json | 1 + updates.xml | 6 ++++++ 4 files changed, 56 insertions(+), 10 deletions(-) create mode 100644 build.py create mode 100644 updates.xml diff --git a/build.py b/build.py new file mode 100644 index 0000000..2bcc703 --- /dev/null +++ b/build.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 +import os + + + +DIST="dist" + +CHROME="$DIST/chrome" +FIREFOX="$DIST/firefox" +OPERA="$DIST/opera" + +BROWSERS=($CHROME $FIREFOX $OPERA) + + +for i in "${BROWSERS[@]}" +do + mkdir -p "$i/src" + + rm -rf "$i" +done + + +exit +rm -rf dist/chrome/extension.zip dist/chrome/extension.zip +mkdir dist + +cp -r src/* dist/firefox/src +rm dist/firefox/src/manifest-chrome.json +mv dist/firefox/src/manifest-firefox.json dist/firefox/manifest.json +zip -j dist/src/extension.zip dist/firefox/src/* + +cp -r src/* dist/chrome/src +rm dist/chrome/src/manifest-firefox.json +mv dist/chrome/src/manifest-chrome.json dist/chrome/src/manifest.json +zip -j dist/extension.zip dist/chrome/src/* diff --git a/build.sh b/build.sh index 53917db..1028da8 100755 --- a/build.sh +++ b/build.sh @@ -1,12 +1,16 @@ -rm -rf dist/burlesco-chrome.zip dist/burlesco-firefox.zip -mkdir dist +DIST="dist" +BROWSERS=("chrome" "firefox" "opera") -cp -r src/* dist/firefox -rm dist/firefox/manifest-chrome.json -mv dist/firefox/manifest-firefox.json dist/firefox/manifest.json -zip -j dist/burlesco-firefox.zip dist/firefox/* -cp -r src/* dist/chrome -rm dist/chrome/manifest-firefox.json -mv dist/chrome/manifest-chrome.json dist/chrome/manifest.json -zip -j dist/burlesco-chrome.zip dist/chrome/* +for i in "${BROWSERS[@]}" +do + mkdir -p "$DIST/$i/src" + + rm -rf "$DIST/$i/src/*" + rm "$DIST/$i/extension.zip" + + cp -r src/* "$DIST/$i/src" + mv "$DIST/$i/manifest-$i.json" "$DIST/$i/manifest.json" + rm -f "$DIST/$i/manifest-*" + zip -j "$DIST/$i/extension.zip" "$DIST/$i/src/*" +done diff --git a/src/manifest-chrome.json b/src/manifest-chrome.json index 0011198..737b7c2 100644 --- a/src/manifest-chrome.json +++ b/src/manifest-chrome.json @@ -5,6 +5,7 @@ "description": "Leia notícias sem ser assinante, burle o paywall", "homepage_url": "http://burles.co", "author": "rodorgas", + "update_url": "https://github.com/Burlesco/chromium/blob/master/updates.xml", "icons": { "128": "icone.png" diff --git a/updates.xml b/updates.xml new file mode 100644 index 0000000..292e996 --- /dev/null +++ b/updates.xml @@ -0,0 +1,6 @@ + + + + + +