the changes to prebuild sources to compile for dotnet6

This commit is contained in:
UbitUmarov 2022-10-09 20:43:56 +01:00
parent 4678611a44
commit 302da0b61f
31 changed files with 27 additions and 483 deletions

Binary file not shown.

View File

@ -0,0 +1,12 @@
{
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
},
"configProperties": {
"System.Runtime.TieredCompilation": false
}
}
}

View File

@ -1 +0,0 @@
NAnt.exe clean

View File

@ -1 +0,0 @@
nant clean

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec mono [PREFIX]/prebuild.exe "$@"

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.10.xsd" version="1.10">
<Solution name="Prebuild" version="2.0.7">
<Solution name="Prebuild" version="2.0.8">
<Configuration name="Debug">
<Options>
<CompilerDefines>DEBUG;TRACE</CompilerDefines>
@ -31,7 +31,7 @@
rootNamespace="Prebuild"
startupObject="Prebuild.Prebuild"
version="2.0.7"
frameworkVersion="v4_6"
frameworkVersion="v6_0"
>
<Author>Matthew Holmes (matthew@wildfiregames.com)</Author>
<Author>Dan Moorehead (dan05a@gmail.com)</Author>
@ -63,8 +63,6 @@
</Options>
</Configuration>
<Reference name="System.EnterpriseServices" />
<Reference name="System.Xml" />
<Reference name="System" />
<Files>
<Match pattern="App.ico" buildAction="EmbeddedResource"/>
<Match path="data" pattern="prebuild-1.10.xsd" buildAction="EmbeddedResource"/>

View File

@ -1,127 +1 @@
rem Prebuild.exe /target VS2010
@ECHO OFF
echo ==========================================
echo ==== WhiteCore Prebuild Configuration ====
echo ==========================================
echo.
echo If you wish to customize the configuration, re-run with the switch '-p'
echo e.g. runprebuild -p
echo.
rem ## Default "configuration" choice ((r)elease, (d)ebug)
set configuration=d
rem ## Default Visual Studio edition
set vstudio=2010
rem ## Default Framework
set framework=4_0
rem ## Default architecture (86 (for 32bit), 64)
:CheckArch
set bits=AnyCPU
rem if exist "%PROGRAMFILES(X86)%" (set bits=x64)
rem if %bits% == x64 (
rem echo Found 64bit architecture
rem )
rem if %bits% == x86 (
rem echo Found 32 bit architecture
rem )
rem ## Determine native framework
:CheckOS
set framework=4_5
for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
if %version% == 10.0 (
set framework=4_5
echo Windows 10
)
if %version% == 6.3 (
set framework=4_5
echo Windows 8.1 or Server 2012 R2
)
if %version% == 6.2 (
set framework=4_5
echo Windows 8 or Server 2012
)
if %version% == 6.1 (
set framework=4_0
echo Windows 7 or Server 2008 R2
)
if %version% == 6.0 (
set framework=3_5
echo hmmm... Windows Vista or Server 2008
)
if %version% == 5.2 (
set framework=3_5
echo hmmm... Windows XP x64 or Server 2003
)
if %version% == 5.1 (
set framework=3_5
echo hmmm... Windows XP
)
rem ## If not requested, skip the prompting
if "%1" =="" goto final
if %1 == -p goto prompt
if %1 == --prompt goto prompt
goto final
:prompt
echo I will now ask you four questions regarding your build.
echo However, if you wish to build for:
echo %bits% Architecture
echo .NET %framework%
echo Visual Studio %vstudio%
echo.
echo Simply tap [ENTER] three times.
echo.
echo Note that you can change these defaults by opening this
echo batch file in a text editor.
echo.
:bits
set /p bits="Choose your architecture (x86, x64, AnyCPU) [%bits%]: "
if %bits%==86 goto configuration
if %bits%==x86 goto configuration
if %bits%==64 goto configuration
if %bits%==x64 goto configuration
if %bits%==AnyCPU goto configuration
if %bits%==anycpu goto configuration
echo "%bits%" isn't a valid choice!
goto bits
:configuration
set /p configuration="Choose your configuration ((r)elease or (d)ebug)? [%configuration%]: "
if %configuration%==r goto framework
if %configuration%==d goto framework
if %configuration%==release goto framework
if %configuration%==debug goto framework
echo "%configuration%" isn't a valid choice!
goto configuration
:framework
set /p framework="Choose your .NET framework (4_0 or 4_5)? [%framework%]: "
if %framework%==4_0 goto final
if %framework%==4_5 goto final
echo "%framework%" isn't a valid choice!
goto framework
:final
echo.
echo Configuring for %bits% architecture using %framework% .NET framework
echo.
echo.
if %framework%==4_5 set %vstudio%=2012
echo Calling Prebuild for target %vstudio% with framework %framework%...
..\bin\Prebuild.exe /target vs%vstudio% /targetframework v%framework% /conditionals ISWIN;NET_%framework%
dotnet bootstrap/prebuild.dll /target vs2022 /targetframework net6_0 /excludedir = "obj | bin" /file prebuild.xml

View File

@ -1,3 +1,2 @@
#!/bin/sh
#exec mono [PREFIX]/prebuild.exe "$@"
exec mono Prebuild.exe /target VS2010
dotnet bootstrap/prebuild.dll /target vs2022 /targetframework net6_0 /excludedir = "obj | bin" /file prebuild.xml

View File

@ -1,2 +0,0 @@
cd ..
Prebuild.exe /clean /yes /removedir obj /file prebuild.xml /build NET_2_0 /pause

View File

@ -1,4 +0,0 @@
#!/bin/sh
./prebuild /clean /removedir obj /file ../prebuild.xml /pause
rm -rf ../Makefile

View File

@ -1,2 +0,0 @@
cd ..
Prebuild.exe /usage /pause

View File

@ -1,2 +0,0 @@
#!/bin/sh
prebuild /target monodev /file ../prebuild.xml /build NET_1_1 /pause

View File

@ -1,231 +0,0 @@
!verbose 3
!define PRODUCT_NAME "Prebuild"
!define PRODUCT_VERSION "1.3.1"
!define PRODUCT_PUBLISHER "Prebuild"
!define PRODUCT_PACKAGE "prebuild"
!define PRODUCT_WEB_SITE "http://dnpb.sourceforge.net"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\Prebuild"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\Prebuild"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_PATH ".."
;!define MUI_WELCOMEFINISHPAGE_BITMAP "PrebuildLogo.bmp"
;!define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
;!define MUI_UNWELCOMEFINISHPAGE_BITMAP "PrebuildLogo.bmp"
;!define MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH
BrandingText "© 2003-2006 David Hudson, http://dnpb.sourceforge.net/"
SetCompressor lzma
CRCCheck on
; File Association defines
;!include "fileassoc.nsh"
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
;--------------------------------
;Variables
;--------------------------------
;Installer Pages
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "..\doc\license.txt"
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH
;------------------------------------
; Uninstaller pages
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;------------------------------------
; Language files
!insertmacro MUI_LANGUAGE "English"
; Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "..\${PRODUCT_PACKAGE}-${PRODUCT_VERSION}-setup.exe"
InstallDir "$PROGRAMFILES\Prebuild"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show
; .NET Framework check
; http://msdn.microsoft.com/netframework/default.aspx?pull=/library/en-us/dnnetdep/html/redistdeploy1_1.asp
; Section "Detecting that the .NET Framework 1.1 is installed"
Function .onInit
ReadRegDWORD $R0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v1.1.4322" Install
StrCmp $R0 "" 0 CheckPreviousVersion
MessageBox MB_OK "Microsoft .NET Framework 1.1 was not found on this system.$\r$\n$\r$\nUnable to continue this installation."
Abort
CheckPreviousVersion:
ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName"
StrCmp $R0 "" CheckOSVersion 0
MessageBox MB_OK "An old version of Prebuild is installed on this computer, please uninstall first.$\r$\n$\r$\nUnable to continue this installation."
Abort
CheckOSVersion:
Call IsSupportedWindowsVersion
Pop $R0
StrCmp $R0 "False" NoAbort 0
MessageBox MB_OK "The operating system you are using is not supported by Prebuild (95/98/ME/NT3.x/NT4.x)."
Abort
NoAbort:
FunctionEnd
Section "Source" SecSource
SetOverwrite ifnewer
SetOutPath "$INSTDIR\src"
File /r /x *.swp /x .svn /x *.xml /x *.csproj /x *.user /x *.build /x *.prjx /x *.mdp /x bin /x obj /x *.nsi ${PRODUCT_PATH}\src\*.*
;Store installation folder
WriteRegStr HKCU "Software\Prebuild" "" $INSTDIR
SectionEnd
Section "Runtime" SecRuntime
SetOverwrite ifnewer
SetOutPath "$INSTDIR"
File /r /x *.swp /x .svn /x *.nsi /x src /x *.sln /x *.cmbx /x *.mds ${PRODUCT_PATH}\Prebuild.exe ${PRODUCT_PATH}\prebuild.xml
;Store installation folder
WriteRegStr HKCU "Software\Prebuild" "" $INSTDIR
SectionEnd
Section "Documentation" SecDocs
SetOverwrite ifnewer
SetOutPath "$INSTDIR\doc"
File /r /x *.swp /x .svn /x *.exe ${PRODUCT_PATH}\doc\*.*
;Store installation folder
WriteRegStr HKCU "Software\Prebuild" "" $INSTDIR
SectionEnd
Section "Scripts" SecScripts
SetOverwrite ifnewer
SetOutPath "$INSTDIR\scripts"
File /r /x *.swp /x .svn /x *.nsi /x *.exe ${PRODUCT_PATH}\scripts\*.*
;Store installation folder
WriteRegStr HKCU "Software\Prebuild" "" $INSTDIR
SectionEnd
;Language strings
Section -AdditionalIcons
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
Section Uninstall
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
RMDir /r "$INSTDIR"
SectionEnd
; GetWindowsVersion, taken from NSIS help, modified for our purposes
Function IsSupportedWindowsVersion
Push $R0
Push $R1
ReadRegStr $R0 HKLM \
"SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
IfErrors 0 lbl_winnt
; we are not NT
ReadRegStr $R0 HKLM \
"SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
StrCpy $R1 $R0 1
StrCmp $R1 '4' 0 lbl_error
StrCpy $R1 $R0 3
StrCmp $R1 '4.0' lbl_win32_95
StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
lbl_win32_95:
StrCpy $R0 'False'
Goto lbl_done
lbl_win32_98:
StrCpy $R0 'False'
Goto lbl_done
lbl_win32_ME:
StrCpy $R0 'False'
Goto lbl_done
lbl_winnt:
StrCpy $R1 $R0 1
StrCmp $R1 '3' lbl_winnt_x
StrCmp $R1 '4' lbl_winnt_x
StrCpy $R1 $R0 3
StrCmp $R1 '5.0' lbl_winnt_2000
StrCmp $R1 '5.1' lbl_winnt_XP
StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
lbl_winnt_x:
StrCpy $R0 'False'
Goto lbl_done
lbl_winnt_2000:
Strcpy $R0 'True'
Goto lbl_done
lbl_winnt_XP:
Strcpy $R0 'True'
Goto lbl_done
lbl_winnt_2003:
Strcpy $R0 'True'
Goto lbl_done
lbl_error:
Strcpy $R0 'False'
lbl_done:
Pop $R1
Exch $R0
FunctionEnd

View File

@ -1,4 +0,0 @@
@rem Generates a combine (.cmbx) and a set of project files (.prjx)
@rem for SharpDevelop (http://icsharpcode.net/OpenSource/SD/Default.aspx)
cd ..
Prebuild.exe /target sharpdev /file prebuild.xml /build NET_1_1 /pause

View File

@ -1,4 +0,0 @@
@rem Generates a combine (.cmbx) and a set of project files (.prjx)
@rem for SharpDevelop (http://icsharpcode.net/OpenSource/SD/Default.aspx)
cd ..
Prebuild.exe /target sharpdev2 /file prebuild.xml /pause

View File

@ -1,4 +0,0 @@
@rem Generates a solution (.sln) and a set of project files (.csproj)
@rem for Microsoft Visual Studio .NET 2002
cd ..
Prebuild.exe /target vs2002 /file prebuild.xml /build NET_1_1 /pause

View File

@ -1,4 +0,0 @@
@rem Generates a solution (.sln) and a set of project files (.csproj)
@rem for Microsoft Visual Studio .NET 2002
cd ..
Prebuild.exe /target vs2003 /file prebuild.xml /build NET_1_1 /pause

View File

@ -1,4 +0,0 @@
@rem Generates a solution (.sln) and a set of project files (.csproj, .vbproj, etc.)
@rem for Microsoft Visual Studio .NET 2005
cd ..
Prebuild.exe /target vs2005 /file prebuild.xml /build NET_2_0 /pause

View File

@ -1,4 +0,0 @@
@rem Generates a solution (.sln) and a set of project files (.csproj, .vbproj, etc.)
@rem for Microsoft Visual Studio .NET 2008
cd ..
Prebuild.exe /target vs2008 /file prebuild.xml /pause

View File

@ -1,4 +0,0 @@
@rem Generates a solution (.sln) and a set of project files (.csproj, .vbproj, etc.)
@rem for Microsoft Visual Studio .NET 2010
cd ..
Prebuild.exe /target vs2010 /file prebuild.xml /pause

View File

@ -1,4 +0,0 @@
@rem Generates Makefiles
@rem for autotools
cd ..
Prebuild.exe /target autotools /file prebuild.xml /pause

View File

@ -1,5 +0,0 @@
#!/bin/sh
RUNTIME=`which mono`
SCRIPTDIR=`dirname $0`
${RUNTIME} ${SCRIPTDIR}/../Prebuild.exe /target autotools /file ${SCRIPTDIR}/../prebuild.xml /build NET_2_0

View File

@ -1,4 +0,0 @@
@rem Generates makefiles
@rem for make
cd ..
Prebuild.exe /target makefile /file prebuild.xml /pause

View File

@ -1,10 +0,0 @@
#!/bin/sh
./prebuild /target makefile /file ../prebuild.xml /pause
if [ -f ../Makefile ]
then
rm -rf ../Makefile
fi
mv ../Prebuild.make ../Makefile

View File

@ -1,4 +0,0 @@
@rem Generates a .build files
@rem for NAnt
cd ..
Prebuild.exe /target nant /file prebuild.xml /pause

View File

@ -1,2 +0,0 @@
#!/bin/sh
prebuild /target nant /file ../prebuild.xml /pause

View File

@ -1,4 +0,0 @@
@rem Generates a Xcode files
@rem for NAnt
cd ..
Prebuild.exe /target xcode /file prebuild.xml /pause

View File

@ -1,2 +0,0 @@
#!/bin/sh
prebuild /target xcode /file ../prebuild.xml /pause

View File

@ -202,21 +202,17 @@ namespace Prebuild.Core.Targets
private void transformToFile(string filename, XsltArgumentList argList, string nodeName)
{
// Create an XslTransform for this file
XslTransform templateTransformer =
new XslTransform();
XslTransform templateTransformer = new XslTransform();
// Load up the template
XmlNode templateNode =
autotoolsDoc.SelectSingleNode(nodeName + "/*");
templateTransformer.Load(templateNode.CreateNavigator(), xr, e);
XmlNode templateNode = autotoolsDoc.SelectSingleNode(nodeName + "/*");
//templateTransformer.Load(templateNode.CreateNavigator(), xr, e);
templateTransformer.Load(templateNode.CreateNavigator(), xr);
// Create a writer for the transformed template
XmlTextWriter templateWriter =
new XmlTextWriter(filename, null);
XmlTextWriter templateWriter = new XmlTextWriter(filename, null);
// Perform transformation, writing the file
templateTransformer.Transform
(m_Kernel.CurrentDoc, argList, templateWriter, xr);
templateTransformer.Transform(m_Kernel.CurrentDoc, argList, templateWriter, xr);
}
static string NormalizeAsmName(string name)
@ -639,7 +635,8 @@ namespace Prebuild.Core.Targets
{
string source = Path.Combine(project.FullPath, filename);
string dest = Path.Combine(projectDir, filename);
/*
if (filename.Contains("AssemblyInfo.cs"))
{
// If we've got an AssemblyInfo.cs, pull the version number from it
@ -683,7 +680,7 @@ namespace Prebuild.Core.Targets
}
}
*/
// Tell the user if there's a problem copying the file
try
{
@ -714,7 +711,7 @@ namespace Prebuild.Core.Targets
for (int refNum = 0; refNum < project.References.Count; refNum++)
{
ReferenceNode refr = project.References[refNum];
Assembly refAssembly = Assembly.LoadWithPartialName(refr.Name);
Assembly refAssembly = Assembly.Load(refr.Name);
/* Determine which pkg-config (.pc) file refers to
this assembly */

View File

@ -110,7 +110,7 @@ namespace Prebuild.Core.Targets
08:12 < cj> alrighty.
08:12 < jonp> you just get warnings when using it
*/
Assembly assem = Assembly.LoadWithPartialName(refr.Name);
Assembly assem = Assembly.Load(refr.Name);
ret += assem.FullName;
//ret += refr.Name;
}

View File

@ -37,7 +37,6 @@ using System.Collections.Specialized;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.EnterpriseServices.Internal;
using Prebuild.Core;
using Prebuild.Core.Utilities;
@ -71,16 +70,6 @@ namespace Prebuild
exit = true;
OutputTargets(kernel);
}
if (kernel.CommandLine.WasPassed("install"))
{
exit = true;
InstallAssembly(kernel);
}
if (kernel.CommandLine.WasPassed("remove"))
{
exit = true;
RemoveAssembly(kernel);
}
if (!exit)
{
@ -108,21 +97,6 @@ namespace Prebuild
#region Private Methods
private static void InstallAssembly(Kernel kernel)
{
Publish publish = new Publish();
string file = kernel.CommandLine["install"];
//Console.WriteLine(".."+file+"..");
publish.GacInstall(file);
}
private static void RemoveAssembly(Kernel kernel)
{
Publish publish = new Publish();
string file = kernel.CommandLine["remove"];
publish.GacRemove(file);
}
private static void OutputUsage()
{
Console.WriteLine("Usage: prebuild /target <target> [options]");
@ -135,8 +109,6 @@ namespace Prebuild
Console.WriteLine("/ppo Pre-process the file, but perform no other processing");
Console.WriteLine("/pause Pauses the application after execution to view the output");
Console.WriteLine("/yes Default to yes to any questions asked");
Console.WriteLine("/install Install assembly into the GAC");
Console.WriteLine("/remove Remove assembly from the GAC");
Console.WriteLine();
Console.WriteLine("See 'prebuild /showtargets for a list of available targets");
Console.WriteLine("See readme.txt or check out http://dnpb.sourceforge.net for more information");