Source:
public <A extends Arg> JavaTest createBuildRule( TargetGraph targetGraph, BuildRuleParams params, BuildRuleResolver resolver, A args) throws NoSuchBuildTargetException { SourcePathResolver pathResolver = new SourcePathResolver(resolver); BuildTarget abiJarTarget = BuildTarget.builder(params.getBuildTarget()) .addFlavors(CalculateAbi.FLAVOR) .build(); GroovycToJarStepFactory stepFactory = new GroovycToJarStepFactory( groovyBuckConfig.getGroovyCompiler().get(), args.extraGroovycArguments, JavacOptionsFactory.create( defaultJavacOptions, params, resolver, pathResolver, args )); JavaTest test = resolver.addToIndex( new JavaTest( params.appendExtraDeps( Iterables.concat( BuildRules.getExportedRules( Iterables.concat( params.getDeclaredDeps().get(), resolver.getAllRules(args.providedDeps.get()))), pathResolver.filterBuildRuleInputs( defaultJavacOptions.getInputs(pathResolver)))), pathResolver, args.srcs.get(), ResourceValidator.validateResources( pathResolver, params.getProjectFilesystem(), args.resources.get()), defaultJavacOptions.getGeneratedSourceFolderName(), args.labels.get(), args.contacts.get(), Optional.<SourcePath>absent(), new BuildTargetSourcePath(abiJarTarget), ImmutableSet.<Path>of(), args.testType.or(TestType.JUNIT), stepFactory, args.vmArgs.get(), ImmutableMap.<String, String>of(), validateAndGetSourcesUnderTest( args.sourceUnderTest.get(), params.getBuildTarget(), resolver), Optional.<Path>absent(), Optional.<String>absent(), args.testRuleTimeoutMs.or(defaultTestRuleTimeoutMs), args.getRunTestSeparately(), args.stdOutLogLevel, args.stdErrLogLevel, testTempDirOverride)); resolver.addToIndex( CalculateAbi.of( abiJarTarget, pathResolver, params, new BuildTargetSourcePath(test.getBuildTarget()))); return test; }

Target:
public <A extends Arg> JavaTest createBuildRule( TargetGraph targetGraph, BuildRuleParams params, BuildRuleResolver resolver, A args) throws NoSuchBuildTargetException { SourcePathResolver pathResolver = new SourcePathResolver(resolver); BuildTarget abiJarTarget = BuildTarget.builder(params.getBuildTarget()) .addFlavors(CalculateAbi.FLAVOR) .build(); GroovycToJarStepFactory stepFactory = new GroovycToJarStepFactory( groovyBuckConfig.getGroovyCompiler().get(), args.extraGroovycArguments, JavacOptionsFactory.create( defaultJavacOptions, params, resolver, pathResolver, args )); JavaTest test = resolver.addToIndex( new JavaTest( params.appendExtraDeps( Iterables.concat( BuildRules.getExportedRules( Iterables.concat( params.getDeclaredDeps().get(), resolver.getAllRules(args.providedDeps.get()))), pathResolver.filterBuildRuleInputs( defaultJavacOptions.getInputs(pathResolver)))), pathResolver, args.srcs.get(), ResourceValidator.validateResources( pathResolver, params.getProjectFilesystem(), args.resources.get()), defaultJavacOptions.getGeneratedSourceFolderName(), args.labels.get(), args.contacts.get(), Optional.<SourcePath>absent(), new BuildTargetSourcePath(abiJarTarget), ImmutableSet.<Path>of(), args.testType.or(TestType.JUNIT), stepFactory, args.vmArgs.get(), ImmutableMap.<String, String>of(), ImmutableSet.<BuildRule>of(), Optional.<Path>absent(), Optional.<String>absent(), args.testRuleTimeoutMs.or(defaultTestRuleTimeoutMs), args.getRunTestSeparately(), args.stdOutLogLevel, args.stdErrLogLevel, testTempDirOverride)); resolver.addToIndex( CalculateAbi.of( abiJarTarget, pathResolver, params, new BuildTargetSourcePath(test.getBuildTarget()))); return test; }