Skip to content
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

Extend the Gradle / sbt 0.13 leniency to Windows #8408

Merged
merged 1 commit into from Sep 10, 2019

Conversation

eed3si9n
Copy link
Member

Fixes scala/bug#11731

postfixOps error exempts /xsbt/Compat.scala specifically to allow sbt 0.13 to work
with Scala 2.13.0. Because this uses forward slash, apparently this did not work on Windows. This extends the compassion to Gradle + Windows users.

Fixes scala/bug#11731

postfixOps error exempts `/xsbt/Compat.scala` specifically to allow sbt 0.13 to work
with Scala 2.13.0. Because this uses forward slash, apparently this did not work on Windows. This extends the compassion to Gradle + Windows users.
@@ -115,7 +115,9 @@ trait Reporting extends scala.reflect.internal.Reporting { self: ast.Positions w
val msg = s"$featureDesc $req be enabled\nby making the implicit value $fqname visible.$explain" replace ("#", construct)
// don't error on postfix in pre-0.13.18 xsbt/Compat.scala
def isSbtCompat =
(featureName == "postfixOps" && pos.source.path.endsWith("/xsbt/Compat.scala") && Thread.currentThread.getStackTrace.exists(_.getClassName.startsWith("sbt.")))
(featureName == "postfixOps" &&
(pos.source.path.endsWith("/xsbt/Compat.scala") || pos.source.path.endsWith("""\xsbt\Compat.scala""")) &&
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about converting this to URL etc to make / and \ checking more elegant, but in the end figured doing the String#endsWith twice would be cheaper.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also use java.io.File.pathSeparator in the cross-platform project setup.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean java.io.File.separator I assume. I'm not sure how Cygwin etc interacts on Windows in that regard.

@SethTisue SethTisue modified the milestones: 2.13.2, 2.13.1 Sep 10, 2019
@SethTisue SethTisue added the release-notes worth highlighting in next release notes label Sep 10, 2019
@SethTisue SethTisue merged commit ead235c into scala:2.13.x Sep 10, 2019
@eed3si9n eed3si9n deleted the wip/bridge-hack branch September 10, 2019 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes worth highlighting in next release notes
Projects
None yet
4 participants