Commit 94d16f33 authored by Carles Pina i Estany's avatar Carles Pina i Estany

Uses the version from the output of "git describe" instead of hardcoding in configure.ac.

autoconf now executes "git describe" to know which version is going to
build. The version depends on the latest git tag (see howto_new_release.txt).

There are two versions: the AssemblyVersion (which is like 1.6.2, since
it only accepts this format) and the new buildInfo.chronojumpVersion and
buildInfo.chronojumpLastCommitTimestamp (not used at the moment).

The buildInfo.chronojumpVersion is used as display string: it's like
1.6.2 if it's a build from a tag or
1.6.2-number_of_commits_since_last_tag-commit_hash. This way we can
identify the build uniquely even if it was from a specific branch.
parent d579c89d
......@@ -888,6 +888,7 @@
<Compile Include="src\executeProcess.cs" />
<Compile Include="src\gui\cjCombo.cs" />
<Compile Include="src\sqlite\usefulObjects.cs" />
<Compile Include="src\buildInfo.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="src\" />
......@@ -1916,6 +1917,7 @@
<None Include="images\xcf\chronojump_icon_graph.xcf" />
<None Include="images\xcf\delete_last.xcf" />
<None Include="images\xcf\pulses.xcf" />
<None Include="src\buildInfo.cs.in" />
</ItemGroup>
<ItemGroup>
<Content Include="src\chronojump.desktop">
......
dnl Warning: This is an automatically generated file, do not edit!
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.54])
AC_INIT([chronojump], [1.6.2])
# chronojump variable is used in the Assembly version and can only have major.minor.release
AC_INIT([chronojump], [m4_esyscmd_s([git describe --abbrev=0])])
# BUILD_CHRONOJUMP_VERSION is used to display it to the user
# "git describe" is 1.6.2 if it's a tagged version or
# 1.6.2-number_of_commits_since_last_tag-sha1 if it's not
AC_SUBST([BUILD_CHRONOJUMP_VERSION], [m4_esyscmd_s([git describe])])
# Date of the last commit
AC_SUBST([BUILD_CHRONOJUMP_LAST_COMMIT_TIMESTAMP], [m4_esyscmd_s([git log -1 --format=%ct])])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_MACRO_DIR([build/m4])
......@@ -156,6 +165,7 @@ chronojump_server/Makefile
encoder/Makefile
manual/Makefile
src/AssemblyInfo.cs
src/buildInfo.cs
src/chronojump
src/chronojump.desktop
src/Mini/chronojump_mini
......
......@@ -2,23 +2,20 @@
check is "updated to last version"
cp ../chronojump-docs/chronojump_manual_e*.pdf manual/
2) change version on configure.ac and src/AssemblyInfo.cs
3) change buildDate string on src/gui/chronojump.cs
2) change version on configure.ac
3) Run autoconf (this will update src/AssemblyInfo.cs - this file is not in the git repo, it's generated from src/AssemblyInfo.cs.in)
linux stuff
------------
sh autogen.sh
make dist
VERSION=1.6.2
[1]
git commit -a -m "Bump version $VERSION"
git push
sh autogen.sh
make dist
#with branching:
#git checkout -b "tags/$VERSION" # creates a new branch
# keep doing commits:
......
// Do not edit the file AssemblyInfo.cs. It gets generated by autoconf
// Do edit the file AssemblyInfo.cs.in
using System.Reflection;
using System.Runtime.CompilerServices;
......@@ -12,7 +15,7 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Copyright (C) 2004-2009 Xavier de Blas <xaviblas@gmail.com>")]
[assembly: AssemblyCopyright("Copyright (C) 2004-2016 Xavier de Blas <xaviblas@gmail.com>")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
......
......@@ -125,6 +125,7 @@ SOURCES = \
execute/multiChronopic.cs\
../chronojump_server/ChronojumpServer.cs\
AssemblyInfo.cs\
buildInfo.cs\
chronojump.cs\
config.cs\
encoder.cs\
......
// Do not edit buildInfo.cs - it gets re-generated by autoconf.
// Do edit buildInfo.cs.in
public class BuildInfo
{
// related: UtilAll::ReadVersion() returns the version file
// from the assembly
// chronojumpVersion might be like 1.6.2 if it's from a tagged
// version and be the same as UtilAll::ReadVersion() or might be
// 1.6.2-276-gd579c89 (see output of git describe)
public static string chronojumpVersion= "1.6.2-276-gd579c89";
// It's the timestamp because git log doesn't give anything like
// YYYY-MM-DD
public static string chronojumpLastCommitTimestamp= "1476703235";
}
public class BuildInfo
{
// related: UtilAll::ReadVersion() returns the version file
// from the assembly
// chronojumpVersion might be like 1.6.2 if it's from a tagged
// version and be the same as UtilAll::ReadVersion() or might be
// 1.6.2-276-gd579c89 (see output of git describe)
public static string chronojumpVersion= "@BUILD_CHRONOJUMP_VERSION@";
// It's the timestamp because git log doesn't give anything like
// YYYY-MM-DD
public static string chronojumpLastCommitTimestamp= "@BUILD_CHRONOJUMP_LAST_COMMIT_TIMESTAMP@";
}
......@@ -240,7 +240,7 @@ public class ChronoJump
}
//print version of chronojump
progVersion = UtilAll.ReadVersion();
progVersion = BuildInfo.chronojumpVersion;
LogB.Information("Chronojump version: {0}", progVersion);
......
......@@ -606,9 +606,9 @@ public partial class ChronoJumpWindow
//leave empty on new releases
//string buildDate = " (2016-07-27)";
string buildDate = " (d)";
label_version.Text = progVersion + buildDate;
LogB.Information("Build date:" + buildDate);
string buildVersion = BuildInfo.chronojumpVersion;
label_version.Text = buildVersion;
LogB.Information("Build version:" + buildVersion);
LeastSquares ls = new LeastSquares();
ls.Test();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment