private JavaCompilationHelper initAttributes( JavaTargetAttributes.Builder attributes, JavaSemantics semantics) { JavaCompilationHelper helper = new JavaCompilationHelper(ruleContext, semantics, javaCommon.getJavacOpts(), attributes); helper.addLibrariesToAttributes(javaCommon.targetsTreatedAsDeps(ClasspathType.COMPILE_ONLY)); helper.addProvidersToAttributes( JavaCommon.compilationArgsFromSources(ruleContext), asNeverLink); attributes.setStrictJavaDeps(getStrictAndroidDeps()); attributes.setRuleKind(ruleContext.getRule().getRuleClass()); attributes.setTargetLabel(ruleContext.getLabel()); JavaCommon.validateConstraint( ruleContext, "android", javaCommon.targetsTreatedAsDeps(ClasspathType.BOTH)); ruleContext.checkSrcsSamePackage(true); return helper; }
JackCompilationHelper initJack(JavaTargetAttributes attributes) throws InterruptedException { AndroidSdkProvider sdk = AndroidSdkProvider.fromRuleContext(ruleContext); return new JackCompilationHelper.Builder() // blaze infrastructure .setRuleContext(ruleContext) // configuration .setOutputArtifact( ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_LIBRARY_JACK_FILE)) // tools .setJackBinary(sdk.getJack()) .setJillBinary(sdk.getJill()) .setResourceExtractorBinary(sdk.getResourceExtractor()) .setJackBaseClasspath(sdk.getAndroidBaseClasspathForJack()) // sources .addJavaSources(attributes.getSourceFiles()) .addSourceJars(attributes.getSourceJars()) .addResources(attributes.getResources()) .addProcessorNames(attributes.getProcessorNames()) .addProcessorClasspathJars(attributes.getProcessorPath()) .addExports(JavaCommon.getExports(ruleContext)) .addClasspathDeps(javaCommon.targetsTreatedAsDeps(ClasspathType.COMPILE_ONLY)) .addRuntimeDeps(javaCommon.targetsTreatedAsDeps(ClasspathType.RUNTIME_ONLY)) .build(); }
public CcLinkParamsStore getCcLinkParamsStore() { return getCcLinkParamsStore(javaCommon.targetsTreatedAsDeps(ClasspathType.BOTH)); }