Generate deps for hosting startup in external dependencies
Use publish deps file instead of build deps file
This commit is contained in:
parent
867438a4ae
commit
cabc9874c5
|
|
@ -176,7 +176,7 @@
|
||||||
|
|
||||||
<!--- MSBuild caches things if you run inproc so have to use Exec -->
|
<!--- MSBuild caches things if you run inproc so have to use Exec -->
|
||||||
<MSBuild Projects="$(HostingStartupWorkDir)HostingStartup.csproj"
|
<MSBuild Projects="$(HostingStartupWorkDir)HostingStartup.csproj"
|
||||||
Targets="Build;CollectDeps"
|
Targets="Publish;CollectDeps"
|
||||||
Properties="$(_HostingStartupProps)" />
|
Properties="$(_HostingStartupProps)" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
|
@ -185,7 +185,8 @@
|
||||||
<!-- Generate RS.Reference project -->
|
<!-- Generate RS.Reference project -->
|
||||||
<RepoTasks.ResolveHostingStartupPackages
|
<RepoTasks.ResolveHostingStartupPackages
|
||||||
BuildArtifacts="@(ArtifactInfo)"
|
BuildArtifacts="@(ArtifactInfo)"
|
||||||
PackageArtifacts="@(PackageArtifact)">
|
PackageArtifacts="@(PackageArtifact)"
|
||||||
|
ExternalDependencies="@(ExternalDependency)">
|
||||||
<Output TaskParameter="HostingStartupArtifacts" ItemName="HostingStartupArtifacts" />
|
<Output TaskParameter="HostingStartupArtifacts" ItemName="HostingStartupArtifacts" />
|
||||||
</RepoTasks.ResolveHostingStartupPackages>
|
</RepoTasks.ResolveHostingStartupPackages>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@ namespace RepoTasks
|
||||||
[Required]
|
[Required]
|
||||||
public ITaskItem[] PackageArtifacts { get; set; }
|
public ITaskItem[] PackageArtifacts { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
public ITaskItem[] ExternalDependencies { get; set; }
|
||||||
|
|
||||||
[Output]
|
[Output]
|
||||||
public ITaskItem[] HostingStartupArtifacts { get; set; }
|
public ITaskItem[] HostingStartupArtifacts { get; set; }
|
||||||
|
|
||||||
|
|
@ -22,7 +25,18 @@ namespace RepoTasks
|
||||||
{
|
{
|
||||||
// Parse input
|
// Parse input
|
||||||
var hostingStartupArtifacts = PackageArtifacts.Where(p => p.GetMetadata("HostingStartup") == "true");
|
var hostingStartupArtifacts = PackageArtifacts.Where(p => p.GetMetadata("HostingStartup") == "true");
|
||||||
HostingStartupArtifacts = BuildArtifacts.Where(p => hostingStartupArtifacts.Any(h => h.GetMetadata("Identity") == p.GetMetadata("PackageId"))).ToArray();
|
var externalHostingStartupArtifacts = ExternalDependencies.Where(p => p.GetMetadata("HostingStartup") == "true");
|
||||||
|
|
||||||
|
var hostingStartups = BuildArtifacts.Where(p => hostingStartupArtifacts.Any(h => h.GetMetadata("Identity") == p.GetMetadata("PackageId")));
|
||||||
|
|
||||||
|
foreach (var externalHostingStartup in externalHostingStartupArtifacts)
|
||||||
|
{
|
||||||
|
// The parameters PackageId and Version are required for output. For external dependencies, the identity is the pacakge id.
|
||||||
|
externalHostingStartup.SetMetadata("PackageId", externalHostingStartup.GetMetadata("Identity"));
|
||||||
|
hostingStartups = hostingStartups.Append(externalHostingStartup);
|
||||||
|
}
|
||||||
|
|
||||||
|
HostingStartupArtifacts = hostingStartups.ToArray();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,6 @@
|
||||||
<DestinationDepsFile>$(DepsOutputPath)\$(HostingStartupPackageName)\shared\Microsoft.NETCore.App\$(DepsRuntimeFrameworkVersion)\$(HostingStartupPackageName).deps.json</DestinationDepsFile>
|
<DestinationDepsFile>$(DepsOutputPath)\$(HostingStartupPackageName)\shared\Microsoft.NETCore.App\$(DepsRuntimeFrameworkVersion)\$(HostingStartupPackageName).deps.json</DestinationDepsFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<Copy SourceFiles="$(ProjectDepsFilePath)" DestinationFiles="$(DestinationDepsFile)" />
|
<Copy SourceFiles="$(PublishDepsFilePath)" DestinationFiles="$(DestinationDepsFile)" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue