-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
Allow custom sources for Javadoc and Scaladoc #1385
Conversation
Signed-off-by: Iltotore <[email protected]>
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.
I'm not that happy with the name processedDocSources
, as I immediately asked myself what "processed" could mean. Why not just docSources
? Some scaladoc should indicate the purpose of the new target.
Also, one motivation to customize the docSources could be to adapt the set of sources files, so it might be probably worth a though, if we could feed files instead of dirs.
It looks like some unrelated formatting changes went into this PR.
Yes, I just noticed my IDE reformatted the code. If needed, I can undo this reformat.
I also thook about docSources but this method already exists and it isn't the same feature. According to scaladocs, What if we have, for some obscure reason, a tasty file and we just want to have it in our doc without processing it ? |
That would be nice. If you enable scalafmt in your IDE, it should automatically use the
I must have overlooked the existing but quite new Besides, the "processed" prefix is misleading, as these sources are going to be processed by the doc tool. |
That's what I did. I will push the code formatted using scalafmt
Do you want me to commit this change then, use |
Yes, please! To avoid conflicts with users who used that target to provide static resources, we should probable output a warning in case the outcome of |
… now docResources) Signed-off-by: Iltotore <[email protected]>
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.
Earlier we talked about reformatting modified files using ScalaFMT but it indicated that they're already formatted correctly.
Once this change is approved, I will add the suggested warning. |
Scalafmt isn't going to remove new lines which you introduced earlier. |
Signed-off-by: Iltotore <[email protected]>
Signed-off-by: Iltotore <[email protected]>
Signed-off-by: Iltotore <[email protected]>
Signed-off-by: Iltotore <[email protected]>
Co-authored-by: Tobias Roeser <[email protected]>
Signed-off-by: Iltotore <[email protected]>
Signed-off-by: Iltotore <[email protected]>
This last change works for Scala 3 and Scala 3 Milestone. Haven't tested with Scala 2 yet but it should as I simply applied the same changes (except for tasty files filter) and it also uses EDIT: Seems to work in Scala 2.x. |
There are still failing tests related to scaladoc. |
Actually, I don't really understand where this error comes from:
Seems like an encoding error but if I'm not wrong, I didn't change something about file encoding. Failing tests are related to pre-release Dotty. I'll check the code tomorrow. EDIT: After some researches, the compiled classes already have illegal characters once compiled. |
scalalib/src/ScalaModule.scala
Outdated
@@ -185,6 +201,8 @@ trait ScalaModule extends JavaModule { outer => | |||
) | |||
} | |||
|
|||
override def docSources: Sources = T.sources(compile().classes.path) |
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.
This seem not correct for early dotty / scala 3 versions (isDotty(scalaVersion()) || isScala3Milestone(scalaVersion())
) which use dottydoc and consumes scala source files.
Only Scala 3 releases (isScala3(scalaVersion())
) use scaladoc 3 tool, which consumes tasty files.
The last commit should fix this issue. Tests passed in local. |
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.
Your PR looks good now. There are still some newly introduced but unwanted newlines. Can you please remove these, and we are good to go.
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.
Looks good to me. Thank you!
This pull request allows the user to define custom sources for Javadoc/Scaladoc though
processedDocSources
:JavaModule#docJar
now usesprocessedDocSources
instead ofallSources
ScalaModule#docJar
now usesprocessedDocSources
instead ofos.walk(compile().classes.path).map(PathRef(_))
Fixes #1384 .