Beispiel #1
0
        private static bool TryCreate(IDictionary env, out Runfiles runfiles)
        {
            if (IsManifestOnly(env))
            {
                // On Windows, the launcher sets RUNFILES_MANIFEST_ONLY=1.
                // On every platform, the launcher also sets RUNFILES_MANIFEST_FILE, but on Linux and macOS it's
                // faster to use RUNFILES_DIR.
                {
                    runfiles = new ManifestBased(GetManifestPath(env));
                    return(true);
                }
            }

            var value = env["RUNFILES_DIR"] as string;

            if (!string.IsNullOrEmpty(value))
            {
                // bazel, a launcher, or another process has told us where the runfiles are
                runfiles = new DirectoryBased(value);
                return(true);
            }

            runfiles = null;
            return(false);
        }
Beispiel #2
0
        public string Rlocation(Label label)
        {
            if (label.IsRelative)
            {
                return(PackagePath(label.Name));
            }
            var rpath = Rpath(label);

            return(Runfiles.Rlocation(rpath));
        }
Beispiel #3
0
 public LabelRunfiles(Runfiles runfiles, Label defaultPackage)
 {
     Runfiles       = runfiles;
     DefaultPackage = defaultPackage;
 }
Beispiel #4
0
 public string Rlocation(string path)
 {
     return(Runfiles.Rlocation(path));
 }
Beispiel #5
0
 public Dictionary <string, string> GetEnvVars() => Runfiles.GetEnvVars();