Skip to content

statesmith 0.17.5 (new formula) #210747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions Formula/s/statesmith.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
class Statesmith < Formula
desc "State machine code generation tool suitable for bare metal, embedded and more"
homepage "https://github.com/StateSmith/StateSmith"
url "https://github.com/StateSmith/StateSmith/archive/refs/tags/cli-v0.17.5.tar.gz"
sha256 "185fc6c05c8c950153bb871ffdad6de47ebf2db18c4607cd4005662d5d9f79b6"
license "Apache-2.0"

bottle do
sha256 cellar: :any_skip_relocation, arm64_sequoia: "06a75aa770bfbe5736191b850192f3018d60de182fb55dbb3a84dba2b4a7c90c"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "926fafa1d15bcca00d6372824d26c6bbd55a59b0a6cf5cf34ec338c7462321e4"
sha256 cellar: :any_skip_relocation, arm64_ventura: "0a11d4baa36bad4b9781afeda8e6767a5e6883e800cfbda179755c41f0344f13"
sha256 cellar: :any_skip_relocation, ventura: "0a52242c5fc55c753a125e12de944672d59ca660c5f7852b7e8809996380b0b6"
sha256 cellar: :any_skip_relocation, x86_64_linux: "9cccfa195619b84f8094ad0a86f8b6ec9b6f11d6c137bbedca6e7f10d06c3c2c"
end

depends_on "dotnet"
depends_on "icu4c@77"
uses_from_macos "zlib"

def install
dotnet = Formula["dotnet"]
args = %W[
-c Release
--framework net#{dotnet.version.major_minor}
--output #{libexec}
--no-self-contained
--use-current-runtime
-p:Version=#{version}
]

system "dotnet", "publish", "src/StateSmith.Cli", *args
(bin/"ss.cli").write_env_script libexec/"StateSmith.Cli", DOTNET_ROOT: "${DOTNET_ROOT:-#{dotnet.opt_libexec}}"
end

test do
if OS.mac?
# We have to do a different test on mac due to https://github.com/orgs/Homebrew/discussions/5966
# Confirming that it fails as expected per the formula cookbook
output = pipe_output("#{bin}/ss.cli --version 2>&1")
assert_match "UnauthorizedAccessException", output
else
assert_match version.to_s, shell_output("#{bin}/ss.cli --version")

File.write("lightbulb.puml", <<~HERE)
@startuml lightbulb
[*] -> Off
Off -> On : Switch
On -> Off : Switch
@enduml
HERE

shell_output("#{bin}/ss.cli run --lang=JavaScript --no-ask --no-csx -h -b")
assert_match version.to_s, File.read(testpath/"lightbulb.js")
end
end
end
Loading