Skip to content

Commit

Permalink
Bazel build support for Plank
Browse files Browse the repository at this point in the history
- We're using the rules_apple repository for swift support
- WORKSPACE defines external dependencies
- BUILD defines the specific targets (similar to Swift PM)
  • Loading branch information
rahul-malik committed Aug 17, 2017
1 parent 864abac commit f7dbdd5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
23 changes: 23 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
load("@build_bazel_rules_apple//apple:swift.bzl", "swift_library")
load("@build_bazel_rules_apple//apple:macos.bzl", "macos_command_line_application")

swift_library(
name = "PlankCore",
srcs = glob(["Sources/Core/*.swift"]),
module_name = "Core",
swift_version = 3,
copts = ["-whole-module-optimization"]
)

swift_library(
name = "PlankLib",
srcs = glob(["Sources/plank/*.swift"]),
swift_version = 3,
copts = ["-whole-module-optimization"],
deps = [":PlankCore"]
)

macos_command_line_application(
name = "plank",
deps = [":PlankLib"]
)
11 changes: 0 additions & 11 deletions Sources/Core/StringExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@ import Foundation
}
#endif

extension NSObject {
// prefix with "pin_" since protocol extensions cannot override parent implementations
class func pin_className() -> String {
#if os(Linux)
return "NSObject"
#else
return NSObject.className()
#endif
}
}

prefix operator -->

prefix func --> (strs: [String]) -> String {
Expand Down
7 changes: 7 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
load('@bazel_tools//tools/build_defs/repo:git.bzl', system_git_repository='git_repository')

system_git_repository(
name = "build_bazel_rules_apple",
remote = "https://github.com/bazelbuild/rules_apple.git",
commit = "f336855ceed6201ad3a0fe7008641f161291cd76",
)

0 comments on commit f7dbdd5

Please sign in to comment.