1 class Cadence < Formula
2 desc "Resource-oriented smart contract programming language"
3 homepage "https://cadence-lang.org/"
4 url "https://github.com/onflow/cadence/archive/refs/tags/v1.3.1.tar.gz"
5 sha256 "7955e8f7715d70f4232d2b6579eed430828019f23cd052be1b18319ba40bae92"
7 head "https://github.com/onflow/cadence.git", branch: "master"
9 # Upstream uses GitHub releases to indicate that a version is released
10 # (there's also sometimes a notable gap between when a version is tagged and
11 # and the release is created), so the `GithubLatest` strategy is necessary.
14 strategy :github_latest
18 sha256 cellar: :any_skip_relocation, arm64_sequoia: "c459a7920f6dcab5d207d2f47d5e60f445e55bbb050dfcda72ff93afa2ff4cf3"
19 sha256 cellar: :any_skip_relocation, arm64_sonoma: "c459a7920f6dcab5d207d2f47d5e60f445e55bbb050dfcda72ff93afa2ff4cf3"
20 sha256 cellar: :any_skip_relocation, arm64_ventura: "c459a7920f6dcab5d207d2f47d5e60f445e55bbb050dfcda72ff93afa2ff4cf3"
21 sha256 cellar: :any_skip_relocation, sonoma: "48a0d24aa77f24be66e7a5f516aadfcd1f69317b6dda5b71b80c212b83bb9a7b"
22 sha256 cellar: :any_skip_relocation, ventura: "48a0d24aa77f24be66e7a5f516aadfcd1f69317b6dda5b71b80c212b83bb9a7b"
23 sha256 cellar: :any_skip_relocation, x86_64_linux: "ecc190fbdebe831acfbd7301d6b7e1e843d0aac15efac959d085ab39f5aad0e4"
26 depends_on "go" => :build
28 conflicts_with "cadence-workflow", because: "both install a `cadence` executable"
31 system "go", "build", *std_go_args(ldflags: "-s -w"), "./cmd/main"
35 # from https://cadence-lang.org/docs/tutorial/hello-world
36 (testpath/"hello.cdc").write <<~EOS
37 access(all) contract HelloWorld {
39 // Declare a public (access(all)) field of type String.
41 // All fields must be initialized in the initializer.
42 access(all) let greeting: String
44 // The initializer is required if the contract contains any fields.
46 self.greeting = "Hello, World!"
49 // Public function that returns our friendly greeting!
50 access(all) view fun hello(): String {
55 system bin/"cadence", "hello.cdc"