File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change 1313# limitations under the License.
1414"""Rules for supporting the Scala language."""
1515
16+ load ("@bazel_skylib//lib:paths.bzl" , "paths" )
1617load (
1718 "@io_bazel_rules_scala//scala/private:coverage_replacements_provider.bzl" ,
1819 _coverage_replacements_provider = "coverage_replacements_provider" ,
@@ -229,25 +230,12 @@ DiagnosticsFile: {diagnostics_output}
229230 diagnostics_file = diagnosticsfile ,
230231 )
231232
232- def _path_is_absolute (path ):
233- # Returns true for absolute path in Linux/Mac (i.e., '/') or Windows (i.e.,
234- # 'X:\' or 'X:/' where 'X' is a letter), false otherwise.
235- if len (path ) >= 1 and path [0 ] == "/" :
236- return True
237- if len (path ) >= 3 and \
238- path [0 ].isalpha () and \
239- path [1 ] == ":" and \
240- (path [2 ] == "/" or path [2 ] == "\\ " ):
241- return True
242-
243- return False
244-
245233def runfiles_root (ctx ):
246234 return "${TEST_SRCDIR}/%s" % ctx .workspace_name
247235
248236def java_bin (ctx ):
249237 java_path = str (ctx .attr ._java_runtime [java_common .JavaRuntimeInfo ].java_executable_runfiles_path )
250- if _path_is_absolute (java_path ):
238+ if paths . is_absolute (java_path ):
251239 javabin = java_path
252240 else :
253241 runfiles_root_var = runfiles_root (ctx )
You can’t perform that action at this time.
0 commit comments