-
Notifications
You must be signed in to change notification settings - Fork 143
Support links in using file directive (implements #1328) #3681
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
base: main
Are you sure you want to change the base?
Changes from all commits
a86f8ca
6a90821
84c042a
d29327e
0691f65
1964539
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package scala.build.errors | ||
|
||
import java.net.URI | ||
|
||
import scala.build.Position | ||
|
||
final class UsingFileFromUriError(uri: URI, positions: Seq[Position], cause: Throwable) | ||
extends BuildException( | ||
message = s"Error using file from $uri - ${cause.getLocalizedMessage}", | ||
positions = positions, | ||
cause = cause | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,6 +126,8 @@ Manually add sources to the project. Does not support chaining, sources are adde | |
#### Examples | ||
`//> using file utils.scala` | ||
|
||
`//> using file https://raw.githubusercontent.com/softwaremill/sttp/refs/heads/master/examples/src/main/scala/sttp/client4/examples/json/GetAndParseJsonCatsEffectCirce.scala` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Gedochao I think it would be nice to reference a file within There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean... dunno if it matters, as long as the example is useful, to be honest. 🤷 |
||
|
||
### Dependency | ||
|
||
Add dependencies | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I think it's accurate that
SharedOptions.coursierCache
should be used.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gedochao but
scala.cli.commands.shared.SharedOptions.coursierCache
is incli
module, while we're inbuild
here - so that definition is inaccessible (build doesn't depend on cli)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's why we haven't picked it up and left a todo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...well, yes, but
cli
depends onbuild
.so what I mean here is that the way to go would be to pass it all the way from
cli
toCrossSources
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you just leave a TODO, it's very likely to get forgotten.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you don't have time to fix it, please at least create a ticket for the follow-up and link it back in the code.