pre_merge.sh: tag last pre-merge commit
Change-Id: Iaf7ffada4c7cc77b85547e7b3c64aaa96e80b64b
This commit is contained in:
parent
cf0dc42020
commit
791766dce2
|
@ -43,25 +43,6 @@ fi
|
||||||
|
|
||||||
last_tag=`downstream_latest_tag`
|
last_tag=`downstream_latest_tag`
|
||||||
|
|
||||||
build_gradle="vector-app/build.gradle"
|
|
||||||
|
|
||||||
get_prop() {
|
|
||||||
local prop="$1"
|
|
||||||
cat "$build_gradle" | grep "$prop = " | sed "s|$prop = ||"
|
|
||||||
}
|
|
||||||
set_prop() {
|
|
||||||
local prop="$1"
|
|
||||||
local value="$2"
|
|
||||||
if grep -q "$prop =" "$build_gradle"; then
|
|
||||||
local equals="= "
|
|
||||||
local not_equals=""
|
|
||||||
else
|
|
||||||
local equals=""
|
|
||||||
# Don't touch lines that have an equals in it, but not for this prop
|
|
||||||
local not_equals="/=/! "
|
|
||||||
fi
|
|
||||||
sed -i "$not_equals""s|\($prop $equals\).*|\1$value|g" "$build_gradle"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Legacy versioning, based on Element's version codes
|
# Legacy versioning, based on Element's version codes
|
||||||
#calculate_version_code() {
|
#calculate_version_code() {
|
||||||
|
|
|
@ -1,5 +1,25 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
build_gradle="vector-app/build.gradle"
|
||||||
|
|
||||||
|
get_prop() {
|
||||||
|
local prop="$1"
|
||||||
|
cat "$build_gradle" | grep "$prop = " | sed "s|$prop = ||"
|
||||||
|
}
|
||||||
|
set_prop() {
|
||||||
|
local prop="$1"
|
||||||
|
local value="$2"
|
||||||
|
if grep -q "$prop =" "$build_gradle"; then
|
||||||
|
local equals="= "
|
||||||
|
local not_equals=""
|
||||||
|
else
|
||||||
|
local equals=""
|
||||||
|
# Don't touch lines that have an equals in it, but not for this prop
|
||||||
|
local not_equals="/=/! "
|
||||||
|
fi
|
||||||
|
sed -i "$not_equals""s|\($prop $equals\).*|\1$value|g" "$build_gradle"
|
||||||
|
}
|
||||||
|
|
||||||
find_last_commit_for_title() {
|
find_last_commit_for_title() {
|
||||||
local title="$1"
|
local title="$1"
|
||||||
git log --oneline --author=SpiritCroc | grep "$title" | head -n 1 | sed 's| .*||'
|
git log --oneline --author=SpiritCroc | grep "$title" | head -n 1 | sed 's| .*||'
|
||||||
|
|
|
@ -8,6 +8,13 @@ source "$mydir/merge_helpers.sh"
|
||||||
# Require clean git state
|
# Require clean git state
|
||||||
require_clean_git
|
require_clean_git
|
||||||
|
|
||||||
|
# Tag this version for easier git diff-ing
|
||||||
|
versionMajor=`get_prop ext.versionMajor`
|
||||||
|
versionMinor=`get_prop ext.versionMinor`
|
||||||
|
versionPatch=`get_prop ext.versionPatch`
|
||||||
|
tag="sc_last_v$versionMajor.$versionMinor.$versionPatch"
|
||||||
|
git tag "$tag"
|
||||||
|
|
||||||
# Revert Schildi's upstream string changes
|
# Revert Schildi's upstream string changes
|
||||||
git checkout `upstream_common_base` -- "$mydir/library/ui-strings/src/main/res/**/strings.xml"
|
git checkout `upstream_common_base` -- "$mydir/library/ui-strings/src/main/res/**/strings.xml"
|
||||||
git commit -m "Automatic revert to unchanged upstream strings, pt.1"
|
git commit -m "Automatic revert to unchanged upstream strings, pt.1"
|
||||||
|
|
Loading…
Reference in New Issue