Skip to content

Commit bc4e731

Browse files
committed
enabled nuget package restore, copied in nuget.exe to enable pushing to nuget feed
1 parent d63bce7 commit bc4e731

10 files changed

Lines changed: 86 additions & 4 deletions

File tree

src/.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>

src/.nuget/NuGet.exe

545 KB
Binary file not shown.

src/.nuget/NuGet.targets

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
6+
<NuGetExePath>$(NuGetToolsPath)\nuget.exe</NuGetExePath>
7+
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
8+
<PackagesDir>$([System.IO.Path]::Combine($(SolutionDir), "packages"))</PackagesDir>
9+
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
10+
11+
<!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
12+
<PackageSources>""</PackageSources>
13+
14+
<!-- Enable the restore command to run before builds -->
15+
<RestorePackages Condition="$(RestorePackages) == ''">false</RestorePackages>
16+
17+
<!-- Property that enables building a package from a project -->
18+
<BuildPackage Condition="$(BuildPackage) == ''">false</BuildPackage>
19+
20+
<!-- Commands -->
21+
<RestoreCommand>"$(NuGetExePath)" install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)"</RestoreCommand>
22+
<BuildCommand>"$(NuGetExePath)" pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>
23+
24+
<!-- Make the build depend on restore packages -->
25+
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
26+
RestorePackages;
27+
$(BuildDependsOn);
28+
</BuildDependsOn>
29+
30+
<!-- Make the build depend on restore packages -->
31+
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
32+
$(BuildDependsOn);
33+
BuildPackage;
34+
</BuildDependsOn>
35+
</PropertyGroup>
36+
37+
<Target Name="CheckPrerequisites">
38+
<!-- Raise an error if we're unable to locate nuget.exe -->
39+
<Error Condition="!Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
40+
</Target>
41+
42+
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
43+
<Exec Command="$(RestoreCommand)"
44+
LogStandardErrorAsError="true"
45+
Condition="Exists('$(PackagesConfig)')" />
46+
</Target>
47+
48+
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
49+
<Exec Command="$(BuildCommand)"
50+
LogStandardErrorAsError="true" />
51+
</Target>
52+
</Project>

src/ServiceStack.Logging.Elmah/ServiceStack.Logging.Elmah.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
1515
<TargetFrameworkProfile />
16+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\src\</SolutionDir>
17+
<RestorePackages>true</RestorePackages>
1618
</PropertyGroup>
1719
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1820
<DebugSymbols>true</DebugSymbols>
@@ -48,6 +50,7 @@
4850
<Compile Include="Properties\AssemblyInfo.cs" />
4951
</ItemGroup>
5052
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
53+
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
5154
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
5255
Other similar extension points exist, see Microsoft.Common.targets.
5356
<Target Name="BeforeBuild">

src/ServiceStack.Logging.EventLog/ServiceStack.Logging.EventLog.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -39,6 +39,8 @@
3939
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
4040
<UseApplicationTrust>false</UseApplicationTrust>
4141
<BootstrapperEnabled>true</BootstrapperEnabled>
42+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\src\</SolutionDir>
43+
<RestorePackages>true</RestorePackages>
4244
</PropertyGroup>
4345
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
4446
<DebugSymbols>true</DebugSymbols>
@@ -101,6 +103,7 @@
101103
</BootstrapperPackage>
102104
</ItemGroup>
103105
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
106+
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
104107
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
105108
Other similar extension points exist, see Microsoft.Common.targets.
106109
<Target Name="BeforeBuild">

src/ServiceStack.Logging.Log4Net/ServiceStack.Logging.Log4Net.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -39,6 +39,8 @@
3939
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
4040
<UseApplicationTrust>false</UseApplicationTrust>
4141
<BootstrapperEnabled>true</BootstrapperEnabled>
42+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\src\</SolutionDir>
43+
<RestorePackages>true</RestorePackages>
4244
</PropertyGroup>
4345
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
4446
<DebugSymbols>true</DebugSymbols>
@@ -105,6 +107,7 @@
105107
</BootstrapperPackage>
106108
</ItemGroup>
107109
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
110+
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
108111
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
109112
Other similar extension points exist, see Microsoft.Common.targets.
110113
<Target Name="BeforeBuild">

src/ServiceStack.Logging.Log4Netv129/ServiceStack.Logging.Log4Netv129.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -39,6 +39,8 @@
3939
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
4040
<UseApplicationTrust>false</UseApplicationTrust>
4141
<BootstrapperEnabled>true</BootstrapperEnabled>
42+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\src\</SolutionDir>
43+
<RestorePackages>true</RestorePackages>
4244
</PropertyGroup>
4345
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
4446
<DebugSymbols>true</DebugSymbols>
@@ -105,6 +107,7 @@
105107
</BootstrapperPackage>
106108
</ItemGroup>
107109
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
110+
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
108111
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
109112
Other similar extension points exist, see Microsoft.Common.targets.
110113
<Target Name="BeforeBuild">

src/ServiceStack.Logging.NLog/ServiceStack.Logging.NLog.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -12,6 +12,8 @@
1212
<AssemblyName>ServiceStack.Logging.NLog</AssemblyName>
1313
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
15+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\src\</SolutionDir>
16+
<RestorePackages>true</RestorePackages>
1517
</PropertyGroup>
1618
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1719
<DebugSymbols>true</DebugSymbols>
@@ -52,6 +54,7 @@
5254
<Compile Include="Properties\AssemblyInfo.cs" />
5355
</ItemGroup>
5456
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
57+
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
5558
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
5659
Other similar extension points exist, see Microsoft.Common.targets.
5760
<Target Name="BeforeBuild">

src/ServiceStack.Logging.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceStack.Logging.NLog",
1313
EndProject
1414
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceStack.Logging.Elmah", "ServiceStack.Logging.Elmah\ServiceStack.Logging.Elmah.csproj", "{EE43BF1E-CF97-4215-A5A3-46D1C363F928}"
1515
EndProject
16+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{CA7CF53F-9C02-4A5B-B9AF-390B1F7B095C}"
17+
ProjectSection(SolutionItems) = preProject
18+
.nuget\NuGet.exe = .nuget\NuGet.exe
19+
.nuget\NuGet.targets = .nuget\NuGet.targets
20+
EndProjectSection
21+
EndProject
1622
Global
1723
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1824
Debug|Any CPU = Debug|Any CPU

tests/ServiceStack.Logging.Tests/ServiceStack.Logging.Tests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
<UseApplicationTrust>false</UseApplicationTrust>
4141
<BootstrapperEnabled>true</BootstrapperEnabled>
4242
<TargetFrameworkProfile />
43+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\src\</SolutionDir>
44+
<RestorePackages>true</RestorePackages>
4345
</PropertyGroup>
4446
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
4547
<DebugSymbols>true</DebugSymbols>
@@ -139,6 +141,7 @@
139141
</ProjectReference>
140142
</ItemGroup>
141143
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
144+
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
142145
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
143146
Other similar extension points exist, see Microsoft.Common.targets.
144147
<Target Name="BeforeBuild">

0 commit comments

Comments
 (0)