From 7d26b5f7a507bbba2da01bbca8df57f6c0c979d8 Mon Sep 17 00:00:00 2001 From: Congyong Su Date: Mon, 13 Oct 2014 10:52:08 +0800 Subject: [PATCH] Delay sign source projects Allow sign source assemblies in TFS by pulling source Allow build using a batch file Add not download nuget exe option Add NuGet.Config to .nuget folder: Allow nuget restore to use nuget.org package source No cache for nuget restore --- .gitignore | 1 + .nuget/NuGet.Config | 9 + DomainFramework.msbuild | 57 +++++ build.cmd | 39 ++++ .../Microsoft.Data.Domain.Conventions.csproj | 36 +-- ...crosoft.Data.Domain.EntityFramework.csproj | 37 +-- .../Microsoft.Data.Domain.Security.csproj | 37 +-- .../Microsoft.Data.Domain.csproj | 35 +-- .../System.Web.OData.Domain.csproj | 37 +-- tools/35MSSharedLib1024.snk | Bin 0 -> 160 bytes tools/DF.settings.targets | 38 +++ tools/DF.tasks.targets | 221 ++++++++++++++++++ 12 files changed, 375 insertions(+), 172 deletions(-) create mode 100644 .nuget/NuGet.Config create mode 100644 DomainFramework.msbuild create mode 100644 build.cmd create mode 100644 tools/35MSSharedLib1024.snk create mode 100644 tools/DF.settings.targets create mode 100644 tools/DF.tasks.targets diff --git a/.gitignore b/.gitignore index c2744464..f8945faf 100644 --- a/.gitignore +++ b/.gitignore @@ -15,5 +15,6 @@ _[Ss]cripts *.vsp *.psess *.orig +*.pdb TrippinDB.mdf TrippinDB_log.ldf diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config new file mode 100644 index 00000000..e99c0733 --- /dev/null +++ b/.nuget/NuGet.Config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/DomainFramework.msbuild b/DomainFramework.msbuild new file mode 100644 index 00000000..6233491e --- /dev/null +++ b/DomainFramework.msbuild @@ -0,0 +1,57 @@ + + + + + + $(BuildInParallel) + + + + + {120146C7-7CFD-4857-ACC0-78C2CD83C2C2} + Release + .nuget + $(NuGetFolder)\NuGet.exe + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.cmd b/build.cmd new file mode 100644 index 00000000..c8393a4c --- /dev/null +++ b/build.cmd @@ -0,0 +1,39 @@ +@echo off +pushd %~dp0 +setlocal + +if exist bin goto build +mkdir bin + +:Build + +REM Find the most recent 32bit MSBuild.exe on the system. Require v12.0 (installed with VS2013) or later since .NET 4.0 +REM is not supported. Also handle x86 operating systems, where %ProgramFiles(x86)% is not defined. Always quote the +REM %MSBuild% value when setting the variable and never quote %MSBuild% references. +set MSBuild="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" +if not exist %MSBuild% @set MSBuild="%ProgramFiles%\MSBuild\12.0\Bin\MSBuild.exe" + +if "%1" == "" goto BuildDefaults + +%MSBuild% DomainFramework.msbuild /m /nr:false /t:%* /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal +if %ERRORLEVEL% neq 0 goto BuildFail +goto BuildSuccess + +:BuildDefaults +%MSBuild% DomainFramework.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal +if %ERRORLEVEL% neq 0 goto BuildFail +goto BuildSuccess + +:BuildFail +echo. +echo *** BUILD FAILED *** +goto End + +:BuildSuccess +echo. +echo **** BUILD SUCCESSFUL *** +goto end + +:End +popd +endlocal diff --git a/src/Microsoft.Data.Domain.Conventions/Microsoft.Data.Domain.Conventions.csproj b/src/Microsoft.Data.Domain.Conventions/Microsoft.Data.Domain.Conventions.csproj index d6b42c4c..4cc67ad8 100644 --- a/src/Microsoft.Data.Domain.Conventions/Microsoft.Data.Domain.Conventions.csproj +++ b/src/Microsoft.Data.Domain.Conventions/Microsoft.Data.Domain.Conventions.csproj @@ -1,38 +1,13 @@  - + - Debug - AnyCPU {5A10C8BB-5CA0-4D41-A731-45CD29A30D34} Library Properties Microsoft.Data.Domain Microsoft.Data.Domain.Conventions - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - bin\Debug\Microsoft.Data.Domain.Conventions.XML - 1591 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - bin\Release\Microsoft.Data.Domain.Conventions.XML + $(OutputPath)$(AssemblyName).xml @@ -71,11 +46,4 @@ - \ No newline at end of file diff --git a/src/Microsoft.Data.Domain.EntityFramework/Microsoft.Data.Domain.EntityFramework.csproj b/src/Microsoft.Data.Domain.EntityFramework/Microsoft.Data.Domain.EntityFramework.csproj index 282aa908..e0f85ef2 100644 --- a/src/Microsoft.Data.Domain.EntityFramework/Microsoft.Data.Domain.EntityFramework.csproj +++ b/src/Microsoft.Data.Domain.EntityFramework/Microsoft.Data.Domain.EntityFramework.csproj @@ -1,39 +1,13 @@  - + - Debug - AnyCPU {F7EC910E-17CE-4579-84C5-36D3777B3218} Library Properties Microsoft.Data.Domain.EntityFramework Microsoft.Data.Domain.EntityFramework - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - bin\Debug\Microsoft.Data.Domain.EntityFramework.XML - 1591 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - bin\Release\Microsoft.Data.Domain.EntityFramework.XML - 1591 + $(OutputPath)$(AssemblyName).xml @@ -80,11 +54,4 @@ - \ No newline at end of file diff --git a/src/Microsoft.Data.Domain.Security/Microsoft.Data.Domain.Security.csproj b/src/Microsoft.Data.Domain.Security/Microsoft.Data.Domain.Security.csproj index ac348114..a7a9babe 100644 --- a/src/Microsoft.Data.Domain.Security/Microsoft.Data.Domain.Security.csproj +++ b/src/Microsoft.Data.Domain.Security/Microsoft.Data.Domain.Security.csproj @@ -1,39 +1,13 @@  - + - Debug - AnyCPU {B15A5064-F0D2-480C-A51E-3430A8360827} Library Properties Microsoft.Data.Domain.Security Microsoft.Data.Domain.Security - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - bin\Debug\Microsoft.Data.Domain.Security.XML - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - bin\Release\Microsoft.Data.Domain.Security.XML - true + $(OutputPath)$(AssemblyName).xml @@ -69,11 +43,4 @@ - \ No newline at end of file diff --git a/src/Microsoft.Data.Domain/Microsoft.Data.Domain.csproj b/src/Microsoft.Data.Domain/Microsoft.Data.Domain.csproj index 756a5e49..90442214 100644 --- a/src/Microsoft.Data.Domain/Microsoft.Data.Domain.csproj +++ b/src/Microsoft.Data.Domain/Microsoft.Data.Domain.csproj @@ -1,38 +1,14 @@  - + - Debug - AnyCPU {F1BEAB8D-82D4-4BBB-A5C6-BA0E6872E508} Library Properties Microsoft.Data.Domain Microsoft.Data.Domain + $(OutputPath)$(AssemblyName).xml - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - bin\Debug\Microsoft.Data.Domain.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - bin\Release\Microsoft.Data.Domain.XML @@ -127,11 +103,4 @@ - \ No newline at end of file diff --git a/src/System.Web.OData.Domain/System.Web.OData.Domain.csproj b/src/System.Web.OData.Domain/System.Web.OData.Domain.csproj index 761b8e8f..96a8eef4 100644 --- a/src/System.Web.OData.Domain/System.Web.OData.Domain.csproj +++ b/src/System.Web.OData.Domain/System.Web.OData.Domain.csproj @@ -1,39 +1,13 @@  - + - Debug - AnyCPU {186F667E-54E5-4B57-9998-21D74CB77C24} Library Properties System.Web.OData.Domain System.Web.OData.Domain - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - 1591 - bin\Debug\System.Web.OData.Domain.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - 1591 - true - bin\Release\System.Web.OData.Domain.XML + $(OutputPath)$(AssemblyName).xml @@ -117,11 +91,4 @@ - \ No newline at end of file diff --git a/tools/35MSSharedLib1024.snk b/tools/35MSSharedLib1024.snk new file mode 100644 index 0000000000000000000000000000000000000000..695f1b38774e839e5b90059bfb7f32df1dff4223 GIT binary patch literal 160 zcmV;R0AK$ABme*efB*oL000060ssI2Bme+XQ$aBR1ONa50098C{E+7Ye`kjtcRG*W zi8#m|)B?I?xgZ^2Sw5D;l4TxtPwG;3)3^j?qDHjEteSTF{rM+4WI`v zCD?tsZ^;k+S&r1&HRMb=j738S=;J$tCKNrc$@P|lZ + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\')) + $(MSBuildThisFileDirectory) + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + Debug + $(DFRootPath)bin\$(Configuration)\ + AnyCPU + 512 + prompt + 4 + true + 1591 + + v4.5 + + true + true + $(DFRootPath)\tools\35MSSharedLib1024.snk + + + + + true + full + false + DEBUG;TRACE; + + + pdbonly + true + TRACE + + \ No newline at end of file diff --git a/tools/DF.tasks.targets b/tools/DF.tasks.targets new file mode 100644 index 00000000..6303444a --- /dev/null +++ b/tools/DF.tasks.targets @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + testFailures = new List(); + + foreach (string testResultFile in testResultFiles) + { + XElement xml; + using (FileStream fileStream = File.OpenRead(testResultFile)) + { + xml = XElement.Load(fileStream); + } + + var assemblies = xml.Elements(XName.Get("assembly")); + foreach (XElement assembly in assemblies) + { + int failures = Int32.Parse(assembly.Attribute(XName.Get("failed")).Value); + + testsPassed += Int32.Parse(assembly.Attribute(XName.Get("passed")).Value); + testsFailed += failures; + testsSkipped += Int32.Parse(assembly.Attribute(XName.Get("skipped")).Value); + timeSpent += Decimal.Parse(assembly.Attribute(XName.Get("time")).Value); + + if (failures > 0) + { + foreach (XElement classWithFailure in assembly.Elements(XName.Get("class")) + .Where(c => Int32.Parse(c.Attribute(XName.Get("failed")).Value) > 0)) + { + foreach (XElement failure in classWithFailure.Elements(XName.Get("test")) + .Where(test => test.Attribute(XName.Get("result")).Value == "Fail")) + { + testFailures.Add(failure.Attribute("name").Value); + } + } + } + } + } + + if (testFailures.Count > 0) + { + Console.WriteLine(); + Console.WriteLine(" Test Failures:"); + ConsoleColor originalColor = Console.ForegroundColor; + Console.ForegroundColor = ConsoleColor.Red; + foreach (string testFailure in testFailures) + { + Console.WriteLine(" " + testFailure); + } + Console.ForegroundColor = originalColor; + } + + Console.WriteLine(); + Console.WriteLine(" Tests passed: {0}, Tests failed: {1}, Tests skipped: {2}", testsPassed, testsFailed, testsSkipped); + Console.WriteLine(" Time spent running tests: {0} seconds", timeSpent); + return true; + } + catch (Exception ex) + { + Log.LogErrorFromException(ex); + return false; + } + ]]> + + + + \ No newline at end of file