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

Define valid package type for Scala.js and Scala Native #941

Merged
merged 1 commit into from
Apr 26, 2022

Conversation

lwronski
Copy link
Contributor

Accept valid package type for Scala.js and Scala.Native, in other case throws error.

For example following command should generate test.jar file:

scala-cli package --js --library test.scala

Closed #915

@lwronski lwronski force-pushed the valid-package-type branch 2 times, most recently from 460295f to cac4cc0 Compare April 26, 2022 11:22
@lwronski lwronski marked this pull request as ready for review April 26, 2022 11:25
@lwronski lwronski requested a review from Gedochao April 26, 2022 11:25
Copy link
Member

@romanowski romanowski left a comment

Choose a reason for hiding this comment

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

Shouldn't we add info in the documentation for each of those options that they will not work with for js or native?

Maybe we can also have more generic method of checking if given option does not conflict with other?

@lwronski
Copy link
Contributor Author

Shouldn't we add info in the documentation for each of those options that they will not work with for js or native?

Maybe we can also have more generic method of checking if given option does not conflict with other?

I created new issue to implement some global mechanism for option checking - #941 (review)

@romanowski romanowski merged commit 28732bc into VirtusLab:main Apr 26, 2022
for (basePackageType <- basePackageTypeOpt)
yield
if (validPackageScalaJS.contains(basePackageType)) basePackageType
else throw new MalformedCliInputError(
Copy link
Contributor

Choose a reason for hiding this comment

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

As much as possible, we shouldn't throw here, but rather try to make the exception be returned via the left side of the either. Thrown exceptions aren't reported as nicely as the ones we propagate via eithers.

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.

package --js --library (incorrectly) requires a main class to be present.
3 participants