diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules')
23 files changed, 102 insertions, 69 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleConfiguredTargetBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleConfiguredTargetBuilder.java index 3b1a24c41e..f2bb02c8dc 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleConfiguredTargetBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleConfiguredTargetBuilder.java @@ -52,8 +52,8 @@ public final class SkylarkRuleConfiguredTargetBuilder { /** * Create a Rule Configured Target from the ruleContext and the ruleImplementation. */ - public static ConfiguredTarget buildRule(RuleContext ruleContext, - BaseFunction ruleImplementation) { + public static ConfiguredTarget buildRule(RuleContext ruleContext, BaseFunction ruleImplementation) + throws InterruptedException { String expectFailure = ruleContext.attributes().get("expect_failure", Type.STRING); try (Mutability mutability = Mutability.create("configured target")) { SkylarkRuleContext skylarkRuleContext = new SkylarkRuleContext(ruleContext); @@ -81,9 +81,6 @@ public final class SkylarkRuleConfiguredTargetBuilder { ConfiguredTarget configuredTarget = createTarget(ruleContext, target); checkOrphanArtifacts(ruleContext); return configuredTarget; - } catch (InterruptedException e) { - ruleContext.ruleError(e.getMessage()); - return null; } catch (EvalException e) { addRuleToStackTrace(e, ruleContext.getRule(), ruleImplementation); // If the error was expected, return an empty target. diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java index 13a653398c..5c13375587 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java +++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java @@ -120,8 +120,9 @@ public final class SkylarkRuleContext { /** * Creates a new SkylarkRuleContext using ruleContext. + * @throws InterruptedException */ - public SkylarkRuleContext(RuleContext ruleContext) throws EvalException { + public SkylarkRuleContext(RuleContext ruleContext) throws EvalException, InterruptedException { this.ruleContext = Preconditions.checkNotNull(ruleContext); fragments = new FragmentCollection(ruleContext, ConfigurationTransition.NONE); hostFragments = new FragmentCollection(ruleContext, ConfigurationTransition.HOST); diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java index e65f28ff73..dc47023355 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java @@ -78,7 +78,7 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { protected abstract AndroidSemantics createAndroidSemantics(); @Override - public ConfiguredTarget create(RuleContext ruleContext) { + public ConfiguredTarget create(RuleContext ruleContext) throws InterruptedException { JavaSemantics javaSemantics = createJavaSemantics(); AndroidSemantics androidSemantics = createAndroidSemantics(); if (!AndroidSdkProvider.verifyPresence(ruleContext)) { @@ -118,7 +118,7 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { AndroidCommon androidCommon, JavaSemantics javaSemantics, AndroidSemantics androidSemantics, - List<String> depsAttributes) { + List<String> depsAttributes) throws InterruptedException { // TODO(bazel-team): Find a way to simplify this code. // treeKeys() means that the resulting map sorts the entries by key, which is necessary to // ensure determinism. @@ -297,7 +297,7 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { ResourceApk splitResourceApk, JavaTargetAttributes resourceClasses, ImmutableList<Artifact> apksUnderTest, - Artifact proguardMapping) { + Artifact proguardMapping) throws InterruptedException { ImmutableList<Artifact> proguardSpecs = getTransitiveProguardSpecs( @@ -712,7 +712,7 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { Artifact deployJarArtifact, NestedSetBuilder<Artifact> filesBuilder, ImmutableList<Artifact> proguardSpecs, - Artifact proguardMapping) { + Artifact proguardMapping) throws InterruptedException { Artifact proguardOutputJar = ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_BINARY_PROGUARD_JAR); @@ -731,8 +731,8 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { proguardSpecs, proguardMapping, sdk.getAndroidJar(), proguardOutputJar, filesBuilder); } - private static ProguardOutput createEmptyProguardAction( - RuleContext ruleContext, Artifact proguardOutputJar, Artifact deployJarArtifact) { + private static ProguardOutput createEmptyProguardAction(RuleContext ruleContext, + Artifact proguardOutputJar, Artifact deployJarArtifact) throws InterruptedException { ImmutableList.Builder<Artifact> failures = ImmutableList.<Artifact>builder().add(proguardOutputJar); if (ruleContext.attributes().get("proguard_generate_mapping", Type.BOOLEAN)) { @@ -751,7 +751,7 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { FilesToRunProvider proguard, Artifact jar, ImmutableList<Artifact> proguardSpecs, Artifact proguardMapping, Artifact androidJar, Artifact proguardOutputJar, - NestedSetBuilder<Artifact> filesBuilder) { + NestedSetBuilder<Artifact> filesBuilder) throws InterruptedException { Iterable<Artifact> libraryJars = NestedSetBuilder.<Artifact>naiveLinkOrder() .add(androidJar) .addTransitive(common.getTransitiveNeverLinkLibraries()) @@ -837,7 +837,7 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { /** Dexes the ProguardedJar to generate ClassesDex that has a reference classes.dex. */ static DexingOutput dex(RuleContext ruleContext, MultidexMode multidexMode, List<String> dexopts, Artifact deployJar, Artifact proguardedJar, AndroidCommon common, - JavaTargetAttributes attributes) { + JavaTargetAttributes attributes) throws InterruptedException { String classesDexFileName = getMultidexMode(ruleContext).getOutputDexFilename(); Artifact classesDex = AndroidBinary.getDxArtifact(ruleContext, classesDexFileName); if (!AndroidBinary.supportsMultidexMode(ruleContext, multidexMode)) { diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java index f90d2ad160..b65014dd5b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java @@ -241,7 +241,7 @@ public class AndroidCommon { JavaCompilationArtifacts.Builder artifactsBuilder, JavaTargetAttributes.Builder attributes, NestedSet<ResourceContainer> resourceContainers, - ResourceContainer updatedResources) { + ResourceContainer updatedResources) throws InterruptedException { Artifact binaryResourcesJar = ruleContext.getImplicitOutputArtifact(JavaSemantics.JAVA_BINARY_CLASS_JAR); compileResourceJar(javaSemantics, binaryResourcesJar, updatedResources.getJavaSourceJar()); @@ -335,7 +335,7 @@ public class AndroidCommon { JavaSemantics javaSemantics, AndroidSemantics androidSemantics, ResourceApk resourceApk, AndroidIdlProvider transitiveIdlImportData, boolean addCoverageSupport, boolean collectJavaCompilationArgs, - SafeImplicitOutputsFunction genClassJarImplicitOutput) { + SafeImplicitOutputsFunction genClassJarImplicitOutput) throws InterruptedException { ImmutableList<Artifact> extraSources = resourceApk.isLegacy() || resourceApk.getResourceJavaSrcJar() == null ? ImmutableList.<Artifact>of() @@ -427,7 +427,8 @@ public class AndroidCommon { return (strict != DEFAULT && strict != STRICT) ? strict : ERROR; } - JackCompilationHelper initJack(JavaTargetAttributes attributes, JavaSemantics javaSemantics) { + JackCompilationHelper initJack(JavaTargetAttributes attributes, JavaSemantics javaSemantics) + throws InterruptedException { Map<PathFragment, Artifact> resourcesMap = new LinkedHashMap<>(); for (Artifact resource : attributes.getResources()) { resourcesMap.put(javaSemantics.getJavaResourcePath(resource.getRootRelativePath()), resource); @@ -459,7 +460,7 @@ public class AndroidCommon { JavaCompilationArtifacts.Builder javaArtifactsBuilder, boolean collectJavaCompilationArgs, @Nullable Artifact additionalSourceJar, - SafeImplicitOutputsFunction genClassJarImplicitOutput) { + SafeImplicitOutputsFunction genClassJarImplicitOutput) throws InterruptedException { NestedSetBuilder<Artifact> filesBuilder = NestedSetBuilder.<Artifact>stableOrder(); if (additionalSourceJar != null) { filesBuilder.add(additionalSourceJar); diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLibrary.java index 2bacf57588..f6d113e7d3 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLibrary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLibrary.java @@ -57,7 +57,7 @@ public abstract class AndroidLibrary implements RuleConfiguredTargetFactory { protected abstract AndroidSemantics createAndroidSemantics(); @Override - public ConfiguredTarget create(RuleContext ruleContext) { + public ConfiguredTarget create(RuleContext ruleContext) throws InterruptedException { JavaSemantics javaSemantics = createJavaSemantics(); AndroidSemantics androidSemantics = createAndroidSemantics(); if (!AndroidSdkProvider.verifyPresence(ruleContext)) { @@ -261,8 +261,10 @@ public abstract class AndroidLibrary implements RuleConfiguredTargetFactory { } } - private static Artifact mergeJarsFromSrcs(RuleContext ruleContext, Artifact inputJar) { - ImmutableList<Artifact> jarSources = ruleContext + private static Artifact mergeJarsFromSrcs(RuleContext ruleContext, Artifact inputJar) + throws InterruptedException { + ImmutableList<Artifact> jarSources = + ruleContext .getPrerequisiteArtifacts("srcs", Mode.TARGET).filter(JavaSemantics.JAR).list(); if (jarSources.isEmpty()) { return inputJar; diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceContainerBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceContainerBuilder.java index 338e424703..89a5496d15 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceContainerBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceContainerBuilder.java @@ -53,8 +53,10 @@ public final class AndroidResourceContainerBuilder { return this; } - /** Creates a {@link ResourceContainer} from a {@link RuleContext}. */ - public ResourceContainer buildFromRule(RuleContext ruleContext, Artifact apk) { + /** Creates a {@link ResourceContainer} from a {@link RuleContext}. + * @throws InterruptedException */ + public ResourceContainer buildFromRule(RuleContext ruleContext, Artifact apk) + throws InterruptedException { Preconditions.checkNotNull(this.manifest); Preconditions.checkNotNull(this.data); return new AndroidResourcesProvider.ResourceContainer( diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSemantics.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSemantics.java index 343b6f11a9..f86fd57b14 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSemantics.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSemantics.java @@ -32,16 +32,18 @@ import com.google.devtools.build.lib.rules.java.JavaTargetAttributes; public interface AndroidSemantics { /** * Adds transitive info providers for {@code android_binary} and {@code android_library} rules. + * @throws InterruptedException */ void addTransitiveInfoProviders(RuleConfiguredTargetBuilder builder, RuleContext ruleContext, JavaCommon javaCommon, AndroidCommon androidCommon, Artifact jarWithAllClasses, ResourceApk resourceApk, Artifact zipAlignedApk, - Iterable<Artifact> apksUnderTest); + Iterable<Artifact> apksUnderTest) throws InterruptedException; /** * Returns the manifest to be used when compiling a given rule. + * @throws InterruptedException */ - ApplicationManifest getManifestForRule(RuleContext ruleContext); + ApplicationManifest getManifestForRule(RuleContext ruleContext) throws InterruptedException; /** * Returns the name of the file in which the file names of native dependencies are listed. @@ -71,8 +73,9 @@ public interface AndroidSemantics { /** * Add coverage instrumentation to the Java compilation of an Android binary. + * @throws InterruptedException */ void addCoverageSupport(RuleContext ruleContext, AndroidCommon common, - JavaSemantics javaSemantics, boolean forAndroidTest, - JavaTargetAttributes.Builder attributes, JavaCompilationArtifacts.Builder artifactsBuilder); + JavaSemantics javaSemantics, boolean forAndroidTest, JavaTargetAttributes.Builder attributes, + JavaCompilationArtifacts.Builder artifactsBuilder) throws InterruptedException; } diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/ApplicationManifest.java b/src/main/java/com/google/devtools/build/lib/rules/android/ApplicationManifest.java index 2b5e999a66..0e79f5f299 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/ApplicationManifest.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/ApplicationManifest.java @@ -99,7 +99,8 @@ public final class ApplicationManifest { } } - public ApplicationManifest addStubApplication(RuleContext ruleContext) { + public ApplicationManifest addStubApplication(RuleContext ruleContext) + throws InterruptedException { Artifact stubManifest = ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.STUB_APPLICATON_MANIFEST); @@ -199,14 +200,15 @@ public final class ApplicationManifest { return builder.build(); } - /** Packages up the manifest with assets from the rule and dependent resources. */ + /** Packages up the manifest with assets from the rule and dependent resources. + * @throws InterruptedException */ public ResourceApk packWithAssets( Artifact resourceApk, RuleContext ruleContext, NestedSet<ResourceContainer> resourceContainers, Artifact rTxt, boolean incremental, - Artifact proguardCfg) { + Artifact proguardCfg) throws InterruptedException { try { LocalResourceContainer data = new LocalResourceContainer.Builder() .withAssets( @@ -237,7 +239,8 @@ public final class ApplicationManifest { } } - /** Packages up the manifest with resource and assets from the rule and dependent resources. */ + /** Packages up the manifest with resource and assets from the rule and dependent resources. + * @throws InterruptedException */ public ResourceApk packWithDataAndResources( Artifact resourceApk, RuleContext ruleContext, @@ -250,7 +253,7 @@ public final class ApplicationManifest { String applicationId, String versionCode, String versionName, - boolean incremental, Artifact proguardCfg) { + boolean incremental, Artifact proguardCfg) throws InterruptedException { try { LocalResourceContainer data = new LocalResourceContainer.Builder() .withAssets( @@ -301,7 +304,7 @@ public final class ApplicationManifest { String versionCode, String versionName, boolean incremental, - LocalResourceContainer data, Artifact proguardCfg) { + LocalResourceContainer data, Artifact proguardCfg) throws InterruptedException { ResourceContainer resourceContainer = checkForInlinedResources( new AndroidResourceContainerBuilder() .withData(data) @@ -395,6 +398,7 @@ public final class ApplicationManifest { /** * Packages up the manifest with resources, and generates the R.java. + * @throws InterruptedException * * @deprecated in favor of {@link ApplicationManifest#packWithDataAndResources}. */ @@ -404,7 +408,7 @@ public final class ApplicationManifest { RuleContext ruleContext, NestedSet<ResourceContainer> resourceContainers, boolean createSource, - Artifact proguardCfg) { + Artifact proguardCfg) throws InterruptedException { TransitiveInfoCollection resourcesPrerequisite = ruleContext.getPrerequisite("resources", Mode.TARGET); diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java index 2e4d497d65..663532ba2b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java @@ -145,12 +145,12 @@ public abstract class CcBinary implements RuleConfiguredTargetFactory { } @Override - public ConfiguredTarget create(RuleContext context) { + public ConfiguredTarget create(RuleContext context) throws InterruptedException { return CcBinary.init(semantics, context, /*fake =*/ false, /*useTestOnlyFlags =*/ false); } public static ConfiguredTarget init(CppSemantics semantics, RuleContext ruleContext, boolean fake, - boolean useTestOnlyFlags) { + boolean useTestOnlyFlags) throws InterruptedException { ruleContext.checkSrcsSamePackage(true); FeatureConfiguration featureConfiguration = CcCommon.configureFeatures(ruleContext); CcCommon common = new CcCommon(ruleContext, featureConfiguration); diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaBinary.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaBinary.java index 63a2320ce7..48423fcaaf 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaBinary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaBinary.java @@ -57,7 +57,7 @@ public class JavaBinary implements RuleConfiguredTargetFactory { } @Override - public ConfiguredTarget create(RuleContext ruleContext) { + public ConfiguredTarget create(RuleContext ruleContext) throws InterruptedException { final JavaCommon common = new JavaCommon(ruleContext, semantics); DeployArchiveBuilder deployArchiveBuilder = new DeployArchiveBuilder(semantics, ruleContext); Runfiles.Builder runfilesBuilder = new Runfiles.Builder(ruleContext.getWorkspaceName()); diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaImport.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaImport.java index 0b86405076..64d1b9b66d 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaImport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaImport.java @@ -46,7 +46,7 @@ public class JavaImport implements RuleConfiguredTargetFactory { } @Override - public ConfiguredTarget create(RuleContext ruleContext) { + public ConfiguredTarget create(RuleContext ruleContext) throws InterruptedException { ImmutableList<Artifact> srcJars = ImmutableList.of(); ImmutableList<Artifact> jars = collectJars(ruleContext); Artifact srcJar = ruleContext.getPrerequisiteArtifact("srcjar", Mode.TARGET); diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaLibrary.java index 5dcb16db29..2991afeba0 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaLibrary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaLibrary.java @@ -51,13 +51,14 @@ public class JavaLibrary implements RuleConfiguredTargetFactory { } @Override - public ConfiguredTarget create(RuleContext ruleContext) { + public ConfiguredTarget create(RuleContext ruleContext) throws InterruptedException { JavaCommon common = new JavaCommon(ruleContext, semantics); RuleConfiguredTargetBuilder builder = init(ruleContext, common); return builder != null ? builder.build() : null; } - public RuleConfiguredTargetBuilder init(RuleContext ruleContext, final JavaCommon common) { + public RuleConfiguredTargetBuilder init(RuleContext ruleContext, final JavaCommon common) + throws InterruptedException { common.initializeJavacOpts(); JavaTargetAttributes.Builder attributesBuilder = common.initCommon(); diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaSemantics.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaSemantics.java index bb7cc83025..3bcbd73f9a 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaSemantics.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaSemantics.java @@ -288,6 +288,7 @@ public interface JavaSemantics { /** * Adds extra providers to a Java target. + * @throws InterruptedException */ void addProviders(RuleContext ruleContext, JavaCommon javaCommon, @@ -299,7 +300,7 @@ public interface JavaSemantics { ImmutableMap<Artifact, Artifact> compilationToRuntimeJarMap, JavaCompilationHelper helper, NestedSetBuilder<Artifact> filesBuilder, - RuleConfiguredTargetBuilder ruleBuilder); + RuleConfiguredTargetBuilder ruleBuilder) throws InterruptedException; /** * Tell if a build with the given configuration should use strict java dependencies. This method @@ -324,10 +325,12 @@ public interface JavaSemantics { * @param attributesBuilder the builder to construct the list of attributes of this target * (mutable). * @return the launcher as an artifact + * @throws InterruptedException */ Artifact getLauncher(final RuleContext ruleContext, final JavaCommon common, DeployArchiveBuilder deployArchiveBuilder, Runfiles.Builder runfilesBuilder, - List<String> jvmFlags, JavaTargetAttributes.Builder attributesBuilder, boolean shouldStrip); + List<String> jvmFlags, JavaTargetAttributes.Builder attributesBuilder, boolean shouldStrip) + throws InterruptedException; /** * Add extra dependencies for runfiles of a Java binary. diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/IosApplication.java b/src/main/java/com/google/devtools/build/lib/rules/objc/IosApplication.java index 335acb8c3e..d287b62d76 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/IosApplication.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/IosApplication.java @@ -49,7 +49,7 @@ public class IosApplication extends ReleaseBundlingTargetFactory { @Override protected void configureTarget(RuleConfiguredTargetBuilder target, RuleContext ruleContext, - ReleaseBundlingSupport releaseBundlingSupport) { + ReleaseBundlingSupport releaseBundlingSupport) throws InterruptedException { // If this is an application built for the simulator, make it runnable. ObjcConfiguration objcConfiguration = ObjcRuleClasses.objcConfiguration(ruleContext); if (objcConfiguration.getBundlingPlatform() == Platform.SIMULATOR) { diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/IosExtension.java b/src/main/java/com/google/devtools/build/lib/rules/objc/IosExtension.java index 821fa5e8e1..f90654d2af 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/IosExtension.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/IosExtension.java @@ -59,7 +59,7 @@ public class IosExtension extends ReleaseBundlingTargetFactory { } @Override - protected ObjcProvider exposedObjcProvider(RuleContext ruleContext) { + protected ObjcProvider exposedObjcProvider(RuleContext ruleContext) throws InterruptedException { // Nest this target's bundle under final IPA return new ObjcProvider.Builder() .add(MERGE_ZIP, ruleContext.getImplicitOutputArtifact(ReleaseBundlingSupport.IPA)) diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/IosFramework.java b/src/main/java/com/google/devtools/build/lib/rules/objc/IosFramework.java index 0774559a35..d823621b20 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/IosFramework.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/IosFramework.java @@ -100,7 +100,7 @@ public class IosFramework extends ReleaseBundlingTargetFactory { } @Override - protected ObjcProvider exposedObjcProvider(RuleContext ruleContext) { + protected ObjcProvider exposedObjcProvider(RuleContext ruleContext) throws InterruptedException { // Assemble framework binary and headers in the label-scoped location, so that it's possible to // pass -F X.framework to the compiler and -framework X to the linker. This mimics usage of // frameworks when built from Xcode. diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java index 61d22adcac..a7a476b9ff 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java @@ -229,8 +229,9 @@ public final class ReleaseBundlingSupport { * multi-architecture binary. * * @return this application support + * @throws InterruptedException */ - ReleaseBundlingSupport registerActions() { + ReleaseBundlingSupport registerActions() throws InterruptedException { bundleSupport.registerActions(objcProvider); registerCombineArchitecturesAction(); @@ -329,7 +330,7 @@ public final class ReleaseBundlingSupport { .build(ruleContext)); } - private Artifact registerBundleSigningActions(Artifact ipaOutput) { + private Artifact registerBundleSigningActions(Artifact ipaOutput) throws InterruptedException { IntermediateArtifacts intermediateArtifacts = ObjcRuleClasses.intermediateArtifacts(ruleContext); Artifact teamPrefixFile = @@ -371,10 +372,13 @@ public final class ReleaseBundlingSupport { * top level target in a blaze invocation. * * @return this application support + * @throws InterruptedException */ - ReleaseBundlingSupport addFilesToBuild(NestedSetBuilder<Artifact> filesToBuild) { - NestedSetBuilder<Artifact> debugSymbolBuilder = NestedSetBuilder.<Artifact>stableOrder() - .addTransitive(objcProvider.get(ObjcProvider.DEBUG_SYMBOLS)); + ReleaseBundlingSupport addFilesToBuild(NestedSetBuilder<Artifact> filesToBuild) + throws InterruptedException { + NestedSetBuilder<Artifact> debugSymbolBuilder = + NestedSetBuilder.<Artifact>stableOrder().addTransitive( + objcProvider.get(ObjcProvider.DEBUG_SYMBOLS)); for (Artifact breakpadFile : getBreakpadFiles().values()) { filesToBuild.add(breakpadFile); @@ -399,8 +403,9 @@ public final class ReleaseBundlingSupport { /** * Creates the {@link XcTestAppProvider} that can be used if this application is used as an * {@code xctest_app}. + * @throws InterruptedException */ - XcTestAppProvider xcTestAppProvider() { + XcTestAppProvider xcTestAppProvider() throws InterruptedException { // We want access to #import-able things from our test rig's dependency graph, but we don't // want to link anything since that stuff is shared automatically by way of the // -bundle_loader linker flag. @@ -445,8 +450,9 @@ public final class ReleaseBundlingSupport { /** * Returns a {@link RunfilesSupport} that uses the provided runner script as the executable. + * @throws InterruptedException */ - RunfilesSupport runfilesSupport(Artifact runnerScript) { + RunfilesSupport runfilesSupport(Artifact runnerScript) throws InterruptedException { Artifact ipaFile = ruleContext.getImplicitOutputArtifact(ReleaseBundlingSupport.IPA); Runfiles runfiles = new Runfiles.Builder(ruleContext.getWorkspaceName()) .addArtifact(ipaFile) diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingTargetFactory.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingTargetFactory.java index b1d26cc9fa..54aeb675f3 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingTargetFactory.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingTargetFactory.java @@ -112,9 +112,10 @@ public abstract class ReleaseBundlingTargetFactory implements RuleConfiguredTarg /** * Performs additional configuration of the target. The default implementation does nothing, but * subclasses may override it to add logic. + * @throws InterruptedException */ protected void configureTarget(RuleConfiguredTargetBuilder target, RuleContext ruleContext, - ReleaseBundlingSupport releaseBundlingSupport) {} + ReleaseBundlingSupport releaseBundlingSupport) throws InterruptedException {} /** * Returns the name of this target's bundle. @@ -125,9 +126,10 @@ public abstract class ReleaseBundlingTargetFactory implements RuleConfiguredTarg /** * Returns an exposed {@code ObjcProvider} object. + * @throws InterruptedException */ @Nullable - protected ObjcProvider exposedObjcProvider(RuleContext ruleContext) { + protected ObjcProvider exposedObjcProvider(RuleContext ruleContext) throws InterruptedException { return null; } diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/TestSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/TestSupport.java index 4a5cb16d59..0b91cf4417 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/TestSupport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/TestSupport.java @@ -55,8 +55,9 @@ public class TestSupport { /** * Registers actions to create all files needed in order to actually run the test. + * @throws InterruptedException */ - public TestSupport registerTestRunnerActions() { + public TestSupport registerTestRunnerActions() throws InterruptedException { registerTestScriptSubstitutionAction(); return this; } @@ -68,7 +69,7 @@ public class TestSupport { return ObjcRuleClasses.artifactByAppendingToBaseName(ruleContext, "_test_script"); } - private void registerTestScriptSubstitutionAction() { + private void registerTestScriptSubstitutionAction() throws InterruptedException { // testIpa is the app actually containing the tests Artifact testIpa = testIpa(); @@ -130,7 +131,7 @@ public class TestSupport { "target_device", Mode.TARGET, IosTestSubstitutionProvider.class); } - private Artifact testIpa() { + private Artifact testIpa() throws InterruptedException { return ruleContext.getImplicitOutputArtifact(ReleaseBundlingSupport.IPA); } @@ -198,8 +199,10 @@ public class TestSupport { * Adds all files needed to run this test to the passed Runfiles builder. * * @param objcProvider common information about this rule's attributes and its dependencies + * @throws InterruptedException */ - public TestSupport addRunfiles(Builder runfilesBuilder, ObjcProvider objcProvider) { + public TestSupport addRunfiles(Builder runfilesBuilder, ObjcProvider objcProvider) + throws InterruptedException { runfilesBuilder .addArtifact(testIpa()) .addArtifacts(xctestIpa().asSet()) @@ -304,8 +307,10 @@ public class TestSupport { /** * Adds files which must be built in order to run this test to builder. + * @throws InterruptedException */ - public TestSupport addFilesToBuild(NestedSetBuilder<Artifact> builder) { + public TestSupport addFilesToBuild(NestedSetBuilder<Artifact> builder) + throws InterruptedException { builder.add(testIpa()).addAll(xctestIpa().asSet()); return this; } diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/XcodeSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/XcodeSupport.java index 45f9726009..d3979dcdce 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/XcodeSupport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/XcodeSupport.java @@ -63,8 +63,10 @@ public final class XcodeSupport { * Adds xcode project files to the given builder. * * @return this xcode support + * @throws InterruptedException */ - XcodeSupport addFilesToBuild(NestedSetBuilder<Artifact> filesToBuild) { + XcodeSupport addFilesToBuild(NestedSetBuilder<Artifact> filesToBuild) + throws InterruptedException { filesToBuild.add(ruleContext.getImplicitOutputArtifact(PBXPROJ)); return this; } @@ -94,8 +96,9 @@ public final class XcodeSupport { * * @param xcodeProvider information about this rule's xcode settings and that of its dependencies * @return this xcode support + * @throws InterruptedException */ - XcodeSupport registerActions(XcodeProvider xcodeProvider) { + XcodeSupport registerActions(XcodeProvider xcodeProvider) throws InterruptedException { registerXcodegenActions(XcodeProvider.Project.fromTopLevelTarget(xcodeProvider)); return this; } @@ -105,8 +108,9 @@ public final class XcodeSupport { * * @param xcodeProviders information about several rules' xcode settings * @return this xcode support + * @throws InterruptedException */ - XcodeSupport registerActions(Iterable<XcodeProvider> xcodeProviders) { + XcodeSupport registerActions(Iterable<XcodeProvider> xcodeProviders) throws InterruptedException { registerXcodegenActions(Project.fromTopLevelTargets(xcodeProviders)); return this; } @@ -199,7 +203,7 @@ public final class XcodeSupport { return this; } - private void registerXcodegenActions(XcodeProvider.Project project) { + private void registerXcodegenActions(XcodeProvider.Project project) throws InterruptedException { Artifact controlFile = ObjcRuleClasses.intermediateArtifacts(ruleContext).pbxprojControlArtifact(); @@ -220,7 +224,8 @@ public final class XcodeSupport { .build(ruleContext)); } - private ByteSource xcodegenControlFileBytes(final XcodeProvider.Project project) { + private ByteSource xcodegenControlFileBytes(final XcodeProvider.Project project) + throws InterruptedException { final Artifact pbxproj = ruleContext.getImplicitOutputArtifact(XcodeSupport.PBXPROJ); final ObjcConfiguration objcConfiguration = ObjcRuleClasses.objcConfiguration(ruleContext); return new ByteSource() { diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java index a60e0d7e88..9cd591a909 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java @@ -40,7 +40,7 @@ public abstract class PyBinary implements RuleConfiguredTargetFactory { protected abstract PythonSemantics createSemantics(); @Override - public ConfiguredTarget create(RuleContext ruleContext) { + public ConfiguredTarget create(RuleContext ruleContext) throws InterruptedException { PyCommon common = new PyCommon(ruleContext); common.initCommon(common.getDefaultPythonVersion()); @@ -51,8 +51,8 @@ public abstract class PyBinary implements RuleConfiguredTargetFactory { return builder.build(); } - static RuleConfiguredTargetBuilder init( - RuleContext ruleContext, PythonSemantics semantics, PyCommon common) { + static RuleConfiguredTargetBuilder init(RuleContext ruleContext, PythonSemantics semantics, + PyCommon common) throws InterruptedException { CcLinkParamsStore ccLinkParamsStore = initializeCcLinkParamStore(ruleContext); List<Artifact> srcs = common.validateSrcs(); diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyTest.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyTest.java index f433eb81e8..076005ab15 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/python/PyTest.java +++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyTest.java @@ -30,7 +30,7 @@ public abstract class PyTest implements RuleConfiguredTargetFactory { protected abstract PythonSemantics createSemantics(); @Override - public ConfiguredTarget create(RuleContext ruleContext) { + public ConfiguredTarget create(RuleContext ruleContext) throws InterruptedException { PythonSemantics semantics = createSemantics(); PyCommon common = new PyCommon(ruleContext); common.initCommon(getDefaultPythonVersion(ruleContext)); diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java b/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java index 357020029b..55d421ddc7 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java +++ b/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java @@ -65,7 +65,8 @@ public interface PythonSemantics { /** * Called at the end of the analysis of {@code py_binary} rules. + * @throws InterruptedException */ void postInitBinary(RuleContext ruleContext, RunfilesSupport runfilesSupport, - PyCommon common); + PyCommon common) throws InterruptedException; } |