File tree 1 file changed +48
-0
lines changed
1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ class Statesmith < Formula
2
+ desc "State machine code generation tool suitable for bare metal, embedded and more"
3
+ homepage "https://github.com/StateSmith/StateSmith"
4
+ url "https://github.com/StateSmith/StateSmith/archive/refs/tags/cli-v0.17.5.tar.gz"
5
+ sha256 "185fc6c05c8c950153bb871ffdad6de47ebf2db18c4607cd4005662d5d9f79b6"
6
+ license "Apache-2.0"
7
+
8
+ depends_on "dotnet"
9
+ depends_on "icu4c@77"
10
+ uses_from_macos "zlib"
11
+
12
+ def install
13
+ dotnet = Formula [ "dotnet" ]
14
+ args = %W[
15
+ -c Release
16
+ --framework net#{ dotnet . version . major_minor }
17
+ --output #{ libexec }
18
+ --no-self-contained
19
+ --use-current-runtime
20
+ -p:Version=#{ version }
21
+ ]
22
+
23
+ system "dotnet" , "publish" , "src/StateSmith.Cli" , *args
24
+ ( bin /"ss.cli" ) . write_env_script libexec /"StateSmith.Cli" , DOTNET_ROOT : "${DOTNET_ROOT:-#{ dotnet . opt_libexec } }"
25
+ end
26
+
27
+ test do
28
+ if OS . mac?
29
+ # We have to do a different test on mac due to https://github.com/orgs/Homebrew/discussions/5966
30
+ # Confirming that it fails as expected per the formula cookbook
31
+ output = pipe_output ( "#{ bin } /ss.cli --version 2>&1" )
32
+ assert_match "UnauthorizedAccessException" , output
33
+ else
34
+ assert_match version . to_s , shell_output ( "#{ bin } /ss.cli --version" )
35
+
36
+ File . write ( "lightbulb.puml" , <<~HERE )
37
+ @startuml lightbulb
38
+ [*] -> Off
39
+ Off -> On : Switch
40
+ On -> Off : Switch
41
+ @enduml
42
+ HERE
43
+
44
+ shell_output ( "#{ bin } /ss.cli run --lang=JavaScript --no-ask --no-csx -h -b" )
45
+ assert_match version . to_s , File . read ( testpath /"lightbulb.js" )
46
+ end
47
+ end
48
+ end
You can’t perform that action at this time.
0 commit comments