Skip to content
Permalink
Browse files

add bazel build defs

  • Loading branch information...
carl-mastrangelo committed Jul 1, 2019
1 parent b5ead0c commit d092e84d8d86bc55da7272353137c3705c7e3e24
Showing with 250 additions and 3 deletions.
  1. +29 −0 WORKSPACE
  2. +52 −0 api/BUILD.bazel
  3. +88 −0 impl/BUILD.bazel
  4. +5 −3 impl/src/main/java/io/perfmark/impl/Mark.java
  5. +33 −0 java6/BUILD.bazel
  6. +9 −0 java7/BUILD.bazel
  7. +34 −0 java9/BUILD.bazel
@@ -0,0 +1,29 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

RULES_JVM_EXTERNAL_TAG = "2.2"
RULES_JVM_EXTERNAL_SHA = "f1203ce04e232ab6fdd81897cf0ff76f2c04c0741424d192f28e65ae752ce2d6"

http_archive(
name = "rules_jvm_external",
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
sha256 = RULES_JVM_EXTERNAL_SHA,
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)

load("@rules_jvm_external//:defs.bzl", "maven_install")

maven_install(
artifacts = [
"junit:junit:4.12",
"com.google.errorprone:error_prone_annotations:2.3.3",
"com.google.code.findbugs:jsr305:3.0.2",
"com.google.code.gson:gson:2.8.5",
"com.google.truth:truth:0.46",
],
repositories = [
"https://maven.google.com",
"https://repo1.maven.org/maven2",
"https://jcenter.bintray.com/",
],
)

@@ -0,0 +1,52 @@
java_library(
name = "api",
visibility = ["//visibility:public"],
exports = [
":link",
":perfmark",
":tag",
],
)

java_library(
name = "perfmark",
srcs = glob(["src/main/java/io/perfmark/PerfMark.java"]),
deps = [
":impl",
":link",
":tag",
"@maven//:com_google_code_findbugs_jsr305",
"@maven//:com_google_errorprone_error_prone_annotations",
],
)

java_library(
name = "tag",
srcs = glob(["src/main/java/io/perfmark/Tag.java"]),
visibility = ["//:__subpackages__"],
deps = [
"@maven//:com_google_code_findbugs_jsr305",
],
)

java_library(
name = "link",
srcs = glob(["src/main/java/io/perfmark/Link.java"]),
visibility = ["//:__subpackages__"],
deps = [
"@maven//:com_google_code_findbugs_jsr305",
"@maven//:com_google_errorprone_error_prone_annotations",
],
)

java_library(
name = "impl",
srcs = glob(["src/main/java/io/perfmark/Impl.java"]),
visibility = ["//:__subpackages__"],
deps = [
":link",
":tag",
"@maven//:com_google_code_findbugs_jsr305",
"@maven//:com_google_errorprone_error_prone_annotations",
],
)
@@ -0,0 +1,88 @@
java_library(
name = "impl",
srcs = [
"src/main/java/io/perfmark/impl/NoopGenerator.java",
"src/main/java/io/perfmark/impl/SecretPerfMarkImpl.java",
],
deps = [
":generator",
":marker",
":storage",
"//api:impl",
"//api:link",
"//api:tag",
"@maven//:com_google_code_findbugs_jsr305",
],
)

java_library(
name = "generator",
srcs = ["src/main/java/io/perfmark/impl/Generator.java"],
deps = [
"@maven//:com_google_code_findbugs_jsr305",
],
visibility = ["//:__subpackages__"],
)

java_library(
name = "marker",
srcs = ["src/main/java/io/perfmark/impl/Marker.java"],
deps = [
"@maven//:com_google_code_findbugs_jsr305",
],
visibility = ["//:__subpackages__"],
)

java_library(
name = "storage",
srcs = [
"src/main/java/io/perfmark/impl/NoopMarkHolderProvider.java",
"src/main/java/io/perfmark/impl/Storage.java",
],
deps = [
":mark",
":mark-holder",
":mark-holder-provider",
":mark-list",
":marker",
"@maven//:com_google_code_findbugs_jsr305",
],
)

java_library(
name = "mark-holder",
srcs = ["src/main/java/io/perfmark/impl/MarkHolder.java"],
deps = [
":mark",
":marker",
],
visibility = ["//:__subpackages__"],
)

java_library(
name = "mark-holder-provider",
srcs = ["src/main/java/io/perfmark/impl/MarkHolderProvider.java"],
deps = [
":mark-holder",
],
visibility = ["//:__subpackages__"],
)

java_library(
name = "mark",
srcs = ["src/main/java/io/perfmark/impl/Mark.java"],
deps = [
":generator",
":marker",
"@maven//:com_google_code_findbugs_jsr305",
],
visibility = ["//:__subpackages__"],
)

java_library(
name = "mark-list",
srcs = ["src/main/java/io/perfmark/impl/MarkList.java"],
deps = [
":mark",
],
)
@@ -4,9 +4,11 @@
import javax.annotation.Nullable;

public final class Mark {
public static final String NO_TAG_NAME = SecretPerfMarkImpl.PerfMarkImpl.NO_TAG_NAME;
public static final long NO_TAG_ID = SecretPerfMarkImpl.PerfMarkImpl.NO_TAG_ID;
public static final long NO_LINK_ID = SecretPerfMarkImpl.PerfMarkImpl.NO_LINK_ID;
// TODO: make sure these match the values in Impl
static final String NO_TAG_NAME = "";
static final long NO_TAG_ID = Long.MIN_VALUE;
static final long NO_LINK_ID = Long.MIN_VALUE;

public static final long NO_NANOTIME = 0;

@Nullable private final String taskName;
@@ -0,0 +1,33 @@
java_library(
name = "generator",
srcs = [
"src/main/java/io/perfmark/java6/SecretVolatileGenerator.java",
],
deps = [
"//impl:generator",
],
)

java_library(
name = "mark-holder",
srcs = [
"src/main/java/io/perfmark/java6/SynchronizedMarkHolder.java",
],
deps = [
"//impl:mark",
"//impl:mark-holder",
"//impl:marker",
],
)

java_library(
name = "mark-holder-provider",
srcs = [
"src/main/java/io/perfmark/java6/SecretSynchronizedMarkHolderProvider.java",
],
deps = [
":mark-holder",
"//impl:mark-holder",
"//impl:mark-holder-provider",
],
)
@@ -0,0 +1,9 @@
java_library(
name = "generator",
srcs = [
"src/main/java/io/perfmark/java7/SecretMethodHandleGenerator.java",
],
deps = [
"//impl:generator",
],
)
@@ -0,0 +1,34 @@
java_library(
name = "generator",
srcs = [
"src/main/java/io/perfmark/java9/SecretVarHandleGenerator.java",
],
deps = [
"//impl:generator",
],
)

java_library(
name = "mark-holder",
srcs = [
"src/main/java/io/perfmark/java9/VarHandleMarkHolder.java",
],
deps = [
"//impl:generator",
"//impl:mark",
"//impl:mark-holder",
"//impl:marker",
],
)

java_library(
name = "mark-holder-provider",
srcs = [
"src/main/java/io/perfmark/java9/SecretVarHandleMarkHolderProvider.java",
],
deps = [
":mark-holder",
"//impl:mark-holder",
"//impl:mark-holder-provider",
],
)

0 comments on commit d092e84

Please sign in to comment.
You can’t perform that action at this time.