Skip to content

Commit 313d1a6

Browse files
VladUrechejsuereth
authored andcommitted
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?!? Conflicts: build.xml
1 parent 06765bf commit 313d1a6

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

build.xml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,21 @@ DOCUMENTATION
14681468
</uptodate>
14691469
</sequential>
14701470
</macrodef>
1471+
1472+
<!-- Set the github.amrom.workers.devmit scaladoc sources point to -->
1473+
<!-- For releases, look for the tag with the same name as the maven version -->
1474+
<condition property="scaladoc.git.commit" value="v${maven.version.number}">
1475+
<isset property="build.release"/>
1476+
</condition>
1477+
<!-- For snapshots, if we know the commit, point scaladoc to that particular commit instead of master -->
1478+
<condition property="scaladoc.git.commit" value="${git.commit.sha}">
1479+
<not><equals arg1="${git.commit.sha}" arg2="unknown"/></not>
1480+
</condition>
1481+
<!-- Fallback: point scaladoc to master -->
1482+
<property name="scaladoc.git.commit" value="master"/>
1483+
<!-- Compute the URL and show it -->
1484+
<property name="scaladoc.url" value="https://github.com/scala/scala/tree/${scaladoc.git.commit}/src"/>
1485+
<echo message="Scaladoc will point to ${scaladoc.url} for source files."/>
14711486
</target>
14721487

14731488
<target name="docs.pre-lib" depends="docs.start">
@@ -1489,7 +1504,7 @@ DOCUMENTATION
14891504
doctitle="Scala Standard Library"
14901505
docversion="${version.number}"
14911506
docfooter="epfl"
1492-
docsourceurl="https://lampsvn.epfl.ch/trac/scala/browser/scala/branches/2.9.x/src/€{FILE_PATH}.scala#L1"
1507+
docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1"
14931508
docUncompilable="${src.dir}/library-aux"
14941509
sourcepath="${src.dir}"
14951510
classpathref="pack.classpath"
@@ -1570,7 +1585,7 @@ DOCUMENTATION
15701585
destdir="${build-docs.dir}/compiler"
15711586
doctitle="Scala Compiler"
15721587
docversion="${version.number}"
1573-
docsourceurl="https://lampsvn.epfl.ch/trac/scala/browser/scala/branches/2.9.x/src/€{FILE_PATH}.scala#L1"
1588+
docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1"
15741589
sourcepath="${src.dir}"
15751590
classpathref="pack.classpath"
15761591
srcdir="${src.dir}/compiler">
@@ -1612,7 +1627,7 @@ DOCUMENTATION
16121627
destdir="${build-docs.dir}/scalap"
16131628
doctitle="Scalap"
16141629
docversion="${version.number}"
1615-
docsourceurl="https://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/€{FILE_PATH}.scala#L1"
1630+
docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1"
16161631
sourcepath="${src.dir}"
16171632
classpathref="pack.classpath"
16181633
srcdir="${src.dir}/scalap">

src/compiler/scala/tools/nsc/doc/html/page/Template.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage {
375375
case dtpl: DocTemplateEntity if (isSelf && dtpl.sourceUrl.isDefined && dtpl.inSource.isDefined && !isReduced) =>
376376
val (absFile, line) = dtpl.inSource.get
377377
<dt>Source</dt>
378-
<dd>{ <a href={ dtpl.sourceUrl.get.toString }>{ Text(absFile.file.getName) }</a> }</dd>
378+
<dd>{ <a href={ dtpl.sourceUrl.get.toString } target="_blank">{ Text(absFile.file.getName) }</a> }</dd>
379379
case _ => NodeSeq.Empty
380380
}
381381

src/library/scala/xml/factory/LoggedNodeFactory.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ object testLogged extends Application {
1818
with scala.util.logging.ConsoleLogger
1919
2020
Console.println("Start")
21-
val doc = x.load(new java.net.URL("http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk/build.xml"))
21+
val doc = x.load(new java.net.URL("http://example.com/file.xml"))
2222
Console.println("End")
2323
Console.println(doc)
2424
}

0 commit comments

Comments
 (0)