diff options
author | Vlad Ureche <vlad.ureche@gmail.com> | 2012-03-25 03:27:51 +0200 |
---|---|---|
committer | Vlad Ureche <vlad.ureche@gmail.com> | 2012-03-25 03:27:51 +0200 |
commit | 0e15be42747a4a36983dcc292b762df6aa2ca91d (patch) | |
tree | 9698264d6eccc4b8130d402fd7bd086fa55d0bb9 | |
parent | c0e9e75becead51d4317c5100f0b33eff62b6daa (diff) | |
download | scala-0e15be42747a4a36983dcc292b762df6aa2ca91d.tar.gz scala-0e15be42747a4a36983dcc292b762df6aa2ca91d.tar.bz2 scala-0e15be42747a4a36983dcc292b762df6aa2ca91d.zip |
Scaladoc is now pointing to sources in github
For snapshots, it points to the exact commit, for releases it points to
the tag ("v" + maven version). The link now opens in a different tab,
as opening in the same frame is not compatible with github (the page
doesn't load for some reason).
Left the repo url in test/review untouched because it points to the
root of all LAMP repos. But... is anyone still using that script?!?
-rw-r--r-- | build.xml | 21 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/html/page/Template.scala | 2 | ||||
-rw-r--r-- | src/library/scala/xml/factory/LoggedNodeFactory.scala | 2 |
3 files changed, 20 insertions, 5 deletions
@@ -1584,6 +1584,21 @@ DOCUMENTATION </uptodate> </sequential> </macrodef> + + <!-- Set the github commit scaladoc sources point to --> + <!-- For releases, look for the tag with the same name as the maven version --> + <condition property="scaladoc.git.commit" value="v${maven.version.number}"> + <isset property="build.release"/> + </condition> + <!-- For snapshots, if we know the commit, point scaladoc to that particular commit instead of master --> + <condition property="scaladoc.git.commit" value="${git.commit.sha}"> + <not><equals arg1="${git.commit.sha}" arg2="unknown"/></not> + </condition> + <!-- Fallback: point scaladoc to master --> + <property name="scaladoc.git.commit" value="master"/> + <!-- Compute the URL and show it --> + <property name="scaladoc.url" value="https://github.com/scala/scala/tree/${scaladoc.git.commit}/src"/> + <echo message="Scaladoc will point to ${scaladoc.url} for source files."/> </target> <target name="docs.pre-lib" depends="docs.start"> @@ -1605,7 +1620,7 @@ DOCUMENTATION doctitle="Scala Standard Library API (Scaladoc)" docversion="${version.number}" docfooter="epfl" - docsourceurl="https://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/€{FILE_PATH}.scala#L1" + docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1" docUncompilable="${src.dir}/library-aux" sourcepath="${src.dir}" classpathref="pack.classpath" @@ -1686,7 +1701,7 @@ DOCUMENTATION destdir="${build-docs.dir}/compiler" doctitle="Scala Compiler" docversion="${version.number}" - docsourceurl="https://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/€{FILE_PATH}.scala#L1" + docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1" sourcepath="${src.dir}" classpathref="pack.classpath" srcdir="${src.dir}/compiler" @@ -1731,7 +1746,7 @@ DOCUMENTATION destdir="${build-docs.dir}/scalap" doctitle="Scalap" docversion="${version.number}" - docsourceurl="https://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/€{FILE_PATH}.scala#L1" + docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1" sourcepath="${src.dir}" classpathref="pack.classpath" srcdir="${src.dir}/scalap" diff --git a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala index 0c9c88c0f5..c8c5f1ec11 100644 --- a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala +++ b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala @@ -389,7 +389,7 @@ class Template(universe: doc.Universe, tpl: DocTemplateEntity) extends HtmlPage case dtpl: DocTemplateEntity if (isSelf && dtpl.sourceUrl.isDefined && dtpl.inSource.isDefined && !isReduced) => val (absFile, line) = dtpl.inSource.get <dt>Source</dt> - <dd>{ <a href={ dtpl.sourceUrl.get.toString }>{ Text(absFile.file.getName) }</a> }</dd> + <dd>{ <a href={ dtpl.sourceUrl.get.toString } target="_blank">{ Text(absFile.file.getName) }</a> }</dd> case _ => NodeSeq.Empty } diff --git a/src/library/scala/xml/factory/LoggedNodeFactory.scala b/src/library/scala/xml/factory/LoggedNodeFactory.scala index c15a9ebe7b..abf8f97f03 100644 --- a/src/library/scala/xml/factory/LoggedNodeFactory.scala +++ b/src/library/scala/xml/factory/LoggedNodeFactory.scala @@ -18,7 +18,7 @@ object testLogged extends Application { with scala.util.logging.ConsoleLogger Console.println("Start") - val doc = x.load(new java.net.URL("http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk/build.xml")) + val doc = x.load(new java.net.URL("http://example.com/file.xml")) Console.println("End") Console.println(doc) } |