Search in sources :

Example 1 with HttpDownloader

use of com.google.devtools.build.lib.bazel.repository.downloader.HttpDownloader in project bazel by bazelbuild.

the class SkylarkRepositoryContextTest method setUpContextForRule.

protected void setUpContextForRule(Map<String, Object> kwargs, Attribute... attributes) throws Exception {
    Package.Builder packageBuilder = Package.newExternalPackageBuilder(Package.Builder.DefaultHelper.INSTANCE, workspaceFile, "runfiles");
    FuncallExpression ast = new FuncallExpression(new Identifier("test"), ImmutableList.<Passed>of());
    ast.setLocation(Location.BUILTIN);
    Rule rule = packageBuilder.externalPackageData().createAndAddRepositoryRule(packageBuilder, buildRuleClass(attributes), null, kwargs, ast);
    HttpDownloader downloader = Mockito.mock(HttpDownloader.class);
    context = new SkylarkRepositoryContext(rule, outputDirectory, Mockito.mock(SkyFunction.Environment.class), ImmutableMap.of("FOO", "BAR"), downloader, new HashMap<String, String>());
}
Also used : Identifier(com.google.devtools.build.lib.syntax.Identifier) SkyFunction(com.google.devtools.build.skyframe.SkyFunction) HttpDownloader(com.google.devtools.build.lib.bazel.repository.downloader.HttpDownloader) HashMap(java.util.HashMap) Package(com.google.devtools.build.lib.packages.Package) Rule(com.google.devtools.build.lib.packages.Rule) FuncallExpression(com.google.devtools.build.lib.syntax.FuncallExpression)

Aggregations

HttpDownloader (com.google.devtools.build.lib.bazel.repository.downloader.HttpDownloader)1 Package (com.google.devtools.build.lib.packages.Package)1 Rule (com.google.devtools.build.lib.packages.Rule)1 FuncallExpression (com.google.devtools.build.lib.syntax.FuncallExpression)1 Identifier (com.google.devtools.build.lib.syntax.Identifier)1 SkyFunction (com.google.devtools.build.skyframe.SkyFunction)1 HashMap (java.util.HashMap)1