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

Fix - use resourcesDir in package command #519

Merged
merged 7 commits into from
Jan 10, 2022

Conversation

lwronski
Copy link
Contributor

@lwronski lwronski commented Dec 27, 2021

Due to a bug in the bloop #1631, scala-cli have to copy resources to classesDir.

I also added exporting resources as unmanagedResourceDirectories in Sbt.

@lwronski lwronski force-pushed the package-resource-dir branch 3 times, most recently from 192b8c4 to 2c0a2de Compare December 29, 2021 09:06
@lwronski lwronski marked this pull request as ready for review December 29, 2021 09:14
modules/build/src/main/scala/scala/build/Build.scala Outdated Show resolved Hide resolved
modules/build/src/main/scala/scala/build/Build.scala Outdated Show resolved Hide resolved
modules/build/src/main/scala/scala/build/Build.scala Outdated Show resolved Hide resolved
modules/build/src/main/scala/scala/build/Build.scala Outdated Show resolved Hide resolved
if (os.exists(path))
Right(path)
else
Left(new NoResourcePathFoundError(path))
Copy link
Contributor

Choose a reason for hiding this comment

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

For later: maybe this could be reported as a warning instead.

path
else {
System.err.println(s"Provided resource directory path doesn't exist: $path")
sys.exit(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really want to do that? This should be reported as an error later on by the NoResourcePathFoundError above, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will not be reported as the error handling above only applies to directives.

.sequence
.map(_.flatten)
}
val mainClassOpt = preprocessedSources.flatMap(_.mainClassOpt.toSeq).headOption
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It wasn't' necessary to run directive processing for mainClass because it was done before in preprocessedSources.

I had a problem that the warning logging for the main class was printed twice.

@lwronski lwronski requested review from alexarchambault and removed request for alexarchambault December 29, 2021 14:41
@lwronski lwronski force-pushed the package-resource-dir branch 2 times, most recently from 059e03e to a4e2044 Compare December 30, 2021 10:52
@lwronski lwronski merged commit 7e3f9af into VirtusLab:master Jan 10, 2022
@lwronski lwronski linked an issue Jan 10, 2022 that may be closed by this pull request
@lwronski lwronski deleted the package-resource-dir branch January 26, 2022 14:13
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.

ScalaCLI resourceDir doesn't work with package
2 participants