2021-01-01 21:49:51 +03:00
|
|
|
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
2020-02-25 16:09:28 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2021-09-07 16:41:43 +03:00
|
|
|
load("@os_info//:os_info.bzl", "is_darwin")
|
2020-02-25 16:09:28 +03:00
|
|
|
load(
|
|
|
|
"//bazel_tools:scala.bzl",
|
|
|
|
"da_scala_library",
|
2020-03-03 11:59:15 +03:00
|
|
|
"da_scala_test",
|
2020-02-25 16:09:28 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
da_scala_library(
|
|
|
|
name = "ports",
|
2021-09-07 16:41:43 +03:00
|
|
|
srcs = [
|
|
|
|
"src/main/scala/com/digitalasset/ports/Port.scala",
|
|
|
|
"src/main/scala/com/digitalasset/ports/PortFiles.scala",
|
|
|
|
"src/main/scala/com/digitalasset/ports/PortLock.scala",
|
|
|
|
],
|
2020-12-14 14:42:26 +03:00
|
|
|
scala_deps = [
|
|
|
|
"@maven//:org_scalaz_scalaz_core",
|
|
|
|
],
|
2020-04-01 12:41:18 +03:00
|
|
|
tags = ["maven_coordinates=com.daml:ports:__VERSION__"],
|
2020-02-25 16:09:28 +03:00
|
|
|
visibility = [
|
|
|
|
"//visibility:public",
|
|
|
|
],
|
|
|
|
)
|
2020-03-03 11:59:15 +03:00
|
|
|
|
2021-09-07 16:41:43 +03:00
|
|
|
da_scala_library(
|
|
|
|
name = "ports-testing",
|
|
|
|
srcs = [
|
|
|
|
"src/main/scala/com/digitalasset/ports/FreePort.scala",
|
|
|
|
"src/main/scala/com/digitalasset/ports/LockedFreePort.scala",
|
|
|
|
],
|
|
|
|
data = ["@sysctl_nix//:bin/sysctl"] if is_darwin else [],
|
|
|
|
visibility = [
|
|
|
|
"//visibility:public",
|
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
":ports",
|
|
|
|
"//bazel_tools/runfiles:scala_runfiles",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2020-03-03 11:59:15 +03:00
|
|
|
da_scala_test(
|
|
|
|
name = "ports-tests",
|
2020-03-31 20:13:02 +03:00
|
|
|
srcs = glob(["src/test/suite/scala/**/*.scala"]),
|
2020-12-14 14:42:26 +03:00
|
|
|
scala_deps = [
|
|
|
|
"@maven//:org_scalaz_scalaz_core",
|
|
|
|
],
|
2020-03-03 11:59:15 +03:00
|
|
|
deps = [
|
|
|
|
":ports",
|
2021-09-07 16:41:43 +03:00
|
|
|
":ports-testing",
|
2020-03-03 11:59:15 +03:00
|
|
|
],
|
|
|
|
)
|