Permalink
Browse files

fix common.build.targets and XmlDom project file for non-windows

- common.build.targets:
  - add target to restore nuget packages
  - only run updateversionfromchangeset batch script on windows
  - Extra ) char causing additional output folders to be created
  - include UpdateFileVersionFromChangeset.sh for unix-like systems
  - change batch script UpdateFileVersionFromChangeset.cmd to only run on Windows NT systems

- XmlDom Project file
  - added windows-os check to prebuild target with windows-specifics
  - separated ClassDynamizer.exe to separate unrestricted prebuild target
  - fix capitalization of System.Configuration assembly reference
  • Loading branch information...
1 parent eb2c75f commit d7b1139bdb9e2540b63d54fb83c2ff13f3c9e31d @diddledan diddledan committed Jan 8, 2016
View
@@ -13,6 +13,7 @@
# nuget-specifics
packages
*.nupkg
+Tools/nuget.exe
# Build results
*_i.c
@@ -52,7 +53,7 @@ ipch/
# ReSharper is a .NET coding add-in
_ReSharper*
-# Installshield output folder
+# Installshield output folder
[Ee]xpress
# Backup & report files from converting an old project file to a newer
@@ -67,7 +68,7 @@ UpgradeLog*.XML
############
# Windows image file caches
-Thumbs.db
+Thumbs.db
# Folder config file
Desktop.ini
@@ -92,4 +93,4 @@ Deployment/Bin/PhpNetXmlDom.xml
Deployment/Bin/PhpNetZip.dll
Deployment/Bin/System.Data.SQLite.dll
Deployment/Release*
-Deployment/Debug*
+Deployment/Debug*
@@ -17,9 +17,9 @@
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputPath Condition="'$(OutputPath)' == ''">$(RootDir)Deployment\$(Configuration)\</OutputPath>
- <IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(MSBuildProjectDirectory)\obj\$(Configuration))\</IntermediateOutputPath>
+ <IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(MSBuildProjectDirectory)\obj\$(Configuration)\</IntermediateOutputPath>
<OutDir>$(OutputPath)</OutDir>
<IntDir>$(IntermediateOutputPath)</IntDir>
@@ -31,7 +31,7 @@
<PropertyGroup>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
- <NoWarn>436,1591</NoWarn>
+ <NoWarn>436,1591</NoWarn>
<TreatWarningsAsErrors Condition="'$(TreatWarningsAsErrors)' == ''">true</TreatWarningsAsErrors>
</PropertyGroup>
@@ -1,34 +1,63 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
- <Compile Include="$(MSBuildThisFileDirectory)\AssemblyInfoCommon.cs">
- <Link>AssemblyInfoCommon.cs</Link>
- </Compile>
+ <Compile Include="$(MSBuildThisFileDirectory)\AssemblyInfoCommon.cs">
+ <Link>AssemblyInfoCommon.cs</Link>
+ </Compile>
</ItemGroup>
-
+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-
- <PropertyGroup>
+
+ <UsingTask TaskName="DownloadFile" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" Condition=" '$(OS)' == 'Windows_NT' ">
+ <ParameterGroup>
+ <Address ParameterType="System.String" Required="true"/>
+ <OutputFilename ParameterType="System.String" Required="true" />
+ </ParameterGroup>
+ <Task>
+ <Reference Include="System" />
+ <Code Type="Fragment" Language="cs">
+ <![CDATA[
+ new System.Net.WebClient().DownloadFile(Address, OutputFilename);
+ ]]>
+ </Code>
+ </Task>
+ </UsingTask>
+
+ <PropertyGroup>
<DocumentationFile>$(OutputPath)$(TargetName).xml</DocumentationFile>
+ <ToolsDir Condition=" '$(ToolsDir)'=='' ">$(SolutionDir)Tools</ToolsDir>
+ <NuGetExeDir Condition=" '$(NuGetExeDir)'=='' ">$(ToolsDir)</NuGetExeDir>
+ <NuGetDownloadAddress Condition=" '$(NuGetDownloadAddress)'=='' ">http://nuget.org/nuget.exe</NuGetDownloadAddress>
+ <NuGetExe Condition=" '$(NuGetExe)'=='' ">$(NuGetExeDir)\nuget.exe</NuGetExe>
+ <GacUtilExe Condition=" '$(GacUtilExe)'=='' ">$(ToolsDir)\gacutil</GacUtilExe>
+ <NuGetCommand Condition=" '$(NuGetCommand)'=='' ">"$(NuGetExe)"</NuGetCommand>
+ <GacUtilCommand Condition=" '$(GacUtilCommand)'=='' ">"$(GacUtilExe)"</GacUtilCommand>
</PropertyGroup>
-
- <Target Name="BeforeBuild">
- <Exec Command="&quot;$(ToolsDir)UpdateFileVersionFromChangeset.cmd&quot; &quot;$(RootDir)&quot; &quot;$(MSBuildThisFileDirectory)AssemblyInfoCommon.cs&quot;"></Exec>
- </Target>
-
- <Target Name="AfterBuild" Condition=" '$(Configutation)' == 'ReleaseGAC' ">
- <Exec Command="&quot;$(ToolsDir)gacutil&quot; /u &quot;$(TargetName)&quot;"></Exec>
- <Exec Command="&quot;$(ToolsDir)gacutil&quot; /f /i &quot;$(TargetPath)&quot;"></Exec>
- </Target>
-
- <Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Release' ">
- <PropertyGroup>
- <OutputNugetPath>$(OutputPath)..\Release-NuGet</OutputNugetPath>
- </PropertyGroup>
-
- <!-- Only download a new copy of nuget.exe if we don't have a copy available -->
- <!--WebDownload Condition="!Exists('nuget.exe')" Filename="nuget.exe" FileUri="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" /-->
-
- <MakeDir Directories="$(OutputNugetPath)" />
- <Exec Command="&quot;$(ToolsDir)nuget&quot; pack &quot;$(MSBuildProjectFullPath)&quot; -IncludeReferencedProjects -Symbols -Prop Configuration=Release -OutputDirectory &quot;$(OutputNugetPath)&quot;"></Exec>
- </Target>
+
+ <Target Name="DownloadNuGet">
+ <MakeDir Directories="$(NuGetExeDir)" Condition=" !Exists('$(NuGetExeDir)') " />
+ <DownloadFile Address="$(NuGetDownloadAddress)" OutputFilename="$(NuGetExe)" Condition=" '$(OS)' == 'Windows_NT' AND !Exists('$(NuGetExe)')" />
+ <Exec Command="wget $(NuGetDownloadAddress) -O $(NuGetExe)" Condition=" '$(OS)' != 'Windows_NT' AND !Exists('$(NuGetExe)') " />
+ </Target>
+
+ <Target Name="RestorePackages" DependsOnTargets="DownloadNuGet">
+ <Exec Command="$(NuGetCommand) restore &quot;$(MSBuildThisFileDirectory)../../Solutions/Phalanger.sln&quot;"/>
+ </Target>
+
+ <Target Name="BeforeBuild" DependsOnTargets="RestorePackages">
+ <Exec Command="&quot;$(ToolsDir)UpdateFileVersionFromChangeset.cmd&quot; &quot;$(RootDir)&quot; &quot;$(MSBuildThisFileDirectory)AssemblyInfoCommon.cs&quot;" Condition=" '$(OS)' == 'Windows_NT' "></Exec>
+ <Exec Command="&quot;$(ToolsDir)UpdateFileVersionFromChangeset.sh&quot; &quot;$(RootDir)&quot; &quot;$(MSBuildThisFileDirectory)AssemblyInfoCommon.cs&quot;" Condition=" '$(OS)' == 'Unix' " />
+ </Target>
+
+ <Target Name="AfterBuild" Condition=" '$(Configutation)' == 'ReleaseGAC' ">
+ <Exec Command="$(GacUtilCommand) /u &quot;$(TargetName)&quot;"></Exec>
+ <Exec Command="$(GacUtilCommand) /f /i &quot;$(TargetPath)&quot;"></Exec>
+ </Target>
+
+ <Target Name="AfterBuild" DependsOnTargets="DownloadNuGet" Condition=" '$(Configuration)' == 'Release' ">
+ <PropertyGroup>
+ <OutputNugetPath>$(OutputPath)..\$(Configuration)-NuGet</OutputNugetPath>
+ </PropertyGroup>
+ <MakeDir Directories="$(OutputNugetPath)" />
+ <Exec Command="$(NuGetCommand) pack &quot;$(MSBuildProjectFullPath)&quot; -IncludeReferencedProjects -Symbols -Prop Configuration=$(Configuration) -OutputDirectory &quot;$(OutputNugetPath)&quot;"></Exec>
+ </Target>
</Project>
@@ -26,7 +26,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>Bin\Debug\PhpNetClassLibrary.xml</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
- <FileAlignment>512</FileAlignment>
+ <FileAlignment>512</FileAlignment>
<NoStdLib>false</NoStdLib>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
@@ -36,39 +36,39 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
- <BaseAddress>4194304</BaseAddress>
+ <BaseAddress>4194304</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>Bin\Release\PhpNetClassLibrary.xml</DocumentationFile>
- <DebugSymbols>true</DebugSymbols>
- <FileAlignment>512</FileAlignment>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>512</FileAlignment>
<NoStdLib>false</NoStdLib>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- <DebugType>pdbonly</DebugType>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseGAC|AnyCPU'">
- <OutputPath>bin\ReleaseGAC\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <BaseAddress>4194304</BaseAddress>
- <DocumentationFile>..\..\Deployment\Release\PhpNetClassLibrary.xml</DocumentationFile>
- <Optimize>true</Optimize>
- <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <FileAlignment>512</FileAlignment>
- <NoWarn>436,1591,1591,419</NoWarn>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- <DebugType>pdbonly</DebugType>
- <DebugSymbols>true</DebugSymbols>
+ <DebugType>pdbonly</DebugType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseGAC|AnyCPU'">
+ <OutputPath>bin\ReleaseGAC\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <BaseAddress>4194304</BaseAddress>
+ <DocumentationFile>..\..\Deployment\Release\PhpNetClassLibrary.xml</DocumentationFile>
+ <Optimize>true</Optimize>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <FileAlignment>512</FileAlignment>
+ <NoWarn>436,1591,1591,419</NoWarn>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <DebugType>pdbonly</DebugType>
+ <DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<Reference Include="System">
<Name>System</Name>
</Reference>
- <Reference Include="System.configuration" />
+ <Reference Include="System.Configuration" />
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
@@ -241,7 +241,7 @@
<Compile Include="Web.cs">
<SubType>Code</SubType>
</Compile>
- <None Include="ClassLibrary.nuspec" />
+ <None Include="ClassLibrary.nuspec" />
<None Include="Resources\WindowsTZ.xml" />
<EmbeddedResource Include="Strings.resx">
<SubType>Designer</SubType>
@@ -257,8 +257,8 @@
<None Include="Generators\json.lex" />
<None Include="Generators\json.y" />
<None Include="Generators\StrToTime.lex" />
- <Content Include="web.config.install.xdt" />
- <Content Include="web.config.uninstall.xdt" />
+ <Content Include="web.config.install.xdt" />
+ <Content Include="web.config.uninstall.xdt" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
@@ -290,4 +290,4 @@
</ProjectReference>
</ItemGroup>
<Import Project="..\Build\Common.Build.targets" />
-</Project>
+</Project>
@@ -29,22 +29,22 @@
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseGAC|AnyCPU'">
- <OutputPath>bin\ReleaseGAC\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <DocumentationFile>..\..\Deployment\Release\PhpNetCore.Parsers.xml</DocumentationFile>
- <Optimize>true</Optimize>
- <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>436,1591</NoWarn>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
- <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseGAC|AnyCPU'">
+ <OutputPath>bin\ReleaseGAC\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <DocumentationFile>..\..\Deployment\Release\PhpNetCore.Parsers.xml</DocumentationFile>
+ <Optimize>true</Optimize>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <NoWarn>436,1591</NoWarn>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="System" />
- <Reference Include="System.configuration" />
+ <Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
@@ -121,7 +121,7 @@
<Compile Include="Utils.cs" />
</ItemGroup>
<ItemGroup>
- <None Include="Core.Parsers.nuspec" />
+ <None Include="Core.Parsers.nuspec" />
<None Include="Generators\Generate.cmd" />
<None Include="Generators\Lexer.lex" />
<None Include="Generators\Parser.y" />
@@ -142,4 +142,4 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+</Project>
@@ -41,37 +41,37 @@
<BaseAddress>402653184</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<DefineConstants>TRACE</DefineConstants>
- <DebugSymbols>true</DebugSymbols>
+ <DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
- <DebugType>pdbonly</DebugType>
+ <DebugType>pdbonly</DebugType>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseGAC|AnyCPU'">
- <OutputPath>bin\ReleaseGAC\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <BaseAddress>402653184</BaseAddress>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseGAC|AnyCPU'">
+ <OutputPath>bin\ReleaseGAC\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <BaseAddress>402653184</BaseAddress>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <DocumentationFile>..\..\Deployment\Release\PhpNetCore.xml</DocumentationFile>
- <Optimize>true</Optimize>
- <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <DocumentationFile>..\..\Deployment\Release\PhpNetCore.xml</DocumentationFile>
+ <Optimize>true</Optimize>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<FileAlignment>4096</FileAlignment>
- <NoWarn>436,1591,1591,419</NoWarn>
+ <NoWarn>436,1591,1591,419</NoWarn>
<PlatformTarget>AnyCPU</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
+ <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- <DebugType>pdbonly</DebugType>
- <DebugSymbols>true</DebugSymbols>
+ <DebugType>pdbonly</DebugType>
+ <DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<Reference Include="System">
<Name>System</Name>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
- <Reference Include="System.configuration" />
+ <Reference Include="System.Configuration" />
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
@@ -390,14 +390,14 @@
<Content Include="Doc\RootPage.html" />
<Content Include="Doc\Streams.xml" />
<Content Include="Doc\Wrappers.xml" />
- <None Include="Core.nuspec" />
+ <None Include="Core.nuspec" />
<None Include="Core.snk" />
<None Include="Emit\AssemblyBuilders.cd" />
<None Include="Reflection\DAssembly.cd" />
<None Include="Reflection\DMember.cd" />
<None Include="Reflection\DMemberDesc.cd" />
- <Content Include="web.config.install.xdt" />
- <Content Include="web.config.uninstall.xdt" />
+ <Content Include="web.config.install.xdt" />
+ <Content Include="web.config.uninstall.xdt" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
@@ -434,4 +434,4 @@
</ProjectReference>
</ItemGroup>
<Import Project="..\Build\Common.Build.targets" />
-</Project>
+</Project>
Oops, something went wrong.

0 comments on commit d7b1139

Please sign in to comment.