From: <mcu...@us...> - 2007-08-15 01:44:13
|
Revision: 1084 http://orm.svn.sourceforge.net/orm/?rev=1084&view=rev Author: mcurland Date: 2007-08-14 18:44:14 -0700 (Tue, 14 Aug 2007) Log Message: ----------- Initial batch file changes to enable building NORMA for Visual Studio 2008 (formerly Code Name "Orcas"). Minor tweaks to NUBuild to use VSCT v3.5 if running in MSBuild v3.5, and to account for item name changes in Microsoft.Common.targets. refs #337 refs #193 refs #320 refs #278 Modified Paths: -------------- trunk/FirstTimeBuildAll.bat trunk/SetupEnvironment.bat trunk/Tools/DisableRuleDirectiveProcessor/Install.bat trunk/Tools/NUBuild/Install.bat trunk/Tools/NUBuild/Neumont.Build.targets trunk/Tools/ORMCustomTool/Install.bat trunk/install.bat Modified: trunk/FirstTimeBuildAll.bat =================================================================== --- trunk/FirstTimeBuildAll.bat 2007-08-15 01:37:14 UTC (rev 1083) +++ trunk/FirstTimeBuildAll.bat 2007-08-15 01:44:14 UTC (rev 1084) @@ -3,15 +3,21 @@ SET RootDir=%~dp0. CALL "%RootDir%\SetupEnvironment.bat" %* +:: Normally, the next two lines would have parentheses around the command portions. However, it is possible +:: for there to be parentheses in the %VSIPDir% path (and there are by default on x64), which +:: causes a syntax error. Therefore, we leave the parentheses off here. +IF "%TargetVisualStudioNumericVersion%"=="8.0" SET VsSDKVsctDir=%VSIPDir%\Prerelease\VSCT +IF NOT DEFINED VsSDKVsctDir SET VsSDKVsctDir=%VSIPDir%\VisualStudioIntegration\Tools\Bin + :: GAC the VSCT compiler so that we can use it. -SET VsSDKVsctDir=%VSIPDir%\Prerelease\VSCT gacutil.exe /nologo /f /i "%VsSDKVsctDir%\VSCTCompress.dll" gacutil.exe /nologo /f /i "%VsSDKVsctDir%\VSCTLibrary.dll" gacutil.exe /nologo /f /i "%VsSDKVsctDir%\VSCT.exe" +:: As of the August 2007 release of the VsSDK, the VSCTCompress assembly is still versioned as 8.0.0.0. ngen.exe install "VSCTCompress, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /NoDependencies /nologo -ngen.exe install "VSCTLibrary, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /NoDependencies /nologo -ngen.exe install "VSCT, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /NoDependencies /nologo +ngen.exe install "VSCTLibrary, Version=%TargetVisualStudioNumericVersion%.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /NoDependencies /nologo +ngen.exe install "VSCT, Version=%TargetFrameworkNumericVersion%.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /NoDependencies /nologo MSBuild.exe /nologo "%RootDir%\Tools\NUBuild\NUBuild.sln" %* MSBuild.exe /nologo "%RootDir%\Tools\DisableRuleDirectiveProcessor\DisableRuleDirectiveProcessor.sln" %* Modified: trunk/SetupEnvironment.bat =================================================================== --- trunk/SetupEnvironment.bat 2007-08-15 01:37:14 UTC (rev 1083) +++ trunk/SetupEnvironment.bat 2007-08-15 01:44:14 UTC (rev 1084) @@ -2,8 +2,15 @@ IF "%~1"=="" (SET BuildOutDir=bin\Debug) ELSE (SET BuildOutDir=%~1.) -IF NOT DEFINED FrameworkSDKDir (CALL:_SetupVsVars) +:: TargetVisualStudioNumericVersion settings: +:: 8.0 = Visual Studio 2005 (Code Name "Whidbey") +:: 9.0 = Visual Studio 2008 (Code Name "Orcas") +SET TargetVisualStudioNumericVersion=8.0 +IF "%TargetVisualStudioNumericVersion%"=="9.0" (SET TargetFrameworkNumericVersion=3.5) ELSE (SET TargetFrameworkNumericVersion=2.0) + +IF NOT DEFINED FrameworkDir (CALL:_SetupVsVars) + :: Normally, the next line would have parentheses around the command portion. However, it is possible :: for there to be parentheses in the %ProgramFiles% path (and there are by default on x64), which :: causes a syntax error. Therefore, we leave the parentheses off here. @@ -19,23 +26,22 @@ SET DILTransformsDir=%DILDir%\Transforms SET VSRegistryRootBase=SOFTWARE\Microsoft\VisualStudio -:: VSRegistryRootVersion settings: -:: 8.0 = Visual Studio 2005 (Code Name "Whidbey") -:: 9.0 = Visual Studio Code Name "Orcas" -SET VSRegistryRootVersion=8.0 +SET VSRegistryRootVersion=%TargetVisualStudioNumericVersion% +:: Remove the value "Exp" on the next line if you want installations to be performed against the +:: regular (non-Experimental) Visual Studio registry hive SET VSRegistryRootSuffix=Exp SET VSRegistryRoot=%VSRegistryRootBase%\%VSRegistryRootVersion%%VSRegistryRootSuffix% FOR /F "usebackq skip=2 tokens=2*" %%A IN (`REG QUERY "HKLM\%VSRegistryRoot%\Setup\VS" /v "EnvironmentPath"`) DO SET VSEnvironmentPath=%%~fB FOR /F "usebackq skip=2 tokens=2*" %%A IN (`REG QUERY "HKLM\%VSRegistryRoot%\Setup\VS" /v "ProductDir"`) DO SET VSDir=%%~fB FOR /F "usebackq skip=2 tokens=2*" %%A IN (`REG QUERY "HKLM\%VSRegistryRoot%\VSTemplate\Item" /v "UserFolder"`) DO SET VSItemTemplatesDir=%%~fB -FOR /F "usebackq skip=2 tokens=2*" %%A IN (`REG QUERY "HKLM\%VSRegistryRootBase%\VSIP\8.0" /v "InstallDir"`) DO SET VSIPDir=%%~fB -SET RegPkg="%VSIPDir%\VisualStudioIntegration\Tools\Bin\regpkg.exe" /root:"%VSRegistryRoot%" +FOR /F "usebackq skip=2 tokens=2*" %%A IN (`REG QUERY "HKLM\%VSRegistryRootBase%\VSIP\%VSRegistryRootVersion%" /v "InstallDir"`) DO SET VSIPDir=%%~fB +IF "%TargetVisualStudioNumericVersion%"=="9.0" (SET RegPkg="%VSIPDir%\VisualStudioIntegration\Tools\Bin\VS2005\regpkg.exe" /root:"%VSRegistryRoot%") ELSE (SET RegPkg="%VSIPDir%\VisualStudioIntegration\Tools\Bin\regpkg.exe" /root:"%VSRegistryRoot%") GOTO:EOF :_SetupVsVars -:: Set up the build environment to use Orcas if available, falling back to 2005 otherwise. -IF DEFINED VS90COMNTOOLS (CALL "%VS90COMNTOOLS%\vsvars32.bat") ELSE (CALL "%VS80COMNTOOLS%\vsvars32.bat") +:: Set up the build environment. +CALL "%%VS%TargetVisualStudioNumericVersion:.=%COMNTOOLS%%\vsvars32.bat" GOTO:EOF Modified: trunk/Tools/DisableRuleDirectiveProcessor/Install.bat =================================================================== --- trunk/Tools/DisableRuleDirectiveProcessor/Install.bat 2007-08-15 01:37:14 UTC (rev 1083) +++ trunk/Tools/DisableRuleDirectiveProcessor/Install.bat 2007-08-15 01:44:14 UTC (rev 1084) @@ -5,8 +5,8 @@ SET BinDir=%RootDir%\bin -CALL:_AddTextTemplateReg "8.0" "DisableRuleDirectiveProcessor" -IF NOT "%VSRegistryRootSuffix%"=="" (CALL:_AddTextTemplateReg "8.0%VSRegistryRootSuffix%" "DisableRuleDirectiveProcessor") +CALL:_AddTextTemplateReg "%VSRegistryRootVersion%" "DisableRuleDirectiveProcessor" +IF NOT "%VSRegistryRootSuffix%"=="" (CALL:_AddTextTemplateReg "%VSRegistryRootVersion%%VSRegistryRootSuffix%" "DisableRuleDirectiveProcessor") GOTO:EOF @@ -15,4 +15,3 @@ REG ADD "HKLM\%VSRegistryRootBase%\%~1\TextTemplating\DirectiveProcessors\%~2" /f /v "Class" /d "Neumont.Tools.Modeling.%~2" REG ADD "HKLM\%VSRegistryRootBase%\%~1\TextTemplating\DirectiveProcessors\%~2" /f /v "CodeBase" /d "%BinDir%\Neumont.Tools.Modeling.DisableRuleDirectiveProcessor.dll" GOTO:EOF - Modified: trunk/Tools/NUBuild/Install.bat =================================================================== --- trunk/Tools/NUBuild/Install.bat 2007-08-15 01:37:14 UTC (rev 1083) +++ trunk/Tools/NUBuild/Install.bat 2007-08-15 01:44:14 UTC (rev 1084) @@ -11,8 +11,8 @@ XCOPY /Y /D /V /Q "%RootDir%\Tasks\RegexCompilationInfo.xsd" "%VSDir%\Xml\Schemas\" XCOPY /Y /D /V /Q "%RootDir%\Neumont.Build.targets" "%MSBuildExtensionsPath%\Neumont\" -REG ADD "HKLM\%VSRegistryRootBase%\8.0\MSBuild\SafeImports" /v "NUBuild1" /d "%MSBuildExtensionsPath%\Neumont\Neumont.Build.targets" /f -IF NOT "%VSRegistryRootSuffix%"=="" (REG ADD "HKLM\%VSRegistryRootBase%\8.0%VSRegistryRootSuffix%\MSBuild\SafeImports" /v "NUBuild1" /d "%MSBuildExtensionsPath%\Neumont\Neumont.Build.targets" /f) +REG ADD "HKLM\%VSRegistryRootBase%\%VSRegistryRootVersion%\MSBuild\SafeImports" /v "NUBuild1" /d "%MSBuildExtensionsPath%\Neumont\Neumont.Build.targets" /f +IF NOT "%VSRegistryRootSuffix%"=="" (REG ADD "HKLM\%VSRegistryRootBase%\%VSRegistryRootVersion%%VSRegistryRootSuffix%\MSBuild\SafeImports" /v "NUBuild1" /d "%MSBuildExtensionsPath%\Neumont\Neumont.Build.targets" /f) gacutil.exe /nologo /f /i "%RootDir%\bin\Neumont.Build.dll" ngen.exe install "Neumont.Build, Version=1.0.0.0, Culture=neutral, PublicKeyToken=957d5b7d5e79e25f" /NoDependencies /nologo /verbose Modified: trunk/Tools/NUBuild/Neumont.Build.targets =================================================================== --- trunk/Tools/NUBuild/Neumont.Build.targets 2007-08-15 01:37:14 UTC (rev 1083) +++ trunk/Tools/NUBuild/Neumont.Build.targets 2007-08-15 01:44:14 UTC (rev 1084) @@ -188,9 +188,10 @@ DependsOnTargets="$(_ResolveResourceMergeTargetsDependsOn)" Condition="'@(MergeResource)'!=''"> + <!-- In MSBuild v3.5, _CoreCompileResourceInputs and _SatelliteAssemblyResourceInputs replace ManifestResourceWithNoCulture and ManifestResourceWithCulture, respectively.--> <ResourceMergeTargetResolver MergeResources="@(MergeResource)" - ManifestResources="@(ManifestResourceWithCulture);@(ManifestResourceWithNoCulture)"> + ManifestResources="@(ManifestResourceWithCulture);@(ManifestResourceWithNoCulture);@(_CoreCompileResourceInputs);@(_SatelliteAssemblyResourceInputs)"> <Output TaskParameter="MergeResourcesWithResolvedTargets" ItemName="_MergeResourceWithResolvedTarget"/> </ResourceMergeTargetResolver> @@ -252,9 +253,14 @@ </Target> + <PropertyGroup> + <!-- HACK: BuildInParallel is a new property in MSBuild 3.5. If it is present, we can (for now) assume that we want to use the 3.5 version of VSCT. --> + <VsctAssemblyVersion Condition="'$(VsctAssemblyVersion)'=='' and '$(BuildInParallel)'!=''">3.5.0.0</VsctAssemblyVersion> + <VsctAssemblyVersion Condition="'$(VsctAssemblyVersion)'==''">2.0.0.0</VsctAssemblyVersion> + </PropertyGroup> <!-- Compiles .vsct files into .cto files. --> - <UsingTask TaskName="VSCTCompiler" AssemblyName="VSCT, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> + <UsingTask TaskName="VSCTCompiler" AssemblyName="VSCT, Version=$(VsctAssemblyVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> <ItemGroup> <!-- Add the CompileVsct Item name to the AvailableItemName item, so that it shows up in the Build Action drop-down menu in the properties windows in Visual Studio (and the equivalent in other IDEs). --> <AvailableItemName Include="CompileVsct"/> Modified: trunk/Tools/ORMCustomTool/Install.bat =================================================================== --- trunk/Tools/ORMCustomTool/Install.bat 2007-08-15 01:37:14 UTC (rev 1083) +++ trunk/Tools/ORMCustomTool/Install.bat 2007-08-15 01:44:14 UTC (rev 1084) @@ -16,10 +16,10 @@ XCOPY /Y /D /V /Q "%~dp0\bin\Neumont.Tools.ORM.ORMCustomTool.pdb" "%NORMADir%\bin\" :: For some reason, the next copy is randomly giving errors about half the time. They can be safely ignored, so they've been redirected to NUL. XCOPY /Y /D /V /Q "%~dp0\bin\Neumont.Tools.ORM.ORMCustomTool.xml" "%NORMADir%\bin\" 2>NUL -CALL:_InstallCustomToolReg "8.0" -CALL:_InstallExtenderReg "8.0" -IF NOT "%VSRegistryRootSuffix%"=="" (CALL:_InstallCustomToolReg "8.0%VSRegistryRootSuffix%") -IF NOT "%VSRegistryRootSuffix%"=="" (CALL:_InstallExtenderReg "8.0%VSRegistryRootSuffix%") +CALL:_InstallCustomToolReg "%VSRegistryRootVersion%" +CALL:_InstallExtenderReg "%VSRegistryRootVersion%" +IF NOT "%VSRegistryRootSuffix%"=="" (CALL:_InstallCustomToolReg "%VSRegistryRootVersion%%VSRegistryRootSuffix%") +IF NOT "%VSRegistryRootSuffix%"=="" (CALL:_InstallExtenderReg "%VSRegistryRootVersion%%VSRegistryRootSuffix%") :: Get rid of old transform registrations REG DELETE "HKLM\SOFTWARE\Neumont\ORM Architect for Visual Studio\Generators" /f 1>NUL 2>&1 Modified: trunk/install.bat =================================================================== --- trunk/install.bat 2007-08-15 01:37:14 UTC (rev 1083) +++ trunk/install.bat 2007-08-15 01:44:14 UTC (rev 1084) @@ -106,7 +106,7 @@ REG ADD "HKCR\ormfile\shell\open" /ve /d "&Open" /f 1>NUL REG ADD "HKCR\ormfile\shell\open\command" /ve /d "\"%VSEnvironmentPath%\" /RootSuffix \"%VSRegistryRootSuffix%\" /dde \"%%1\"" /f 1>NUL REG ADD "HKCR\ormfile\shell\open\ddeexec" /ve /d "Open(\"%%1\")" /f 1>NUL -REG ADD "HKCR\ormfile\shell\open\ddeexec\application" /ve /d "VisualStudio.8.0" /f 1>NUL +REG ADD "HKCR\ormfile\shell\open\ddeexec\application" /ve /d "VisualStudio.%TargetVisualStudioNumericVersion%" /f 1>NUL REG ADD "HKCR\ormfile\shell\open\ddeexec\topic" /ve /d "system" /f 1>NUL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |