aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/runfiles/java/com/google/devtools/build/runfiles/RunfilesTest.java
Commit message (Collapse)AuthorAge
* Java, runfiles: move runfiles library sourcesGravatar laszlocsomor2018-08-10
| | | | | | | | | | | | Move the Java runfiles library's sources from //src/tools/runfiles/j/c/g/devtools/build/runfiles:* to //tools/java/runfiles. Fixes https://github.com/bazelbuild/bazel/issues/5803 RELNOTES[NEW]: Java, runfiles: the Java runfiles library is now in @bazel_tools//tools/java/runfiles. The old target (@bazel_tools//tools/runfiles:java-runfiles) is deprecated and will be removed in Bazel 0.18.0. PiperOrigin-RevId: 208191521
* java,runfiles: merge classesGravatar Laszlo Csomor2018-04-25
| | | | | | | | | | | | | | | | | | | | | | This commit prepares simplifying the Java runfiles library, which itself prepares mergint the manifest-based and directory-based logic so that the Runfiles class could handle both at the same time. This commit only moves classes around: - moves the ManifestBased and DirectoryBased classes into Runfiles, as nested classes - adds a createManifestBasedForTesting and createDirectoryBasedForTesting method to create the classes for testing - moves the ManifestBasedTest and DirectoryBasedTest into RunfilesTest Otherwise this commit has no functional change. Change-Id: I56b582c1a95793b0a871748697673b53a780f0fb PiperOrigin-RevId: 194227675
* runfiles: rlocation() checks if arg is normalizedGravatar Laszlo Csomor2018-04-24
| | | | | | | | | | | | | | | | | | | rlocation() now validates that the path argument is normalized, i.e. contains none of: - current directory references (".") - uplevel references ("..") - double slash ("//") This helps avoiding a bug similar to https://github.com/bazelbuild/bazel/pull/5083. See https://github.com/bazelbuild/bazel/pull/4460 Change-Id: Ia73fa2df1eae86fc7084162c24e144129672742d Closes #5085. Change-Id: Ia73fa2df1eae86fc7084162c24e144129672742d PiperOrigin-RevId: 194074072
* Java,runfiles: add Runfiles.getEnvVars()Gravatar Laszlo Csomor2018-04-16
| | | | | | | | | | | | | | | | The new method lets Java programs export the RUNFILES_* environment variables for subprocesses, in case those subprocesses are other Bazel-built binaries that also need runfiles. See https://github.com/bazelbuild/bazel/issues/4460 Change-Id: I05c0b84db357128bc15f21a167a0d92e8d17599c Closes #5016. Change-Id: I66ca5c44067a7353b8de180a64f20c8352e3c9ec PiperOrigin-RevId: 193013289
* runfiles,py,java: rlocation accepts absolute pathGravatar Laszlo Csomor2018-03-09
| | | | | | | | | | | | | | | | | | | | | The rlocation functions in the Python and Java runfiles libraries (under @bazel_tools//tools/runfiles) now consistently return the argument itself if it is an absolute path. If the argument is a driveless absolute Windows path (e.g. "\\windows\\system32") then rlocation reports an error. See https://github.com/bazelbuild/bazel/issues/4460 Change-Id: I80474f7cc4736a571bf113438a916f71c36a344d Closes #4806. Change-Id: I80474f7cc4736a571bf113438a916f71c36a344d PiperOrigin-RevId: 188453982
* java,runfiles: fix bugs in runfiles libraryGravatar Laszlo Csomor2018-02-08
| | | | | | | | | | | | | | | | | | | | Bazel 0.11.0 releases a new Java runfiles library in @bazel_tools. This commit fixes some bugs in 0.11.0rc1: - The library no longer respects TEST_SRCDIR, so now it's possible to run Bazel inside of a test and build and run a mock java_binary, and that java_binary will *not* pick up the test's TEST_SRCDIR. - The library now allows calling rlocation for absolute paths, and just returns the path itself. This is in accordance with how our Bash rlocation() implementation works. Change-Id: I471247d7538a76ea8162d2192add3f9733f844a8 PiperOrigin-RevId: 184990272
* java,runfiles: add Java library to handle runfilesGravatar Laszlo Csomor2018-01-12
This is a prerequisite to port all tests to run on Windows. It is also part of the effort to provide platform-independent, language-specific runfiles-handling libraries. See: - https://github.com/bazelbuild/bazel/issues/4292 - https://github.com/bazelbuild/bazel/issues/3839 Change-Id: Ic64aadcf3f97885de3151da9f921d6351687dce9 PiperOrigin-RevId: 181727511