Skip to content

Commit

Permalink
Automated rollback of commit 496d3de.
Browse files Browse the repository at this point in the history
*** Reason for rollback ***

Roll-forward.

unknown commit fixed the internal protoc to also accept full paths, just as the external one does. Fixes #2265

*** Original change description ***

Automated rollback of commit bcd2355.

*** Reason for rollback ***

RELNOTES: None
PiperOrigin-RevId: 164324424
  • Loading branch information
buchgr committed Aug 7, 2017
1 parent 0ace9b0 commit e8d4366
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ static CustomCommandLine createCommandLineFromToolchains(
}

for (Artifact src : protosToCompile) {
cmdLine.addPath(src.getRootRelativePath());
cmdLine.addPath(src.getExecPath());
}

if (!allowServices) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,30 @@ public void commandLine_basic() throws Exception {
.inOrder();
}

@Test
public void commandline_derivedArtifact() {
// Verify that the command line contains the correct path to a generated protocol buffers.
SupportData supportData =
SupportData.create(
Predicates.<TransitiveInfoCollection>alwaysFalse(),
ImmutableList.of(derivedArtifact("//:dont-care", "source_file.proto")),
NestedSetBuilder.<Artifact>emptySet(STABLE_ORDER) /* protosInDirectDeps */,
NestedSetBuilder.<Artifact>emptySet(STABLE_ORDER) /* transitiveImports */,
true /* hasProtoSources */);

CustomCommandLine cmdLine =
createCommandLineFromToolchains(
ImmutableList.<ToolchainInvocation>of() /* toolchainInvocations */,
supportData.getDirectProtoSources(),
supportData.getTransitiveImports(),
null /* protosInDirectDeps */,
"//foo:bar",
true /* allowServices */,
ImmutableList.<String>of() /* protocOpts */);

assertThat(cmdLine.arguments()).containsExactly("out/source_file.proto");
}

@Test
public void commandLine_strictDeps() throws Exception {
ProtoLangToolchainProvider toolchain =
Expand Down

0 comments on commit e8d4366

Please sign in to comment.