Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MultiProjectIncrementalSpec to test shadowing detection #179

Merged
merged 10 commits into from Sep 29, 2016
Merged

Add MultiProjectIncrementalSpec to test shadowing detection #179

merged 10 commits into from Sep 29, 2016

Conversation

eed3si9n
Copy link
Member

@eed3si9n eed3si9n commented Sep 22, 2016

Ref #166
This is on top of #176

Instead of the virtual project, this uses actual files and JAR to test the shadowing detection.

steps

There are two subprojects sub1 and sub2. sub1 depends on sub2. The test consists of three phases:

  1. sub1 is compiled with src/Depender.scala, and uses empty sub2/target/ directory and lib/sample-binary_2.11-0.1.jar as the classpath. Depender calls test.pkg.Ext1.x, which is defined in the JAR file.
  2. sub1 is compiled next with src/Depender.scala and src/Depender2.scala, and uses empty sub2/target/ directory and lib/sample-binary_2.11-0.1.jar as the classpath. Depender2 calls test.pkg.Ext2.x, which is defined in the JAR file.
  3. Next, sub2 is compiled with src/Ext1.scala.
  4. sub1 is compiled again with src/Depender.scala, src/Depender2.scala, and src/Good.scala. This should detect that test.pkg.Ext1 is now shadowed by sub2/target, and thus src/Depender.scala must be invalidated.

problem

ff75cd1 demonstrates that current implementation does not detect this shadowing.

Ref #166

There are two subprojects sub1 and sub2. sub1 depends on sub2. The test
consists of three phases:

1. sub1 is compiled with `src/Depender.scala`, and uses empty
`sub2/target/` directory and `lib/sample-binary_2.11-0.1.jar` as the
classpath. Depender calls `test.pkg.Ext1.x`, which is defined in the
JAR file.
2. Next, sub2 is compiled with `src/Ext1.scala`.
3. sub1 is compiled again with `src/Good.scala`. This should detect
that `test.pkg.Ext1` is now shadowed by `sub2/target`, and thus
`src/Depender.scala` must be invalidated.
This change is to test `externalBinaryModified`'s ability to detect
shadowing when there are more than one class name involved per JAR file.
@gkossakowski
Copy link
Contributor

gkossakowski commented Sep 28, 2016

Should you mark your test as pending and then mark it as passing in #180? Otherwise, LGTM.

@eed3si9n eed3si9n merged commit 89c1777 into sbt:1.0 Sep 29, 2016
@eed3si9n eed3si9n deleted the wip/test_lookup branch September 29, 2016 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants