You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.0 KiB
33 lines
1.0 KiB
10 years ago
|
(*
|
||
10 years ago
|
* Copyright (c) 2009 - 2013 Monoidics ltd.
|
||
|
* Copyright (c) 2013 - present Facebook, Inc.
|
||
|
* All rights reserved.
|
||
|
*
|
||
|
* This source code is licensed under the BSD style license found in the
|
||
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||
|
*)
|
||
10 years ago
|
|
||
9 years ago
|
open! Utils
|
||
|
|
||
9 years ago
|
let major = @INFER_MAJOR@
|
||
|
let minor = @INFER_MINOR@
|
||
|
let patch = @INFER_PATCH@
|
||
|
|
||
|
let commit = "@INFER_GIT_COMMIT@"
|
||
|
let branch = "@INFER_GIT_BRANCH@"
|
||
9 years ago
|
let is_release = string_equal "@IS_RELEASE_TREE@" "yes"
|
||
9 years ago
|
let tag = Printf.sprintf "v%d.%d.%d" major minor patch
|
||
10 years ago
|
|
||
|
let versionString =
|
||
9 years ago
|
if is_release then tag
|
||
|
else Printf.sprintf "%s-%s" tag commit
|
||
10 years ago
|
|
||
|
let versionJson = String.concat "\n" [
|
||
|
"{"; "\"major\": " ^ (string_of_int major) ^ ", ";
|
||
|
"\"minor\": " ^ (string_of_int minor) ^ ", ";
|
||
|
"\"patch\": " ^ (string_of_int patch) ^ ", ";
|
||
|
"\"commit\": \"" ^ commit ^ "\", ";
|
||
|
"\"branch\": \"" ^ branch ^ "\", ";
|
||
|
"\"tag\": \"" ^ tag ^ "\""; "}" ]
|