Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Commit

Permalink
Enable cross platform compilation of the solution. (#31)
Browse files Browse the repository at this point in the history
Without a targeting pack running dotnet build on a mac/ubuntu will fail with a "Reference assemblies were not found".Adding these targeting pack will allow happy roundtripping between windows and mac or ubuntu.
See dotnet/sdk#335 for more details
  • Loading branch information
Hananiel Sarella authored Jan 2, 2019
1 parent ce8ba71 commit b4ba1fc
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 12 deletions.
1 change: 1 addition & 0 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
<add key="SteeltoeDev" value="https://www.myget.org/F/steeltoedev/api/v3/index.json" />
<add key="OpenCensusDev" value="https://www.myget.org/F/opencensus/api/v3/index.json" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
<add key="DotnetCore" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
</packageSources>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Steeltoe.Management.Endpoint.Info.Contributor;
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;

namespace Steeltoe.Management.EndpointOwin.Info
Expand Down Expand Up @@ -79,9 +80,10 @@ public static IAppBuilder UseInfoActuator(this IAppBuilder builder, IConfigurati

private static IList<IInfoContributor> GetDefaultInfoContributors(IConfiguration config, ILoggerFactory loggerFactory = null)
{
var gitInfoPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "git.properties");
return new List<IInfoContributor>
{
new GitInfoContributor(AppDomain.CurrentDomain.BaseDirectory + "\\git.properties", loggerFactory?.CreateLogger<GitInfoContributor>()),
new GitInfoContributor(gitInfoPath, loggerFactory?.CreateLogger<GitInfoContributor>()),
new AppSettingsInfoContributor(config)
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
<PackageProjectUrl>https://steeltoe.io</PackageProjectUrl>
<PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
</PropertyGroup>

<Import Project="..\..\targetframework.props" />

<ItemGroup>
<PackageReference Include="Microsoft.AspNet.WebApi.Owin" Version="$(AspNetVersion)" />
<PackageReference Include="Microsoft.Owin" Version="$(OwinVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<PackageProjectUrl>https://steeltoe.io</PackageProjectUrl>
<PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
</PropertyGroup>

<Import Project="..\..\targetframework.props" />

<ItemGroup>
<PackageReference Include="Autofac" Version="$(AutofacVersion)" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\versions.props" />

<PropertyGroup>
<Description>Steeltoe Management Endpoints for ASP.NET 4.x</Description>
<Authors>Pivotal;dtillman</Authors>
Expand All @@ -17,7 +17,7 @@
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>

<Import Project="..\..\targetframework.props" />
<PropertyGroup>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Steeltoe.Management.EndpointWeb.xml</DocumentationFile>
</PropertyGroup>
Expand Down
10 changes: 10 additions & 0 deletions targetframework.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project>
<PropertyGroup Condition="! $(OS.Contains('win')) AND '$(TargetFramework)'== 'net461'">
<FrameworkPathOverride>$(NuGetPackageRoot)microsoft.targetingpack.netframework.v4.6.1/1.0.1/lib/net461/</FrameworkPathOverride>
<RestoreAdditionalProjectSources>https://dotnet.myget.org/F/dotnet-core/api/v3/index.json</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup Condition="! $(OS.Contains('win')) AND '$(TargetFramework)'== 'net461'">
<PackageReference Include="Microsoft.TargetingPack.NETFramework.v4.6.1" Version="1.0.1" ExcludeAssets="All" PrivateAssets="All" />
</ItemGroup>
</Project>

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;netcoreapp2.1;net461</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\targetframework.props" />

<ItemGroup>
<None Update="xunit.runner.json">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void GetPropertySourceName_ReturnsExpected()
Assert.Equal(provider.GetType().Name, name);

builder = new ConfigurationBuilder();
builder.AddJsonFile("c:\\foobar", true);
builder.AddJsonFile("foobar", true);
config = builder.Build();

ep = new EnvEndpoint(opts, config, new TestHosting());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
<PackageProjectUrl>http://steeltoe.io</PackageProjectUrl>
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
</PropertyGroup>


<Import Project="..\..\targetframework.props" />

<ItemGroup>
<None Update="empty.git.properties">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<PackageProjectUrl>http://steeltoe.io</PackageProjectUrl>
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
</PropertyGroup>


<Import Project="..\..\targetframework.props" />

<ItemGroup>
<None Update="empty.git.properties">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
<Description>Unit test project for Steeltoe.Management.EndpointOwin</Description>
<TargetFrameworks>net461</TargetFrameworks>
</PropertyGroup>


<Import Project="..\..\targetframework.props" />

<ItemGroup>
<None Update="empty.git.properties">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
<TargetFrameworks>net461</TargetFrameworks>
<AssemblyName>Steeltoe.Management.EndpointAutofac.Test</AssemblyName>
</PropertyGroup>

<PropertyGroup Condition="! $(OS.Contains('win')) AND '$(TargetFramework)'== 'net461'">
<FrameworkPathOverride>$(NuGetPackageRoot)microsoft.targetingpack.netframework.v4.6.1/1.0.1/lib/net461/</FrameworkPathOverride>
<RestoreAdditionalProjectSources>https://dotnet.myget.org/F/dotnet-core/api/v3/index.json</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup Condition="! $(OS.Contains('win')) AND '$(TargetFramework)'== 'net461'">
<PackageReference Include="Microsoft.TargetingPack.NETFramework.v4.6.1" Version="1.0.1" ExcludeAssets="All" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Steeltoe.Management.EndpointOwinAutofac\Steeltoe.Management.EndpointOwinAutofac.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
<PackageProjectUrl>http://steeltoe.io</PackageProjectUrl>
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
</PropertyGroup>


<Import Project="..\..\targetframework.props" />

<ItemGroup>
<ProjectReference Include="..\..\src\Steeltoe.Management.ExporterBase\Steeltoe.Management.ExporterBase.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
<PackageProjectUrl>http://steeltoe.io</PackageProjectUrl>
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
</PropertyGroup>


<Import Project="..\..\targetframework.props" />

<ItemGroup>
<ProjectReference Include="..\..\src\Steeltoe.Management.ExporterCore\Steeltoe.Management.ExporterCore.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
<RootNamespace>Steeltoe.Management.Census</RootNamespace>
</PropertyGroup>


<Import Project="..\..\targetframework.props" />

<ItemGroup>
<None Update="xunit.runner.json">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
<PackageProjectUrl>http://steeltoe.io</PackageProjectUrl>
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
</PropertyGroup>


<Import Project="..\..\targetframework.props" />

<ItemGroup>
<ProjectReference Include="..\..\src\Steeltoe.Management.TracingBase\Steeltoe.Management.TracingBase.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
<PackageProjectUrl>http://steeltoe.io</PackageProjectUrl>
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
</PropertyGroup>


<Import Project="..\..\targetframework.props" />

<ItemGroup>
<ProjectReference Include="..\..\src\Steeltoe.Management.TracingCore\Steeltoe.Management.TracingCore.csproj" />
</ItemGroup>
Expand Down

0 comments on commit b4ba1fc

Please sign in to comment.