Merge pull request #5877 from piotrpMSFT/piotrpMSFT/infra/chmodfaster
Clean up chmod usage
This commit is contained in:
commit
5aed4714bb
4 changed files with 17 additions and 47 deletions
|
@ -22,32 +22,6 @@
|
|||
Configuration="$(Configuration)"
|
||||
ProjectPath="$(RootProject)" />
|
||||
|
||||
<!-- Corehostify Binaries -->
|
||||
<ItemGroup Condition=" '$(OSName)' != 'win' ">
|
||||
<SdkOutputChmodTargets Remove="*" />
|
||||
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*.exe;
|
||||
$(SdkOutputDirectory)/**/*.dll" >
|
||||
<!-- Managed assemblies do not need execute -->
|
||||
<Mode>u=rw,g=r,o=r</Mode>
|
||||
</SdkOutputChmodTargets>
|
||||
|
||||
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*.dylib;
|
||||
$(SdkOutputDirectory)/**/*.so" >
|
||||
<!-- Generally, dylibs and sos have 'x' -->
|
||||
<Mode>u=rwx,g=rx,o=rx</Mode>
|
||||
</SdkOutputChmodTargets>
|
||||
|
||||
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*"
|
||||
Exclude="$(SdkOutputDirectory)/**/*.*" >
|
||||
<!-- Executables need x -->
|
||||
<Mode>u=rwx,g=rx,o=rx</Mode>
|
||||
</SdkOutputChmodTargets>
|
||||
</ItemGroup>
|
||||
|
||||
<Chmod Condition=" '$(OSName)' != 'win' "
|
||||
File="%(SdkOutputChModTargets.FullPath)"
|
||||
Mode="%(SdkOutputChModTargets.Mode)" />
|
||||
|
||||
<ItemGroup>
|
||||
<FilesToClean Include="$(OutputDirectory)/sdk/**/vbc.exe" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -65,7 +65,8 @@
|
|||
<Target Name="BuildTests"
|
||||
DependsOnTargets="RestoreTests;">
|
||||
<DotNetBuild ToolPath="$(OutputDirectory)"
|
||||
ProjectPath=""$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln"" />
|
||||
ProjectPath=""$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln""
|
||||
MaxCpuCount="1" />
|
||||
</Target>
|
||||
|
||||
<Target Name="CreateTestAssetPackageNuPkgs"
|
||||
|
|
|
@ -9,27 +9,13 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
public class Chmod : ToolTask
|
||||
{
|
||||
[Required]
|
||||
public string File { get; set; }
|
||||
public string Glob { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Mode { get; set; }
|
||||
|
||||
public bool Recursive { get; set; }
|
||||
|
||||
protected override bool ValidateParameters()
|
||||
{
|
||||
base.ValidateParameters();
|
||||
|
||||
if (!System.IO.File.Exists(File))
|
||||
{
|
||||
Log.LogError($"File '{File} does not exist.");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override string ToolName
|
||||
{
|
||||
get { return "chmod"; }
|
||||
|
@ -47,12 +33,12 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
|
||||
protected override string GenerateCommandLineCommands()
|
||||
{
|
||||
return $"{GetRecursive()} {GetMode()} {GetFilePath()}";
|
||||
return $"{GetRecursive()} {GetMode()} {GetGlob()}";
|
||||
}
|
||||
|
||||
private string GetFilePath()
|
||||
private string GetGlob()
|
||||
{
|
||||
return File;
|
||||
return Glob;
|
||||
}
|
||||
|
||||
private string GetMode()
|
||||
|
|
|
@ -144,8 +144,8 @@
|
|||
|
||||
<!-- Ensure crossgen tool is executable. See https://github.com/NuGet/Home/issues/4424 -->
|
||||
<Chmod Condition=" '$(OSName)' != 'win' "
|
||||
File="$(CrossgenPath)"
|
||||
Mode="u+x" />
|
||||
Glob="$(CrossgenPath)"
|
||||
Mode="u+x" />
|
||||
|
||||
<Crossgen SourceAssembly="%(CrossgenTargets.FullPath)"
|
||||
DestinationPath="%(CrossgenTargets.FullPath)"
|
||||
|
@ -160,4 +160,13 @@
|
|||
<Move SourceFiles="@(NETCore10Assemblies->'$(PublishDir)/%(Filename)%(Extension).bak')"
|
||||
DestinationFiles="@(NETCore10Assemblies)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="ChmodPublishDir"
|
||||
AfterTargets="CrossgenPublishDir"
|
||||
Condition=" '$(OSName)' != 'win' ">
|
||||
|
||||
<Exec Command="find $(SdkOutputDirectory) -type d -exec chmod 755 {} \;" />
|
||||
<Exec Command="find $(SdkOutputDirectory) -type f -exec chmod 644 {} \;" />
|
||||
<Chmod Mode="755" Glob="$(SdkOutputDirectory)/Roslyn/RunCsc.sh" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
Loading…
Reference in a new issue