Skip to content

Commit

Permalink
possible fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerLeonhardt authored and colombod committed Feb 5, 2020
1 parent 2db7afa commit da97cca
Showing 1 changed file with 24 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="PSRestoreBuiltInModules;GetNuGetPackageRoot">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
Expand All @@ -11,6 +11,25 @@
<NoWarn>;NU5104;2003;8002</NoWarn>
</PropertyGroup>

<!-- Restore the module manifests for built in modules. This is temporary until https://github.com/PowerShell/PowerShell/issues/11783 is fixed. -->
<Target Name="PSRestoreBuiltInModules">
<PropertyGroup>
<PSUtilityUrl>https://raw.githubusercontent.com/PowerShell/PowerShell/v7.0.0-rc.2/src/Modules/Windows/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1</PSUtilityUrl>
<PSManagementUrl>https://raw.githubusercontent.com/PowerShell/PowerShell/v7.0.0-rc.2/src/Modules/Windows/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1</PSManagementUrl>
</PropertyGroup>

<PropertyGroup>
<PSUtilityFolder>$(MSBuildProjectDirectory)\Modules\Microsoft.PowerShell.Utility</PSUtilityFolder>
<PSManagementFolder>$(MSBuildProjectDirectory)\Modules\Microsoft.PowerShell.Management</PSManagementFolder>
</PropertyGroup>

<MakeDir Directories="$(PSUtilityFolder)" />
<MakeDir Directories="$(PSManagementFolder)" />

<DownloadFile SourceUrl="$(PSUtilityUrl)" DestinationFolder="$(PSUtilityFolder)" />
<DownloadFile SourceUrl="$(PSManagementUrl)" DestinationFolder="$(PSManagementFolder)" />
</Target>

<!-- PowerShell Module Versions -->
<PropertyGroup>
<PackageManagementVersion>1.4.6</PackageManagementVersion>
Expand All @@ -30,8 +49,6 @@
<!-- Get NuGetPackageRoot if it's not defined -->
<Target
Name="GetNuGetPackageRoot"
AfterTargets="Restore"
BeforeTargets="Build"
Condition=" '$(NuGetPackageRoot)' == '' "
>
<Exec Command="dotnet nuget locals global-packages --list --force-english-output" ConsoleToMSBuild="true">
Expand All @@ -51,51 +68,32 @@
Include="$(NuGetPackageRoot)packagemanagement\$(PackageManagementVersion)\**"
Exclude="$(NuGetPackageRoot)**\*.nupkg;$(NuGetPackageRoot)**\*.sha512"
PackageCopyToOutput="true">
<Link>Modules\PackageManagement\$(PackageManagementVersion)\%(RecursiveDir)\%(FileName)%(Extension)</Link>
<Link>Modules\PackageManagement\%(RecursiveDir)\%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content
Include="$(NuGetPackageRoot)powershellget\$(PowerShellGetVersion)\**"
Exclude="$(NuGetPackageRoot)**\*.nupkg;$(NuGetPackageRoot)**\*.sha512"
PackageCopyToOutput="true">
<Link>Modules\PowerShellGet\$(PowerShellGetVersion)\%(RecursiveDir)\%(FileName)%(Extension)</Link>
<Link>Modules\PowerShellGet\%(RecursiveDir)\%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content
Include="$(NuGetPackageRoot)microsoft.powershell.archive\$(MicrosoftPowerShellArchiveVersion)\**"
Exclude="$(NuGetPackageRoot)**\*.nupkg;$(NuGetPackageRoot)**\*.sha512"
PackageCopyToOutput="true">
<Link>Modules\Microsoft.PowerShell.Archive\$(MicrosoftPowerShellArchiveVersion)\%(RecursiveDir)\%(FileName)%(Extension)</Link>
<Link>Modules\Microsoft.PowerShell.Archive\%(RecursiveDir)\%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content
Include="$(NuGetPackageRoot)threadjob\$(ThreadJobVersion)\**"
Exclude="$(NuGetPackageRoot)**\*.nupkg;$(NuGetPackageRoot)**\*.sha512"
PackageCopyToOutput="true">
<Link>Modules\ThreadJob\$(ThreadJobVersion)\%(RecursiveDir)\%(FileName)%(Extension)</Link>
<Link>Modules\ThreadJob\%(RecursiveDir)\%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<!-- Restore the module manifests for built in modules. This is temporary until https://github.com/PowerShell/PowerShell/issues/11783 is fixed. -->
<Target Name="PSRestoreBuiltInModules" AfterTargets="Restore" BeforeTargets="Build">
<PropertyGroup>
<PSUtilityUrl>https://raw.githubusercontent.com/PowerShell/PowerShell/v7.0.0-rc.2/src/Modules/Windows/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1</PSUtilityUrl>
<PSManagementUrl>https://raw.githubusercontent.com/PowerShell/PowerShell/v7.0.0-rc.2/src/Modules/Windows/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1</PSManagementUrl>
</PropertyGroup>

<PropertyGroup>
<PSUtilityFolder>$(MSBuildProjectDirectory)\Modules\Microsoft.PowerShell.Utility</PSUtilityFolder>
<PSManagementFolder>$(MSBuildProjectDirectory)\Modules\Microsoft.PowerShell.Management</PSManagementFolder>
</PropertyGroup>

<MakeDir Directories="$(PSUtilityFolder)" />
<MakeDir Directories="$(PSManagementFolder)" />

<DownloadFile SourceUrl="$(PSUtilityUrl)" DestinationFolder="$(PSUtilityFolder)" />
<DownloadFile SourceUrl="$(PSManagementUrl)" DestinationFolder="$(PSManagementFolder)" />
</Target>

<!-- The dependencies for this project -->
<ItemGroup>
<ProjectReference Include="..\Microsoft.DotNet.Interactive.Formatting\Microsoft.DotNet.Interactive.Formatting.csproj" />
Expand Down

0 comments on commit da97cca

Please sign in to comment.