-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New using directive syntax #546
Changes from all commits
c224dcb
75c577c
4af8f2b
1a2cbad
d51c690
0762acc
73591e7
f55139d
3f05dad
98e5341
ab02993
f1fd1b1
0162676
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// using scala 2.13 | ||
// using target scala-native | ||
//> using scala 2.13 | ||
//> using target scala-native | ||
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above |
||
|
||
import scala.scalanative.libc._ | ||
import scala.scalanative.unsafe._ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,7 +95,7 @@ Using directives syntax is still experimental and may change in future versions | |
So when we will have: | ||
|
||
```scala title=version.scala | ||
// using scala 2.12.5 | ||
//> using scala 2.12.5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above |
||
|
||
object OldCode | ||
//rest of the config | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// File was generated from based on docs/cookbooks/scala-versions.md, do not edit manually! | ||
|
||
// using scala 2.12.5 | ||
//> using scala 2.12.5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above |
||
|
||
object OldCode | ||
//rest of the config |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// using lib "com.lihaoyi::utest::0.7.10" | ||
//> using lib "com.lihaoyi::utest::0.7.10" | ||
|
||
import utest._ | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package scala.build | ||
|
||
import java.io.PrintStream | ||
|
||
import scala.build.blooprifle.BloopRifleLogger | ||
import scala.build.errors.{BuildException, Diagnostic} | ||
import scala.scalanative.{build => sn} | ||
|
||
class PersistentDiagnosticLogger(parent: Logger) extends Logger { | ||
private val diagBuilder = List.newBuilder[Diagnostic] | ||
|
||
def diagnostics = diagBuilder.result() | ||
|
||
// TODO Use macros for log and debug calls to have zero cost when verbosity <= 0 | ||
def message(message: => String): Unit = parent.message(message) | ||
def log(s: => String): Unit = parent.log(s) | ||
def log(s: => String, debug: => String): Unit = parent.log(s, debug) | ||
def debug(s: => String): Unit = parent.debug(s) | ||
|
||
def log(diagnostics: Seq[Diagnostic]): Unit = { | ||
parent.log(diagnostics) | ||
diagBuilder ++= diagnostics | ||
} | ||
|
||
def log(ex: BuildException): Unit = parent.log(ex) | ||
def exit(ex: BuildException): Nothing = parent.exit(ex) | ||
|
||
def coursierLogger: coursier.cache.CacheLogger = parent.coursierLogger | ||
def bloopRifleLogger: BloopRifleLogger = parent.bloopRifleLogger | ||
def scalaNativeTestLogger: sn.Logger = parent.scalaNativeTestLogger | ||
def scalaNativeCliInternalLoggerOptions: List[String] = parent.scalaNativeCliInternalLoggerOptions | ||
|
||
def compilerOutputStream: PrintStream = parent.compilerOutputStream | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did I omit a moment when we allowed strings without quotes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we do not check examples if compile file, a good catch, I've open a new issue for that: #575
I will also include fixes in a followup PR.