diff --git a/core/about.cpp b/core/about.cpp index 55733a580..d17a24cdc 100644 --- a/core/about.cpp +++ b/core/about.cpp @@ -58,7 +58,7 @@ AboutScreen::AboutScreen(wxWindow *parent) wxString aboutString; wxString translatorCredit = _("Translated into LANGUAGE by PERSON\n"); 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 += _("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"); @@ -66,7 +66,8 @@ AboutScreen::AboutScreen(wxWindow *parent) aboutString += _("Manual by ArchMage ZeratuL, jfs, movax, Kobi, TheFluff and Jcubed.\n"); aboutString += _("Forum and bug tracker hosting by Bot1.\n"); 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 wxSizer *TextSizer = new wxBoxSizer(wxVERTICAL); diff --git a/core/ass_file.cpp b/core/ass_file.cpp index ae18aa9fc..e2103ab86 100644 --- a/core/ass_file.cpp +++ b/core/ass_file.cpp @@ -129,7 +129,7 @@ void AssFile::Load (const wxString _filename,const wxString charset) { loaded = true; // 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")); SetScriptInfo(_T("ScriptType"),_T("v4.00+")); AddToRecent(_filename); diff --git a/core/build/make-svn-rev-header.py b/core/build/make-svn-rev-header.py index 97e90dcea..705382f8b 100644 --- a/core/build/make-svn-rev-header.py +++ b/core/build/make-svn-rev-header.py @@ -10,6 +10,7 @@ # as described in version.cpp from xml.dom.minidom import parse +from time import gmtime, strftime 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("// Do not modify or add to revision control\n\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() diff --git a/core/frame_main.cpp b/core/frame_main.cpp index af0107826..7d479dfa9 100644 --- a/core/frame_main.cpp +++ b/core/frame_main.cpp @@ -706,7 +706,7 @@ void FrameMain::UpdateTitle() { newTitle << file.GetFullName(); } else newTitle << _T("Untitled"); - newTitle << _T(" - Aegisub ") << GetAegisubVersionString(); + newTitle << _T(" - Aegisub ") << GetAegisubLongVersionString(); // Get current title wxString curTitle = GetTitle(); diff --git a/core/readme.txt b/core/readme.txt index 14e8fc4e1..9debdc325 100644 --- a/core/readme.txt +++ b/core/readme.txt @@ -70,6 +70,10 @@ Include: include Libraries: 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): @@ -81,7 +85,19 @@ Building instructions (aegisub): 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. 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: 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. \ No newline at end of file +6. Compile and wait. \ No newline at end of file diff --git a/core/version.cpp b/core/version.cpp index 1d1c52b46..7816927a3 100644 --- a/core/version.cpp +++ b/core/version.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2005, Rodrigo Braz Monteiro +// Copyright (c) 2005, Niels Martin Hansen // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -30,24 +30,85 @@ // AEGISUB // // 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 +#include #include "version.h" -wxString GetAegisubVersionString() { -#ifdef _DEBUG - return _T("v1.10 Beta (debug)"); -#else - return _T("v1.10 Beta PRE-RELEASE"); +// This include is generated by build/make-svn-rev-header.py +// That script should be run before every build is initiated +#include "build/svn-revision.h" + +// 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 + +// 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; } diff --git a/core/version.h b/core/version.h index abc78402f..f7fbe5575 100644 --- a/core/version.h +++ b/core/version.h @@ -1,4 +1,4 @@ -// Copyright (c) 2005, Rodrigo Braz Monteiro +// Copyright (c) 2005, Niels Martin Hansen // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -30,9 +30,16 @@ // AEGISUB // // Website: http://aegisub.cellosoft.com -// Contact: mailto:zeratul@cellosoft.com +// Contact: mailto:jiifurusu@gmail.com // 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();