-
-
Notifications
You must be signed in to change notification settings - Fork 652
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
### Problem #7742 removed the method `self._on_invalid_compile_dependency()` from `JvmCompile`, as it seemed complex and it wasn't clear if it was still needed. We were able to reproduce an error internally which made it clear that logic was still necessary, so that method was added back, along with some testing to avoid further regression. ### Solution - Re-add `self._on_invalid_compile_dependency()`. - Refactor rsc compile integration testing to remove the manual split between between hermetic and nonhermetic testing. - Add a test case for a `zinc-java` target depending transitively on a scala target compiled with `rsc-and-zinc`. ### Result The rsc compile task passes our internal CI job which compiles some code using rsc and zinc!
- Loading branch information
1 parent
9838893
commit a3e3649
Showing
10 changed files
with
183 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 21 additions & 2 deletions
23
testprojects/src/scala/org/pantsbuild/testproject/javadepsonscalatransitive/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,33 @@ | ||
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
# This java_library() target transitively depending on an rsc-compiled scala_library() target | ||
# triggers some logic to traverse more deeply through dependencies to get the complete classpath. | ||
java_library( | ||
name = 'java-in-different-package', | ||
sources = ['Java.java'], | ||
dependencies = [':scala-in-different-package'], | ||
strict_deps = True, | ||
) | ||
|
||
scala_library( | ||
name = 'scala-in-different-package', | ||
sources = ['ScalaInDifferentPackage.scala'], | ||
dependencies = [':scala'], | ||
exports = [':scala'], | ||
strict_deps = True, | ||
) | ||
|
||
scala_library( | ||
name = 'scala', | ||
sources = ['Scala.scala'], | ||
dependencies = [':scala-2'], | ||
exports = [':scala-2'] | ||
exports = [':scala-2'], | ||
tags = {'use-compiler:rsc-and-zinc'}, | ||
) | ||
|
||
scala_library( | ||
name = 'scala-2', | ||
sources = ['Scala2.scala'] | ||
sources = ['Scala2.scala'], | ||
tags = {'use-compiler:rsc-and-zinc'}, | ||
) |
19 changes: 19 additions & 0 deletions
19
testprojects/src/scala/org/pantsbuild/testproject/javadepsonscalatransitive/Java.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). | ||
// Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
package org.pantsbuild.testproject.java.javadepsonscalatransitive; | ||
|
||
import org.pantsbuild.testproject.javadepsonscalatransitive.Scala; | ||
import org.pantsbuild.testproject.javadepsonscalatransitive.Scala2; | ||
|
||
public class Java { | ||
|
||
public String doStuff() { | ||
// This should not trigger a missing dependency warning | ||
// since we actually depend on the scala library. | ||
Scala scala = new Scala(); | ||
Scala2 scala2 = new Scala2(); | ||
return scala.toString() + scala2.toString(); | ||
} | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
.../scala/org/pantsbuild/testproject/javadepsonscalatransitive/ScalaInDifferentPackage.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). | ||
// Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
package org.pantsbuild.testproject.scala.javadepsonscalatransitive | ||
|
||
object ScalaInDifferentPackage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.