Skip to content

Commit

Permalink
[mono] Small improvements to the sdk update script
Browse files Browse the repository at this point in the history
- don't copy unnecessary files from the sdk nugets like netcoreapp*,
.signature.p7s etc files
- slightly better error handling
  • Loading branch information
radical committed Aug 3, 2018
1 parent 8b67c5a commit 2455f14
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion mono/build/sdks_and_nugets/deploy_from_nugets.proj
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@
Inputs="@(FilesToCopy)"
Outputs="@(FilesToCopy->'%(OutputDirectory)\%(RecursiveDir)\%(FileName)%(Extension)')">

<ItemGroup>
<FilesToCopy Remove="@(FilesToCopy)" Condition="$([System.String]::new('%(FilesToCopy.RecursiveDir)').Contains('netcoreapp'))" />
<FilesToCopy Remove="@(FilesToCopy)" Condition="$([System.String]::new('%(FilesToCopy.RecursiveDir)').Contains('GenerateDeps'))" />
<FilesToCopy Remove="@(FilesToCopy)" Condition="'%(FilesToCopy.Extension)' == '.p7s'" />
</ItemGroup>

<Copy
SourceFiles="@(FilesToCopy)"
DestinationFiles="@(FilesToCopy->'%(OutputDirectory)\%(RecursiveDir)\%(FileName)%(Extension)')">
<Output TaskParameter="CopiedFiles" ItemName="CopiedFiles" />
</Copy>

<Exec Command="chmod -x @(CopiedFiles->'%(Identity)', ' ')"
Condition="'$(OS)' != 'Windows_NT'" />
Condition="'$(OS)' != 'Windows_NT' and '@(CopiedFiles)' != ''" />
</Target>

<Target Name="EnsureDependencyRestored"
Expand All @@ -35,5 +41,10 @@
Projects="$(MSBuildThisFileDirectory)\sdks\sdks.csproj"
Targets="Restore"
Properties="DependencyPackageName=$(DependencyPackageName);DependencyPackageVersion=$(DependencyPackageVersion)"/>

<Error
Condition="!Exists('$(DependencyNuPkgPath)/$(DependencyPackageName.ToLower()).nuspec')"
Text="Tried to restore, but seems to have failed for Sdk/nuget named '$(DependencyPackageName)' version '$(DependencyPackageVersion)'" />

</Target>
</Project>

0 comments on commit 2455f14

Please sign in to comment.