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

Add library-friendly entrypoint for sbt.ForkMain #5315

Merged
merged 1 commit into from
Dec 17, 2019

Conversation

olafurpg
Copy link
Member

Previously, it was not possible to use sbt.ForkMain as a library since

  • it called System.exit, shutting down the library client JVM process.
  • it assumed that it was always running in the same classloader as where
    the test suites it was running causing "class not found: my.test.Suite"
    if the ForkMain class lives in a classloader above the test suite
    classes.

This commit adds a new main(Array[String],ClassLoader]) entrypoint
that allows clients to call ForkMain as a library.

Previously, it was not possible to use `sbt.ForkMain` as a library since
* it called `System.exit`, shutting down the library client JVM process.
* it assumed that it was always running in the same classloader as where
  the test suites it was running causing "class not found: my.test.Suite"
  if the `ForkMain` class lives in a classloader above the test suite
  classes.
This commit adds a new `main(Array[String],ClassLoader])` entrypoint
that allows clients to call `ForkMain` as a library.
@olafurpg
Copy link
Member Author

I don't know if you're open to adding a library endpoint for sbt.ForkMain but I thought I would at least give it a try. The alternative for us to to maintain a fork of the test-agent project, which I'm fine with doing as well.

@eed3si9n
Copy link
Member

The travis CI failure on actions/doc-scala-instance seems unrelated since I am seeing that on other PRs too.

Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

LGTM

@eed3si9n eed3si9n merged commit 215b16c into sbt:develop Dec 17, 2019
@olafurpg
Copy link
Member Author

Thank you for merging! I appreciate it 😁

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.

2 participants