From a97e17f4a5b6662b96ab4e14b804ac75d6f76ad4 Mon Sep 17 00:00:00 2001 From: John Field Date: Fri, 13 Nov 2015 02:19:52 +0000 Subject: Use Labels, rather than PathFragments, to represent Skylark loads internally. The load location for a Skylark Aspect is specified via a PathFragment, for consistency with current non-Aspect Skylark loads. This should be a semantics-preserving change for users. In a subsequent CL, I'll change the Skylark syntax to allow load statements to use labels as well as paths, with the goal of eventually deprecating the latter. Also: - Removed the hack for handling relative loads in the prelude file. - Refactored some redundant functionality in PackageFunction and SkylarkImportLookupFunction for handling loads. - Removed the ability to put the BUILD file for the package containing a Skylark file under a different package root than the Skylark file itself. This functionality isn't currently used and is inconsistent with Blaze's handling of the package path elsewhere. - Added BUILD files to a number of tests that load Skylark files; this is consistent with the requirement that all Skylark files need to be part of some package. - Changed the constants used to set the location of the prelude file from paths to labels. -- MOS_MIGRATED_REVID=107741568 --- .../com/google/devtools/build/lib/packages/RuleClassProvider.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/packages/RuleClassProvider.java') diff --git a/src/main/java/com/google/devtools/build/lib/packages/RuleClassProvider.java b/src/main/java/com/google/devtools/build/lib/packages/RuleClassProvider.java index db69c2494f..55aa950d2d 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/RuleClassProvider.java +++ b/src/main/java/com/google/devtools/build/lib/packages/RuleClassProvider.java @@ -14,6 +14,7 @@ package com.google.devtools.build.lib.packages; +import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.events.EventHandler; import com.google.devtools.build.lib.packages.NativeAspectClass.NativeAspectFactory; import com.google.devtools.build.lib.syntax.Environment; @@ -31,9 +32,9 @@ import javax.annotation.Nullable; public interface RuleClassProvider { /** - * Workspace relative path to the prelude file. + * Label referencing the prelude file. */ - PathFragment getPreludePath(); + Label getPreludeLabel(); /** * The default runfiles prefix (may be overwritten by the WORKSPACE file). -- cgit v1.2.3