mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-10-04 23:56:32 +08:00
Add GIT commit version to About dialog and to exported GCode.
Implements #4532
This commit is contained in:
parent
880e9a52c3
commit
d17659b67c
@ -52,6 +52,7 @@ matrix:
|
|||||||
- export SLIC3R_STATIC=1
|
- export SLIC3R_STATIC=1
|
||||||
- export CXX=g++-4.9
|
- export CXX=g++-4.9
|
||||||
- export CC=g++-4.9
|
- export CC=g++-4.9
|
||||||
|
- export SLIC3R_GIT_VERSION=$(git rev-parse HEAD)
|
||||||
- source $HOME/perl5/perlbrew/etc/bashrc
|
- source $HOME/perl5/perlbrew/etc/bashrc
|
||||||
after_success:
|
after_success:
|
||||||
- eval $(perl -Mlocal::lib=$TRAVIS_BUILD_DIR/local-lib)
|
- eval $(perl -Mlocal::lib=$TRAVIS_BUILD_DIR/local-lib)
|
||||||
|
@ -11,6 +11,7 @@ use warnings;
|
|||||||
require v5.10;
|
require v5.10;
|
||||||
|
|
||||||
our $VERSION = VERSION();
|
our $VERSION = VERSION();
|
||||||
|
our $GITVERSION = GITVERSION();
|
||||||
|
|
||||||
our $debug = 0;
|
our $debug = 0;
|
||||||
sub debugf {
|
sub debugf {
|
||||||
|
@ -12,7 +12,7 @@ use base 'Wx::Dialog';
|
|||||||
sub new {
|
sub new {
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
my ($parent) = @_;
|
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);
|
$self->SetBackgroundColour(Wx::wxWHITE);
|
||||||
my $hsizer = Wx::BoxSizer->new(wxHORIZONTAL);
|
my $hsizer = Wx::BoxSizer->new(wxHORIZONTAL);
|
||||||
@ -20,7 +20,7 @@ sub new {
|
|||||||
|
|
||||||
# logo
|
# logo
|
||||||
my $logo = Slic3r::GUI::AboutDialog::Logo->new($self, -1, wxDefaultPosition, wxDefaultSize);
|
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);
|
$hsizer->Add($logo, 0, wxEXPAND | wxLEFT | wxRIGHT, 30);
|
||||||
|
|
||||||
my $vsizer = Wx::BoxSizer->new(wxVERTICAL);
|
my $vsizer = Wx::BoxSizer->new(wxVERTICAL);
|
||||||
@ -45,8 +45,10 @@ sub new {
|
|||||||
# text
|
# text
|
||||||
my $text =
|
my $text =
|
||||||
'<html>' .
|
'<html>' .
|
||||||
'<body bgcolor="#ffffff" link="#808080">' .
|
'<body link="#808080">' .
|
||||||
'<font color="#808080">' .
|
'Build commit: ' . $Slic3r::GITVERSION .
|
||||||
|
'<br /><br />' .
|
||||||
|
'<font>' .
|
||||||
'Copyright © 2011-2017 Alessandro Ranellucci. <br />' .
|
'Copyright © 2011-2017 Alessandro Ranellucci. <br />' .
|
||||||
'<a href="http://slic3r.org/">Slic3r</a> is licensed under the ' .
|
'<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>.' .
|
'<a href="http://www.gnu.org/licenses/agpl-3.0.html">GNU Affero General Public License, version 3</a>.' .
|
||||||
|
@ -70,7 +70,7 @@ sub export {
|
|||||||
|
|
||||||
# Write information on the generator.
|
# Write information on the generator.
|
||||||
my @lt = localtime;
|
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];
|
$lt[5] + 1900, $lt[4]+1, $lt[3], $lt[2], $lt[1], $lt[0];
|
||||||
# Write notes (content of all Settings tabs -> Notes)
|
# Write notes (content of all Settings tabs -> Notes)
|
||||||
print $fh $gcodegen->notes;
|
print $fh $gcodegen->notes;
|
||||||
|
@ -13,6 +13,7 @@ cd C:\projects\slic3r
|
|||||||
rm -r 'C:\Program Files (x86)\Microsoft Vis*\bin' -Force
|
rm -r 'C:\Program Files (x86)\Microsoft Vis*\bin' -Force
|
||||||
|
|
||||||
Add-AppveyorCompilationMessage -Message "Building Slic3r XS"
|
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"
|
wget "http://www.siusgs.com/slic3r/buildserver/win/Build_PL" -O "Build.PL"
|
||||||
perl ./Build.pl
|
perl ./Build.pl
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@ $ENV{LD_RUN_PATH} //= "";
|
|||||||
# NOGDI : prevents inclusion of wingdi.h which defines functions Polygon() and Polyline() in global namespace
|
# 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
|
# 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);
|
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) {
|
if ($cpp_guess->is_gcc) {
|
||||||
# GCC is pedantic with c++11 std, so undefine strict ansi to get M_PI back
|
# GCC is pedantic with c++11 std, so undefine strict ansi to get M_PI back
|
||||||
push @cflags, qw(-U__STRICT_ANSI__);
|
push @cflags, qw(-U__STRICT_ANSI__);
|
||||||
|
@ -44,14 +44,16 @@ namespace Slic3r {
|
|||||||
|
|
||||||
constexpr auto SLIC3R_VERSION = "1.3.1-dev";
|
constexpr auto SLIC3R_VERSION = "1.3.1-dev";
|
||||||
|
|
||||||
#ifndef SLIC3RXS
|
|
||||||
#ifndef SLIC3R_BUILD_COMMIT
|
#ifndef SLIC3R_BUILD_COMMIT
|
||||||
#define SLIC3R_BUILD_COMMIT (Unknown revision)
|
#define SLIC3R_BUILD_COMMIT (Unknown revision)
|
||||||
#endif
|
#endif
|
||||||
#define VER1_(x) #x
|
#define VER1_(x) #x
|
||||||
#define VER_(x) VER1_(x)
|
#define VER_(x) VER1_(x)
|
||||||
#define BUILD_COMMIT VER_(SLIC3R_BUILD_COMMIT)
|
#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
|
#ifdef _WIN32
|
||||||
typedef int64_t coord_t;
|
typedef int64_t coord_t;
|
||||||
|
@ -16,6 +16,12 @@ VERSION()
|
|||||||
RETVAL = newSVpv(SLIC3R_VERSION, 0);
|
RETVAL = newSVpv(SLIC3R_VERSION, 0);
|
||||||
OUTPUT: RETVAL
|
OUTPUT: RETVAL
|
||||||
|
|
||||||
|
SV*
|
||||||
|
GITVERSION()
|
||||||
|
CODE:
|
||||||
|
RETVAL = newSVpv(SLIC3R_GIT, 0);
|
||||||
|
OUTPUT: RETVAL
|
||||||
|
|
||||||
void
|
void
|
||||||
xspp_test_croak_hangs_on_strawberry()
|
xspp_test_croak_hangs_on_strawberry()
|
||||||
CODE:
|
CODE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user