Skip to content

Commit 4b9df91

Browse files
committed
Beta3
1 parent a7532ae commit 4b9df91

File tree

7 files changed

+156
-2
lines changed

7 files changed

+156
-2
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<solution>
4+
<add key="disableSourceControlIntegration" value="true" />
5+
</solution>
6+
</configuration>
1.53 MB
Binary file not shown.
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
5+
6+
<!-- Enable the restore command to run before builds -->
7+
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
8+
9+
<!-- Property that enables building a package from a project -->
10+
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
11+
12+
<!-- Determines if package restore consent is required to restore packages -->
13+
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
14+
15+
<!-- Download NuGet.exe if it does not already exist -->
16+
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
17+
</PropertyGroup>
18+
19+
<ItemGroup Condition=" '$(PackageSources)' == '' ">
20+
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
21+
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
22+
<!--
23+
<PackageSource Include="https://www.nuget.org/api/v2/" />
24+
<PackageSource Include="https://my-nuget-source/nuget/" />
25+
-->
26+
</ItemGroup>
27+
28+
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
29+
<!-- Windows specific commands -->
30+
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
31+
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
32+
</PropertyGroup>
33+
34+
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
35+
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
36+
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
37+
<PackagesConfig>packages.config</PackagesConfig>
38+
</PropertyGroup>
39+
40+
<PropertyGroup>
41+
<!-- NuGet command -->
42+
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
43+
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
44+
45+
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
46+
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
47+
48+
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
49+
50+
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
51+
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
52+
53+
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
54+
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
55+
56+
<!-- Commands -->
57+
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
58+
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
59+
60+
<!-- We need to ensure packages are restored prior to assembly resolve -->
61+
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
62+
RestorePackages;
63+
$(BuildDependsOn);
64+
</BuildDependsOn>
65+
66+
<!-- Make the build depend on restore packages -->
67+
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
68+
$(BuildDependsOn);
69+
BuildPackage;
70+
</BuildDependsOn>
71+
</PropertyGroup>
72+
73+
<Target Name="CheckPrerequisites">
74+
<!-- Raise an error if we're unable to locate nuget.exe -->
75+
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
76+
<!--
77+
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
78+
This effectively acts as a lock that makes sure that the download operation will only happen once and all
79+
parallel builds will have to wait for it to complete.
80+
-->
81+
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
82+
</Target>
83+
84+
<Target Name="_DownloadNuGet">
85+
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
86+
</Target>
87+
88+
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
89+
<Exec Command="$(RestoreCommand)"
90+
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
91+
92+
<Exec Command="$(RestoreCommand)"
93+
LogStandardErrorAsError="true"
94+
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
95+
</Target>
96+
97+
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
98+
<Exec Command="$(BuildCommand)"
99+
Condition=" '$(OS)' != 'Windows_NT' " />
100+
101+
<Exec Command="$(BuildCommand)"
102+
LogStandardErrorAsError="true"
103+
Condition=" '$(OS)' == 'Windows_NT' " />
104+
</Target>
105+
106+
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
107+
<ParameterGroup>
108+
<OutputFilename ParameterType="System.String" Required="true" />
109+
</ParameterGroup>
110+
<Task>
111+
<Reference Include="System.Core" />
112+
<Using Namespace="System" />
113+
<Using Namespace="System.IO" />
114+
<Using Namespace="System.Net" />
115+
<Using Namespace="Microsoft.Build.Framework" />
116+
<Using Namespace="Microsoft.Build.Utilities" />
117+
<Code Type="Fragment" Language="cs">
118+
<![CDATA[
119+
try {
120+
OutputFilename = Path.GetFullPath(OutputFilename);
121+
122+
Log.LogMessage("Downloading latest version of NuGet.exe...");
123+
WebClient webClient = new WebClient();
124+
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
125+
126+
return true;
127+
}
128+
catch (Exception ex) {
129+
Log.LogErrorFromException(ex);
130+
return false;
131+
}
132+
]]>
133+
</Code>
134+
</Task>
135+
</UsingTask>
136+
</Project>

TaskParallelFoundation/ConsoleTest/ConsoleTest.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
3333
<UseApplicationTrust>false</UseApplicationTrust>
3434
<BootstrapperEnabled>true</BootstrapperEnabled>
35+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
36+
<RestorePackages>true</RestorePackages>
3537
</PropertyGroup>
3638
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
3739
<DebugSymbols>true</DebugSymbols>
@@ -133,6 +135,7 @@
133135
</None>
134136
</ItemGroup>
135137
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
138+
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
136139
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
137140
Other similar extension points exist, see Microsoft.Common.targets.
138141
<Target Name="BeforeBuild">

TaskParallelFoundation/Databases/SqlServer/SqlServer.sqlproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
3838
<ProjectGuid>{6726a98e-44d9-4740-a20e-dcc517318b6c}</ProjectGuid>
3939
<GenerateDatabaseFile>False</GenerateDatabaseFile>
40-
<GenerateCreateScript>False</GenerateCreateScript>
40+
<GenerateCreateScript>True</GenerateCreateScript>
4141
<TargetLanguage>CS</TargetLanguage>
4242
<AllowSnapshotIsolation>False</AllowSnapshotIsolation>
4343
<AnsiNullDefault>True</AnsiNullDefault>

TaskParallelFoundation/Dispatcher/Dispatcher.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
<SccLocalPath>SAK</SccLocalPath>
3333
<SccAuxPath>SAK</SccAuxPath>
3434
<SccProvider>SAK</SccProvider>
35+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
36+
<RestorePackages>true</RestorePackages>
3537
</PropertyGroup>
3638
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
3739
<DebugSymbols>true</DebugSymbols>
@@ -115,6 +117,7 @@
115117
</ItemGroup>
116118
<ItemGroup />
117119
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
120+
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
118121
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
119122
Other similar extension points exist, see Microsoft.Common.targets.
120123
<Target Name="BeforeBuild">

TaskParallelFoundation/TaskParallelFoundation.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "SqlServer", "Databases\SqlS
2525
EndProject
2626
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "PumpServiceSetup", "PumpServiceSetup\PumpServiceSetup.vdproj", "{F333E657-06DC-404D-ADA7-B2406F1ACCE7}"
2727
EndProject
28+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{69AA8AC1-5B44-4D0E-862B-845BE7CD256D}"
29+
ProjectSection(SolutionItems) = preProject
30+
.nuget\NuGet.Config = .nuget\NuGet.Config
31+
.nuget\NuGet.exe = .nuget\NuGet.exe
32+
.nuget\NuGet.targets = .nuget\NuGet.targets
33+
EndProjectSection
34+
EndProject
2835
Global
2936
GlobalSection(TeamFoundationVersionControl) = preSolution
3037
SccNumberOfProjects = 7
@@ -84,7 +91,6 @@ Global
8491
HideSolutionNode = FALSE
8592
EndGlobalSection
8693
GlobalSection(NestedProjects) = preSolution
87-
{6726A98E-44D9-4740-A20E-DCC517318B6C} = {B5A1CBE3-FEBD-4C7B-8C08-E2EA612D0F71}
8894
{CD1CCA70-E67E-4CDA-BC1D-54D8F2BA0780} = {B5A1CBE3-FEBD-4C7B-8C08-E2EA612D0F71}
8995
{6726A98E-44D9-4740-A20E-DCC517318B6C} = {B5A1CBE3-FEBD-4C7B-8C08-E2EA612D0F71}
9096
EndGlobalSection

0 commit comments

Comments
 (0)