aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/exec/MiddlemanActionTest.java
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2016-08-11 14:44:40 +0000
committerGravatar Yue Gan <yueg@google.com>2016-08-12 08:50:54 +0000
commitf8a1ae63ed616c4579db724a4d97effb8c216ceb (patch)
tree0843a158162c246f49d10058e57427f13754c6de /src/test/java/com/google/devtools/build/lib/exec/MiddlemanActionTest.java
parent153e5586a0a09237119f613ce591f892adc7efe4 (diff)
Add the repository name as a parameter to the output path functions
This doesn't do anything yet, it's in preparation for the execroot rearranging change. The execroot will have one bazel-out per repo, so it'll look like: execroot/ repo1/ bazel-out/ local-fastbuild/ bin/ repo2/ bazel-out/ local-fastbuild/ bin/ genfiles/ repo3/ bazel-out/ local-fastbuild/ testlogs/ and so on. Thus, any output path (getBinDirectory() & friends) needs to know what the repo name is. This changes so many places in the code I thought it would be good to do separately, then just flip the functionality in the execroot-rearranging commit. While I was poking around, I changed all of the refs I could from getPackageRelativeArtifact() to getBin/GenfilesArtifact(), so that 1) rule implementation don't have to know as much about roots and 2) they'll be more isolated from other output dir changes. `bazel info` and similar just return roots for the main repository. The only "change" is passing around a target label in the Java rules. Continues work on #1262. -- MOS_MIGRATED_REVID=129985336
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/exec/MiddlemanActionTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/exec/MiddlemanActionTest.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/exec/MiddlemanActionTest.java b/src/test/java/com/google/devtools/build/lib/exec/MiddlemanActionTest.java
index 7176669d40..b58554cada 100644
--- a/src/test/java/com/google/devtools/build/lib/exec/MiddlemanActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/exec/MiddlemanActionTest.java
@@ -26,17 +26,16 @@ import com.google.devtools.build.lib.actions.MiddlemanAction;
import com.google.devtools.build.lib.actions.MiddlemanFactory;
import com.google.devtools.build.lib.analysis.util.AnalysisTestUtil;
import com.google.devtools.build.lib.analysis.util.BuildViewTestCase;
+import com.google.devtools.build.lib.cmdline.RepositoryName;
import com.google.devtools.build.lib.testutil.Suite;
import com.google.devtools.build.lib.testutil.TestSpec;
-
+import java.util.ArrayList;
+import java.util.Arrays;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
-import java.util.ArrayList;
-import java.util.Arrays;
-
/**
* A test for {@link MiddlemanAction}.
*/
@@ -63,7 +62,7 @@ public class MiddlemanActionTest extends BuildViewTestCase {
middle = middlemanFactory.createAggregatingMiddleman(
NULL_ACTION_OWNER, "middleman_test",
Arrays.asList(a, b),
- targetConfig.getMiddlemanDirectory());
+ targetConfig.getMiddlemanDirectory(RepositoryName.MAIN));
analysisEnvironment.registerWith(getMutableActionGraph());
}
@@ -89,7 +88,8 @@ public class MiddlemanActionTest extends BuildViewTestCase {
@Test
public void testMiddlemanIsNullForEmptyInputs() throws Exception {
assertNull(middlemanFactory.createAggregatingMiddleman(NULL_ACTION_OWNER,
- "middleman_test", new ArrayList<Artifact>(), targetConfig.getMiddlemanDirectory()));
+ "middleman_test", new ArrayList<Artifact>(),
+ targetConfig.getMiddlemanDirectory(RepositoryName.MAIN)));
}
@Test
@@ -98,7 +98,7 @@ public class MiddlemanActionTest extends BuildViewTestCase {
middlemanFactory.createAggregatingMiddleman(
NULL_ACTION_OWNER, "middleman_test",
Lists.newArrayList(a),
- targetConfig.getMiddlemanDirectory()));
+ targetConfig.getMiddlemanDirectory(RepositoryName.MAIN)));
}
@Test
@@ -112,10 +112,12 @@ public class MiddlemanActionTest extends BuildViewTestCase {
analysisEnvironment.clear();
Artifact middlemanForC = middlemanFactory.createRunfilesMiddleman(
- NULL_ACTION_OWNER, c, Arrays.asList(c, common), targetConfig.getMiddlemanDirectory(),
+ NULL_ACTION_OWNER, c, Arrays.asList(c, common),
+ targetConfig.getMiddlemanDirectory(RepositoryName.MAIN),
"runfiles");
Artifact middlemanForD = middlemanFactory.createRunfilesMiddleman(
- NULL_ACTION_OWNER, d, Arrays.asList(d, common), targetConfig.getMiddlemanDirectory(),
+ NULL_ACTION_OWNER, d, Arrays.asList(d, common),
+ targetConfig.getMiddlemanDirectory(RepositoryName.MAIN),
"runfiles");
analysisEnvironment.registerWith(getMutableActionGraph());