Source:
<code>public Javac.Invocation getJavacInvocation(ExecutionContext context) throws IOException, InterruptedException { if (invocation == null) { javacOptions.validateOptions(classpathChecker::validateClasspath); stdout = new CapturingPrintStream(); closeables.add(stdout); stderr = new CapturingPrintStream(); closeables.add(stderr); Verbosity verbosity = context.getVerbosity().isSilent() ? Verbosity.STANDARD_INFORMATION : context.getVerbosity(); ExecutionContext firstOrderContext = context.createSubContext(stdout, stderr, Optional.of(verbosity)); closeables.add(firstOrderContext); JavacExecutionContext javacExecutionContext = JavacExecutionContext.of( new JavacEventSinkToBuckEventBusBridge(firstOrderContext.getBuckEventBus()), stderr, firstOrderContext.getClassLoaderCache(), verbosity, firstOrderContext.getCellPathResolver(), firstOrderContext.getJavaPackageFinder(), filesystem, context.getProjectFilesystemFactory(), firstOrderContext.getEnvironment(), firstOrderContext.getProcessExecutor()); ImmutableList<JavacPluginJsr199Fields> pluginFields = ImmutableList.copyOf( javacOptions .getAnnotationProcessingParams() .getAnnotationProcessors(this.filesystem, resolver) .stream() .map(ResolvedJavacPluginProperties::getJavacPluginJsr199Fields) .collect(Collectors.toList())); <END> ImmutableSortedSet<Path> sourcePaths = ImmutableSortedSet.copyOf( PathHelper.flatmapDirectories(filesystem, compilerParameters.getSourceFilePaths()) .stream() .filter(input -> new PathOrGlobMatcher("**.java").matches(input)) .collect(Collectors.toSet())); if (!sourcePaths.isEmpty()) { invocation = getJavac() .newBuildInvocation( javacExecutionContext, resolver, invokingRule, getOptions(context, compilerParameters.getClasspathEntries()), pluginFields, sourcePaths, compilerParameters.getPathToSourcesList(), compilerParameters.getWorkingDirectory(), compilerParameters.shouldTrackClassUsage(), abiJarParameters, libraryJarParameters, compilerParameters.getAbiGenerationMode(), compilerParameters.getAbiCompatibilityMode(), compilerParameters.getSourceOnlyAbiRuleInfo()); closeables.add(invocation); } } return invocation; }</code><technical_language>This is another reason do rules steps -- need special case this a java_library rule empty sources right thing</technical_language>

Target:
public Javac.Invocation getJavacInvocation(ExecutionContext context) throws IOException { if (invocation == null) { javacOptions.validateOptions(classpathChecker::validateClasspath); stdout = new CapturingPrintStream(); closeables.add(stdout); stderr = new CapturingPrintStream(); closeables.add(stderr); Verbosity verbosity = context.getVerbosity().isSilent() ? Verbosity.STANDARD_INFORMATION : context.getVerbosity(); ExecutionContext firstOrderContext = context.createSubContext(stdout, stderr, Optional.of(verbosity)); closeables.add(firstOrderContext); JavacExecutionContext javacExecutionContext = JavacExecutionContext.of( new JavacEventSinkToBuckEventBusBridge(firstOrderContext.getBuckEventBus()), stderr, firstOrderContext.getClassLoaderCache(), verbosity, firstOrderContext.getCellPathResolver(), firstOrderContext.getJavaPackageFinder(), filesystem, context.getProjectFilesystemFactory(), firstOrderContext.getEnvironment(), firstOrderContext.getProcessExecutor()); ImmutableList<JavacPluginJsr199Fields> pluginFields = ImmutableList.copyOf( javacOptions .getAnnotationProcessingParams() .getAnnotationProcessors(this.filesystem, resolver) .stream() .map(ResolvedJavacPluginProperties::getJavacPluginJsr199Fields) .collect(Collectors.toList())); invocation = getJavac() .newBuildInvocation( javacExecutionContext, resolver, invokingRule, getOptions(context, compilerParameters.getClasspathEntries()), pluginFields, compilerParameters.getSourceFilePaths(), compilerParameters.getPathToSourcesList(), compilerParameters.getWorkingDirectory(), compilerParameters.shouldTrackClassUsage(), abiJarParameters, libraryJarParameters, compilerParameters.getAbiGenerationMode(), compilerParameters.getAbiCompatibilityMode(), compilerParameters.getSourceOnlyAbiRuleInfo()); closeables.add(invocation); } return invocation; }