Skip to content

Commit

Permalink
Merge pull request #197927 from Homebrew/sbom-tool-detect-rid
Browse files Browse the repository at this point in the history
sbom-tool: use detected RID, disable DOTNET_ROOT override
  • Loading branch information
chenrui333 authored Nov 16, 2024
2 parents d49965f + 35421a5 commit 2722dba
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Formula/s/sbom-tool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,12 @@ def install
ENV["DOTNET_CLI_TELEMETRY_OPTOUT"] = "true"

dotnet = Formula["dotnet@8"]
os = OS.mac? ? "osx" : OS.kernel_name.downcase
arch = Hardware::CPU.intel? ? "x64" : Hardware::CPU.arch.to_s

args = %W[
--configuration Release
--framework net#{dotnet.version.major_minor}
--output #{libexec}
--runtime #{os}-#{arch}
--no-self-contained
--output #{libexec}
--use-current-runtime
-p:OFFICIAL_BUILD=true
-p:MinVerVersionOverride=#{version}
-p:PublishSingleFile=true
Expand All @@ -50,8 +47,7 @@ def install
]

system "dotnet", "publish", "src/Microsoft.Sbom.Tool/Microsoft.Sbom.Tool.csproj", *args
(bin/"sbom-tool").write_env_script libexec/"Microsoft.Sbom.Tool",
DOTNET_ROOT: "${DOTNET_ROOT:-#{dotnet.opt_libexec}}"
(bin/"sbom-tool").write_env_script libexec/"Microsoft.Sbom.Tool", DOTNET_ROOT: dotnet.opt_libexec
end

test do
Expand Down

0 comments on commit 2722dba

Please sign in to comment.