Skip to content
Browse files

ability to give a version suffix to compiler version

  • Loading branch information...
1 parent eae946b commit 6af1b0f22d695bce95c369be849251f170217c93 @Aqua-Ye Aqua-Ye committed Oct 5, 2012
Showing with 20 additions and 10 deletions.
  1. +0 −1 compiler/buildinfos/buildInfos.ml.pre
  2. +13 −6 compiler/buildinfos/generate_buildinfos.sh
  3. +7 −3 tools/build/build_rules.ml
View
1 compiler/buildinfos/buildInfos.ml.pre
@@ -5,5 +5,4 @@
It is possible to add code definition there :
*)
-
(* From there, the rest of the module is generated by bld *)
View
19 compiler/buildinfos/generate_buildinfos.sh
@@ -28,22 +28,24 @@ MLSTATE_DIFFING=${MLSTATE_DIFFING:-"0"}
help () {
cat <<EOF
-generating buildInfos.ml
+Generator for buildInfos.ml
Use:
- $0 opageneral-dir [options]
+ $0 opalang-dir [options]
Options:
--version file.txt precise the file to read the name of opa version
+ --version-suffix TXT precise the text to be append to opa version
--release release mode
EOF
}
OPA_VERSION="S?"
-ROOTDIR=""
+OPA_VERSION_SUFFIX=""
+ROOTDIR="."
IS_RELEASE="false"
if [ -z "$1" ]; then
help
- echo "opageneral-dir is not specified"
+ echo "opalang-dir is not specified"
exit 1
else
ROOTDIR="$1"
@@ -64,6 +66,11 @@ while [ "$#" -gt 0 ]; do
shift;
OPA_VERSION="$(cat $1)"
;;
+ --version-suffix)
+ if [ -z "$2" ]; then echo "Error: option $1 requires an argument"; exit 1; fi
+ shift;
+ OPA_VERSION_SUFFIX=$1
+ ;;
*)
help
exit 1
@@ -72,7 +79,7 @@ while [ "$#" -gt 0 ]; do
shift
done
-ROOT_REPO="opalang"
+: ${ROOT_REPO:="opalang"}
REPOS="$ROOT_REPO"
PATH_TO_REPOS="repos"
@@ -129,7 +136,7 @@ EOF
fi
# opa version
-echo "let opa_version_name = \"${OPA_VERSION}\""
+echo "let opa_version_name = \"${OPA_VERSION}${OPA_VERSION_SUFFIX}\""
# git infos
for repo in $REPOS ; do
View
10 tools/build/build_rules.ml
@@ -216,10 +216,14 @@ rule "buildinfos: compiler/buildinfos/* -> compiler/buildinfos/buildInfos.ml"
let post_prod = env post_buildinfos in
Seq[
Cmd(S[Sh "cat" ; P pre_prod ; Sh ">" ; P prod]);
- Cmd(S[P "bash"; A "-e"; P generate_buildinfos; P Pathname.pwd;
+ Cmd(S([P "bash"; A "-e"; P generate_buildinfos; P Pathname.pwd;
if Config.is_release then A "--release" else N;
- A "--version" ; P version ;
- Sh ">>" ; P prod]);
+ A "--version" ; P version ] @ (
+ try
+ let suffix = Sys.getenv "VERSION_SUFFIX" in
+ [ A "--version-suffix"; A suffix ]
+ with Not_found -> []
+ ) @ [Sh ">>" ; P prod]));
Cmd(S[Sh "cat" ; P post_prod ; Sh ">>" ; P prod]);
]
);

0 comments on commit 6af1b0f

Please sign in to comment.
Something went wrong with that request. Please try again.