Skip to content

Instantly share code, notes, and snippets.

@perezd
Created August 1, 2017 04:03
Show Gist options
  • Save perezd/ad391bc236b15712fb451a29cd9827ec to your computer and use it in GitHub Desktop.
Save perezd/ad391bc236b15712fb451a29cd9827ec to your computer and use it in GitHub Desktop.
package(default_visibility = ["//visibility:public"])
load("@build_bazel_rules_apple//apple:swift.bzl", "swift_library")
COPTS = ["-static-stdlib"]
swift_library(
name = "swift_protobuf",
module_name = "SwiftProtobuf",
srcs = glob(["Sources/SwiftProtobuf/*.swift"]),
copts = COPTS,
)
swift_library(
name = "protoc_gen_swift",
srcs = glob(["Sources/protoc-gen-swift/*.swift"]),
copts = COPTS,
deps = [
":plugin_library",
":swift_protobuf",
],
)
swift_library(
name = "plugin_library",
module_name = "PluginLibrary",
srcs = glob(["Sources/PluginLibrary/*.swift"]),
copts = COPTS,
deps = [
":swift_protobuf",
],
)
load("@build_bazel_rules_apple//apple:versioning.bzl", "apple_bundle_version")
apple_bundle_version(
name = "protoc_version",
build_version = "1.0",
)
load("@build_bazel_rules_apple//apple:macos.bzl", "macos_command_line_application")
macos_command_line_application(
name = "protoc",
bundle_id = "protoc.swift",
infoplists = [":SwiftProtobuf.xcodeproj/Protobuf_Info.plist"],
minimum_os_version = "10.11",
version = ":protoc_version",
deps = [":protoc_gen_swift"],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment