// Copyright 2018 The Bazel Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.devtools.build.lib.skylarkbuildapi.java; import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.events.Location; import com.google.devtools.build.lib.skylarkbuildapi.FileApi; import com.google.devtools.build.lib.skylarkbuildapi.ProviderApi; import com.google.devtools.build.lib.skylarkbuildapi.SkylarkActionFactoryApi; import com.google.devtools.build.lib.skylarkbuildapi.StructApi; import com.google.devtools.build.lib.skylarkinterface.Param; import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable; import com.google.devtools.build.lib.skylarkinterface.SkylarkConstructor; import com.google.devtools.build.lib.skylarkinterface.SkylarkModule; import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory; import com.google.devtools.build.lib.syntax.Environment; import com.google.devtools.build.lib.syntax.EvalException; import com.google.devtools.build.lib.syntax.SkylarkList; import com.google.devtools.build.lib.syntax.SkylarkNestedSet; /** * Info object encapsulating all information by java rules. */ @SkylarkModule( name = "JavaInfo", doc = "Encapsulates all information provided by Java rules.", category = SkylarkModuleCategory.PROVIDER) public interface JavaInfoApi extends StructApi { @SkylarkCallable( name = "transitive_runtime_jars", doc = "Depset of runtime jars required by this target", structField = true ) public SkylarkNestedSet getTransitiveRuntimeJars(); @SkylarkCallable( name = "transitive_compile_time_jars", doc = "Depset of compile time jars recusrively required by this target. See `compile_jars` " + "for more details.", structField = true ) public SkylarkNestedSet getTransitiveCompileTimeJars(); @SkylarkCallable( name = "compile_jars", doc = "Returns the compile time jars required by this target directly. They can be: ", structField = true ) public SkylarkNestedSet getCompileTimeJars(); @SkylarkCallable( name = "full_compile_jars", doc = "Returns the full compile time jars required by this target directly. They can be " + "Note: `compile_jars` can return a mix of ijars and normal full jars. In that case, " + "`full_compile_jars` returns the corresponding full jars of the ijars and the remaining" + "normal full jars in `compile_jars`.", structField = true ) public SkylarkNestedSet getFullCompileTimeJars(); @SkylarkCallable( name = "source_jars", doc = "Returns a list of jar files containing all the uncompiled source files (including " + "those generated by annotations) from the target itself, i.e. NOT including the sources of " + "the transitive dependencies", structField = true ) public SkylarkList getSourceJars(); @SkylarkCallable( name = "outputs", doc = "Returns information about outputs of this Java target.", structField = true, allowReturnNones = true ) public JavaRuleOutputJarsProviderApi getOutputJars(); @SkylarkCallable( name = "annotation_processing", structField = true, allowReturnNones = true, doc = "Returns information about annotation processing for this Java target." ) public JavaAnnotationProcessingApi getGenJarsProvider(); @SkylarkCallable( name = "compilation_info", structField = true, allowReturnNones = true, doc = "Returns compilation information for this Java target." ) public JavaCompilationInfoProviderApi getCompilationInfoProvider(); @SkylarkCallable( name = "runtime_output_jars", doc = "Returns the runtime output jars provided by this Java target.", structField = true) public SkylarkList getRuntimeOutputJars(); @SkylarkCallable( name = "transitive_deps", doc = "Returns the transitive set of Jars required to build the target.", structField = true ) public NestedSet getTransitiveDeps(); @SkylarkCallable( name = "transitive_runtime_deps", doc = "Returns the transitive set of Jars required on the target's runtime classpath.", structField = true ) public NestedSet getTransitiveRuntimeDeps(); @SkylarkCallable( name = "transitive_source_jars", doc = "Returns the Jars containing Java source files for the target " + "and all of its transitive dependencies.", structField = true ) public NestedSet getTransitiveSourceJars(); @SkylarkCallable( name = "transitive_exports", structField = true, doc = "Returns transitive set of labels that are being exported from this rule." ) public NestedSet