diff options
author | Rohan Jain <rohanj@google.com> | 2018-07-06 11:14:53 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-07-06 11:17:47 -0700 |
commit | ed494f17fcd5ad6613ad5ac6025f537357a59bc5 (patch) | |
tree | 94315c3cfd96feacf0aaa3a1759b7fec181d0308 /tensorflow/java | |
parent | 8f5e2a740e169c035e45c4fcffb5bc80b5dab891 (diff) |
Rolling back tensorflow .bzl file changes
END_PUBLIC
BEGIN_PUBLIC
Automated g4 rollback of changelist 203459720
PiperOrigin-RevId: 203501636
Diffstat (limited to 'tensorflow/java')
-rw-r--r-- | tensorflow/java/build_defs.bzl | 2 | ||||
-rw-r--r-- | tensorflow/java/src/gen/gen_ops.bzl | 80 |
2 files changed, 40 insertions, 42 deletions
diff --git a/tensorflow/java/build_defs.bzl b/tensorflow/java/build_defs.bzl index f423cc4d82..e1916ca4d9 100644 --- a/tensorflow/java/build_defs.bzl +++ b/tensorflow/java/build_defs.bzl @@ -18,7 +18,7 @@ XLINT_OPTS = [ "-Xlint:-processing", "-Xlint:-serial", "-Xlint:-try", - "-Xlint:-classfile", # see b/32750402, go/javac-warnings#classfile + "-Xlint:-classfile", # see b/32750402, go/javac-warnings#classfile ] # The bazel errorprone plugin currently only enables default errorChecks diff --git a/tensorflow/java/src/gen/gen_ops.bzl b/tensorflow/java/src/gen/gen_ops.bzl index b46721a93d..f4ff34ea03 100644 --- a/tensorflow/java/src/gen/gen_ops.bzl +++ b/tensorflow/java/src/gen/gen_ops.bzl @@ -17,48 +17,46 @@ load( # and then archive those source files into # ops/gen_sources.srcjar # -def tf_java_op_gen_srcjar( - name, - gen_tool, - base_package, - api_def_srcs = [], - out_dir = "ops/", - out_src_dir = "src/main/java/", - visibility = ["//tensorflow/java:__pkg__"]): - gen_cmds = ["rm -rf $(@D)"] # Always start from fresh when generating source files - srcs = api_def_srcs[:] +def tf_java_op_gen_srcjar(name, + gen_tool, + base_package, + api_def_srcs=[], + out_dir="ops/", + out_src_dir="src/main/java/", + visibility=["//tensorflow/java:__pkg__"]): - if not api_def_srcs: - api_def_args_str = "," - else: - api_def_args = [] - for api_def_src in api_def_srcs: - # Add directory of the first ApiDef source to args. - # We are assuming all ApiDefs in a single api_def_src are in the - # same directory. - api_def_args.append( - "$$(dirname $$(echo $(locations " + api_def_src + - ") | cut -d\" \" -f1))", - ) - api_def_args_str = ",".join(api_def_args) + gen_cmds = ["rm -rf $(@D)"] # Always start from fresh when generating source files + srcs = api_def_srcs[:] - gen_cmds += ["$(location " + gen_tool + ")" + - " --output_dir=$(@D)/" + out_src_dir + - " --base_package=" + base_package + - " --api_dirs=" + api_def_args_str] + if not api_def_srcs: + api_def_args_str = "," + else: + api_def_args = [] + for api_def_src in api_def_srcs: + # Add directory of the first ApiDef source to args. + # We are assuming all ApiDefs in a single api_def_src are in the + # same directory. + api_def_args.append( + "$$(dirname $$(echo $(locations " + api_def_src + + ") | cut -d\" \" -f1))") + api_def_args_str = ",".join(api_def_args) - # Generate a source archive containing generated code for these ops. - gen_srcjar = out_dir + name + ".srcjar" - gen_cmds += ["$(location @local_jdk//:jar) cMf $(location :" + gen_srcjar + ") -C $(@D) src"] + gen_cmds += ["$(location " + gen_tool + ")" + + " --output_dir=$(@D)/" + out_src_dir + + " --base_package=" + base_package + + " --api_dirs=" + api_def_args_str] - native.genrule( - name = name, - srcs = srcs, - outs = [gen_srcjar], - tools = [ - "@local_jdk//:jar", - "@local_jdk//:jdk", - gen_tool, - ] + tf_binary_additional_srcs(), - cmd = " && ".join(gen_cmds), - ) + # Generate a source archive containing generated code for these ops. + gen_srcjar = out_dir + name + ".srcjar" + gen_cmds += ["$(location @local_jdk//:jar) cMf $(location :" + gen_srcjar + ") -C $(@D) src"] + + native.genrule( + name=name, + srcs=srcs, + outs=[gen_srcjar], + tools=[ + "@local_jdk//:jar", + "@local_jdk//:jdk", + gen_tool + ] + tf_binary_additional_srcs(), + cmd=" && ".join(gen_cmds)) |