-
Notifications
You must be signed in to change notification settings - Fork 26
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 #514 from iusildra/add--g-option
added -g javac option & updated bin/scalafmt
- Loading branch information
Showing
8 changed files
with
84 additions
and
1 deletion.
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
37 changes: 37 additions & 0 deletions
37
modules/sbt-plugin/src/sbt-test/debug-session/debug-java/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,37 @@ | ||
import ch.epfl.scala.debugadapter.testfmk._ | ||
|
||
val checkDebugJava = inputKey[Unit]("Check that the -g option has been added") | ||
|
||
def checkDebugJavaTask = Def.inputTask { | ||
val uri = (Compile / startMainClassDebugSession).evaluated | ||
val source = (Compile / sources).value.head.toPath | ||
implicit val context: TestingContext = TestingContext(source, "3.3.0") | ||
DebugTest.check(uri)(Breakpoint(source, 6), Evaluation.success("x", 1)) | ||
} | ||
def checkDebugJavaWithGSpecializedTask = Def.inputTask { | ||
val uri = (Compile / startMainClassDebugSession).evaluated | ||
val source = (Compile / sources).value.head.toPath | ||
implicit val context: TestingContext = TestingContext(source, "3.3.0") | ||
DebugTest.check(uri)(Breakpoint(source, 6), Evaluation.failed("x")) | ||
} | ||
|
||
lazy val debugJavaWithG = | ||
project | ||
.in(file("./withG")) | ||
.settings( | ||
javacOptions += "-g", | ||
checkDebugJava := checkDebugJavaTask.evaluated | ||
) | ||
|
||
lazy val debugJavaWithoutG = | ||
project | ||
.in(file("./withoutG")) | ||
.settings(checkDebugJava := checkDebugJavaTask.evaluated) | ||
|
||
lazy val debugJavaWithGSpecialized = | ||
project | ||
.in(file("./withGSpecialized")) | ||
.settings( | ||
javacOptions += "-g:lines,source", | ||
checkDebugJava := checkDebugJavaWithGSpecializedTask.evaluated | ||
) |
12 changes: 12 additions & 0 deletions
12
modules/sbt-plugin/src/sbt-test/debug-session/debug-java/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,12 @@ | ||
val pluginVersion = sys.props | ||
.get("plugin.version") | ||
.getOrElse { | ||
sys.error( | ||
"""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D. | ||
|""".stripMargin | ||
) | ||
} | ||
|
||
addSbtPlugin("ch.epfl.scala" % "sbt-debug-adapter" % pluginVersion) | ||
libraryDependencies += "ch.epfl.scala" %% "scala-debug-adapter-test" % pluginVersion |
2 changes: 2 additions & 0 deletions
2
modules/sbt-plugin/src/sbt-test/debug-session/debug-java/project/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,2 @@ | ||
// required for adopt@1.8 | ||
addSbtPlugin("org.scala-debugger" % "sbt-jdi-tools" % "1.1.1") |
3 changes: 3 additions & 0 deletions
3
modules/sbt-plugin/src/sbt-test/debug-session/debug-java/test
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 @@ | ||
> 'debugJavaWithG / checkDebugJava {"class":"example.Main","arguments":[],"jvmOptions":[]}' | ||
> 'debugJavaWithoutG / checkDebugJava {"class":"example.Main","arguments":[],"jvmOptions":[]}' | ||
> 'debugJavaWithGSpecialized / checkDebugJava {"class":"example.Main","arguments":[],"jvmOptions":[]}' |
8 changes: 8 additions & 0 deletions
8
...es/sbt-plugin/src/sbt-test/debug-session/debug-java/withG/src/main/java/example/Main.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,8 @@ | ||
package example; | ||
|
||
public class Main { | ||
public static void main(String[] args) { | ||
int x = 1; | ||
System.out.println("Hello, world!"); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...in/src/sbt-test/debug-session/debug-java/withGSpecialized/src/main/java/example/Main.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,8 @@ | ||
package example; | ||
|
||
public class Main { | ||
public static void main(String[] args) { | ||
int x = 1; | ||
System.out.println("Hello, world!"); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...sbt-plugin/src/sbt-test/debug-session/debug-java/withoutG/src/main/java/example/Main.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,8 @@ | ||
package example; | ||
|
||
public class Main { | ||
public static void main(String[] args) { | ||
int x = 1; | ||
System.out.println("Hello, world!"); | ||
} | ||
} |