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

Support Scala Native 0.4.0 #1108

Merged
merged 13 commits into from
Jan 19, 2021
Merged

Conversation

lolgab
Copy link
Member

@lolgab lolgab commented Jan 12, 2021

  • Drop support for Scala Native 0.3
  • Remove Release ReleaseMode
  • Make nativeTarget Option[String] like upstream
  • Rewrote tests to JUnit. Since Scala Native ships with JUnit and Utest
    depends on Mill itself we can't use it to test Mill.
    JUnit is the official testing framework and stresses all the features
    that were tested with Utest and Scalatest
  • Testing Scala Native for Scala 2.11, 2.12 and 2.13
  • Move worker again into the 0.4 folder. It was moved outside using
    def millSourcePath = super.millSourcePath / os.up to reuse the code
    between worker 0.3 and 0.4. Since now we're dropping 0.3 it
    doesn't make sense anymore to do this, and we can be prepared for a
    future 0.5

- Drop support for Scala Native 0.3
- Remove `Release` ReleaseMode
- Make `nativeTarget` `Option[String]` like upstream
- Rewrote tests to JUnit. Since Scala Native ships with JUnit and Utest
  depends on Mill itself we can't use it to test Mill.
  JUnit is the official testing framework and stresses all the features
  that were tested with Utest and Scalatest
- Testing Scala Native for Scala 2.11, 2.12 and 2.13
- Move worker again into the `0.4` folder. It was moved outside using
  `def millSourcePath = super.millSourcePath / os.up` to reuse the code
  between worker `0.3` and `0.4`. Since now we're dropping `0.3` it
  doesn't make sense anymore to do this, and we can be prepared for a
  future 0.5
Copy link
Member

@lefou lefou left a comment

Choose a reason for hiding this comment

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

Thanks for keeping Scala Native support up-to-date (and ahead)! I had a quick look at it. Looks good so far. I added some comments. And we still need to wait for 0.4.0 release to really test it.

Comment on lines 70 to 77
override def sources = T.sources{ millSourcePath / "src" / "no-tests" }
def testFrameworks = Seq("com.novocode.junit.JUnitFramework")
override def ivyDeps = Agg(
ivy"org.scala-native::junit-runtime::$sNativeVersion"
)
override def compileIvyDeps = Agg(
ivy"org.scala-native:::junit-plugin:$sNativeVersion"
)
Copy link
Member

Choose a reason for hiding this comment

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

This looks like a repetitiion of the JUnit-variant. Maybe, we can have it in a shared trait?

Copy link
Member Author

Choose a reason for hiding this comment

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

Extracted on a separate trait ✅

@@ -0,0 +1,14 @@
package mill.scalanativelib.api;
Copy link
Member

Choose a reason for hiding this comment

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

This source files should be located in a directory structure reflecting the package name. The Java Standard isn't as flexible as the Scala one. Beside the fact that it just works with zinc, it won't for pure Java compiler.

Same, for all other Java files.

Copy link
Member Author

Choose a reason for hiding this comment

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

@lefou You're right! Moved them ✅

- Move Java file to a directory structure based on package
- Fix not compiling tests
- Extract JUnit test setting in a trait in tests
- Remove deprecated nativeLib config from worker
  It is still in ScalaNativeModule because bloop depends on it.
  I will remove it when Bloop will be updated to Scala Native 0.4.0 too
@lolgab
Copy link
Member Author

lolgab commented Jan 13, 2021

@lefou I tried in every way on earth to make the Scala Native JUnit framework to work on mill but I can't make it work.
I tried with utest (after publishing an updated version locally) and everything works fine.
If you agree I would change the test back to utest releasing a version for Scala Native 0.4.0 from my fork to bootstrap the test. When Mill is released I can update utest and move the test to use the official one from com.lihaoyi.
What do you think?

@lolgab lolgab changed the title [Blocked by Scala Native Release] Support Scala Native 0.4.0 Support Scala Native 0.4.0 Jan 19, 2021
@lolgab lolgab marked this pull request as ready for review January 19, 2021 19:25
@lolgab lolgab force-pushed the update-scala-native-0.4.0 branch from 36b33e4 to 36067fe Compare January 19, 2021 19:30
@lefou
Copy link
Member

lefou commented Jan 19, 2021

@lefou I tried in every way on earth to make the Scala Native JUnit framework to work on mill but I can't make it work.
I tried with utest (after publishing an updated version locally) and everything works fine.
If you agree I would change the test back to utest releasing a version for Scala Native 0.4.0 from my fork to bootstrap the test. When Mill is released I can update utest and move the test to use the official one from com.lihaoyi.
What do you think?

@lolgab Makes sense. But I have no idea how long until a newer utest is released. Did you requested your changes for merge?

Let me restart Github tests first. If everything is green, we can merge to get a new snapshot release.

@sideeffffect
Copy link
Contributor

Build is green 🎉

@lolgab
Copy link
Member Author

lolgab commented Jan 19, 2021

@lefou I opened a PR here but it is red because it needs this mill PR to work 😄.
Circular dependencies 🤷‍♂️.
If you merge this I can start updating utest, change it back and updating all the other libs that make the Scala Native ecosystem.

@lefou lefou merged commit 82ea873 into com-lihaoyi:master Jan 19, 2021
@lefou
Copy link
Member

lefou commented Jan 19, 2021

Thank you!

@lefou lefou added this to the after 0.9.4 milestone Jan 19, 2021
@lolgab lolgab deleted the update-scala-native-0.4.0 branch January 19, 2021 22:26
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.

3 participants