-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
120 additions
and
9 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
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
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
35 changes: 35 additions & 0 deletions
35
...c/main/scala/scala/build/preprocessing/directives/UsingJavacOptionsDirectiveHandler.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,35 @@ | ||
package scala.build.preprocessing.directives | ||
|
||
import scala.build.Logger | ||
import scala.build.errors.BuildException | ||
import scala.build.options.{BuildOptions, JavaOpt, JavaOptions, ShadowingSeq} | ||
|
||
case object UsingJavacOptionsDirectiveHandler extends UsingDirectiveHandler { | ||
def name = "Javac options" | ||
def description = "Add Javac options. Options to be used when compiling things." | ||
def usage = "//> using javac-opt _options_ | //> using javacOpt _options_" | ||
override def usageMd = | ||
"""`//> using javac-opt `_options_ | ||
| | ||
|`//> using javacOpt `_options_""".stripMargin | ||
override def examples = Seq( | ||
"//> using javacOpt \"source\", \"1.8\"", | ||
"\"target\", \"1.8\"" | ||
) | ||
override def isRestricted = false | ||
def keys = Seq("javacOpt", "javacOptions", "javac-opt", "javac-options") | ||
def handleValues( | ||
scopedDirective: ScopedDirective, | ||
logger: Logger | ||
): Either[BuildException, ProcessedUsingDirective] = | ||
checkIfValuesAreExpected(scopedDirective).map { groupedValuesContainer => | ||
val javacOptions = groupedValuesContainer.scopedStringValues | ||
val options = BuildOptions( | ||
javaOptions = JavaOptions( | ||
javacOptions = javacOptions.map(_.positioned) | ||
) | ||
) | ||
ProcessedDirective(Some(options), Seq.empty) | ||
} | ||
|
||
} |
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
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