[Fix 8635] About showed "Version ()" instead of Version 0.14.0 (201908...) on Android
Fixes #8635 by adding VERSION and BUILD_NUMBER files in the correct nix template and updating bash script in order to prevent it from failing, due to the git repository being not initialized in the nix environment. Move scripts/build_no.sh and scripts/gen_build_no.sh to scripts/version/build_no.sh to prevent Nix from rebuilding when unrelated scripts are touched. Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
parent
397b193de2
commit
5dbac2b1d9
|
@ -112,7 +112,7 @@ def getVersionCode = { ->
|
|||
}
|
||||
|
||||
exec {
|
||||
commandLine "bash", "../../scripts/build_no.sh"
|
||||
commandLine "bash", "../../scripts/version/build_no.sh"
|
||||
standardOutput = stdOut
|
||||
errorOutput = System.err
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ def doGitRebase() {
|
|||
def genBuildNumber() {
|
||||
def number = sh(
|
||||
returnStdout: true,
|
||||
script: "${env.WORKSPACE}/scripts/gen_build_no.sh"
|
||||
script: "${env.WORKSPACE}/scripts/version/gen_build_no.sh"
|
||||
).trim()
|
||||
println "Build Number: ${number}"
|
||||
return number
|
||||
|
@ -66,7 +66,7 @@ def genBuildNumber() {
|
|||
def readBuildNumber() {
|
||||
def number = sh(
|
||||
returnStdout: true,
|
||||
script: "${env.WORKSPACE}/scripts/build_no.sh"
|
||||
script: "${env.WORKSPACE}/scripts/version/build_no.sh"
|
||||
).trim().toInteger()
|
||||
return number
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ if [[ $(git ls-files -m "StatusIm/Info.plist") = *"Info.plist"* ]]; then
|
|||
echo "version was set in Info.plist"
|
||||
else
|
||||
RELEASE_VERSION=$(cat ../../VERSION)
|
||||
BUILD_NO=$(bash ../scripts/build_no.sh)
|
||||
BUILD_NO=$(bash ../scripts/version/build_no.sh)
|
||||
|
||||
# For debugging:
|
||||
echo "SHORT VERSION: $RELEASE_VERSION"
|
||||
|
|
|
@ -22,10 +22,10 @@ in stdenv.mkDerivation {
|
|||
mkFilter {
|
||||
dirRootsToInclude = [
|
||||
"components/src" "react-native/src/cljsjs" "react-native/src/mobile" "src" "env/prod" "prod" # Taken from project.clj :profiles :prod :cljsbuild :builds :android :source-paths
|
||||
"resources" "status-modules/cljs" "status-modules/resources"
|
||||
"resources" "status-modules/cljs" "status-modules/resources" "scripts/version"
|
||||
];
|
||||
dirsToExclude = [ ".git" ".svn" "CVS" ".hg" ".gradle" "build" "intermediates" "libs" "obj" ];
|
||||
filesToInclude = [ "build.clj" "externs.js" "project.clj" "prepare-modules.js" ];
|
||||
filesToInclude = [ "build.clj" "externs.js" "project.clj" "prepare-modules.js" "VERSION" "BUILD_NUMBER"];
|
||||
root = path;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -26,12 +26,14 @@
|
|||
# Fail on first error
|
||||
set -e
|
||||
|
||||
GIT_ROOT=$(git rev-parse --show-toplevel)
|
||||
DEV_BUILD_NUMBER=9999
|
||||
BUILD_NUMBER_FILE="${GIT_ROOT}/BUILD_NUMBER"
|
||||
|
||||
SCRIPTPATH="$(cd "$(dirname "$0")" ; pwd -P)"
|
||||
ROOT_PATH="${SCRIPTPATH}/../../"
|
||||
BUILD_NUMBER_FILE="${ROOT_PATH}/BUILD_NUMBER"
|
||||
|
||||
# If running under Jenkins use a timestamp-based build number.
|
||||
# That build number is generated by the scripts/gen_build_no.sh script.
|
||||
# That build number is generated by the scripts/version/gen_build_no.sh script.
|
||||
if [[ -f "${BUILD_NUMBER_FILE}" ]]; then
|
||||
echo "Build number file found, using: $(cat ${BUILD_NUMBER_FILE})" 1>&2
|
||||
cat "${BUILD_NUMBER_FILE}"
|
|
@ -6,7 +6,7 @@
|
|||
# that get uploaded to places like:
|
||||
# Apple Store, Play Store, or TestFlight
|
||||
#
|
||||
# The result of this script is used by scripts/build_no.sh
|
||||
# The result of this script is used by scripts/version/build_no.sh
|
||||
# when being run in Jenkins build context.
|
||||
#
|
||||
#####################################################################
|
|
@ -22,7 +22,7 @@
|
|||
(System/exit 1))))
|
||||
|
||||
(defmacro get-build-no []
|
||||
(-> (shell/sh "bash" "./scripts/build_no.sh")
|
||||
(-> (shell/sh "bash" "./scripts/version/build_no.sh")
|
||||
:out
|
||||
(string/replace "\n" "")))
|
||||
|
||||
|
|
Loading…
Reference in New Issue