generate manual pages from Scala code

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@7856 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
spoon 2006-06-15 12:29:57 +00:00
parent 49e2bf8a1e
commit c6ca71d854
1 changed files with 151 additions and 135 deletions

112
debian/simpbuild.xml vendored
View File

@ -39,6 +39,7 @@
<!-- Location of build products properties --> <!-- Location of build products properties -->
<property name="build.dir" value="${topdir}/simpbuild"/> <property name="build.dir" value="${topdir}/simpbuild"/>
<property name="api.dir" value="${build.dir}/api"/> <property name="api.dir" value="${build.dir}/api"/>
<property name="tooldocs.dir" value="${build.dir}/manual"/>
<!-- Location of source and build elements names properties --> <!-- Location of source and build elements names properties -->
<property name="lib.dir.name" value="library"/> <property name="lib.dir.name" value="library"/>
@ -66,6 +67,7 @@
<property name="build.dbc.dir" value="${build.dir}/${dbc.dir.name}"/> <property name="build.dbc.dir" value="${build.dir}/${dbc.dir.name}"/>
<property name="build.jar.dir" value="${build.dir}/lib"/> <property name="build.jar.dir" value="${build.dir}/lib"/>
<property name="build.bin.dir" value="${build.dir}/bin"/> <property name="build.bin.dir" value="${build.dir}/bin"/>
<property name="build.manual.dir" value="${build.dir}/manual.classes"/>
<property name="api.lib.pdir" value="${api.dir}/${lib.dir.name}"/> <property name="api.lib.pdir" value="${api.dir}/${lib.dir.name}"/>
<property name="api.lib.dir" value="${api.lib.pdir}/api"/> <property name="api.lib.dir" value="${api.lib.pdir}/api"/>
<property name="api.comp.pdir" value="${api.dir}/${comp.dir.name}"/> <property name="api.comp.pdir" value="${api.dir}/${comp.dir.name}"/>
@ -78,27 +80,6 @@
<property name="sbaz.scala.name" value="${dist.name}"/> <property name="sbaz.scala.name" value="${dist.name}"/>
<property name="sbaz.universe" value="http://scala.epfl.ch/downloads/packages"/> <property name="sbaz.universe" value="http://scala.epfl.ch/downloads/packages"/>
<target name="init" unless="init.avail">
<tstamp prefix="time">
<format
property="human"
pattern="EEEE, d MMMM yyyy, HH:mm:ss (zz)"
/>
<format
property="short"
pattern="yyyyMMdd-HHmmss"
/>
<format
property="this.year"
pattern="yyyy"
/>
</tstamp>
<property
name="copyright"
value="(c) 2002-${time.this.year} ${copyright.holder}"
/>
<!-- Testing if everything is in place --> <!-- Testing if everything is in place -->
<echo level="verbose" message="starr.lib.jar=${starr.lib.jar}"/> <echo level="verbose" message="starr.lib.jar=${starr.lib.jar}"/>
<fail message="STARR library in 'lib/' is not available"> <fail message="STARR library in 'lib/' is not available">
@ -117,6 +98,7 @@
/> />
</and></not></condition> </and></not></condition>
</fail> </fail>
<echo level="verbose" message="starr.comp.jar=${starr.comp.jar}"/> <echo level="verbose" message="starr.comp.jar=${starr.comp.jar}"/>
<fail message="STARR compiler in 'lib/' is not available"> <fail message="STARR compiler in 'lib/' is not available">
<condition><not> <condition><not>
@ -126,6 +108,7 @@
/> />
</not></condition> </not></condition>
</fail> </fail>
<echo level="verbose" message="fjbg.jar=${fjbg.jar}"/> <echo level="verbose" message="fjbg.jar=${fjbg.jar}"/>
<fail message="FJBG library in 'lib/' is not available"> <fail message="FJBG library in 'lib/' is not available">
<condition><not> <condition><not>
@ -172,10 +155,7 @@
/> />
<echo level="verbose" message="version.number=${version.number}"/> <echo level="verbose" message="version.number=${version.number}"/>
<property name="init.avail" value="yes"/>
</target>
<target name="setup" depends="init">
<!-- Creating tasks --> <!-- Creating tasks -->
<taskdef <taskdef
name="starr" name="starr"
@ -198,10 +178,38 @@
classpathref="starr.classpath" classpathref="starr.classpath"
/> />
</target> <macrodef name="emit">
<attribute name="command"/>
<sequential>
<mkdir dir="${tooldocs.dir}"/>
<java classname="scala.tools.docutil.EmitHtml"
output="${tooldocs.dir}/@{command}.html"
fork="false" logError="yes"
failonerror="true"
>
<arg value="scala.man1.@{command}"/>
<classpath>
<pathelement location="${build.manual.dir}"/>
<path refid="starr.classpath"/>
</classpath>
</java>
<java classname="scala.tools.docutil.EmitManPage"
output="${tooldocs.dir}/@{command}.1"
fork="false" logError="yes"
failonerror="true"
>
<arg value="scala.man1.@{command}"/>
<classpath>
<pathelement location="${build.manual.dir}"/>
<path refid="starr.classpath"/>
</classpath>
</java>
</sequential>
</macrodef>
<target name="build" depends="setup">
<target name="build">
<!-- Build library --> <!-- Build library -->
<mkdir dir="${build.lib.dir}"/> <mkdir dir="${build.lib.dir}"/>
<javac <javac
@ -211,9 +219,6 @@
target="${jc.target}" target="${jc.target}"
deprecation="${jc.deprecation}" deprecation="${jc.deprecation}"
> >
<classpath>
<pathelement location="${build.lib.dir}"/> <!-- XXX ??? -->
</classpath>
<include name="**/*.java"/> <include name="**/*.java"/>
</javac> </javac>
<starr <starr
@ -308,6 +313,9 @@
file="${build.bin.dir}/${scala.exec.name}" file="${build.bin.dir}/${scala.exec.name}"
version="${version.number}" version="${version.number}"
copyright="${copyright}" copyright="${copyright}"
name="Scala code runner"
class="scala.tools.nsc.MainGenericRunner"
javaFlags="-Xmx256M -Xms16M"
/> />
<starrtool <starrtool
file="${build.bin.dir}/${scalac.exec.name}" file="${build.bin.dir}/${scalac.exec.name}"
@ -326,32 +334,18 @@
copyright="${copyright}" copyright="${copyright}"
javaFlags="-Xmx256M -Xms16M" javaFlags="-Xmx256M -Xms16M"
/> />
<starrtool
file="${build.bin.dir}/${scalaint.exec.name}"
name="Scala interpreter"
class="scala.tools.nsc.MainInterpreter"
version="${version.number}"
copyright="${copyright}"
/>
<starrtool
file="${build.bin.dir}/scalascript"
name="Scala script runner"
class="scala.tools.nsc.MainScript"
version="${version.number}"
copyright="${copyright}"
/>
</target> </target>
<target name="docs.lib" depends="setup"> <target name="docs.lib">
<mkdir dir="${api.lib.dir}"/> <mkdir dir="${api.lib.dir}"/>
<starrdoc <starrdoc
srcdir="${src.dir}" srcdir="${src.dir}"
destdir="${api.lib.dir}" destdir="${api.lib.dir}"
sourcepath="" sourcepath=""
windowtitle="Scala Library Documentation" windowtitle="Scala Library Documentation"
documenttitle="&lt;div&gt;Scala 2&lt;div&gt;v${version.number}&lt;/div&gt;&lt;/div&gt;" documenttitle="Scala 2v${version.number}"
> >
<classpath> <classpath>
<pathelement location="${build.jar.dir}/${lib.jar.name}"/> <pathelement location="${build.jar.dir}/${lib.jar.name}"/>
@ -361,10 +355,31 @@
</starrdoc> </starrdoc>
</target> </target>
<target name="docs" depends="docs.lib"/> <target name="docs.manual">
<mkdir dir="${build.manual.dir}"/>
<starr srcdir="${topdir}/src/manual" destdir="${build.manual.dir}">
<classpath>
<path refid="starr.classpath"/>
</classpath>
</starr>
<emit command="scala"/>
<emit command="scalac"/>
<emit command="scaladoc"/>
<emit command="scalap"/>
<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>
<target name="docs" depends="docs.lib, docs.manual"/>
<target name="dist" <target name="dist"
depends="build, docs.lib" depends="build, docs"
> >
<!-- Create the SBaz packages --> <!-- Create the SBaz packages -->
<mkdir dir="${dist.sbaz.dir}"/> <mkdir dir="${dist.sbaz.dir}"/>
@ -391,9 +406,10 @@
> >
<binset dir="${build.bin.dir}" includes="**"/> <binset dir="${build.bin.dir}" includes="**"/>
<libset dir="${build.jar.dir}" includes="${comp.jar.name}"/> <libset dir="${build.jar.dir}" includes="${comp.jar.name}"/>
<manset dir="${docs.dir}/man" includes="**"/> <manset dir="${tooldocs.dir}" includes="*.1"/>
<docset dir="${docs.dir}" includes="README,LICENSE"/> <docset dir="${docs.dir}" includes="README,LICENSE"/>
<docset dir="${api.lib.pdir}" includes="api/**"/> <docset dir="${api.lib.pdir}" includes="api/**"/>
<docset dir="${tooldocs.dir}" includes="*.html"/>
</starrsbaz> </starrsbaz>
<!-- Creates the empty umbrella Scala package --> <!-- Creates the empty umbrella Scala package -->
<starrsbaz <starrsbaz