diff options
author | michelou <michelou@epfl.ch> | 2006-06-12 14:18:13 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2006-06-12 14:18:13 +0000 |
commit | 1c43cfe216a0d759568a964a16345ea773f32211 (patch) | |
tree | cc9c93e37b6817c14e1334d910b9012e408c85b8 | |
parent | de843e4a74769be951e28d7f744dc812e3eed83e (diff) | |
download | scala-1c43cfe216a0d759568a964a16345ea773f32211.tar.gz scala-1c43cfe216a0d759568a964a16345ea773f32211.tar.bz2 scala-1c43cfe216a0d759568a964a16345ea773f32211.zip |
moved docs/man/src to src/manual and updated bu...
moved docs/man/src to src/manual and updated build.xml
-rw-r--r-- | build.xml | 60 | ||||
-rw-r--r-- | docs/man/build.xml | 108 | ||||
-rw-r--r-- | src/manual/scala/man1/Command.scala (renamed from docs/man/src/man/man1/Command.scala) | 15 | ||||
-rw-r--r-- | src/manual/scala/man1/sbaz.scala (renamed from docs/man/src/man/man1/sbaz.scala) | 6 | ||||
-rw-r--r-- | src/manual/scala/man1/scala.scala (renamed from docs/man/src/man/man1/scala.scala) | 10 | ||||
-rw-r--r-- | src/manual/scala/man1/scalac.scala (renamed from docs/man/src/man/man1/scalac.scala) | 10 | ||||
-rw-r--r-- | src/manual/scala/man1/scaladoc.scala (renamed from docs/man/src/man/man1/scaladoc.scala) | 8 | ||||
-rw-r--r-- | src/manual/scala/man1/scalaint.scala (renamed from docs/man/src/man/man1/scalaint.scala) | 8 | ||||
-rw-r--r-- | src/manual/scala/man1/scalap.scala (renamed from docs/man/src/man/man1/scalap.scala) | 8 | ||||
-rw-r--r-- | src/manual/scala/man1/scalascript.scala (renamed from docs/man/src/man/man1/scalascript.scala) | 8 | ||||
-rw-r--r-- | src/manual/scala/tools/docutil/EmitHtml.scala (renamed from docs/man/src/man/EmitHtml.scala) | 10 | ||||
-rw-r--r-- | src/manual/scala/tools/docutil/EmitManPage.scala (renamed from docs/man/src/man/EmitManPage.scala) | 10 | ||||
-rw-r--r-- | src/manual/scala/tools/docutil/ManPage.scala (renamed from docs/man/src/man/ManPage.scala) | 4 | ||||
-rw-r--r-- | src/manual/scala/tools/docutil/resources/css/style.css (renamed from docs/man/src/css/style.css) | 0 | ||||
-rw-r--r-- | src/manual/scala/tools/docutil/resources/images/external.gif (renamed from docs/man/src/images/external.gif) | bin | 289 -> 289 bytes | |||
-rw-r--r-- | src/manual/scala/tools/docutil/resources/images/scala_logo.png (renamed from docs/man/src/images/scala_logo.png) | bin | 4751 -> 4751 bytes | |||
-rw-r--r-- | src/manual/scala/tools/docutil/resources/index.html (renamed from docs/man/src/index.html) | 0 |
17 files changed, 106 insertions, 159 deletions
@@ -47,6 +47,7 @@ PROPERTIES <property name="strap.dir" value="${build.dir}/strap"/> <property name="api-lib.dir" value="${build.dir}/api-library"/> <property name="api-comp.dir" value="${build.dir}/api-compiler"/> + <property name="tooldocs.dir" value="${build.dir}/tooldocs"/> <property name="examples.dir" value="${build.dir}/examples"/> <!-- Sets location and structure of the distribution --> <property name="dist.dir" value="${basedir}/dists"/> @@ -700,6 +701,57 @@ DOCUMENTATION </quickdoc> </target> + <target name="docs.manual" depends="setup.quick" + description="Generated the manual for the Scala tools"> + <mkdir dir="${tooldocs.dir}/classes"/> + <path id="manual.classpath"> + <pathelement location="${quick.dir}/lib/library"/> + <pathelement location="${tooldocs.dir}/classes"/> + </path> + <quick + srcdir="${src.dir}/manual" + destdir="${tooldocs.dir}/classes" + classpathref="manual.classpath"> + <include name="**/*.scala"/> + </quick> + <emit command="sbaz"/> + <emit command="scala"/> + <emit command="scalac"/> + <emit command="scaladoc"/> + <emit command="scalaint"/> + <emit command="scalap"/> + <emit command="scalascript"/> + <fixcrlf srcdir="${tooldocs.dir}" eol="unix" includes="**/*.1"/> + <copy todir="${tooldocs.dir}"> + <fileset dir="${src.dir}/manual/scala/tools/docutil/resources"> + <include name="**/*.html"/> + <include name="**/*.css"/> + <include name="**/*.gif"/> + <include name="**/*.png"/> + </fileset> + </copy> + </target> + + <macrodef name="emit"> + <attribute name="command"/> + <sequential> + <java classname="scala.tools.docutil.EmitHtml" + output="${tooldocs.dir}/@{command}.html" + classpathref="manual.classpath" + fork="true" logError="yes" + > + <arg value="scala.man1.@{command}"/> + </java> + <java classname="scala.tools.docutil.EmitManPage" + output="${tooldocs.dir}/@{command}.1" + classpathref="manual.classpath" + fork="true" logError="yes" + > + <arg value="scala.man1.@{command}"/> + </java> + </sequential> + </macrodef> + <!-- =========================================================================== GENERATES A DISTRIBUTION ============================================================================ --> @@ -741,7 +793,7 @@ GENERATES A DISTRIBUTION description="Packs a distribution for SBaz and ZIP/TAR"/> <target name="build.dist" - depends="test,docs" + depends="test,docs,docs.manual" description="Creates the latest Scala distribution"> <property name="dist.current.dir" value="${dist.dir}/scala-${version.number}"/> @@ -788,18 +840,16 @@ GENERATES A DISTRIBUTION <copy todir="${dist.current.dir}/doc/scala/examples"> <fileset dir="${docs.dir}/examples"/> </copy> - <ant dir="${docs.dir}/man" target="dist" inheritAll="false"/> <copy todir="${dist.current.dir}/man"> - <fileset dir="${docs.dir}/man/dists" includes="**/*.1"/> + <fileset dir="${tooldocs.dir}" includes="**/*.1"/> </copy> <copy todir="${dist.current.dir}/doc/scala/tools"> - <fileset dir="${docs.dir}/man/src"> + <fileset dir="${tooldocs.dir}"> <include name="**/*.html"/> <include name="**/*.css"/> <include name="**/*.gif"/> <include name="**/*.png"/> </fileset> - <fileset dir="${docs.dir}/man/dists" includes="**/*.html"/> </copy> <!-- Recreate the 'latest' link to point to this distribution --> <if><isset property="os.win"/> diff --git a/docs/man/build.xml b/docs/man/build.xml deleted file mode 100644 index ef7a3ababa..0000000000 --- a/docs/man/build.xml +++ /dev/null @@ -1,108 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- $Id$ --> - -<project name="scala-manpages" default="build"> - - <property environment="env"/> - <property file="${basedir}/build.properties"/> - - <property name="scala.lib.dir" value="../../lib"/> - <property name="scala-library.jar" value="${scala.lib.dir}/scala-library.jar"/> - <property name="scala-compiler.jar" value="${scala.lib.dir}/scala-compiler.jar"/> - - <property name="src.dir" value="${basedir}/src"/> - <property name="build.dir" value="${basedir}/classes"/> - <property name="dist.dir" value="${basedir}/dists"/> - - <target name="init"> - <echo level="verbose">scala.lib.dir=${scala.lib.dir}</echo> - <fail message="A required Scala library is missing."> - <condition><not><and> - <available file="${scala-library.jar}"/> - <available file="${scala-compiler.jar}"/> - </and></not></condition> - </fail> - <path id="scala.classpath"> - <pathelement location="${scala-library.jar}"/> - <pathelement location="${scala-compiler.jar}"/> - </path> - <taskdef - name="scalac" - classname="scala.tools.ant.Scalac" - classpathref="scala.classpath" - /> - <path id="build.classpath"> - <pathelement location="${scala-library.jar}"/> - <pathelement location="${build.dir}"/> - </path> - </target> - - <target name="build" depends="init"> - <mkdir dir="${build.dir}"/> - <scalac - srcdir="${src.dir}" - destdir="${build.dir}" - classpathref="build.classpath" - /> - </target> - - <target name="dist" depends="build"> - <mkdir dir="${dist.dir}"/> - <emit command="sbaz"/> - <emit command="scala"/> - <emit command="scalac"/> - <emit command="scaladoc"/> - <emit command="scalaint"/> - <emit command="scalap"/> - <emit command="scalascript"/> - <fixcrlf srcdir="${dist.dir}" eol="unix" includes="**/*.1"/> - <copy todir="${dist.dir}"> - <fileset dir="${src.dir}"> - <include name="**/*.html"/> - <include name="**/*.css"/> - <include name="**/*.gif"/> - <include name="**/*.png"/> - </fileset> - </copy> - </target> - - <macrodef name="emit"> - <attribute name="command"/> - <sequential> - <java classname="man.EmitHtml" - output="${dist.dir}/@{command}.html" - classpathref="build.classpath" - fork="true" logError="yes" - > - <arg value="@{command}"/> - </java> - <java classname="man.EmitManPage" - output="${dist.dir}/@{command}.1" - classpathref="build.classpath" - logError="yes" fork="true" - > - <arg value="@{command}"/> - </java> - </sequential> - </macrodef> - - <macrodef name="remove"> - <attribute name="dir"/> - <sequential> - <delete dir="@{dir}" - includeemptydirs="yes" - quiet="yes" - failonerror="no"/> - </sequential> - </macrodef> - - <target name="clean"> - <remove dir="${build.dir}"/> - </target> - - <target name="clean.all"> - <remove dir="${build.dir}"/> - <remove dir="${dist.dir}"/> - </target> - -</project> diff --git a/docs/man/src/man/man1/Command.scala b/src/manual/scala/man1/Command.scala index 49c79e6f66..23f951354d 100644 --- a/docs/man/src/man/man1/Command.scala +++ b/src/manual/scala/man1/Command.scala @@ -2,15 +2,15 @@ * Copyright 2005-2006 LAMP/EPFL * @author Stephane Micheloud */ -//$Id$ +//$Id: $ -package man.man1 +package scala.man1 trait Command { - import ManPage._ + import _root_.scala.tools.docutil.ManPage._ - protected val cn: String - val command = cn.substring(cn.lastIndexOf(".") + 1, cn.length() - 1) + protected def cn: String + def command = cn.substring(cn.lastIndexOf(".") + 1, cn.length() - 1) protected def MBold(contents: AbstractText) = Mono(Bold(contents)) protected def MItalic(contents: AbstractText) = Mono(Italic(contents)) @@ -48,5 +48,10 @@ trait Command { "Report bugs to " & Mono("<scala@listes.epfl.ch>") & ".") + //private val df = new java.text.SimpleDateFormat("MMM d, yyyy") + //private val rightNow = new java.util.Date() + + def lastModified: String = "June 8, 2006" // df.format(rightNow) + def manpage: Document } diff --git a/docs/man/src/man/man1/sbaz.scala b/src/manual/scala/man1/sbaz.scala index 6095b71290..f9d12ecc97 100644 --- a/docs/man/src/man/man1/sbaz.scala +++ b/src/manual/scala/man1/sbaz.scala @@ -2,12 +2,12 @@ * Copyright 2005-2006 LAMP/EPFL * @author Stephane Micheloud */ -//$Id$ +//$Id: $ -package man.man1 +package scala.man1 object sbaz extends Command { - import ManPage._ + import _root_.scala.tools.docutil.ManPage._ protected val cn = new Error().getStackTrace()(0).getClassName() diff --git a/docs/man/src/man/man1/scala.scala b/src/manual/scala/man1/scala.scala index 0ed763fb59..827bd09cb2 100644 --- a/docs/man/src/man/man1/scala.scala +++ b/src/manual/scala/man1/scala.scala @@ -2,14 +2,14 @@ * Copyright 2005-2006 LAMP/EPFL * @author Stephane Micheloud */ -//$Id$ +//$Id: $ -package man.man1 +package scala.man1 object scala extends Command { - import ManPage._ + import _root_.scala.tools.docutil.ManPage._ - protected val cn = new Error().getStackTrace()(0).getClassName() + protected def cn = new Error().getStackTrace()(0).getClassName() val name = Section("NAME", @@ -127,7 +127,7 @@ object scala extends Command { def manpage = new Document { title = command - date = "June 8, 2006" + date = lastModified author = "Stephane Micheloud" version = "0.2" sections = List( diff --git a/docs/man/src/man/man1/scalac.scala b/src/manual/scala/man1/scalac.scala index 5e22d4929d..7931b18d21 100644 --- a/docs/man/src/man/man1/scalac.scala +++ b/src/manual/scala/man1/scalac.scala @@ -2,14 +2,14 @@ * Copyright 2005-2006 LAMP/EPFL * @author Stephane Micheloud */ -//$Id$ +//$Id: $ -package man.man1 +package scala.man1 object scalac extends Command { - import ManPage._ + import _root_.scala.tools.docutil.ManPage._ - protected val cn = new Error().getStackTrace()(0).getClassName() + protected def cn = new Error().getStackTrace()(0).getClassName() val name = Section("NAME", @@ -296,7 +296,7 @@ object scalac extends Command { def manpage = new Document { title = command - date = "June 8, 2006" + date = lastModified // e.g. "June 8, 2006" author = "Stephane Micheloud" version = "0.2" sections = List( diff --git a/docs/man/src/man/man1/scaladoc.scala b/src/manual/scala/man1/scaladoc.scala index da333a88c4..c0454b06fc 100644 --- a/docs/man/src/man/man1/scaladoc.scala +++ b/src/manual/scala/man1/scaladoc.scala @@ -2,14 +2,14 @@ * Copyright 2005-2006 LAMP/EPFL * @author Stephane Micheloud */ -//$Id$ +//$Id: $ -package man.man1 +package scala.man1 object scaladoc extends Command { - import ManPage._ + import _root_.scala.tools.docutil.ManPage._ - protected val cn = new Error().getStackTrace()(0).getClassName() + protected def cn = new Error().getStackTrace()(0).getClassName() val name = Section("NAME", diff --git a/docs/man/src/man/man1/scalaint.scala b/src/manual/scala/man1/scalaint.scala index bc3e18866f..08dcfe6c9b 100644 --- a/docs/man/src/man/man1/scalaint.scala +++ b/src/manual/scala/man1/scalaint.scala @@ -2,14 +2,14 @@ * Copyright 2005-2006 LAMP/EPFL * @author Stephane Micheloud */ -//$Id$ +//$Id: $ -package man.man1 +package scala.man1 object scalaint extends Command { - import ManPage._ + import _root_.scala.tools.docutil.ManPage._ - protected val cn = new Error().getStackTrace()(0).getClassName() + protected def cn = new Error().getStackTrace()(0).getClassName() val name = Section("NAME", diff --git a/docs/man/src/man/man1/scalap.scala b/src/manual/scala/man1/scalap.scala index d5396747f7..d14ed2a352 100644 --- a/docs/man/src/man/man1/scalap.scala +++ b/src/manual/scala/man1/scalap.scala @@ -2,14 +2,14 @@ * Copyright 2005-2006 LAMP/EPFL * @author Stephane Micheloud */ -//$Id$ +//$Id: $ -package man.man1 +package scala.man1 object scalap extends Command { - import ManPage._ + import _root_.scala.tools.docutil.ManPage._ - protected val cn = new Error().getStackTrace()(0).getClassName() + protected def cn = new Error().getStackTrace()(0).getClassName() val name = Section("NAME", diff --git a/docs/man/src/man/man1/scalascript.scala b/src/manual/scala/man1/scalascript.scala index 9768d5654a..e67078c177 100644 --- a/docs/man/src/man/man1/scalascript.scala +++ b/src/manual/scala/man1/scalascript.scala @@ -2,14 +2,14 @@ * Copyright 2005-2006 LAMP/EPFL * @author Stephane Micheloud */ -//$Id$ +//$Id: $ -package man.man1 +package scala.man1 object scalascript extends Command { - import ManPage._ + import _root_.scala.tools.docutil.ManPage._ - protected val cn = new Error().getStackTrace()(0).getClassName() + protected def cn = new Error().getStackTrace()(0).getClassName() val name = Section("NAME", diff --git a/docs/man/src/man/EmitHtml.scala b/src/manual/scala/tools/docutil/EmitHtml.scala index e6d773c185..a7c10fd24a 100644 --- a/docs/man/src/man/EmitHtml.scala +++ b/src/manual/scala/tools/docutil/EmitHtml.scala @@ -3,9 +3,9 @@ * @author Stephane Micheloud * Adapted from Lex Spoon's sbaz manual */ -//$Id$ +//$Id: $ -package man +package scala.tools.docutil object EmitHtml { import scala.xml.{Node, NodeBuffer, NodeSeq, XML} @@ -334,9 +334,9 @@ object EmitHtml { } try { val cl = ClassLoader.getSystemClassLoader() - val clasz = cl.loadClass("man.man1." + args(0)) - val meth = clasz.getDeclaredMethod("manpage", Array[Class]()) - val doc = meth.invoke(null, Array[Object]()).asInstanceOf[Document] + val clasz = cl.loadClass(args(0)) + val meth = clasz.getDeclaredMethod("manpage", Predef.Array[Class]()) + val doc = meth.invoke(null, Predef.Array[Object]()).asInstanceOf[Document] val addDocType = (args.length > 1 && "-doctype".equals(args(1))) emitDocument(doc, addDocType) } catch { diff --git a/docs/man/src/man/EmitManPage.scala b/src/manual/scala/tools/docutil/EmitManPage.scala index 4ca865fae0..888a4cac5a 100644 --- a/docs/man/src/man/EmitManPage.scala +++ b/src/manual/scala/tools/docutil/EmitManPage.scala @@ -3,9 +3,9 @@ * @author Stephane Micheloud * Adapted from Lex Spoon's sbaz manual */ -//$Id$ +//$Id: $ -package man +package scala.tools.docutil // For help on man pages see: // - http://www.linuxfocus.org/English/November2003/article309.shtml @@ -151,9 +151,9 @@ object EmitManPage { def main(args: Array[String]) = try { val cl = ClassLoader.getSystemClassLoader() - val clasz = cl.loadClass("man.man1." + args(0)) - val meth = clasz.getDeclaredMethod("manpage", Array[Class]()) - val doc = meth.invoke(null, Array[Object]()).asInstanceOf[Document] + val clasz = cl.loadClass(args(0)) + val meth = clasz.getDeclaredMethod("manpage", Predef.Array[Class]()) + val doc = meth.invoke(null, Predef.Array[Object]()).asInstanceOf[Document] emitDocument(doc) } catch { case ex: Exception => diff --git a/docs/man/src/man/ManPage.scala b/src/manual/scala/tools/docutil/ManPage.scala index aef665bf3f..3d23d69064 100644 --- a/docs/man/src/man/ManPage.scala +++ b/src/manual/scala/tools/docutil/ManPage.scala @@ -3,9 +3,9 @@ * @author Stephane Micheloud * Adapted from Lex Spoon's sbaz manual */ -//$Id$ +//$Id: $ -package man +package scala.tools.docutil object ManPage { abstract class AbstractText { diff --git a/docs/man/src/css/style.css b/src/manual/scala/tools/docutil/resources/css/style.css index 3072be4012..3072be4012 100644 --- a/docs/man/src/css/style.css +++ b/src/manual/scala/tools/docutil/resources/css/style.css diff --git a/docs/man/src/images/external.gif b/src/manual/scala/tools/docutil/resources/images/external.gif Binary files differindex dc962b779d..dc962b779d 100644 --- a/docs/man/src/images/external.gif +++ b/src/manual/scala/tools/docutil/resources/images/external.gif diff --git a/docs/man/src/images/scala_logo.png b/src/manual/scala/tools/docutil/resources/images/scala_logo.png Binary files differindex f89a81c1af..f89a81c1af 100644 --- a/docs/man/src/images/scala_logo.png +++ b/src/manual/scala/tools/docutil/resources/images/scala_logo.png diff --git a/docs/man/src/index.html b/src/manual/scala/tools/docutil/resources/index.html index 3a728604ca..3a728604ca 100644 --- a/docs/man/src/index.html +++ b/src/manual/scala/tools/docutil/resources/index.html |