Skip to content
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

statesmith 0.17.5 (new formula) #210747

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
48 changes: 48 additions & 0 deletions Formula/s/statesmith.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
class Statesmith < Formula

Check warning on line 1 in Formula/s/statesmith.rb

View workflow job for this annotation

GitHub Actions / macOS 14-x86_64

No bottle built for statesmith!

statesmith has unbottled dependencies, so a bottle will not be built.
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"

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