From 11b907ebf45f5a0707c2748b8f7413b2910976a8 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Sun, 24 Apr 2011 12:34:57 -0400 Subject: CREATE_PROJECT: Update revision number support (fixes bug #3280881) Replace existing environment variable based revision number support by a file-based method - Generate a special header file in the build output folder with the current revision number - Include the new header file from internal_version.h when a specific define is set - Update create_project to define SCUMMVM_INTERNAL_REVISION as needed and add the build output folder to the include path - Remove support for git-svn clones in the revision script (not useful anymore after the switch to git) --- devtools/create_project/scripts/postbuild.cmd | 4 +- devtools/create_project/scripts/prebuild.cmd | 16 +++++-- devtools/create_project/scripts/revision.vbs | 69 ++++++++++++++------------- 3 files changed, 49 insertions(+), 40 deletions(-) (limited to 'devtools/create_project/scripts') diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd index 5c2bd8a1ad..f548b81442 100644 --- a/devtools/create_project/scripts/postbuild.cmd +++ b/devtools/create_project/scripts/postbuild.cmd @@ -12,7 +12,7 @@ REM Root folder REM Output folder REM Architecture -if "%~1"=="" goto error_input +if "%~1"=="" goto error_root if "%~2"=="" goto error_output if "%~3"=="" goto error_arch @@ -29,7 +29,7 @@ xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 > NUL 2>&1 xcopy /F /Y "%SCUMMVM_LIBS%/lib/%~3/SDL.dll" %~2 > NUL 2>&1 goto done -:error_output +:error_root echo Invalid root folder (%~1)! goto done diff --git a/devtools/create_project/scripts/prebuild.cmd b/devtools/create_project/scripts/prebuild.cmd index b824f0d5a0..dd4d12a851 100644 --- a/devtools/create_project/scripts/prebuild.cmd +++ b/devtools/create_project/scripts/prebuild.cmd @@ -4,22 +4,28 @@ REM --------------------------------------------------------------- REM -- Pre-Build Script REM --------------------------------------------------------------- REM -REM Generate file with proper revision number +REM Generate file with revision number REM REM Expected parameters -REM Root folder +REM Root folder (the source root folder) +REM Target folder (the build output folder, will be used to copy internal_revision.h) -if "%~1"=="" goto error_input +if "%~1"=="" goto error_root +if "%~2"=="" goto error_target REM Run the revision script -@call cscript "%~1/devtools/create_project/scripts/revision.vbs" %~1 1>NUL +@call cscript "%~1/devtools/create_project/scripts/revision.vbs" %~1 %~2 1>NUL if not %errorlevel% == 0 goto error_script goto done -:error_output +:error_root echo Invalid root folder (%~1)! goto done +:error_target +echo Invalid target folder (%~2)! +goto done + :error_script: echo An error occured while running the revision script! diff --git a/devtools/create_project/scripts/revision.vbs b/devtools/create_project/scripts/revision.vbs index 851185371b..9c29a88f2d 100644 --- a/devtools/create_project/scripts/revision.vbs +++ b/devtools/create_project/scripts/revision.vbs @@ -35,6 +35,7 @@ Dim WshShell : Set WshShell = CreateObject("WScript.Shell") ' Folders Dim rootFolder : rootFolder = "" +Dim targetFolder : targetFolder = "" ' Info variables Dim tool : tool = "" @@ -85,23 +86,25 @@ Sub DetermineRevision() Wscript.StdErr.WriteLine "Found revision " & revision & " on branch " & branch & vbCrLf ' Setup our revision string - Dim revisionString : revisionString = "r" & revision + Dim revisionString : revisionString = revision If (modified) Then - revisionString = revisionString & " M" + revisionString = revisionString & "-dirty" End If ' If we are not on trunk, add the branch name to the revision string - If (branch <> "trunk" And branch <> "") Then - revisionString = revisionString & " (" & branch & ")" + If (branch <> "trunk" And branch <> "master" And branch <> "") Then + revisionString = revisionString & "(" & branch & ")" End If - ' Add the DVCS name at the end - revisionString = revisionString & " - " & tool + ' Add the DVCS name at the end (when not git) + If (tool <> "git") Then + revisionString = revisionString & "-" & tool + End If - ' Setup an environment variable with the revision string - Dim Env: Set Env = WshShell.Environment("User") - Env.item("SCUMMVM_REVISION_STRING") = revisionString + ' Output revision header file + FSO.CopyFile rootFolder & "\\base\\internal_revision.h.in", targetFolder & "\\internal_revision.h" + FindReplaceInFile targetFolder & "\\internal_revision.h", "@REVISION@", revisionString End Sub Function DetermineTortoiseSVNVersion() @@ -283,29 +286,9 @@ Function DetermineGitVersion() End If End If - ' Check for svn clones - Set oExec = WshShell.Exec(gitPath & "log --pretty=format:%s --grep=" & Chr(34) & "^(svn r[0-9]*)" & Chr(34) & " -1 " & rootFolder) - if Err.Number = 0 Then - revision = Mid(oExec.StdOut.ReadLine(), 7) - revision = Mid(revision, 1, InStr(revision, ")") - 1) - tool = "svn-git" - End If - - ' No revision? Maybe it is a custom git-svn clone - If revision = "" Then - Err.Clear - Set oExec = WshShell.Exec(gitPath & "log --pretty=format:%b --grep=" & Chr(34) & "git-svn-id:.*@[0-9]*" & Chr(34) & " -1 " & rootFolder) - If Err.Number = 0 Then - revision = oExec.StdOut.ReadLine() - revision = Mid(revision, InStr(revision, "@") + 1) - revision = Mid(revision, 1, InStr(revision, " ") - 1) - tool = "svn-git" - End If - End If - ' Fallback to abbreviated revision number If revision = "" Then - revision = Mid(hash, 1, 8) + revision = Mid(hash, 1, 7) End If DetermineGitVersion = True @@ -385,8 +368,8 @@ End Function Function ParseCommandLine() ParseCommandLine = True - If Wscript.Arguments.Count <> 1 Then - Wscript.StdErr.WriteLine "[Error] Invalid number of arguments (was: " & Wscript.Arguments.Count & ", expected: 1)" + If Wscript.Arguments.Count <> 2 Then + Wscript.StdErr.WriteLine "[Error] Invalid number of arguments (was: " & Wscript.Arguments.Count & ", expected: 2)" ParseCommandLine = False Exit Function @@ -394,6 +377,7 @@ Function ParseCommandLine() ' Get our arguments rootFolder = Wscript.Arguments.Item(0) + targetFolder = Wscript.Arguments.Item(1) ' Check that the folders are valid If Not FSO.FolderExists(rootFolder) Then @@ -403,8 +387,16 @@ Function ParseCommandLine() Exit Function End If - ' Set absolute path + If Not FSO.FolderExists(targetFolder) Then + Wscript.StdErr.WriteLine "[Error] Invalid target folder (" & targetFolder & ")" + + ParseCommandLine = False + Exit Function + End If + + ' Set absolute paths rootFolder = FSO.GetAbsolutePathName(rootFolder) + targetFolder = FSO.GetAbsolutePathName(targetFolder) End Function Function ReadRegistryKey(shive, subkey, valuename, architecture) @@ -443,3 +435,14 @@ Function ReadRegistryKey(shive, subkey, valuename, architecture) ReadRegistryKey = Outparams.SValue End Function + +Sub FindReplaceInFile(filename, to_find, replacement) + Dim file, data + Set file = FSO.OpenTextFile(filename, 1, 0, 0) + data = file.ReadAll + file.Close + data = Replace(data, to_find, replacement) + Set file = FSO.CreateTextFile(filename, -1, 0) + file.Write data + file.Close +End Sub -- cgit v1.2.3 From 878d72b387d13bdb7713b142abae32bc28a51047 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Sun, 24 Apr 2011 13:33:23 -0400 Subject: CREATE_PROJECT: Move project-specific information to configuration file User-visible output and project-specific names are now defined in a config header. This allows an easier usage of the create_project tools in other scummvm-derived projects (such as residual). --- devtools/create_project/scripts/postbuild.cmd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'devtools/create_project/scripts') diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd index f548b81442..6c062f7ab1 100644 --- a/devtools/create_project/scripts/postbuild.cmd +++ b/devtools/create_project/scripts/postbuild.cmd @@ -11,10 +11,12 @@ REM Expected parameters REM Root folder REM Output folder REM Architecture +REM Libs folder if "%~1"=="" goto error_root if "%~2"=="" goto error_output if "%~3"=="" goto error_arch +if "%~4"=="" goto error_libs echo Copying data files echo. @@ -26,7 +28,7 @@ xcopy /F /Y "%~1/dists/engine-data/*.cpt" %~2 > NUL 2>&1 xcopy /F /Y "%~1/dists/engine-data/README" %~2 > NUL 2>&1 xcopy /F /Y "%~1/gui/themes/*.zip" %~2 > NUL 2>&1 xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 > NUL 2>&1 -xcopy /F /Y "%SCUMMVM_LIBS%/lib/%~3/SDL.dll" %~2 > NUL 2>&1 +xcopy /F /Y "%~4/lib/%~3/SDL.dll" %~2 > NUL 2>&1 goto done :error_root @@ -41,5 +43,9 @@ goto done echo Invalid arch parameter (was: %~3, allowed: x86, x64)! goto done +:error_libs +echo Invalid libs folder (%~4)! +goto done + :done exit /B0 -- cgit v1.2.3 From d418cd0fd7ebc3847fcf7097281bb1580324295c Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 26 Apr 2011 22:31:37 -0400 Subject: TOOLS: Add virtual keyboard feature selection to create_project --- devtools/create_project/scripts/postbuild.cmd | 2 ++ 1 file changed, 2 insertions(+) (limited to 'devtools/create_project/scripts') diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd index 6c062f7ab1..e5f29058b9 100644 --- a/devtools/create_project/scripts/postbuild.cmd +++ b/devtools/create_project/scripts/postbuild.cmd @@ -29,6 +29,8 @@ xcopy /F /Y "%~1/dists/engine-data/README" %~2 > NUL 2>&1 xcopy /F /Y "%~1/gui/themes/*.zip" %~2 > NUL 2>&1 xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 > NUL 2>&1 xcopy /F /Y "%~4/lib/%~3/SDL.dll" %~2 > NUL 2>&1 + +xcopy /F /Y "%~1/backends/vkeybd/packs/vkeybd_default.zip" %~2 > NUL 2>&1 goto done :error_root -- cgit v1.2.3 From 3f2b25f8790708cfdfd9c357acf7e43b95330077 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 26 Apr 2011 20:10:46 -0400 Subject: TOOLS: Update create_project to optionally create an installer after a successful build --- devtools/create_project/scripts/installer.vbs | 170 ++++++++++++++++++++++++++ devtools/create_project/scripts/postbuild.cmd | 41 +++++-- 2 files changed, 202 insertions(+), 9 deletions(-) create mode 100644 devtools/create_project/scripts/installer.vbs (limited to 'devtools/create_project/scripts') diff --git a/devtools/create_project/scripts/installer.vbs b/devtools/create_project/scripts/installer.vbs new file mode 100644 index 0000000000..3348b692e5 --- /dev/null +++ b/devtools/create_project/scripts/installer.vbs @@ -0,0 +1,170 @@ +' +' ScummVM - Graphic Adventure Engine +' +' ScummVM is the legal property of its developers, whose names +' are too numerous to list here. Please refer to the COPYRIGHT +' file distributed with this source distribution. +' +' This program is free software; you can redistribute it and/or +' modify it under the terms of the GNU General Public License +' as published by the Free Software Foundation, version 2 +' of the License. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License +' along with this program; if not, write to the Free Software +' Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +' +'/ + +Option Explicit + +Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject") +Dim WshShell : Set WshShell = CreateObject("WScript.Shell") + +' Folders +Dim rootFolder : rootFolder = "" +Dim targetFolder : targetFolder = "" + +' Parse our command line arguments +If ParseCommandLine() Then + CreateInstaller() +End If + +'//////////////////////////////////////////////////////////////// +'// Installer creation +'//////////////////////////////////////////////////////////////// +Sub CreateInstaller() + ' Get nsis installation folder + Dim nsisPath : nsisPath = GetNSISPath() + If (nsisPath = "") Then + Exit Sub + End If + + ' Build command line + Dim commandLine : commandLine = """" & nsisPath & "\makensis.exe"" /V2" & _ + " /Dtop_srcdir=""" & rootFolder & """" & _ + " /Dbuild_dir=""" & targetFolder & """" & _ + " /Dtext_dir=""" & targetFolder & """" & _ + " """ & rootFolder & "\dists\nsis\scummvm.nsi""" + + Dim oExec: Set oExec = WshShell.Exec(commandline) + If Err.Number <> 0 Then + Wscript.StdErr.WriteLine "Error running makensis.exe!" + Exit Sub + End If + + ' Wait till the application is finished ... + Dim ostdOut : Set oStdOut = oExec.StdOut + Do While oExec.Status = 0 + If Not ostdOut.AtEndOfStream Then + Wscript.StdErr.WriteLine ostdOut.ReadAll + End If + + WScript.Sleep 100 + Loop + + If oExec.ExitCode <> 0 Then + Wscript.StdErr.WriteLine "Error while creating installer!" + Exit Sub + End If +End Sub + +Function GetNSISPath() + ' Get the directory where NSIS (should) reside(s) + Dim sNSIS + + ' First, try with 32-bit architecture + sNSIS = ReadRegistryKey("HKLM", "SOFTWARE\NSIS", "", 32) + + If sNSIS = "" Or IsNull(sNSIS) Then + ' No 32-bit version of TortoiseSVN installed, try 64-bit version (doesn't hurt on 32-bit machines, it returns nothing or is ignored) + sNSIS = ReadRegistryKey("HKLM", "SOFTWARE\NSIS", "", 64) + End If + + ' Check if Tortoise is present + If sNSIS = "" Then + Wscript.StdErr.WriteLine "NSIS not installed!" + Exit Function + End If + + GetNSISPath = sNSIS +End Function + +'//////////////////////////////////////////////////////////////// +'// Utilities +'//////////////////////////////////////////////////////////////// +Function ParseCommandLine() + ParseCommandLine = True + + If Wscript.Arguments.Count <> 2 Then + Wscript.StdErr.WriteLine "[Error] Invalid number of arguments (was: " & Wscript.Arguments.Count & ", expected: 2)" + + ParseCommandLine = False + Exit Function + End If + + ' Get our arguments + rootFolder = Wscript.Arguments.Item(0) + targetFolder = Wscript.Arguments.Item(1) + + ' Check that the folders are valid + If Not FSO.FolderExists(rootFolder) Then + Wscript.StdErr.WriteLine "[Error] Invalid root folder (" & rootFolder & ")" + + ParseCommandLine = False + Exit Function + End If + + If Not FSO.FolderExists(targetFolder) Then + Wscript.StdErr.WriteLine "[Error] Invalid target folder (" & targetFolder & ")" + + ParseCommandLine = False + Exit Function + End If + + ' Set absolute paths + rootFolder = FSO.GetAbsolutePathName(rootFolder) + targetFolder = FSO.GetAbsolutePathName(targetFolder) +End Function + +Function ReadRegistryKey(shive, subkey, valuename, architecture) + Dim hiveKey, objCtx, objLocator, objServices, objReg, Inparams, Outparams + + ' First, get the Registry Provider for the requested architecture + Set objCtx = CreateObject("WbemScripting.SWbemNamedValueSet") + objCtx.Add "__ProviderArchitecture", architecture ' Must be 64 of 32 + Set objLocator = CreateObject("Wbemscripting.SWbemLocator") + Set objServices = objLocator.ConnectServer("","root\default","","",,,,objCtx) + Set objReg = objServices.Get("StdRegProv") + + ' Check the hive and give it the right value + Select Case shive + Case "HKCR", "HKEY_CLASSES_ROOT" + hiveKey = &h80000000 + Case "HKCU", "HKEY_CURRENT_USER" + hiveKey = &H80000001 + Case "HKLM", "HKEY_LOCAL_MACHINE" + hiveKey = &h80000002 + Case "HKU", "HKEY_USERS" + hiveKey = &h80000003 + Case "HKCC", "HKEY_CURRENT_CONFIG" + hiveKey = &h80000005 + Case "HKDD", "HKEY_DYN_DATA" ' Only valid for Windows 95/98 + hiveKey = &h80000006 + Case Else + MsgBox "Hive not valid (ReadRegistryKey)" + End Select + + Set Inparams = objReg.Methods_("GetStringValue").Inparameters + Inparams.Hdefkey = hiveKey + Inparams.Ssubkeyname = subkey + Inparams.Svaluename = valuename + Set Outparams = objReg.ExecMethod_("GetStringValue", Inparams,,objCtx) + + ReadRegistryKey = Outparams.SValue +End Function \ No newline at end of file diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd index 6c062f7ab1..aacf7255d0 100644 --- a/devtools/create_project/scripts/postbuild.cmd +++ b/devtools/create_project/scripts/postbuild.cmd @@ -1,34 +1,49 @@ -REM @echo off +@echo off REM --------------------------------------------------------------- REM -- Post-Build Script REM --------------------------------------------------------------- REM REM Copy engine data, themes, translation and required dlls to the -REM output folder. +REM output folder and optionnaly create an installer REM REM Expected parameters REM Root folder REM Output folder REM Architecture REM Libs folder +REM Installer ("1" to build, "0" to skip) if "%~1"=="" goto error_root if "%~2"=="" goto error_output if "%~3"=="" goto error_arch if "%~4"=="" goto error_libs +if "%~5"=="" goto error_installer echo Copying data files echo. -REM Copy files -xcopy /F /Y "%~1/dists/engine-data/*.dat" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/dists/engine-data/*.tbl" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/dists/engine-data/*.cpt" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/dists/engine-data/README" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/gui/themes/*.zip" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/AUTHORS" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/COPYING.GPL" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/COPYING" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/COPYING.LGPL" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/COPYRIGHT" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/NEWS" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/README" %~2 > NUL 2>&1 + +xcopy /F /Y "%~1/dists/engine-data/*.dat" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/dists/engine-data/*.tbl" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/dists/engine-data/*.cpt" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/gui/themes/*.zip" %~2 > NUL 2>&1 xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 > NUL 2>&1 -xcopy /F /Y "%~4/lib/%~3/SDL.dll" %~2 > NUL 2>&1 +xcopy /F /Y "%~4/lib/%~3/SDL.dll" %~2 > NUL 2>&1 + +if "%~5"=="0" goto done + +echo Running installer script +echo. +@call cscript "%~1/devtools/create_project/scripts/installer.vbs" %~1 %~2 1>NUL +if not %errorlevel% == 0 goto error_script goto done :error_root @@ -47,5 +62,13 @@ goto done echo Invalid libs folder (%~4)! goto done +:error_installer +echo Invalid installer parameter. Should be "0" or "1" (was %~5)! +goto done + +:error_script: +echo An error occured while running the installer script! +goto done + :done exit /B0 -- cgit v1.2.3 From 5618276f1884788f44c0f43d7a287e800ba8b5e8 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 28 Apr 2011 05:02:39 -0400 Subject: TOOLS: Add documentation to create_project installer/revision build scripts --- devtools/create_project/scripts/installer.vbs | 16 +++++++++++++++- devtools/create_project/scripts/revision.vbs | 17 ++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) (limited to 'devtools/create_project/scripts') diff --git a/devtools/create_project/scripts/installer.vbs b/devtools/create_project/scripts/installer.vbs index 3348b692e5..716fa279a9 100644 --- a/devtools/create_project/scripts/installer.vbs +++ b/devtools/create_project/scripts/installer.vbs @@ -21,6 +21,20 @@ ' '/ +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +' This script calls the makensis tool to generate a NSIS Windows installer for ScummVM +' +' It tries to read the NSIS installation folder from the registry and then calls the +' command line script compiler to create the installer. +' +' This is called from the postbuild.cmd batch file +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +'================================================================ +' TODO: Reduce duplication with revision.vbs script +' (ReadRegistryKey and ParseCommandLine are identical) +'================================================================ + Option Explicit Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject") @@ -167,4 +181,4 @@ Function ReadRegistryKey(shive, subkey, valuename, architecture) Set Outparams = objReg.ExecMethod_("GetStringValue", Inparams,,objCtx) ReadRegistryKey = Outparams.SValue -End Function \ No newline at end of file +End Function diff --git a/devtools/create_project/scripts/revision.vbs b/devtools/create_project/scripts/revision.vbs index 9c29a88f2d..fb904856ec 100644 --- a/devtools/create_project/scripts/revision.vbs +++ b/devtools/create_project/scripts/revision.vbs @@ -23,6 +23,21 @@ ' '/ +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +' This script tries to determine a revision number based on the current working tree +' by trying revision control tools in the following order: +' - git (with hg-git detection) +' - mercurial +' - TortoiseSVN +' - SVN +' +' It then writes a new header file to be included during build, with the revision +' information, the current branch, the revision control system (when not git) and +' a flag when the tree is dirty. +' +' This is called from the prebuild.cmd batch file +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + Option Explicit ' Working copy check priority: @@ -216,7 +231,7 @@ Function DetermineGitVersion() Wscript.StdErr.Write " Git... " tool = "git" - ' First check if we have both a .git & .svn folders (in case hg-git has been set up to have the git folder at the working copy level) + ' First check if we have both a .git & .hg folders (in case hg-git has been set up to have the git folder at the working copy level) If FSO.FolderExists(rootFolder & "/.git") And FSO.FolderExists(rootFolder & "/.hg") Then Wscript.StdErr.WriteLine "Mercurial clone with git repository in tree!" Exit Function -- cgit v1.2.3 From 8a02cf47320a9c2e8b6601ed61ee4d8264f4de09 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 28 Apr 2011 05:04:06 -0400 Subject: DISTS: Copy/use README-SDL to/from the build folder (it is copied from out of tree) --- devtools/create_project/scripts/postbuild.cmd | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'devtools/create_project/scripts') diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd index aacf7255d0..a9ffecabcf 100644 --- a/devtools/create_project/scripts/postbuild.cmd +++ b/devtools/create_project/scripts/postbuild.cmd @@ -5,7 +5,7 @@ REM -- Post-Build Script REM --------------------------------------------------------------- REM REM Copy engine data, themes, translation and required dlls to the -REM output folder and optionnaly create an installer +REM output folder and optionally create an installer REM REM Expected parameters REM Root folder @@ -23,13 +23,13 @@ if "%~5"=="" goto error_installer echo Copying data files echo. -xcopy /F /Y "%~1/AUTHORS" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/COPYING.GPL" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/COPYING" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/COPYING.LGPL" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/COPYRIGHT" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/NEWS" %~2 > NUL 2>&1 -xcopy /F /Y "%~1/README" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/AUTHORS" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/COPYING.GPL" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/COPYING" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/COPYING.LGPL" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/COPYRIGHT" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/NEWS" %~2 > NUL 2>&1 +xcopy /F /Y "%~1/README" %~2 > NUL 2>&1 xcopy /F /Y "%~1/dists/engine-data/*.dat" %~2 > NUL 2>&1 xcopy /F /Y "%~1/dists/engine-data/*.tbl" %~2 > NUL 2>&1 @@ -37,6 +37,7 @@ xcopy /F /Y "%~1/dists/engine-data/*.cpt" %~2 > NUL 2>&1 xcopy /F /Y "%~1/gui/themes/*.zip" %~2 > NUL 2>&1 xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 > NUL 2>&1 xcopy /F /Y "%~4/lib/%~3/SDL.dll" %~2 > NUL 2>&1 +xcopy /F /Y "%~4/README-SDL" %~2 > NUL 2>&1 if "%~5"=="0" goto done -- cgit v1.2.3 From ca9ed0a9798b1d44541a73950a01f1f5b4e3b442 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 5 May 2011 13:11:57 -0400 Subject: CREATE_PROJECT: Pass architecture to nsis setup in post-build step --- devtools/create_project/scripts/installer.vbs | 16 ++++++++++++++-- devtools/create_project/scripts/postbuild.cmd | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'devtools/create_project/scripts') diff --git a/devtools/create_project/scripts/installer.vbs b/devtools/create_project/scripts/installer.vbs index 716fa279a9..6bcd794bef 100644 --- a/devtools/create_project/scripts/installer.vbs +++ b/devtools/create_project/scripts/installer.vbs @@ -43,6 +43,7 @@ Dim WshShell : Set WshShell = CreateObject("WScript.Shell") ' Folders Dim rootFolder : rootFolder = "" Dim targetFolder : targetFolder = "" +Dim arch : arch = "" ' Parse our command line arguments If ParseCommandLine() Then @@ -59,11 +60,21 @@ Sub CreateInstaller() Exit Sub End If + ' Preprocess architecture + Select Case arch + Case "x86" + arch = "win32" + + Case "x64" + arch = "win64" + End Select + ' Build command line Dim commandLine : commandLine = """" & nsisPath & "\makensis.exe"" /V2" & _ " /Dtop_srcdir=""" & rootFolder & """" & _ " /Dbuild_dir=""" & targetFolder & """" & _ " /Dtext_dir=""" & targetFolder & """" & _ + " /DARCH=""" & arch & """" & _ " """ & rootFolder & "\dists\nsis\scummvm.nsi""" Dim oExec: Set oExec = WshShell.Exec(commandline) @@ -115,8 +126,8 @@ End Function Function ParseCommandLine() ParseCommandLine = True - If Wscript.Arguments.Count <> 2 Then - Wscript.StdErr.WriteLine "[Error] Invalid number of arguments (was: " & Wscript.Arguments.Count & ", expected: 2)" + If Wscript.Arguments.Count <> 3 Then + Wscript.StdErr.WriteLine "[Error] Invalid number of arguments (was: " & Wscript.Arguments.Count & ", expected: 3)" ParseCommandLine = False Exit Function @@ -125,6 +136,7 @@ Function ParseCommandLine() ' Get our arguments rootFolder = Wscript.Arguments.Item(0) targetFolder = Wscript.Arguments.Item(1) + arch = Wscript.Arguments.Item(2) ' Check that the folders are valid If Not FSO.FolderExists(rootFolder) Then diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd index da61afcc3c..e78861463a 100644 --- a/devtools/create_project/scripts/postbuild.cmd +++ b/devtools/create_project/scripts/postbuild.cmd @@ -45,7 +45,7 @@ if "%~5"=="0" goto done echo Running installer script echo. -@call cscript "%~1/devtools/create_project/scripts/installer.vbs" %~1 %~2 1>NUL +@call cscript "%~1/devtools/create_project/scripts/installer.vbs" %~1 %~2 %~3 1>NUL if not %errorlevel% == 0 goto error_script goto done -- cgit v1.2.3 From 3f370629020d0d13c2612a55566b2c3480acc4eb Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 5 May 2011 13:53:32 -0400 Subject: CREATE_PROJECT: Generate the same revision numbers as the configure script The revision number now includes the number of commits since the last tag --- devtools/create_project/scripts/revision.vbs | 31 +++++++++++++++++++++------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'devtools/create_project/scripts') diff --git a/devtools/create_project/scripts/revision.vbs b/devtools/create_project/scripts/revision.vbs index fb904856ec..3e1212521c 100644 --- a/devtools/create_project/scripts/revision.vbs +++ b/devtools/create_project/scripts/revision.vbs @@ -97,14 +97,15 @@ Sub DetermineRevision() End If End If End If - - Wscript.StdErr.WriteLine "Found revision " & revision & " on branch " & branch & vbCrLf - + + Dim outputInfo : outputInfo = "Found revision " & revision & " on branch " & branch + ' Setup our revision string Dim revisionString : revisionString = revision If (modified) Then revisionString = revisionString & "-dirty" + outputInfo = outputInfo & " (dirty)" End If ' If we are not on trunk, add the branch name to the revision string @@ -115,7 +116,10 @@ Sub DetermineRevision() ' Add the DVCS name at the end (when not git) If (tool <> "git") Then revisionString = revisionString & "-" & tool + outputInfo = outputInfo & " using " & tool End If + + Wscript.StdErr.WriteLine outputInfo & vbCrLf ' Output revision header file FSO.CopyFile rootFolder & "\\base\\internal_revision.h.in", targetFolder & "\\internal_revision.h" @@ -228,6 +232,7 @@ Function DetermineGitVersion() Err.Clear On Error Resume Next DetermineGitVersion = False + Dim line Wscript.StdErr.Write " Git... " tool = "git" @@ -265,10 +270,10 @@ Function DetermineGitVersion() End If ' Get the version hash - Dim hash: hash = oExec.StdOut.ReadLine() + Dim hash : hash = oExec.StdOut.ReadLine() ' Make sure index is in sync with disk - Set oExec = WshShell.Exec(gitPath & "update-index --refresh") + Set oExec = WshShell.Exec(gitPath & "update-index --refresh --unmerged") If Err.Number = 0 Then ' Wait till the application is finished ... Do While oExec.Status = 0 @@ -276,7 +281,7 @@ Function DetermineGitVersion() Loop End If - Set oExec = WshShell.Exec(gitPath & "diff-index --exit-code --quiet HEAD " & rootFolder) + Set oExec = WshShell.Exec(gitPath & "diff-index --quiet HEAD " & rootFolder) If oExec.ExitCode <> 0 Then Wscript.StdErr.WriteLine "Error parsing git revision!" Exit Function @@ -294,14 +299,24 @@ Function DetermineGitVersion() ' Get branch name Set oExec = WshShell.Exec(gitPath & "symbolic-ref HEAD") If Err.Number = 0 Then - Dim line: line = oExec.StdOut.ReadLine() + line = oExec.StdOut.ReadLine() line = Mid(line, InStrRev(line, "/") + 1) If line <> "master" Then branch = line End If End If - ' Fallback to abbreviated revision number + ' Get revision description + Set oExec = WshShell.Exec(gitPath & "describe --match desc/*") + If Err.Number = 0 Then + line = oExec.StdOut.ReadLine() + line = Mid(line, InStr(line, "-") + 1) + If line <> "" Then + revision = line + End If + End If + + ' Fallback to abbreviated revision number if needed If revision = "" Then revision = Mid(hash, 1, 7) End If -- cgit v1.2.3