diff options
author | John Cater <jcater@google.com> | 2017-06-15 17:11:20 +0200 |
---|---|---|
committer | Yun Peng <pcloudy@google.com> | 2017-06-16 09:27:03 +0200 |
commit | 9cadd78bce65f9b2fbcc22c2db1be2fc83bcc797 (patch) | |
tree | 78fc2a797fd689642d302378578c27c285cee379 /src/main/java/com/google/devtools/build/lib/rules/repository | |
parent | 855b7c56a90d54a934b48900404ced14088ef5c2 (diff) |
Add more methods to ExternalPackageUtil to load all rules of a specific
rule class.
Change-Id: Iaa830658a62de661f16e100d24b2d1a3e66af638
PiperOrigin-RevId: 159104714
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/repository')
2 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java index 80e0cdfe75..1ab88232c0 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java @@ -116,7 +116,7 @@ public final class RepositoryDelegatorFunction implements SkyFunction { Rule rule; try { - rule = ExternalPackageUtil.getRule(repositoryName, null, env); + rule = ExternalPackageUtil.getRepository(repositoryName, null, env); } catch (ExternalPackageUtil.ExternalRuleNotFoundException e) { return RepositoryDirectoryValue.NO_SUCH_REPOSITORY_VALUE; } diff --git a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryFunction.java b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryFunction.java index 036cd7b056..16c29673ba 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryFunction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryFunction.java @@ -394,9 +394,10 @@ public abstract class RepositoryFunction { try { // Add a dependency to the repository rule. RepositoryDirectoryValue does add this - // dependency already but we want to catch RepositoryNotFoundException, so invoke #getRule + // dependency already but we want to catch RepositoryNotFoundException, so invoke + // #getRuleByName // first. - Rule rule = ExternalPackageUtil.getRule(repositoryName, env); + Rule rule = ExternalPackageUtil.getRuleByName(repositoryName, env); if (rule == null) { return; } @@ -421,7 +422,8 @@ public abstract class RepositoryFunction { } } catch (ExternalPackageUtil.ExternalRuleNotFoundException ex) { // The repository we are looking for does not exist so we should depend on the whole - // WORKSPACE file. In that case, the call to RepositoryFunction#getRule(String, Environment) + // WORKSPACE file. In that case, the call to RepositoryFunction#getRuleByName(String, + // Environment) // already requested all repository functions from the WORKSPACE file from Skyframe as part // of the resolution. Therefore we are safe to ignore that Exception. return; |