Changed build-versioning system. You are now required to use make-svn-rev-header.py and create a personal build-credit.h file.
Originally committed to SVN as r377.
This commit is contained in:
parent
04e8ef1cd9
commit
9950531430
7 changed files with 111 additions and 24 deletions
|
@ -58,7 +58,7 @@ AboutScreen::AboutScreen(wxWindow *parent)
|
||||||
wxString aboutString;
|
wxString aboutString;
|
||||||
wxString translatorCredit = _("Translated into LANGUAGE by PERSON\n");
|
wxString translatorCredit = _("Translated into LANGUAGE by PERSON\n");
|
||||||
if (translatorCredit == _T("Translated into LANGUAGE by PERSON\n")) translatorCredit.Clear();
|
if (translatorCredit == _T("Translated into LANGUAGE by PERSON\n")) translatorCredit.Clear();
|
||||||
aboutString += wxString(_T("Aegisub ")) + GetAegisubVersionString() + _(" by ArchMage ZeratuL.\n");
|
aboutString += wxString(_T("Aegisub ")) + GetAegisubShortVersionString() + _(" by ArchMage ZeratuL.\n");
|
||||||
aboutString += _("Copyright (c) 2005-2006 - Rodrigo Braz Monteiro.\n\n");
|
aboutString += _("Copyright (c) 2005-2006 - Rodrigo Braz Monteiro.\n\n");
|
||||||
aboutString += _("Automation module is Copyright (c) 2005-2006 Niels Martin Hansen (aka jfs).\n");
|
aboutString += _("Automation module is Copyright (c) 2005-2006 Niels Martin Hansen (aka jfs).\n");
|
||||||
aboutString += _("Motion tracker module is Copyright (c) 2006 Hajo Krabbenhoeft (aka Tentacle).\n");
|
aboutString += _("Motion tracker module is Copyright (c) 2006 Hajo Krabbenhoeft (aka Tentacle).\n");
|
||||||
|
@ -66,7 +66,8 @@ AboutScreen::AboutScreen(wxWindow *parent)
|
||||||
aboutString += _("Manual by ArchMage ZeratuL, jfs, movax, Kobi, TheFluff and Jcubed.\n");
|
aboutString += _("Manual by ArchMage ZeratuL, jfs, movax, Kobi, TheFluff and Jcubed.\n");
|
||||||
aboutString += _("Forum and bug tracker hosting by Bot1.\n");
|
aboutString += _("Forum and bug tracker hosting by Bot1.\n");
|
||||||
aboutString += translatorCredit;
|
aboutString += translatorCredit;
|
||||||
aboutString += _("\nSee the help file for full credits.");
|
aboutString += _("\nSee the help file for full credits.\n");
|
||||||
|
aboutString += wxString::Format(_("Built by %s on %s."), GetAegisubBuildCredit().c_str(), GetAegisubBuildTime().c_str());
|
||||||
|
|
||||||
// Text sizer
|
// Text sizer
|
||||||
wxSizer *TextSizer = new wxBoxSizer(wxVERTICAL);
|
wxSizer *TextSizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
|
@ -129,7 +129,7 @@ void AssFile::Load (const wxString _filename,const wxString charset) {
|
||||||
loaded = true;
|
loaded = true;
|
||||||
|
|
||||||
// Add comments and set vars
|
// Add comments and set vars
|
||||||
AddComment(_T("Script generated by Aegisub ") + GetAegisubVersionString());
|
AddComment(_T("Script generated by Aegisub ") + GetAegisubLongVersionString());
|
||||||
AddComment(_T("http://www.aegisub.net"));
|
AddComment(_T("http://www.aegisub.net"));
|
||||||
SetScriptInfo(_T("ScriptType"),_T("v4.00+"));
|
SetScriptInfo(_T("ScriptType"),_T("v4.00+"));
|
||||||
AddToRecent(_filename);
|
AddToRecent(_filename);
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
# as described in version.cpp
|
# as described in version.cpp
|
||||||
|
|
||||||
from xml.dom.minidom import parse
|
from xml.dom.minidom import parse
|
||||||
|
from time import gmtime, strftime
|
||||||
|
|
||||||
entries_file = parse('../.svn/entries')
|
entries_file = parse('../.svn/entries')
|
||||||
|
|
||||||
|
@ -24,4 +25,5 @@ outfile = file("svn-revision.h", "w+")
|
||||||
outfile.write("// This file is automatically generated by make-svn-rev-header.py\n")
|
outfile.write("// This file is automatically generated by make-svn-rev-header.py\n")
|
||||||
outfile.write("// Do not modify or add to revision control\n\n")
|
outfile.write("// Do not modify or add to revision control\n\n")
|
||||||
outfile.write("#define BUILD_SVN_REVISION " + revision + "\n")
|
outfile.write("#define BUILD_SVN_REVISION " + revision + "\n")
|
||||||
|
outfile.write("#define BUILD_TIMESTAMP \"" + strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()) + "\"\n")
|
||||||
outfile.close()
|
outfile.close()
|
||||||
|
|
|
@ -706,7 +706,7 @@ void FrameMain::UpdateTitle() {
|
||||||
newTitle << file.GetFullName();
|
newTitle << file.GetFullName();
|
||||||
}
|
}
|
||||||
else newTitle << _T("Untitled");
|
else newTitle << _T("Untitled");
|
||||||
newTitle << _T(" - Aegisub ") << GetAegisubVersionString();
|
newTitle << _T(" - Aegisub ") << GetAegisubLongVersionString();
|
||||||
|
|
||||||
// Get current title
|
// Get current title
|
||||||
wxString curTitle = GetTitle();
|
wxString curTitle = GetTitle();
|
||||||
|
|
|
@ -71,6 +71,10 @@ Include:
|
||||||
Libraries:
|
Libraries:
|
||||||
lib
|
lib
|
||||||
|
|
||||||
|
6. Install a Python interpreter if you don't have one already, you will NEED it to run a script during the
|
||||||
|
build process.
|
||||||
|
http://www.python.org/download
|
||||||
|
|
||||||
Building instructions (aegisub):
|
Building instructions (aegisub):
|
||||||
|
|
||||||
1. Create a new blank Win32 c++ project in msvc.
|
1. Create a new blank Win32 c++ project in msvc.
|
||||||
|
@ -81,7 +85,19 @@ Building instructions (aegisub):
|
||||||
|
|
||||||
3.1. OPTIONAL - Define NO_SPELLCHECKER if you want to compile without aspell support.
|
3.1. OPTIONAL - Define NO_SPELLCHECKER if you want to compile without aspell support.
|
||||||
|
|
||||||
4. Add the libraries to the linker input. If you compiled portaudio with wmme you have to remove dsound.lib and srmiids.lib
|
4. Set up the build-versioning stuff.
|
||||||
|
|
||||||
|
4.1. Open projects settings and select All Configurations. Go to Build Events, Pre-build Event.
|
||||||
|
Change the Command Line to the following two lines (click "..."):
|
||||||
|
cd $(InputDir)\core\build
|
||||||
|
c:\python24\python.exe make-svn-rev-header.py
|
||||||
|
You'll obviously want to change the path to the Python interpreter.
|
||||||
|
|
||||||
|
4.2 Create the file core/build/build-credit.h and add this line to it:
|
||||||
|
#define BUILD_CREDIT "yournick"
|
||||||
|
Of course without indendation and replacing the yournick part.
|
||||||
|
|
||||||
|
5. Add the libraries to the linker input. If you compiled portaudio with wmme you have to remove dsound.lib and srmiids.lib
|
||||||
and replace PAStaticDS*.lib with the wmme version. Remove libaspell-15-dll.lib if you defined NO_SPELLCHECKER.
|
and replace PAStaticDS*.lib with the wmme version. Remove libaspell-15-dll.lib if you defined NO_SPELLCHECKER.
|
||||||
|
|
||||||
Link to these libraries for release:
|
Link to these libraries for release:
|
||||||
|
@ -90,4 +106,4 @@ freetype2110MT.lib libaspell-15-dll.lib wxzlib.lib wxpng.lib wxregexu.lib wxmsw2
|
||||||
Link to these libraries for debug:
|
Link to these libraries for debug:
|
||||||
freetype2110MT_D.lib libaspell-15-dll.lib dsound.lib PAStaticDSMTd.lib Vfw32.lib lua50MTd.lib wxzlibd.lib wxpngd.lib wxregexud.lib wxbase26ud.lib wxmsw26ud_media.lib wxmsw26ud_core.lib wxmsw26ud_adv.lib comctl32.lib rpcrt4.lib winmm.lib advapi32.lib wsock32.lib strmiids.lib
|
freetype2110MT_D.lib libaspell-15-dll.lib dsound.lib PAStaticDSMTd.lib Vfw32.lib lua50MTd.lib wxzlibd.lib wxpngd.lib wxregexud.lib wxbase26ud.lib wxmsw26ud_media.lib wxmsw26ud_core.lib wxmsw26ud_adv.lib comctl32.lib rpcrt4.lib winmm.lib advapi32.lib wsock32.lib strmiids.lib
|
||||||
|
|
||||||
5. Compile and wait.
|
6. Compile and wait.
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2005, Rodrigo Braz Monteiro
|
// Copyright (c) 2005, Niels Martin Hansen
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -30,24 +30,85 @@
|
||||||
// AEGISUB
|
// AEGISUB
|
||||||
//
|
//
|
||||||
// Website: http://aegisub.cellosoft.com
|
// Website: http://aegisub.cellosoft.com
|
||||||
// Contact: mailto:zeratul@cellosoft.com
|
// Contact: mailto:jiifurusu@gmail.com
|
||||||
//
|
//
|
||||||
|
|
||||||
// A note about this file:
|
|
||||||
// You can exclude version.cpp from your build (but still include version.h),
|
|
||||||
// and instead provide your own, custom version.cpp file, call it eg.
|
|
||||||
// my_version.cpp. This way you can easily provide a custom build notice.
|
|
||||||
//
|
|
||||||
// If you often distribute SVN builds you are encouraged to label your builds
|
|
||||||
// in this manner.
|
|
||||||
|
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
|
#include <wx/datetime.h>
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
wxString GetAegisubVersionString() {
|
// This include is generated by build/make-svn-rev-header.py
|
||||||
#ifdef _DEBUG
|
// That script should be run before every build is initiated
|
||||||
return _T("v1.10 Beta (debug)");
|
#include "build/svn-revision.h"
|
||||||
#else
|
|
||||||
return _T("v1.10 Beta PRE-RELEASE");
|
// Either create a build/build-credit.h file defining BUILD_CREDIT,
|
||||||
|
// or define it during compilation of this file
|
||||||
|
#ifndef BUILD_CREDIT
|
||||||
|
#include "build/build-credit.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// If the BUILD_SVN_REVISION happens to be zero or less, the build is assumed to be a public-release build (ie. not prerel)
|
||||||
|
// So manually edit build/svn-revision.h to match that, when doing such a build, or add some other magic to do that.
|
||||||
|
|
||||||
|
struct VersionInfoStruct {
|
||||||
|
// Some raw data
|
||||||
|
wxChar *VersionNumber;
|
||||||
|
bool IsDebug;
|
||||||
|
int SvnRev;
|
||||||
|
wxChar *BuildTime;
|
||||||
|
wxChar *BuildCredit;
|
||||||
|
|
||||||
|
// Nice strings for display
|
||||||
|
wxString LongVersionString;
|
||||||
|
wxString ShortVersionString;
|
||||||
|
|
||||||
|
// Generate the above data
|
||||||
|
VersionInfoStruct() {
|
||||||
|
// Update this whenever a new version is release
|
||||||
|
VersionNumber = _T("v1.10");
|
||||||
|
#ifdef _DEBUG
|
||||||
|
IsDebug = true;
|
||||||
|
#else
|
||||||
|
IsDebug = false;
|
||||||
|
#endif
|
||||||
|
SvnRev = BUILD_SVN_REVISION;
|
||||||
|
BuildTime = _T(BUILD_TIMESTAMP);
|
||||||
|
BuildCredit = _T(BUILD_CREDIT);
|
||||||
|
|
||||||
|
if (IsDebug && SvnRev > 0) {
|
||||||
|
LongVersionString = wxString::Format(_T("%s PRE-RELEASE (debug, svn %d, %s)"), VersionNumber, SvnRev, BuildCredit);
|
||||||
|
ShortVersionString = wxString::Format(_T("%s svn %d debug"), VersionNumber, SvnRev);
|
||||||
|
|
||||||
|
} else if (IsDebug && SvnRev <= 0) {
|
||||||
|
LongVersionString = wxString::Format(_T("%s beta (debug, %s)"), VersionNumber, BuildCredit);
|
||||||
|
ShortVersionString = wxString::Format(_T("%s beta debug"), VersionNumber);
|
||||||
|
|
||||||
|
} else if (SvnRev > 0) {
|
||||||
|
LongVersionString = wxString::Format(_T("%s PRE-RELEASE (svn %d, %s)"), VersionNumber, SvnRev, BuildCredit);
|
||||||
|
ShortVersionString = wxString::Format(_T("%s svn %d PRE-RELEASE"), VersionNumber, SvnRev);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
ShortVersionString = LongVersionString = wxString::Format(_T("%s beta"), VersionNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
VersionInfoStruct versioninfo;
|
||||||
|
|
||||||
|
|
||||||
|
wxString GetAegisubLongVersionString() {
|
||||||
|
return versioninfo.LongVersionString;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString GetAegisubShortVersionString() {
|
||||||
|
return versioninfo.ShortVersionString;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString GetAegisubBuildTime() {
|
||||||
|
return versioninfo.BuildTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString GetAegisubBuildCredit() {
|
||||||
|
return versioninfo.BuildCredit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2005, Rodrigo Braz Monteiro
|
// Copyright (c) 2005, Niels Martin Hansen
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -30,9 +30,16 @@
|
||||||
// AEGISUB
|
// AEGISUB
|
||||||
//
|
//
|
||||||
// Website: http://aegisub.cellosoft.com
|
// Website: http://aegisub.cellosoft.com
|
||||||
// Contact: mailto:zeratul@cellosoft.com
|
// Contact: mailto:jiifurusu@gmail.com
|
||||||
//
|
//
|
||||||
|
|
||||||
class wxString;
|
class wxString;
|
||||||
|
|
||||||
wxString GetAegisubVersionString();
|
// Version string appended in title bar of main window (quick identification of all elements of a build)
|
||||||
|
wxString GetAegisubLongVersionString();
|
||||||
|
// Version string used in About box, looks nicer
|
||||||
|
wxString GetAegisubShortVersionString();
|
||||||
|
// Timestamp of build, only shown in About box
|
||||||
|
wxString GetAegisubBuildTime();
|
||||||
|
// Name of who built the binary
|
||||||
|
wxString GetAegisubBuildCredit();
|
||||||
|
|
Loading…
Reference in a new issue