Reduce chmod
This commit is contained in:
parent
b2429da437
commit
664f089985
3 changed files with 12 additions and 46 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>
|
||||
|
|
|
@ -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,7 +144,7 @@
|
|||
|
||||
<!-- Ensure crossgen tool is executable. See https://github.com/NuGet/Home/issues/4424 -->
|
||||
<Chmod Condition=" '$(OSName)' != 'win' "
|
||||
File="$(CrossgenPath)"
|
||||
Glob="$(CrossgenPath)"
|
||||
Mode="u+x" />
|
||||
|
||||
<Crossgen SourceAssembly="%(CrossgenTargets.FullPath)"
|
||||
|
@ -160,4 +160,10 @@
|
|||
<Move SourceFiles="@(NETCore10Assemblies->'$(PublishDir)/%(Filename)%(Extension).bak')"
|
||||
DestinationFiles="@(NETCore10Assemblies)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="ChmodPublishDir"
|
||||
AfterTargets="CrossgenPublishDir">
|
||||
|
||||
<Chmod Glob="$(SdkOutputDirectory)/**/*" Mode="u=rw,g=r,o=r" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue