@Override
 protected void amendBuilder(ShTestRule.Builder builder, BuildRuleFactoryParams params)
     throws NoSuchBuildTargetException {
   // test
   String test = params.getRequiredStringAttribute("test");
   String testPath = params.resolveFilePathRelativeToBuildFileDirectory(test);
   builder.setTest(testPath);
 }
Esempio n. 2
0
 private static TargetNode<?> createTargetNode(
     BuildTarget buildTarget, ImmutableSet<Path> inputs) {
   Description<FakeDescription.FakeArg> description = new FakeDescription();
   FakeDescription.FakeArg arg = description.createUnpopulatedConstructorArg();
   arg.inputs = inputs;
   BuildRuleFactoryParams params =
       NonCheckingBuildRuleFactoryParams.createNonCheckingBuildRuleFactoryParams(buildTarget);
   try {
     return new TargetNode<>(
         Hashing.sha1().hashString(params.target.getFullyQualifiedName(), UTF_8),
         description,
         arg,
         new DefaultTypeCoercerFactory(),
         params,
         ImmutableSet.<BuildTarget>of(),
         ImmutableSet.<BuildTargetPattern>of(),
         createCellRoots(params.getProjectFilesystem()));
   } catch (NoSuchBuildTargetException | TargetNode.InvalidSourcePathInputException e) {
     throw new RuntimeException(e);
   }
 }