diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-06-19 13:40:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-19 13:40:11 +0200 |
commit | aaf7bc0b948ee073934885f8240193a4ba2b3bb8 (patch) | |
tree | 37e189bfd35440ed88f84007d03e29b8f01088b0 /test/scaladoc/run/t8557.scala | |
parent | 91b6944480a3b37f1d62a8a2ed3c332ce02a835a (diff) | |
parent | c2c08a45a99f6ba48d8dc3b7c06d44196e50a2a2 (diff) | |
download | scala-aaf7bc0b948ee073934885f8240193a4ba2b3bb8.tar.gz scala-aaf7bc0b948ee073934885f8240193a4ba2b3bb8.tar.bz2 scala-aaf7bc0b948ee073934885f8240193a4ba2b3bb8.zip |
Merge pull request #5190 from szeiger/wip/validate-test-use-sbt
Use sbt for PR validation [ci: last-only]
Diffstat (limited to 'test/scaladoc/run/t8557.scala')
-rw-r--r-- | test/scaladoc/run/t8557.scala | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/test/scaladoc/run/t8557.scala b/test/scaladoc/run/t8557.scala index 451f004d7d..7876896bb7 100644 --- a/test/scaladoc/run/t8557.scala +++ b/test/scaladoc/run/t8557.scala @@ -1,3 +1,5 @@ +import java.net.URI + import scala.tools.nsc.doc.base._ import scala.tools.nsc.doc.model._ import scala.tools.partest.ScaladocModelTest @@ -15,10 +17,22 @@ object Test extends ScaladocModelTest { class A """ + def scalaURL = "http://www.scala-lang.org/api/current/" + // a non-canonical path to scala-library.jar should still work - // this is a bit fragile (depends on the current directory being the root of the repo ; - // ant & partest seem to do that properly) - def scaladocSettings = "-doc-external-doc build/pack/bin/../lib/scala-library.jar#http://www.scala-lang.org/api/current/" + override def scaladocSettings = { + val samplePath = getClass.getClassLoader.getResource("scala/Function1.class").getPath.replace('\\', '/') + val scalaLibPath = if(samplePath.contains("!")) { // in scala-library.jar + val scalaLibUri = samplePath.split("!")(0) + val p = new URI(scalaLibUri).getPath + // this is a bit fragile (depends on the scala library being in build/pack as produced by ant) + p.replace("/pack/lib/scala-library.jar", "/pack/bin/../lib/scala-library.jar") + } else { // individual class files on disk + val p = samplePath.dropRight("scala/Function1.class".length + 1) + p + "/.." + p.takeRight(p.length - p.lastIndexOf('/')) + } + s"-doc-external-doc $scalaLibPath#$scalaURL" + } def testModel(rootPackage: Package) = { // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s)) |