Add GIT commit version to About dialog and to exported GCode.

Implements #4532
This commit is contained in:
Joseph Lenox 2018-09-07 21:40:49 -05:00
parent 880e9a52c3
commit d17659b67c
8 changed files with 22 additions and 7 deletions

View File

@ -52,6 +52,7 @@ matrix:
- export SLIC3R_STATIC=1
- export CXX=g++-4.9
- export CC=g++-4.9
- export SLIC3R_GIT_VERSION=$(git rev-parse HEAD)
- source $HOME/perl5/perlbrew/etc/bashrc
after_success:
- eval $(perl -Mlocal::lib=$TRAVIS_BUILD_DIR/local-lib)

View File

@ -11,6 +11,7 @@ use warnings;
require v5.10;
our $VERSION = VERSION();
our $GITVERSION = GITVERSION();
our $debug = 0;
sub debugf {

View File

@ -12,7 +12,7 @@ use base 'Wx::Dialog';
sub new {
my $class = shift;
my ($parent) = @_;
my $self = $class->SUPER::new($parent, -1, 'About Slic3r', wxDefaultPosition, [600, 340], wxCAPTION);
my $self = $class->SUPER::new($parent, -1, 'About Slic3r', wxDefaultPosition, [600, 440], wxCAPTION);
$self->SetBackgroundColour(Wx::wxWHITE);
my $hsizer = Wx::BoxSizer->new(wxHORIZONTAL);
@ -20,7 +20,7 @@ sub new {
# logo
my $logo = Slic3r::GUI::AboutDialog::Logo->new($self, -1, wxDefaultPosition, wxDefaultSize);
$logo->SetBackgroundColour(Wx::wxWHITE);
$logo->SetBackgroundColour(Wx::wxWHITE);
$hsizer->Add($logo, 0, wxEXPAND | wxLEFT | wxRIGHT, 30);
my $vsizer = Wx::BoxSizer->new(wxVERTICAL);
@ -45,8 +45,10 @@ sub new {
# text
my $text =
'<html>' .
'<body bgcolor="#ffffff" link="#808080">' .
'<font color="#808080">' .
'<body link="#808080">' .
'Build commit: ' . $Slic3r::GITVERSION .
'<br /><br />' .
'<font>' .
'Copyright &copy; 2011-2017 Alessandro Ranellucci. <br />' .
'<a href="http://slic3r.org/">Slic3r</a> is licensed under the ' .
'<a href="http://www.gnu.org/licenses/agpl-3.0.html">GNU Affero General Public License, version 3</a>.' .

View File

@ -70,7 +70,7 @@ sub export {
# Write information on the generator.
my @lt = localtime;
printf $fh "; generated by Slic3r $Slic3r::VERSION on %04d-%02d-%02d at %02d:%02d:%02d\n\n",
printf $fh "; generated by Slic3r $Slic3r::VERSION (Build $Slic3r::GITVERSION) on %04d-%02d-%02d at %02d:%02d:%02d\n\n",
$lt[5] + 1900, $lt[4]+1, $lt[3], $lt[2], $lt[1], $lt[0];
# Write notes (content of all Settings tabs -> Notes)
print $fh $gcodegen->notes;

View File

@ -13,6 +13,7 @@ cd C:\projects\slic3r
rm -r 'C:\Program Files (x86)\Microsoft Vis*\bin' -Force
Add-AppveyorCompilationMessage -Message "Building Slic3r XS"
$env:SLIC3R_GIT_VERSION = $(git rev-parse HEAD)
wget "http://www.siusgs.com/slic3r/buildserver/win/Build_PL" -O "Build.PL"
perl ./Build.pl

View File

@ -20,6 +20,8 @@ $ENV{LD_RUN_PATH} //= "";
# NOGDI : prevents inclusion of wingdi.h which defines functions Polygon() and Polyline() in global namespace
# BOOST_ASIO_DISABLE_KQUEUE : prevents a Boost ASIO bug on OS X: https://svn.boost.org/trac/boost/ticket/5339
my @cflags = qw(-D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DSLIC3RXS -DBOOST_ASIO_DISABLE_KQUEUE -Dexprtk_disable_rtl_io_file -Dexprtk_disable_return_statement -Dexprtk_disable_rtl_vecops -Dexprtk_disable_string_capabilities -Dexprtk_disable_enhanced_features);
push @cflags, "-DSLIC3R_BUILD_COMMIT=$ENV{SLIC3R_GIT_VERSION}";
if ($cpp_guess->is_gcc) {
# GCC is pedantic with c++11 std, so undefine strict ansi to get M_PI back
push @cflags, qw(-U__STRICT_ANSI__);

View File

@ -44,14 +44,16 @@ namespace Slic3r {
constexpr auto SLIC3R_VERSION = "1.3.1-dev";
#ifndef SLIC3RXS
#ifndef SLIC3R_BUILD_COMMIT
#define SLIC3R_BUILD_COMMIT (Unknown revision)
#endif
#define VER1_(x) #x
#define VER_(x) VER1_(x)
#define BUILD_COMMIT VER_(SLIC3R_BUILD_COMMIT)
#endif
const auto SLIC3R_GIT_STR = std::string(BUILD_COMMIT);
const auto SLIC3R_GIT = SLIC3R_GIT_STR.c_str();
#ifdef _WIN32
typedef int64_t coord_t;

View File

@ -16,6 +16,12 @@ VERSION()
RETVAL = newSVpv(SLIC3R_VERSION, 0);
OUTPUT: RETVAL
SV*
GITVERSION()
CODE:
RETVAL = newSVpv(SLIC3R_GIT, 0);
OUTPUT: RETVAL
void
xspp_test_croak_hangs_on_strawberry()
CODE: