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

Scala plugin's scaladoc task broken with Scala 2.13.0 #9855

Closed
dubinsky opened this issue Jul 3, 2019 · 8 comments
Closed

Scala plugin's scaladoc task broken with Scala 2.13.0 #9855

dubinsky opened this issue Jul 3, 2019 · 8 comments
Assignees
Labels
Milestone

Comments

@dubinsky
Copy link

dubinsky commented Jul 3, 2019

Expected Behavior

When gradle scaladoc is run, Scaladoc should be generated.

Current Behavior

When using Scala 2.13.0:

  Execution failed for task ':scaladoc'.
  java.net.MalformedURLException

Context

When publishing to JCenter, I include Scaladoc jar - which is impossible to generate with Scala 2.13.

Steps to Reproduce

In the attached project gradle-scaladoc-bug.zip

  $ gradle scaladoc -PscalaVersion=2.13.0

Reason:
https://github.com/gradle/gradle/blob/master/subprojects/scala/src/main/java/org/gradle/api/internal/tasks/scala/AntScalaDoc.java#L53 assumes presence of scala/tools/ant/antlib.xml, which was removed: scala/scala#6255; see also https://users.scala-lang.org/t/scala-2-13-0-ant-support/4694/11

Your Environment

Build scan URL: https://scans.gradle.com/s/7wmsskmoua3uu

@barrybecker4
Copy link

barrybecker4 commented Sep 29, 2019

I have encountered the same problem using Scale 13.1 and using either gradle 4.10.2 or 5.6.2.

@ljacomet
Copy link
Member

Gradle 6.0 will have improvements, including better support of Scala 2.13.

When 6.0 RC1 is out, could you test again?

@dubinsky
Copy link
Author

@ljacomet :

Gradle 6.0 will have improvements, including better support of Scala 2.13.
When 6.0 RC1 is out, could you test again?

I did; it breaks the same way. "Better support for Scala 2.13" is not going to fix this issue; Gradle Scala plugin needs to be reworked to NOT use scala/tools/ant/antlib.xml (removed in Scala 2.13.0) to generate Scaladoc.

@big-guy big-guy added this to the 6.0 RC2 milestone Oct 25, 2019
@jjohannes jjohannes modified the milestones: 6.0 RC2, 6.1, 6.1 RC1 Oct 29, 2019
nilskp added a commit to hazelcast/hazelcast-scala that referenced this issue Oct 29, 2019
Broken for 2.13. Re-instate when fixed:
gradle/gradle#9855
@lacasseio
Copy link
Contributor

Scala 2.13 indeed broke everyone by removing the Ant support. We looked into fixing the issue by executing the work directly inside a worker action (https://github.com/gradle/gradle/tree/lacasseio/scala-doc-fix-for-2.13) however we hit an issue with the classloader which makes it impossible to run the action hence doesn't fix the issue.

At the moment, it would be recommended to build https://github.com/cigaly/scala-ant and adding that JAR to the ScalaDoc task's scalaClasspath property. We didn't confirm nor wrote a sample for this workaround, however, it should be the path forward to unblock users immediately.

We will look into the classloader issue with the worker API to see what needs to be fixed so we can move forward with a proper fix to handle 2.13 breakage.

@dubinsky
Copy link
Author

We will look into the classloader issue with the worker API to see what needs to be fixed so we can move forward with a proper fix to handle 2.13 breakage.

Thank you!!!

@big-guy big-guy modified the milestones: 6.1 RC1, 6.2 RC1 Dec 9, 2019
@SimY4
Copy link

SimY4 commented Jan 17, 2020

Just if anyone is interested. Minimal gradle build configuration that worked for me:

configurations {
    scaladocExtras
}

dependencies {
    scaladocExtras 'org.scala-lang:scala-library:2.13.1'
    scaladocExtras 'org.scala-lang:scala-compiler:2.13.1'
    scaladocExtras 'org.scala-lang:scala-reflect:2.13.1'
    scaladocExtras 'org.apache.ant:ant:1.9.14'
}

scaladoc {
    scalaClasspath = configurations.scaladocExtras + files("lib/scala-ant-2.13.1.jar")
}

@barrybecker4
Copy link

Just to be clear, it looks like this should be fixed in release 6.2 of Gradle. Please correct me if that is not correct.

big-guy added a commit that referenced this issue Jan 30, 2020
@big-guy
Copy link
Member

big-guy commented Jan 31, 2020

Yep, this is fixed in release and will be in 6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants