-
-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow in-repo scalac plugins to have in-repo deps.
scalac plugins are not read from the regular classpath, so this requires special handling. javac plugins are read from the regular classpath, so deps work naturally there. Note that we don't support external plugins with deps, as there's no easy way to resolve just those deps by the time we're figuring out plugins. However no-dep plugins seem to be the norm - e.g., SBT doesn't appear to support plugin deps at all. To have external plugins with deps, you presumably need to publish the plugin as a "fat jar". Also adds examples to demonstrate javac/scalac plugin deps.
- Loading branch information
Showing
9 changed files
with
105 additions
and
23 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
14 changes: 14 additions & 0 deletions
14
examples/src/java/org/pantsbuild/example/javac/plugin/SimpleJavacPluginHelper.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,14 @@ | ||
// Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). | ||
// Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
package org.pantsbuild.example.javac.plugin; | ||
|
||
|
||
/** | ||
* A trivial helper class, to test that plugin dependencies are handled correctly. | ||
*/ | ||
public class SimpleJavacPluginHelper { | ||
public static String getName() { | ||
return "simple_javac_plugin"; | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
examples/src/scala/org/pantsbuild/example/scalac/plugin/SimpleScalacPluginHelper.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,12 @@ | ||
// Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). | ||
// Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
package org.pantsbuild.example.scalac.plugin | ||
|
||
|
||
/** | ||
* A trivial helper class, to test that plugin dependencies are handled correctly. | ||
*/ | ||
object SimpleScalacPluginHelper { | ||
val name = "simple_scalac_plugin" | ||
} |
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