| # Copyright 2021 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/go/go_binary.gni") |
| import("//build/go/go_library.gni") |
| import("//build/go/go_test.gni") |
| |
| if (is_host) { |
| go_library("gopkg") { |
| sources = [ |
| "format.go", |
| "format_test.go", |
| "main.go", |
| ] |
| } |
| |
| go_binary("gidl-format") { |
| gopackage = "go.fuchsia.dev/fuchsia/tools/fidl/gidl-format" |
| deps = [ ":gopkg" ] |
| } |
| |
| go_test("gidl_format_tests") { |
| gopackages = [ "go.fuchsia.dev/fuchsia/tools/fidl/gidl-format" ] |
| deps = [ |
| ":gopkg", |
| "//third_party/golibs:github.com/google/go-cmp", |
| ] |
| } |
| } # is_host |
| |
| install_host_tools("host") { |
| deps = [ ":gidl-format" ] |
| outputs = [ "gidl-format" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":gidl_format_tests($host_toolchain)" ] |
| } |