Skip to content

Commit adbe3da

Browse files
committed
Merge pull request #20 from JakeGinnivan/NuGetUpdates
Changed NuGet title to TestStack.BDDfy and allowed build server to pass ...
2 parents c3de2f0 + 187f933 commit adbe3da

File tree

88 files changed

+283
-11459
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+283
-11459
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ obj/
99
*.nupkg
1010
*.crunchproject.local.xml
1111
*.crunchsolution.local.xml
12-
*.ncrunchsolution
13-
*.ncrunchproject
1412
*.cache
15-
src/packages/*
13+
packages/*
1614
PackageBuild/*
1715
Build/*
1816
TestResult.xml

.nuget/NuGet.Config

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>

.nuget/NuGet.exe

760 KB
Binary file not shown.

.nuget/NuGet.targets

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
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)' == '' ">true</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://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://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+
<!-- Commands -->
54+
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " </RestoreCommand>
55+
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties Configuration=$(Configuration) $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
56+
57+
<!-- We need to ensure packages are restored prior to assembly resolve -->
58+
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
59+
RestorePackages;
60+
$(BuildDependsOn);
61+
</BuildDependsOn>
62+
63+
<!-- Make the build depend on restore packages -->
64+
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
65+
$(BuildDependsOn);
66+
BuildPackage;
67+
</BuildDependsOn>
68+
</PropertyGroup>
69+
70+
<Target Name="CheckPrerequisites">
71+
<!-- Raise an error if we're unable to locate nuget.exe -->
72+
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
73+
<!--
74+
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
75+
This effectively acts as a lock that makes sure that the download operation will only happen once and all
76+
parallel builds will have to wait for it to complete.
77+
-->
78+
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
79+
</Target>
80+
81+
<Target Name="_DownloadNuGet">
82+
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
83+
</Target>
84+
85+
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
86+
<Exec Command="$(RestoreCommand)"
87+
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
88+
89+
<Exec Command="$(RestoreCommand)"
90+
LogStandardErrorAsError="true"
91+
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
92+
</Target>
93+
94+
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
95+
<Exec Command="$(BuildCommand)"
96+
Condition=" '$(OS)' != 'Windows_NT' " />
97+
98+
<Exec Command="$(BuildCommand)"
99+
LogStandardErrorAsError="true"
100+
Condition=" '$(OS)' == 'Windows_NT' " />
101+
</Target>
102+
103+
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
104+
<ParameterGroup>
105+
<OutputFilename ParameterType="System.String" Required="true" />
106+
</ParameterGroup>
107+
<Task>
108+
<Reference Include="System.Core" />
109+
<Using Namespace="System" />
110+
<Using Namespace="System.IO" />
111+
<Using Namespace="System.Net" />
112+
<Using Namespace="Microsoft.Build.Framework" />
113+
<Using Namespace="Microsoft.Build.Utilities" />
114+
<Code Type="Fragment" Language="cs">
115+
<![CDATA[
116+
try {
117+
OutputFilename = Path.GetFullPath(OutputFilename);
118+
119+
Log.LogMessage("Downloading latest version of NuGet.exe...");
120+
WebClient webClient = new WebClient();
121+
webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
122+
123+
return true;
124+
}
125+
catch (Exception ex) {
126+
Log.LogErrorFromException(ex);
127+
return false;
128+
}
129+
]]>
130+
</Code>
131+
</Task>
132+
</UsingTask>
133+
</Project>

.nuget/packages.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="NUnit.Runners" version="2.6.2" />
4+
</packages>

NuGet/TestStack.BDDfy.Samples/TestStack.BDDfy.Samples.nuspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
33
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
44
<id>TestStack.BDDfy.Samples</id>
5-
<version>3.10</version>
6-
<title>Two BDD samples done using BDDfy</title>
5+
<version>$version$</version>
6+
<title>TestStack.BDDfy.Samples</title>
77
<authors>Mehdi Khalili, Michael Whelan</authors>
88
<owners>Mehdi Khalili, Michael Whelan</owners>
99
<requireLicenseAcceptance>false</requireLicenseAcceptance>
10-
<description>contains two small samples that showcase BDDfy's API and usage</description>
10+
<description>Contains two small samples that showcase BDDfy's API and usage</description>
1111
<projectUrl>http://teststack.github.com/TestStack.BDDfy/</projectUrl>
1212
<dependencies>
13-
<dependency id="TestStack.BDDfy" version="3.10" />
13+
<dependency id="TestStack.BDDfy" version="$version$" />
1414
<dependency id="nunit" version="2.5" />
1515
</dependencies>
1616
</metadata>

NuGet/TestStack.BDDfy/TestStack.BDDfy.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
33
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
44
<id>TestStack.BDDfy</id>
5-
<version>3.15</version>
6-
<title>A simple to use and extend BDD framework for .Net programmers</title>
5+
<version>$version$</version>
6+
<title>TestStack.BDDfy</title>
77
<authors>Mehdi Khalili, Michael Whelan</authors>
88
<owners>Mehdi Khalili, Michael Whelan</owners>
99
<requireLicenseAcceptance>false</requireLicenseAcceptance>

Packages.build

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PackageWorkingPath>$(MSBuildProjectDirectory)\PackageBuild</PackageWorkingPath>
1111
<ArtifactTemp>$(PackageWorkingPath)\Library</ArtifactTemp>
1212
<PackageDefinitionPath>$(PackageWorkingPath)\PackageTemp</PackageDefinitionPath>
13-
<NuGetExe>"$(MSBuildProjectDirectory)\Resource\Tool\NuGet\NuGet.exe"</NuGetExe>
13+
<NuGetExe>"$(MSBuildProjectDirectory)\.nuget\NuGet.exe"</NuGetExe>
1414
<BDDfyBuild>$(MSBuildProjectDirectory)\TestStack.BDDfy.build</BDDfyBuild>
1515
<PackageOutput>$(PackageWorkingPath)\Packages</PackageOutput>
1616
<ZipPath>$(BuildPath)\_Package</ZipPath>
@@ -81,10 +81,9 @@
8181
<CreateItem Include="$(BDDfySpec);$(SamplesSpec);">
8282
<Output ItemName="NuGetSpec" TaskParameter="Include"/>
8383
</CreateItem>
84-
<FileUpdate Files="@(NuGetSpec)" Regex="0\.0\.0\.0" ReplacementText="$(Version)" />
8584
<CallTarget Targets="CopyBDDfyLibs;CopyBDDfySampleFiles;" />
8685
<MakeDir Directories="$(PackageOutput)" ContinueOnError="true"/>
87-
<Exec Command='$(NuGetExe) pack "%(NuGetSpec.FullPath)"' WorkingDirectory="$(PackageOutput)"/>
86+
<Exec Command='$(NuGetExe) pack "%(NuGetSpec.FullPath)" -version $(Version)' WorkingDirectory="$(PackageOutput)"/>
8887
</Target>
8988

9089
<Target Name="Release" DependsOnTargets="Clean;Prepare;Build;Pack"/>

0 commit comments

Comments
 (0)