Update to 1.10.2
This commit is contained in:
@@ -19,7 +19,7 @@ Sub FindReplaceInFile(filename, to_find, replacement)
|
||||
file.Close
|
||||
End Sub
|
||||
|
||||
Sub UpdateFile(modified, isodate, version, cur_date, githash, istag, isstabletag, filename)
|
||||
Sub UpdateFile(modified, isodate, version, cur_date, githash, istag, isstabletag, year, filename)
|
||||
FSO.CopyFile filename & ".in", filename
|
||||
FindReplaceInFile filename, "!!MODIFIED!!", modified
|
||||
FindReplaceInFile filename, "!!ISODATE!!", isodate
|
||||
@@ -28,10 +28,11 @@ Sub UpdateFile(modified, isodate, version, cur_date, githash, istag, isstabletag
|
||||
FindReplaceInFile filename, "!!GITHASH!!", githash
|
||||
FindReplaceInFile filename, "!!ISTAG!!", istag
|
||||
FindReplaceInFile filename, "!!ISSTABLETAG!!", isstabletag
|
||||
FindReplaceInFile filename, "!!YEAR!!", year
|
||||
End Sub
|
||||
|
||||
Sub UpdateFiles(version)
|
||||
Dim modified, isodate, cur_date, githash, istag, isstabletag
|
||||
Dim modified, isodate, cur_date, githash, istag, isstabletag, year
|
||||
cur_date = DatePart("D", Date) & "." & DatePart("M", Date) & "." & DatePart("YYYY", Date)
|
||||
|
||||
If InStr(version, Chr(9)) Then
|
||||
@@ -41,26 +42,29 @@ Sub UpdateFiles(version)
|
||||
githash = Mid(modified, InStr(modified, Chr(9)) + 1)
|
||||
istag = Mid(githash, InStr(githash, Chr(9)) + 1)
|
||||
isstabletag = Mid(istag, InStr(istag, Chr(9)) + 1)
|
||||
year = Mid(isstabletag, InStr(isstabletag, Chr(9)) + 1)
|
||||
' Remove tails from fields
|
||||
version = Mid(version, 1, InStr(version, Chr(9)) - 1)
|
||||
isodate = Mid(isodate, 1, InStr(isodate, Chr(9)) - 1)
|
||||
modified = Mid(modified, 1, InStr(modified, Chr(9)) - 1)
|
||||
githash = Mid(githash, 1, InStr(githash, Chr(9)) - 1)
|
||||
istag = Mid(istag, 1, InStr(istag, Chr(9)) - 1)
|
||||
isstabletag = Mid(isstabletag, 1, InStr(isstabletag, Chr(9)) - 1)
|
||||
Else
|
||||
isodate = 0
|
||||
modified = 1
|
||||
githash = ""
|
||||
istag = 0
|
||||
isstabletag = 0
|
||||
year = ""
|
||||
End If
|
||||
|
||||
UpdateFile modified, isodate, version, cur_date, githash, istag, isstabletag, "../src/rev.cpp"
|
||||
UpdateFile modified, isodate, version, cur_date, githash, istag, isstabletag, "../src/os/windows/ottdres.rc"
|
||||
UpdateFile modified, isodate, version, cur_date, githash, istag, isstabletag, year, "../src/rev.cpp"
|
||||
UpdateFile modified, isodate, version, cur_date, githash, istag, isstabletag, year, "../src/os/windows/ottdres.rc"
|
||||
End Sub
|
||||
|
||||
Function DetermineVersion()
|
||||
Dim WshShell, branch, tag, modified, isodate, oExec, line, hash, shorthash
|
||||
Dim WshShell, branch, tag, modified, isodate, oExec, line, hash, shorthash, year
|
||||
Set WshShell = CreateObject("WScript.Shell")
|
||||
On Error Resume Next
|
||||
|
||||
@@ -70,6 +74,7 @@ Function DetermineVersion()
|
||||
branch = ""
|
||||
isodate = ""
|
||||
tag = ""
|
||||
year = ""
|
||||
|
||||
' Set the environment to english
|
||||
WshShell.Environment("PROCESS")("LANG") = "en"
|
||||
@@ -108,6 +113,7 @@ Function DetermineVersion()
|
||||
if Err.Number = 0 Then
|
||||
isodate = Mid(oExec.StdOut.ReadLine(), 1, 10)
|
||||
isodate = Replace(isodate, "-", "")
|
||||
year = Mid(isodate, 1, 4)
|
||||
End If ' Err.Number = 0
|
||||
|
||||
' Check branch
|
||||
@@ -171,7 +177,7 @@ Function DetermineVersion()
|
||||
isstabletag = 0
|
||||
End If
|
||||
|
||||
DetermineVersion = version & Chr(9) & isodate & Chr(9) & modified & Chr(9) & hash & Chr(9) & istag & Chr(9) & isstabletag
|
||||
DetermineVersion = version & Chr(9) & isodate & Chr(9) & modified & Chr(9) & hash & Chr(9) & istag & Chr(9) & isstabletag & Chr(9) & year
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ fi
|
||||
# First, collect the list of Windows files
|
||||
allegro_config=""
|
||||
sdl_config="1"
|
||||
sdl2_config="1"
|
||||
png_config="1"
|
||||
os="MSVC"
|
||||
enable_dedicated="0"
|
||||
@@ -123,6 +124,7 @@ load_main_data() {
|
||||
|
||||
if ($0 == "ALLEGRO" && "'$allegro_config'" == "") { next; }
|
||||
if ($0 == "SDL" && "'$sdl_config'" == "") { next; }
|
||||
if ($0 == "SDL2" && "'$sdl2_config'" == "") { next; }
|
||||
if ($0 == "PNG" && "'$png_config'" == "") { next; }
|
||||
if ($0 == "OSX" && "'$os'" != "OSX") { next; }
|
||||
if ($0 == "OS2" && "'$os'" != "OS2") { next; }
|
||||
@@ -263,19 +265,22 @@ generate() {
|
||||
echo "Generating $2..."
|
||||
# Everything above the !!FILTERS!! marker
|
||||
cat "$ROOT_DIR/projects/$2".in | ${AWK} -v BINMODE=1 -v FILTERS="$3" -v FILES="$1" '
|
||||
{ CR = (match($0, "\\r$") > 0 ? "\r" : "") }
|
||||
/^$/ { next }
|
||||
/!!FILTERS!!/ {
|
||||
split(FILTERS, filters, "\n");
|
||||
for (i = 1; filters[i] != ""; i++) {
|
||||
print filters[i] CR;
|
||||
line = $0
|
||||
gsub(/!!FILTERS!!/, filters[i], line);
|
||||
print line;
|
||||
}
|
||||
next;
|
||||
}
|
||||
/!!FILES!!/ {
|
||||
split(FILES, files, "\n");
|
||||
for (i = 1; files[i] != ""; i++) {
|
||||
print files[i] CR;
|
||||
line = $0
|
||||
gsub(/!!FILES!!/, files[i], line);
|
||||
print line;
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
@@ -172,6 +172,7 @@ Sub load_main_data(filename, ByRef vcxproj, ByRef filters, ByRef files)
|
||||
line = Replace(line, "#if ", "")
|
||||
If deep = skip And ( _
|
||||
line = "SDL" Or _
|
||||
line = "SDL2" Or _
|
||||
line = "PNG" Or _
|
||||
line = "WIN32" Or _
|
||||
line = "MSVC" Or _
|
||||
@@ -321,21 +322,26 @@ Sub load_baseset_data(dir, langdir, ByRef vcxproj, ByRef files, ByRef langs)
|
||||
End Sub
|
||||
|
||||
Sub generate(data, dest, data2)
|
||||
Dim srcfile, destfile, line
|
||||
Dim srcfile, destfile, line, regexp
|
||||
WScript.Echo "Generating " & FSO.GetFileName(dest) & "..."
|
||||
Set srcfile = FSO.OpenTextFile(dest & ".in", 1, 0, 0)
|
||||
Set destfile = FSO.CreateTextFile(dest, -1, 0)
|
||||
|
||||
If Not IsNull(data2) Then
|
||||
' Everything above the !!FILTERS!! marker
|
||||
Set regexp = New RegExp
|
||||
regexp.Pattern = "!!FILTERS!!"
|
||||
regexp.Global = True
|
||||
|
||||
line = srcfile.ReadLine()
|
||||
While line <> "!!FILTERS!!"
|
||||
While Not regexp.Test(line)
|
||||
If len(line) > 0 Then destfile.WriteLine(line)
|
||||
line = srcfile.ReadLine()
|
||||
Wend
|
||||
|
||||
' Our generated content
|
||||
destfile.WriteLine(data2)
|
||||
line = regexp.Replace(line, data2)
|
||||
destfile.WriteLine(line)
|
||||
End If
|
||||
|
||||
' Everything above the !!FILES!! marker
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<SettingsCommandLine>
|
||||
..\objs\settings\settings_gen.exe -o ..\objs\settings\table\settings.h -b ..\src\table\settings.h.preamble -a ..\src\table\settings.h.postamble ..\src\table\company_settings.ini ..\src\table\currency_settings.ini ..\src\table\gameopt_settings.ini ..\src\table\misc_settings.ini ..\src\table\settings.ini ..\src\table\win32_settings.ini ..\src\table\window_settings.ini
|
||||
</SettingsCommandLine>
|
||||
<SettingsCommandLine>..\objs\settings\settings_gen.exe -o ..\objs\settings\table\settings.h -b ..\src\table\settings.h.preamble -a ..\src\table\settings.h.postamble ..\src\table\company_settings.ini ..\src\table\currency_settings.ini ..\src\table\gameopt_settings.ini ..\src\table\misc_settings.ini ..\src\table\settings.ini ..\src\table\win32_settings.ini ..\src\table\window_settings.ini</SettingsCommandLine>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\settings\table\</OutDir>
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<SettingsCommandLine>
|
||||
!!FILTERS!!
|
||||
</SettingsCommandLine>
|
||||
<SettingsCommandLine>!!FILTERS!!</SettingsCommandLine>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\settings\table\</OutDir>
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<SettingsCommandLine>
|
||||
..\objs\settings\settings_gen.exe -o ..\objs\settings\table\settings.h -b ..\src\table\settings.h.preamble -a ..\src\table\settings.h.postamble ..\src\table\company_settings.ini ..\src\table\currency_settings.ini ..\src\table\gameopt_settings.ini ..\src\table\misc_settings.ini ..\src\table\settings.ini ..\src\table\win32_settings.ini ..\src\table\window_settings.ini
|
||||
</SettingsCommandLine>
|
||||
<SettingsCommandLine>..\objs\settings\settings_gen.exe -o ..\objs\settings\table\settings.h -b ..\src\table\settings.h.preamble -a ..\src\table\settings.h.postamble ..\src\table\company_settings.ini ..\src\table\currency_settings.ini ..\src\table\gameopt_settings.ini ..\src\table\misc_settings.ini ..\src\table\settings.ini ..\src\table\win32_settings.ini ..\src\table\window_settings.ini</SettingsCommandLine>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\settings\table\</OutDir>
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<SettingsCommandLine>
|
||||
!!FILTERS!!
|
||||
</SettingsCommandLine>
|
||||
<SettingsCommandLine>!!FILTERS!!</SettingsCommandLine>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\settings\table\</OutDir>
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<SettingsCommandLine>
|
||||
..\objs\settings\settings_gen.exe -o ..\objs\settings\table\settings.h -b ..\src\table\settings.h.preamble -a ..\src\table\settings.h.postamble ..\src\table\company_settings.ini ..\src\table\currency_settings.ini ..\src\table\gameopt_settings.ini ..\src\table\misc_settings.ini ..\src\table\settings.ini ..\src\table\win32_settings.ini ..\src\table\window_settings.ini
|
||||
</SettingsCommandLine>
|
||||
<SettingsCommandLine>..\objs\settings\settings_gen.exe -o ..\objs\settings\table\settings.h -b ..\src\table\settings.h.preamble -a ..\src\table\settings.h.postamble ..\src\table\company_settings.ini ..\src\table\currency_settings.ini ..\src\table\gameopt_settings.ini ..\src\table\misc_settings.ini ..\src\table\settings.ini ..\src\table\win32_settings.ini ..\src\table\window_settings.ini</SettingsCommandLine>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\settings\table\</OutDir>
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<SettingsCommandLine>
|
||||
!!FILTERS!!
|
||||
</SettingsCommandLine>
|
||||
<SettingsCommandLine>!!FILTERS!!</SettingsCommandLine>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\settings\table\</OutDir>
|
||||
|
||||
Reference in New Issue
Block a user