File: mkProjectInfo.ml

package info (click to toggle)
unison 2.48.3-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,320 kB
  • ctags: 4,814
  • sloc: ml: 29,933; objc: 6,225; ansic: 1,633; makefile: 572; python: 430; sh: 80
file content (101 lines) | stat: -rw-r--r-- 2,072 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
(* Program for printing project info into a Makefile.  Documentation below. *)

(* FIX: When the time comes for the next alpha-release, remember to
   increment the archive version number first. See update.ml. *)

let projectName = "unison"
let majorVersion = 2
let minorVersion = 48
let pointVersionOrigin = 533 (* Revision that corresponds to point version 0 *)

(* Documentation:
   This is a program to construct a version of the form Major.Minor.Point,
   e.g., 2.10.4.
   The Point release number is calculated from the Subversion revision number,
   so it will be automatically incremented on svn commit.
   The Major and Minor numbers are hard coded, as is the revision number
   corresponding to the 0 point release.

   If you want to increment the Major or Minor number, you will have to do a
   little thinking to get the Point number back to 0.  Suppose the current svn
   revision number is 27, and we have below

        let majorVersion = 2
        let minorVersion = 11
        let pointVersionOrigin = 3

   This means that the current Unison version is 2.11.24, since 27-3 = 24.
   If we want to change the release to 3.0.0 we need to change things to

        let majorVersion = 3
        let minorVersion = 0
        let pointVersionOrigin = 28

   and then do a svn commit.

   The first two lines are obvious.  The last line says that Subversion
   revision 28 corresponds to a 0 point release.  Since we were at revision
   27 and we're going to do a commit before making a release, we
   will be at 28 after the commit and this will be Unison version 3.0.0.
*)

(* ---------------------------------------------------------------------- *)
(* You shouldn't need to edit below. *)

let revisionString = "$Rev: 536 $";;

let pointVersion = 
  Scanf.sscanf revisionString "$Rev: %d " (fun x -> x) - pointVersionOrigin;;

Printf.printf "MAJORVERSION=%d.%d\n" majorVersion minorVersion;;
Printf.printf "VERSION=%d.%d.%d\n" majorVersion minorVersion pointVersion;;
Printf.printf "NAME=%s\n" projectName;;