Skip to content

Make sbt aware of Dotty#2344

Merged
eed3si9n merged 1 commit intosbt:0.13from
smarter:0.13-dotty
Jan 4, 2016
Merged

Make sbt aware of Dotty#2344
eed3si9n merged 1 commit intosbt:0.13from
smarter:0.13-dotty

Conversation

@smarter
Copy link
Contributor

@smarter smarter commented Dec 30, 2015

This small set of changes, together with the compiler-bridge I wrote
(https://github.com/smarter/dotty-bridge) enables us to compile code
using Dotty in sbt, see https://github.com/smarter/dotty-example-project
for an example.

It'd be great if this could go in 0.13.10 as using a custom sbt is very cumbersome, let me know if there's anything I can do to help with that!

@lightbend-cla-validator

Hi @smarter,

Thank you for your contribution! We really value the time you've taken to put this together.

Before we proceed with reviewing this pull request, please sign the Typesafe Contributors License Agreement:

http://www.typesafe.com/contribute/cla

@eed3si9n eed3si9n added the ready label Dec 30, 2015
@typesafe-tools
Copy link

Can one of the admins verify this patch?

Copy link
Member

Choose a reason for hiding this comment

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

This is a breaking (bincompat) change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, will fix, I have no idea what is and isn't public API :). Is it okay if I push-force my branch or do you prefer code reviews to be addressed in separate commits?

Copy link
Member

Choose a reason for hiding this comment

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

Part of 1.0 is making that decision and enforcing it. In these 0.13 days, anything that can be accessed, is public :-/

It's not really been decided, but I'm personally happy with history-rewrites and force pushes.

@dwijnand
Copy link
Member

This is kind of exciting. I'm surprised it's such a small change.

@smarter
Copy link
Contributor Author

smarter commented Dec 31, 2015

This would have been much harder to get in 0.13 without #2197, so thank you @Duhemm :).

@SethTisue
Copy link
Member

perhaps instead of the isDotty hack, an actual SettingKey[Boolean] called isDotty?

@smarter
Copy link
Contributor Author

smarter commented Dec 31, 2015

A setting would be slightly annoying if you want your sbt build to support both Scala and Dotty, you'd have to do isDotty := scalaVersion.value.startsWith("0.") yourself, but I'm not opposed to it if people like this better.

@smarter
Copy link
Contributor Author

smarter commented Dec 31, 2015

...Unless the setting default value is scalaVersion.value.startsWith("0.") ? I could do this but I have no idea of the proper place to put this setting in the many dimensions of sbt.

@eed3si9n
Copy link
Member

Settings generally go into Keys.scala and Defaults.scala. Somewhere around here perhaps? https://github.com/sbt/sbt/blob/v0.13.9/main/src/main/scala/sbt/Defaults.scala#L245

This small set of changes, together with the compiler-bridge I wrote
(https://github.com/smarter/dotty-bridge) enables us to compile code
using Dotty in sbt, see https://github.com/smarter/dotty-example-project
for an example.
@smarter
Copy link
Contributor Author

smarter commented Jan 3, 2016

If I make isDotty a key then we need a way to access isDotty from various classes like RawCompiler, the obvious thing to do would be to add an isDotty field to the class ScalaInstance but this is tricky to do without breaking binary compatibility (I can't change the primary constructor of the class so I'd have to add a mutable field, ...). So I'd rather keep things as-is (no isDotty key) for now and revisit this for 1.0 when we'll break binary compatiblity. Anything else that needs to be done before this can be merged?

@eed3si9n
Copy link
Member

eed3si9n commented Jan 4, 2016

So I'd rather keep things as-is (no isDotty key) for now and revisit this for 1.0 when we'll break binary compatibility.

That is a very good point.

Anything else that needs to be done before this can be merged?

I think we're good here.

eed3si9n added a commit that referenced this pull request Jan 4, 2016
@eed3si9n eed3si9n merged commit f00f6fd into sbt:0.13 Jan 4, 2016
@eed3si9n eed3si9n removed the ready label Jan 4, 2016
@eed3si9n eed3si9n mentioned this pull request Jan 7, 2016
7 tasks
eed3si9n pushed a commit to eed3si9n/sbt that referenced this pull request Feb 26, 2016
This small set of changes, together with the compiler-bridge I wrote
(https://github.com/smarter/dotty-bridge) enables us to compile code
using Dotty in sbt, see https://github.com/smarter/dotty-example-project
for an example.

Partial forward port of sbt#2344.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants