diff options
author | Ulf Adams <ulfjack@google.com> | 2015-08-24 07:41:45 +0000 |
---|---|---|
committer | Han-Wen Nienhuys <hanwen@google.com> | 2015-08-24 14:02:37 +0000 |
commit | 52bcf5a5f03eba1e990006df589f351acbcd8692 (patch) | |
tree | b2cf84c58bd3c8d0f472d0e5e57b14be971cf0f0 /tools | |
parent | 4217a8edf7911447013e061d0f29cb6303badf41 (diff) |
Change the skylark Java rules to use the configuration path separator.
The build-in rules also use it.
--
MOS_MIGRATED_REVID=101343109
Diffstat (limited to 'tools')
-rw-r--r-- | tools/build_rules/java_rules_skylark.bzl | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tools/build_rules/java_rules_skylark.bzl b/tools/build_rules/java_rules_skylark.bzl index 21b344d72b..47a62cf7d2 100644 --- a/tools/build_rules/java_rules_skylark.bzl +++ b/tools/build_rules/java_rules_skylark.bzl @@ -16,15 +16,6 @@ java_filetype = FileType([".java"]) jar_filetype = FileType([".jar"]) srcjar_filetype = FileType([".jar", ".srcjar"]) -def is_windows(fragments): - return fragments.cpp.compiler.startswith("windows_") - -def path_separator(ctx): - if is_windows(ctx.fragments): - return ";" - else: - return ":" - # This is a quick and dirty rule to make Bazel compile itself. It's not # production ready. @@ -70,7 +61,7 @@ def java_library_impl(ctx): cmd += ctx.file._javac.path cmd += " " + " ".join(javac_options) if compile_time_jars: - cmd += " -classpath '" + cmd_helper.join_paths(path_separator(ctx), compile_time_jars) + "'" + cmd += " -classpath '" + cmd_helper.join_paths(ctx.configuration.host_path_separator, compile_time_jars) + "'" cmd += " -d " + build_output + files + "\n" # We haven't got a good story for where these should end up, so @@ -207,7 +198,9 @@ java_library = rule( attrs = java_library_attrs, outputs = { "class_jar": "lib%{name}.jar", - }) + }, + fragments = ['java'], +) # A copy to avoid conflict with native rule. bootstrap_java_library = rule( @@ -215,7 +208,9 @@ bootstrap_java_library = rule( attrs = java_library_attrs, outputs = { "class_jar": "lib%{name}.jar", - }) + }, + fragments = ['java'], +) java_binary_attrs_common = java_library_attrs + { "jvm_flags": attr.string_list(), @@ -235,13 +230,17 @@ java_binary_outputs = { java_binary = rule(java_binary_impl, executable = True, attrs = java_binary_attrs, - outputs = java_binary_outputs) + outputs = java_binary_outputs, + fragments = ['java'], +) # A copy to avoid conflict with native rule bootstrap_java_binary = rule(java_binary_impl, executable = True, attrs = java_binary_attrs, - outputs = java_binary_outputs) + outputs = java_binary_outputs, + fragments = ['java'], +) java_test = rule(java_binary_impl, executable = True, @@ -253,6 +252,7 @@ java_test = rule(java_binary_impl, }, outputs = java_binary_outputs, test = True, + fragments = ['java'], ) java_import = rule( |