diff --git a/src/test/java/com/google/devtools/build/lib/buildtool/util/BUILD b/src/test/java/com/google/devtools/build/lib/buildtool/util/BUILD index 260b539f47d1d8..ac4628f982b326 100644 --- a/src/test/java/com/google/devtools/build/lib/buildtool/util/BUILD +++ b/src/test/java/com/google/devtools/build/lib/buildtool/util/BUILD @@ -50,7 +50,6 @@ java_library( "//src/main/java/com/google/devtools/build/lib/analysis:workspace_status_action", "//src/main/java/com/google/devtools/build/lib/bazel:main", "//src/main/java/com/google/devtools/build/lib/bazel:repository_module", - "//src/main/java/com/google/devtools/build/lib/bazel/rules/android", "//src/main/java/com/google/devtools/build/lib/bugreport", "//src/main/java/com/google/devtools/build/lib/buildeventstream", "//src/main/java/com/google/devtools/build/lib/clock", @@ -73,15 +72,12 @@ java_library( "//src/main/java/com/google/devtools/build/lib/packages/semantics", "//src/main/java/com/google/devtools/build/lib/pkgcache", "//src/main/java/com/google/devtools/build/lib/profiler", - "//src/main/java/com/google/devtools/build/lib/rules:repository/local_repository_rule", "//src/main/java/com/google/devtools/build/lib/rules:repository/repository_function", "//src/main/java/com/google/devtools/build/lib/runtime/commands", "//src/main/java/com/google/devtools/build/lib/sandbox", "//src/main/java/com/google/devtools/build/lib/shell", "//src/main/java/com/google/devtools/build/lib/skyframe:configured_target_and_data", - "//src/main/java/com/google/devtools/build/lib/skyframe:managed_directories_knowledge", "//src/main/java/com/google/devtools/build/lib/skyframe:precomputed_value", - "//src/main/java/com/google/devtools/build/lib/skyframe:sky_functions", "//src/main/java/com/google/devtools/build/lib/skyframe:skyframe_cluster", "//src/main/java/com/google/devtools/build/lib/standalone", "//src/main/java/com/google/devtools/build/lib/util", diff --git a/src/test/java/com/google/devtools/build/lib/buildtool/util/BuildIntegrationTestCase.java b/src/test/java/com/google/devtools/build/lib/buildtool/util/BuildIntegrationTestCase.java index 850e18ce081677..0016e883d66262 100644 --- a/src/test/java/com/google/devtools/build/lib/buildtool/util/BuildIntegrationTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/buildtool/util/BuildIntegrationTestCase.java @@ -50,10 +50,7 @@ import com.google.devtools.build.lib.analysis.util.AnalysisMock; import com.google.devtools.build.lib.analysis.util.AnalysisTestUtil; import com.google.devtools.build.lib.analysis.util.AnalysisTestUtil.DummyWorkspaceStatusActionContext; -import com.google.devtools.build.lib.bazel.rules.android.AndroidNdkRepositoryFunction; -import com.google.devtools.build.lib.bazel.rules.android.AndroidNdkRepositoryRule; -import com.google.devtools.build.lib.bazel.rules.android.AndroidSdkRepositoryFunction; -import com.google.devtools.build.lib.bazel.rules.android.AndroidSdkRepositoryRule; +import com.google.devtools.build.lib.bazel.BazelRepositoryModule; import com.google.devtools.build.lib.bugreport.BugReport; import com.google.devtools.build.lib.bugreport.BugReporter; import com.google.devtools.build.lib.bugreport.Crash; @@ -78,10 +75,7 @@ import com.google.devtools.build.lib.packages.NoSuchTargetException; import com.google.devtools.build.lib.packages.util.MockToolsConfig; import com.google.devtools.build.lib.pkgcache.PackageManager; -import com.google.devtools.build.lib.rules.repository.LocalRepositoryFunction; -import com.google.devtools.build.lib.rules.repository.LocalRepositoryRule; import com.google.devtools.build.lib.rules.repository.RepositoryDelegatorFunction; -import com.google.devtools.build.lib.rules.repository.RepositoryFunction; import com.google.devtools.build.lib.runtime.BlazeModule; import com.google.devtools.build.lib.runtime.BlazeRuntime; import com.google.devtools.build.lib.runtime.BlazeServerStartupOptions; @@ -96,12 +90,9 @@ import com.google.devtools.build.lib.shell.AbnormalTerminationException; import com.google.devtools.build.lib.shell.Command; import com.google.devtools.build.lib.shell.CommandException; -import com.google.devtools.build.lib.skyframe.BazelSkyframeExecutorConstants; import com.google.devtools.build.lib.skyframe.ConfiguredTargetAndData; -import com.google.devtools.build.lib.skyframe.ManagedDirectoriesKnowledge; import com.google.devtools.build.lib.skyframe.PrecomputedValue; import com.google.devtools.build.lib.skyframe.PrecomputedValue.Injected; -import com.google.devtools.build.lib.skyframe.SkyFunctions; import com.google.devtools.build.lib.skyframe.SkyframeExecutor; import com.google.devtools.build.lib.skyframe.util.SkyframeExecutorTestUtils; import com.google.devtools.build.lib.standalone.StandaloneModule; @@ -131,7 +122,6 @@ import java.util.Map; import java.util.Optional; import java.util.Set; -import java.util.concurrent.atomic.AtomicBoolean; import javax.annotation.concurrent.GuardedBy; import org.junit.After; import org.junit.Before; @@ -419,26 +409,6 @@ protected BlazeModule getStrategyModule() { private static BlazeModule getMockBazelRepositoryModule() { return new BlazeModule() { - @Override - public void workspaceInit( - BlazeRuntime runtime, BlazeDirectories directories, WorkspaceBuilder builder) { - ImmutableMap.Builder repositoryHandlers = - new ImmutableMap.Builder() - .put(LocalRepositoryRule.NAME, new LocalRepositoryFunction()) - .put(AndroidSdkRepositoryRule.NAME, new AndroidSdkRepositoryFunction()) - .put(AndroidNdkRepositoryRule.NAME, new AndroidNdkRepositoryFunction()); - builder.addSkyFunction( - SkyFunctions.REPOSITORY_DIRECTORY, - new RepositoryDelegatorFunction( - repositoryHandlers.build(), - null, - new AtomicBoolean(true), - ImmutableMap::of, - directories, - ManagedDirectoriesKnowledge.NO_MANAGED_DIRECTORIES, - BazelSkyframeExecutorConstants.EXTERNAL_PACKAGE_HELPER)); - } - @Override public ImmutableList getPrecomputedValues() { ImmutableList.Builder builder = ImmutableList.builder(); @@ -493,7 +463,8 @@ protected BlazeRuntime.Builder getRuntimeBuilder() throws Exception { builder .addBlazeModule(new NoSpawnCacheModule()) .addBlazeModule(new WorkerModule()) - .addBlazeModule(new SandboxModule()); + .addBlazeModule(new SandboxModule()) + .addBlazeModule(new BazelRepositoryModule()); } return builder; }