-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support new targetSourcePackages/targetDestinationPackages settings in missinglink
- Loading branch information
1 parent
2f855f9
commit d6b9520
Showing
12 changed files
with
174 additions
and
15 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
19 changes: 19 additions & 0 deletions
19
src/sbt-test/missinglink/target-destination-package/build.sbt
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 @@ | ||
inThisBuild(Def.settings( | ||
version := "0.1.0", | ||
scalaVersion := "2.12.8", | ||
)) | ||
|
||
lazy val `target-destination-package` = project | ||
.in(file(".")) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
"com.google.guava" % "guava" % "14.0", | ||
"com.google.guava" % "guava" % "18.0" % Runtime, | ||
), | ||
|
||
// Speed up compilation a bit. Our .java files do not need to see the .scala files. | ||
compileOrder := CompileOrder.JavaThenScala, | ||
|
||
// Will ignore Guava conflict | ||
missinglinkTargetDestinationPackages += TargetedPackage("test") | ||
) |
8 changes: 8 additions & 0 deletions
8
src/sbt-test/missinglink/target-destination-package/project/plugins.sbt
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,8 @@ | ||
System.getProperty("plugin.version") match { | ||
case null => | ||
throw new MessageOnlyException( | ||
"The system property 'plugin.version' is not defined. " + | ||
"Specify this property using the scriptedLaunchOpts -D.") | ||
case pluginVersion => | ||
addSbtPlugin("ch.epfl.scala" % "sbt-missinglink" % pluginVersion) | ||
} |
5 changes: 5 additions & 0 deletions
5
src/sbt-test/missinglink/target-destination-package/src/main/java/test/Foo.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,5 @@ | ||
package test; | ||
|
||
public enum Foo { | ||
BAR | ||
} |
14 changes: 14 additions & 0 deletions
14
...st/missinglink/target-destination-package/src/main/scala/test/ProblematicDependency.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,14 @@ | ||
package test | ||
|
||
import com.google.common.base.Enums | ||
|
||
/** | ||
* Calls a method in the Guava Enums class which was removed in guava 18. If a project calls this | ||
* method while overriding Guava to >= 18, it will cause a NoSuchMethodError at runtime. | ||
*/ | ||
object ProblematicDependency { | ||
|
||
def reliesOnRemovedMethod(): AnyRef = { | ||
Enums.valueOfFunction(classOf[Foo]) | ||
} | ||
} |
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,3 @@ | ||
> compile | ||
> compile:missinglinkCheck | ||
> runtime:missinglinkCheck |
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,18 @@ | ||
inThisBuild(Def.settings( | ||
version := "0.1.0", | ||
scalaVersion := "2.12.8", | ||
)) | ||
|
||
lazy val `target-source-package` = project | ||
.in(file(".")) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
"com.google.guava" % "guava" % "14.0", | ||
"com.google.guava" % "guava" % "18.0" % Runtime, | ||
), | ||
|
||
// Speed up compilation a bit. Our .java files do not need to see the .scala files. | ||
compileOrder := CompileOrder.JavaThenScala, | ||
|
||
missinglinkTargetSourcePackages += TargetedPackage("test") | ||
) |
8 changes: 8 additions & 0 deletions
8
src/sbt-test/missinglink/target-source-package/project/plugins.sbt
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,8 @@ | ||
System.getProperty("plugin.version") match { | ||
case null => | ||
throw new MessageOnlyException( | ||
"The system property 'plugin.version' is not defined. " + | ||
"Specify this property using the scriptedLaunchOpts -D.") | ||
case pluginVersion => | ||
addSbtPlugin("ch.epfl.scala" % "sbt-missinglink" % pluginVersion) | ||
} |
5 changes: 5 additions & 0 deletions
5
src/sbt-test/missinglink/target-source-package/src/main/java/test/Foo.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,5 @@ | ||
package test; | ||
|
||
public enum Foo { | ||
BAR | ||
} |
14 changes: 14 additions & 0 deletions
14
...bt-test/missinglink/target-source-package/src/main/scala/test/ProblematicDependency.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,14 @@ | ||
package test | ||
|
||
import com.google.common.base.Enums | ||
|
||
/** | ||
* Calls a method in the Guava Enums class which was removed in guava 18. If a project calls this | ||
* method while overriding Guava to >= 18, it will cause a NoSuchMethodError at runtime. | ||
*/ | ||
object ProblematicDependency { | ||
|
||
def reliesOnRemovedMethod(): AnyRef = { | ||
Enums.valueOfFunction(classOf[Foo]) | ||
} | ||
} |
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,3 @@ | ||
> compile | ||
> compile:missinglinkCheck | ||
-> runtime:missinglinkCheck |