Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up package asset resolution #1857

Merged
merged 7 commits into from
Jan 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion sdk.sln
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{09AD2F
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Resources", "Resources", "{7D6CD7B6-0237-40DD-9911-44FF22292131}"
ProjectSection(SolutionItems) = preProject
src\Tasks\Common\Resources\Strings.Designer.cs = src\Tasks\Common\Resources\Strings.Designer.cs
src\Tasks\Common\Resources\Strings.resx = src\Tasks\Common\Resources\Strings.resx
EndProjectSection
EndProject
Expand Down
6 changes: 6 additions & 0 deletions src/Assets/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!--
Sometimes it is useful to play around with the test assets
directly where you're authoring them, and they should never
get the build customization from the rest of the repo.
-->
<Project />
6 changes: 6 additions & 0 deletions src/Assets/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!--
Sometimes it is useful to play around with the test assets
directly where you're authoring them, and they should never
get the build customization from the rest of the repo.
-->
<Project />
8 changes: 8 additions & 0 deletions src/Assets/TestProjects/AppWithLibraryFS/TestApp/Program.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Learn more about F# at http://fsharp.org

open System

[<EntryPoint>]
let main argv =
TestLibrary.Say.hello "F#"
0 // return an integer exit code
16 changes: 16 additions & 0 deletions src/Assets/TestProjects/AppWithLibraryFS/TestApp/TestApp.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\TestLibrary\TestLibrary.fsproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace TestLibrary

module Say =
let public hello name =
printfn "Hello %s" name
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="Library.fs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<Version>42.43.44.45-alpha</Version>
<OutputType>Library</OutputType>
<TargetFramework>netstandard1.5</TargetFramework>
<RootNamespace />
</PropertyGroup>
</Project>
37 changes: 0 additions & 37 deletions src/Tasks/Common/DiagnosticsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,6 @@ public DiagnosticsHelper(ILog log)

public ITaskItem[] GetDiagnosticMessages() => _diagnosticMessages.ToArray();

public ITaskItem Add(string diagnosticCode, string message, string filePath, DiagnosticMessageSeverity severity)
=> Add(diagnosticCode, message, filePath, severity, startLine: 1, startColumn: 0);

public ITaskItem Add(string diagnosticCode, string message, string filePath, DiagnosticMessageSeverity severity, int startLine, int startColumn)
=> Add(
diagnosticCode,
message,
filePath,
severity,
startLine,
startColumn,
targetFrameworkMoniker: null,
packageId: null);

public ITaskItem Add(
string diagnosticCode,
string message,
string filePath,
DiagnosticMessageSeverity severity,
int startLine,
int startColumn,
string targetFrameworkMoniker,
string packageId,
bool logToMSBuild = true)
=> Add(
diagnosticCode,
message,
filePath,
severity,
startLine,
startColumn,
endLine: startLine,
endColumn: startColumn,
targetFrameworkMoniker: targetFrameworkMoniker,
packageId: packageId,
logToMSBuild: logToMSBuild);

public ITaskItem Add(
string diagnosticCode,
string message,
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Common/ItemUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static string GetTargetPath(ITaskItem item)

var fileName = Path.GetFileName(sourcePath);

// Get locale subdirectory for satellite assemblies
// Get subdirectory for satellite assemblies / runtime targets
var destinationSubDirectory = item.GetMetadata("DestinationSubDirectory");

if (!string.IsNullOrWhiteSpace(destinationSubDirectory))
Expand Down
23 changes: 23 additions & 0 deletions src/Tasks/Common/MetadataKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,28 @@ internal static class MetadataKeys

// Conflict Resolution
public const string OverriddenPackages = "OverriddenPackages";

// Package assets
public const string NuGetIsFrameworkReference = "NuGetIsFrameworkReference";
public const string NuGetPackageId = "NuGetPackageId";
public const string NuGetPackageVersion = "NuGetPackageVersion";
public const string NuGetSourceType = "NuGetSourceType";

// References
public const string ExternallyResolved = "ExternallyResolved";
public const string HintPath = "HintPath";
public const string Private = "Private";
public const string Pack = "Pack";

// Content files
public const string PPOutputPath = "PPOutputPath";
public const string CodeLanguage = "CodeLanguage";
public const string CopyToOutput = "CopyToOutput";
public const string BuildAction = "BuildAction";
public const string OutputPath = "OutputPath";

// Resource assemblies
public const string Culture = "Culture";
public const string DestinationSubDirectory = "DestinationSubDirectory";
}
}
Loading