forked from scala/scala
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request scala#4595 from som-snytt/issue/9370
SI-9370 Xplugin scans plugin path for descriptor
- Loading branch information
Showing
5 changed files
with
45 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package scala.test.plugins | ||
|
||
import scala.tools.nsc | ||
import nsc.Global | ||
import nsc.Phase | ||
import nsc.plugins.Plugin | ||
import nsc.plugins.PluginComponent | ||
|
||
class ThePlugin(val global: Global) extends Plugin { | ||
import global._ | ||
|
||
val name = "timebomb" | ||
val description = "Explodes if run. Maybe I haven't implemented it yet." | ||
val components = List[PluginComponent](thePhase1) | ||
|
||
private object thePhase1 extends PluginComponent { | ||
val global = ThePlugin.this.global | ||
|
||
val runsAfter = List[String]("parser") | ||
override val runsBefore = List[String]("namer") | ||
val phaseName = ThePlugin.this.name | ||
|
||
def newPhase(prev: Phase) = new ThePhase(prev) | ||
} | ||
|
||
private class ThePhase(prev: Phase) extends Phase(prev) { | ||
override def name = ThePlugin.this.name | ||
override def run = ??? | ||
} | ||
} | ||
|
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 @@ | ||
-Xplugin:/tmp:. -Xplugin-require:timebomb -Ystop-after:parser |
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 @@ | ||
|
||
package sample | ||
|
||
// just a sample that is compiled with the explosive plugin disabled | ||
object Sample extends App { | ||
} |
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 @@ | ||
<plugin> | ||
<name>ignored</name> | ||
<classname>scala.test.plugins.ThePlugin</classname> | ||
</plugin> | ||
|