Skip to content

Commit

Permalink
kiota: fix HEAD build, detect RID, non-overridable DOTNET_ROOT
Browse files Browse the repository at this point in the history
  • Loading branch information
cho-m committed Nov 16, 2024
1 parent c4d75cb commit e24c330
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Formula/k/kiota.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,20 @@ class Kiota < Formula

def install
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
--use-current-runtime
-p:TargetFramework=net#{dotnet.version.major_minor}
-p:PublishSingleFile=true
-p:Version=#{version}
]
args << "-p:Version=#{version}" if build.stable?

system "dotnet", "publish", "src/kiota/kiota.csproj", *args

(bin/"kiota").write_env_script libexec/"kiota",
DOTNET_ROOT: "${DOTNET_ROOT:-#{dotnet.opt_libexec}}"
(bin/"kiota").write_env_script libexec/"kiota", DOTNET_ROOT: dotnet.opt_libexec
end

test do
Expand Down

0 comments on commit e24c330

Please sign in to comment.