Add infrastructure
Add several tools to help with the extension development:
- Add .editorconfig file to set formatting options for the code editors.
- Add generateManifest.bash to generate the manifest.json file
dynamically, from a template at templates/manifest.gjson. The
manifest.gjson file can have lines defining what parts of the manifest
are added for each target browser.
- Add release.bash to generate the extension ZIP files.
- Add Makefile to serve as a wrapper for the release.bash script.
- Add tagRelease.bash to help tag versions in Git accordingly.
- Add docs to explain all this new infrastructure (will need to be
updated in the future with more details).
Change-Id: I698ffc59d0d2ec02b483935f7860e95760951a42
diff --git a/tagRelease.bash b/tagRelease.bash
new file mode 100644
index 0000000..d639f70
--- /dev/null
+++ b/tagRelease.bash
@@ -0,0 +1,53 @@
+#!/bin/bash
+#
+# Tags the current git HEAD as a new version, passed via a flag.
+
+GITILES_REPO_URL="https://gerrit.avm99963.com/plugins/gitiles/translateselectedtext"
+
+# Prints help text
+function usage() {
+ cat <<END
+
+ Usage: $progname --version VERSION
+
+ required arguments:
+ -v, --version the version of the new release (in the form vx)
+ which wants to be tagged.
+
+ optional arguments:
+ -h, --help show this help message and exit
+
+END
+}
+
+opts=$(getopt -l "help,version:" -o "hv:" -n "$progname" -- "$@")
+eval set -- "$opts"
+
+prevVersion=$(git describe --abbrev=0)
+nextVersion="null"
+
+while true; do
+ case "$1" in
+ -h | --help)
+ usage
+ exit
+ ;;
+ -v | --version)
+ nextVersion="$2"
+ shift 2
+ ;;
+ *) break ;;
+ esac
+done
+
+if [[ $nextVersion == "null" ]]; then
+ echo "version parameter value is incorrect." >&2
+ usage
+ exit
+fi
+
+commitMessage1="$nextVersion"
+commitMessage2="Changelog: $GITILES_REPO_URL/+log/refs/tags/$prevVersion..refs/tags/$nextVersion"
+git tag -a $nextVersion -m "$commitMessage1" -m "$commitMessage2"
+
+echo "Tag created. Now run \`git push --tags\` to push the tags to the server."