summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mversion/mVersion.sty
blob: e12d713089797617c8099130cf7f3393a4ddcab2 (plain)
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
%%
%% This is file `mVersion.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% mVersion.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2011 by Michael Schmeing <michael.schmeing@googlemail.com>
%% 
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.2 of this license
%% or (at your option) any later version.  The latest version of this
%% license is in:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% and version 1.2 or later is part of all distributions of LaTeX version
%% 1999/12/01 or later.
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{mVersion}
    [2013/03/11 v1.0.1 easy versioning for LaTeX]
\def\parseline#1;#2 %this space is important
{
  \def\versionnumber{#1}
  \def\buildnumber{#2}
}
\IfFileExists{version.dat}
{ }
{
\newwrite\outfile
\immediate\openout\outfile=version.dat
\immediate\write\outfile{0.0;0}
\immediate\closeout\outfile
}
\newread\versionfile
\openin\versionfile=version.dat
\read\versionfile to \versionline
\closein\versionfile
\expandafter\parseline\versionline
\newcounter{buildcounter}
\setcounter{buildcounter}{\buildnumber}
\newcommand{\version}{\versionnumber.\thebuildcounter}
\newcommand{\setVersion}[1]
{
\newwrite\outfile
\immediate\openout\outfile=version.dat
\immediate\write\outfile{#1;\thebuildcounter}
\immediate\closeout\outfile
\newread\versionfile
\openin\versionfile=version.dat
\read\versionfile to \versionline
\expandafter\parseline\versionline
\closein\versionfile
}
\newcommand{\increaseBuild}
{
\stepcounter{buildcounter}
\newwrite\outfile
\immediate\openout\outfile=version.dat
\immediate\write\outfile{\versionnumber;\thebuildcounter}
\immediate\closeout\outfile
}
\endinput
%%
%% End of file `mVersion.sty'.