Skip to content
This repository was archived by the owner on Nov 21, 2018. It is now read-only.

Commit a5a9b6a

Browse files
committed
Use RuntimeFrameworkVersion instead for directory name (#82)
1 parent 7cb4586 commit a5a9b6a

File tree

11 files changed

+151
-14
lines changed

11 files changed

+151
-14
lines changed

.travis.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
language: csharp
2+
sudo: false
3+
dist: trusty
4+
env:
5+
global:
6+
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
7+
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
8+
mono: none
9+
os:
10+
- linux
11+
- osx
12+
osx_image: xcode8.2
13+
branches:
14+
only:
15+
- master
16+
- release
17+
- dev
18+
- /^(.*\/)?ci-.*$/
19+
before_install:
20+
- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fi
21+
script:
22+
- ./build.sh

MetaPackages.sln

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 15
3-
VisualStudioVersion = 15.0.26424.2
3+
VisualStudioVersion = 15.0.26412.1
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED834E68-51C3-4ADE-ACC8-6BA6D4207C09}"
66
EndProject
@@ -49,6 +49,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-archive", "src\dotne
4949
EndProject
5050
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Archive", "src\Microsoft.DotNet.Archive\Microsoft.DotNet.Archive.csproj", "{302400A0-98BB-4C04-88D4-C32DC2D4B945}"
5151
EndProject
52+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TrimDeps", "tools\TrimDeps\TrimDeps.csproj", "{67E4C92F-6D12-4C52-BB79-B8D11BFC6B82}"
53+
EndProject
5254
Global
5355
GlobalSection(SolutionConfigurationPlatforms) = preSolution
5456
Debug|Any CPU = Debug|Any CPU
@@ -99,6 +101,10 @@ Global
99101
{302400A0-98BB-4C04-88D4-C32DC2D4B945}.Debug|Any CPU.Build.0 = Debug|Any CPU
100102
{302400A0-98BB-4C04-88D4-C32DC2D4B945}.Release|Any CPU.ActiveCfg = Release|Any CPU
101103
{302400A0-98BB-4C04-88D4-C32DC2D4B945}.Release|Any CPU.Build.0 = Release|Any CPU
104+
{67E4C92F-6D12-4C52-BB79-B8D11BFC6B82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
105+
{67E4C92F-6D12-4C52-BB79-B8D11BFC6B82}.Debug|Any CPU.Build.0 = Debug|Any CPU
106+
{67E4C92F-6D12-4C52-BB79-B8D11BFC6B82}.Release|Any CPU.ActiveCfg = Release|Any CPU
107+
{67E4C92F-6D12-4C52-BB79-B8D11BFC6B82}.Release|Any CPU.Build.0 = Release|Any CPU
102108
EndGlobalSection
103109
GlobalSection(SolutionProperties) = preSolution
104110
HideSolutionNode = FALSE
@@ -118,5 +124,6 @@ Global
118124
{9BBA7A0A-109A-4AC8-B6EF-A52EA7CF1D90} = {9E49B5B9-9E72-42FB-B684-90CA1B1BCF9C}
119125
{AE4216BF-D471-471B-82F3-6B6D004F7D17} = {ED834E68-51C3-4ADE-ACC8-6BA6D4207C09}
120126
{302400A0-98BB-4C04-88D4-C32DC2D4B945} = {ED834E68-51C3-4ADE-ACC8-6BA6D4207C09}
127+
{67E4C92F-6D12-4C52-BB79-B8D11BFC6B82} = {ED834E68-51C3-4ADE-ACC8-6BA6D4207C09}
121128
EndGlobalSection
122129
EndGlobal

appveyor.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
init:
2+
- git config --global core.autocrlf true
3+
branches:
4+
only:
5+
- master
6+
- release
7+
- dev
8+
- /^(.*\/)?ci-.*$/
9+
build_script:
10+
- ps: .\build.ps1
11+
clone_depth: 1
12+
test: off
13+
deploy: off
14+
os: Visual Studio 2017

build/common.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,14 @@
185185
<FullMetaPackageProjectReference Include="../Microsoft.AspNetCore/Microsoft.AspNetCore.csproj" />
186186
</ItemGroup>
187187

188+
<ItemGroup>
189+
<HostingStartupPackageReference Include="Microsoft.AspNetCore.AzureAppServices.HostingStartup" Version="$(AspNetCoreVersion)" PrivateAssets="None" />
190+
<HostingStartupPackageReference Include="Microsoft.AspNetCore.ApplicationInsights.HostingStartup" Version="$(AspNetCoreVersion)" PrivateAssets="None" />
191+
</ItemGroup>
192+
188193
<ItemGroup>
189194
<RuntimeStorePackageReference Include="@(FullMetaPackagePackageReference)" />
195+
<RuntimeStorePackageReference Include="@(HostingStartupPackageReference)" />
190196
<RuntimeStorePackageReference Include="Microsoft.AspNetCore" Version="$(AspNetCoreVersion)" PrivateAssets="None" />
191197
<RuntimeStorePackageReference Include="Microsoft.AspNetCore.AzureAppServices.HostingStartup" Version="$(AspNetCoreVersion)" PrivateAssets="None" />
192198
<RuntimeStorePackageReference Include="Microsoft.AspNetCore.AzureAppServicesIntegration" Version="$(AspNetCoreVersion)" PrivateAssets="None" />

build/dependencies.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<AspNetCoreIdentityServiceVersion>1.0.0-*</AspNetCoreIdentityServiceVersion>
66
<CoreFxVersion>4.3.0</CoreFxVersion>
77
<InternalAspNetCoreSdkVersion>2.0.0-*</InternalAspNetCoreSdkVersion>
8+
<NewtonsoftJsonVersion>10.0.1</NewtonsoftJsonVersion>
89
<TestSdkVersion>15.0.0</TestSdkVersion>
910
<XunitVersion>2.2.0</XunitVersion>
1011
</PropertyGroup>

build/repo.targets

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@
66
<MetaPackagePath>$(RepositoryRoot)src\Microsoft.AspNetCore.RuntimeStore\</MetaPackagePath>
77
<MetaPackageFile>$(MetaPackagePath)Microsoft.AspNetCore.RuntimeStore.csproj</MetaPackageFile>
88

9+
<HostingStartupTemplatePath>$(RepositoryRoot)tools\Microsoft.AspNetCore.HostingStartup.Template\</HostingStartupTemplatePath>
10+
<HostingStartupTemplateFile>$(HostingStartupTemplatePath)Microsoft.AspNetCore.HostingStartup.Template.csproj</HostingStartupTemplateFile>
11+
912
<!-- Project for building the NuGet Fallback Archive (LZMA for CLI) -->
1013
<FallbackArchiveDir>$(RepositoryRoot)src\Archive.AspNetCore.All\</FallbackArchiveDir>
1114
<FallbackArchiveProj>$(FallbackArchiveDir)Archive.AspNetCore.All.csproj</FallbackArchiveProj>
1215

1316
<WorkingDirectory>$(MetaPackagePath)bin\work\</WorkingDirectory>
1417
<PackageCacheOutputPath>$(MetaPackagePath)bin\packageCache\</PackageCacheOutputPath>
15-
<DepsOutputPath>$(MetaPackagePath)bin\deps\</DepsOutputPath>
1618
<ArtifactsDir>$(RepositoryRoot)artifacts\</ArtifactsDir>
1719
<ArtifactsZipDir>$(ArtifactsDir)zip\</ArtifactsZipDir>
20+
<DepsOutputPath>$(ArtifactsDir)deps\</DepsOutputPath>
1821
<ArtifactsZipTimestampDir>$(ArtifactsZipDir)ts\</ArtifactsZipTimestampDir>
1922
<ArtifactsZipNoTimestampDir>$(ArtifactsZipDir)nt\</ArtifactsZipNoTimestampDir>
2023
<TempDir>$(ArtifactsDir)temp\</TempDir>
@@ -34,7 +37,7 @@
3437
Condition="Exists('$(DependencyBuildDirectory)')" />
3538
</Target>
3639

37-
<Target Name="BuildPackageCache" DependsOnTargets="UpdateNuGetConfig">
40+
<Target Name="BuildPackageCache" DependsOnTargets="UpdateNuGetConfig;Restore">
3841
<GetOSPlatform>
3942
<!-- Returns {Linux, macOS, Windows} -->
4043
<Output TaskParameter="PlatformName" PropertyName="OSPlatform" />
@@ -55,7 +58,9 @@
5558
<RemoveDir Directories="$(PackageCacheOutputPath)" />
5659
<RemoveDir Directories="$(WorkingDirectory)" />
5760
<Exec Command="dotnet store --manifest $(MetaPackageFile) --configuration Release --framework netcoreapp2.0 --runtime $(RID) --output $(PackageCacheOutputPath) --framework-version 2.0.0-* --working-dir $(WorkingDirectory)" />
58-
<MsBuild Projects="$(MetaPackageFile)" Targets="CollectDeps" Properties="DepsOutputPath=$(DepsOutputPath)"/>
61+
62+
<!--- MSBuild caches things if you run inproc so have to use Exec -->
63+
<Exec Command="dotnet msbuild /t:Restore;Rebuild;CollectDeps $(HostingStartupTemplateFile) /p:DepsOutputPath=$(DepsOutputPath);HostingStartupPackageName=%(HostingStartupPackageReference.Identity);HostingStartupPackageVersion=%(Version)"/>
5964

6065
<ItemGroup>
6166
<PackageStoreManifestFiles Include="$(PackageCacheOutputPath)**\artifact.xml">

src/Microsoft.AspNetCore.RuntimeStore/Microsoft.AspNetCore.RuntimeStore.csproj

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,4 @@
99
<ItemGroup>
1010
<PackageReference Include="@(RuntimeStorePackageReference)" />
1111
</ItemGroup>
12-
13-
<Target Name="CollectDeps" DependsOnTargets="Restore;RunResolvePackageDependencies">
14-
<ItemGroup>
15-
<DepsFiles Include="%(FileDefinitions.ResolvedPath)" Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('%(Identity)', '.*?\.HostingStartup\.deps\.json')) " >
16-
<PackageName>$([System.String]::Copy('%(Filename)').Replace('.deps',''))</PackageName>
17-
</DepsFiles>
18-
</ItemGroup>
19-
20-
<Copy SourceFiles="%(DepsFiles.FullPath)" DestinationFiles="$(DepsOutputPath)\%(DepsFiles.PackageName)\Microsoft.NETCore.App\2.0.0\deps.json" />
21-
</Target>
2212
</Project>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk">
3+
4+
<Import Project="..\..\build\common.props" />
5+
6+
<PropertyGroup>
7+
<TargetFramework>netcoreapp2.0</TargetFramework>
8+
<OutputType>Exe</OutputType>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="$(HostingStartupPackageName)" Version="$(HostingStartupPackageVersion)" PrivateAssets="None" />
13+
</ItemGroup>
14+
15+
<Target Name="CollectDeps">
16+
<PropertyGroup>
17+
<DestinationDepsFile>$(DepsOutputPath)\$(HostingStartupPackageName)\shared\Microsoft.NETCore.App\$(RuntimeFrameworkVersion)\$(HostingStartupPackageName).deps.json</DestinationDepsFile>
18+
</PropertyGroup>
19+
<Copy SourceFiles="$(ProjectDepsFilePath)" DestinationFiles="$(DestinationDepsFile)" />
20+
<Exec Command="dotnet run --framework netcoreapp2.0 $([System.IO.Path]::GetFullPath('$(DestinationDepsFile)'))" WorkingDirectory="../TrimDeps/"/>
21+
</Target>
22+
</Project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
public class Program
5+
{
6+
public static void Main() { }
7+
}

tools/TrimDeps/Program.cs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System.IO;
5+
using System.Linq;
6+
using Newtonsoft.Json;
7+
using Newtonsoft.Json.Linq;
8+
9+
public class Program
10+
{
11+
public static void Main(string[] args)
12+
{
13+
ChangeEntryPointLibraryName(args[0]);
14+
}
15+
16+
private static void ChangeEntryPointLibraryName(string depsFile)
17+
{
18+
JToken deps;
19+
using (var file = File.OpenText(depsFile))
20+
using (JsonTextReader reader = new JsonTextReader(file))
21+
{
22+
deps = JObject.ReadFrom(reader);
23+
}
24+
25+
string version = null;
26+
foreach (JProperty target in deps["targets"])
27+
{
28+
var targetLibrary = target.Value.Children<JProperty>().FirstOrDefault();
29+
if (targetLibrary == null)
30+
{
31+
continue;
32+
}
33+
34+
targetLibrary.Remove();
35+
}
36+
if (version != null)
37+
{
38+
var library = deps["libraries"].Children<JProperty>().First();
39+
library.Remove();
40+
41+
using (var file = File.CreateText(depsFile))
42+
using (var writer = new JsonTextWriter(file) { Formatting = Formatting.Indented })
43+
{
44+
deps.WriteTo(writer);
45+
}
46+
}
47+
}
48+
}

tools/TrimDeps/TrimDeps.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk">
3+
4+
<Import Project="..\..\build\common.props" />
5+
6+
<PropertyGroup>
7+
<TargetFramework>netcoreapp2.0</TargetFramework>
8+
<OutputType>Exe</OutputType>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
13+
</ItemGroup>
14+
15+
</Project>

0 commit comments

Comments
 (0)