You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ar...@apache.org on 2004/04/22 21:31:01 UTC

cvs commit: db-ojb/forrest forrest-targets.ent forrest-targets.xml forrest.properties

arminw      2004/04/22 12:31:01

  Added:       forrest  forrest-targets.ent forrest-targets.xml
                        forrest.properties
  Log:
  more forrest stuff
  
  Revision  Changes    Path
  1.1                  db-ojb/forrest/forrest-targets.ent
  
  Index: forrest-targets.ent
  ===================================================================
  <!--
    Copyright 2002-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <!--
  This build.xml snippet contains Forrest targets for Ant 1.5+.  It checks that
  the user has set ${forrest.home}, either in one of:
    FORREST_HOME environment variable
    project.properties
    build.properties
    ant.properties
    .ant.properties
  and prints an informative error message if not found.
  
  Usage:
  1) Copy this file to somewhere in your project.
  2) Add the following to the top of your project's Ant build.xml script
  (adjusting the path):
  
    <!DOCTYPE project [
      <!ENTITY forrest-targets SYSTEM "file:./forrest-targets.ent">
    ]>
  
  3) Before the closing '</project>' in your build.xml, add this:
  
    &forrest-targets;
    
  This is like expanding a macro: it pulls in the contents of this file.
  
  A minimal build.xml would thus be:
  
  <!DOCTYPE project [
  <!ENTITY forrest-targets SYSTEM "file:./forrest-targets.ent">
  ]>
  
  <project default="site">
      &forrest-targets;
  </project>
  -->
  
    <target name="site" depends="forrest.init" description="Generates static HTML documentation">
      <ant antfile="${forrest.home}/forrest.antproxy.xml" target="site"/>
    </target>
  
    <target name="webapp" depends="forrest.init" description="Generates an unpackaged webapp of the website">
      <ant antfile="${forrest.home}/forrest.antproxy.xml" target="webapp"/>
    </target>
  
    <target name="war" depends="forrest.init" description="Generates a .war file containing the website">
      <ant antfile="${forrest.home}/forrest.antproxy.xml" target="war"/>
    </target>
  
    <target name="validate" depends="forrest.init" description="Validates XML documentation files">
      <ant antfile="${forrest.home}/forrest.antproxy.xml" target="validate"/>
    </target>
  
    <target name="forrest.init" depends="forrest.sethome, forrest.home.defined"/>
  
    <target name="forrest.sethome" depends="forrest.loadenv,
    forrest.checkenv, forrest.checkhome, forrest.check-build.properties,
    forrest.check-project.properties, forrest.check-ant.properties,
    forrest.check-.ant.properties"/>
  
    <target name="forrest.loadenv" unless="forrest.home.present">
      <property environment="env"/>
      <echo level="verbose">Forrest: Got ${env.FORREST_HOME}</echo>
    </target>
  
    <target name="forrest.checkenv" if="env.FORREST_HOME">
      <echo level="verbose">Found $FORREST_HOME=${env.FORREST_HOME}</echo>
      <property name="forrest.home" location="${env.FORREST_HOME}"/>
      <echo level="verbose">forrest.home set to ${forrest.home}</echo>
      <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
    </target>
  
  
    <target name="forrest.checkhome">
      <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
      <available file="build.properties" type="file" property="build.properties.present"/>
      <available file="project.properties" type="file" property="project.properties.present"/>
      <available file="ant.properties" type="file" property="ant.properties.present"/>
      <available file=".ant.properties" type="file" property=".ant.properties.present"/>
    </target>
  
    <!-- No we can't extract the commonalities below into an antcall'ed target,
    because it wouldn't be able to set forrest.home -->
    <target name="forrest.check-build.properties" unless="forrest.home.present"
    if="build.properties.present">
      <echo level="verbose">Forrest: Checking build.properties..</echo>
      <loadproperties srcfile="build.properties">
        <filterchain>
          <linecontains>
            <contains value="forrest.home"/>
          </linecontains>
        </filterchain>
      </loadproperties>
      <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
  
    </target>
  
    <target name="forrest.check-project.properties" unless="forrest.home.present"
    if="project.properties.present">
      <echo level="verbose">Forrest: Checking project.properties..</echo>
      <loadproperties srcfile="project.properties">
        <filterchain>
          <linecontains>
            <contains value="forrest.home"/>
          </linecontains>
        </filterchain>
      </loadproperties>
      <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
    </target>
  
    <target name="forrest.check-ant.properties" unless="forrest.home.present"
    if="ant.properties.present">
      <echo level="verbose">Forrest: Checking ant.properties..</echo>
      <loadproperties srcfile="ant.properties">
        <filterchain>
          <linecontains>
            <contains value="forrest.home"/>
          </linecontains>
        </filterchain>
      </loadproperties>
      <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
    </target>
  
    <target name="forrest.check-.ant.properties" unless="forrest.home.present"
    if=".ant.properties.present">
      <echo level="verbose">Forrest: Checking .ant.properties..</echo>
      <loadproperties srcfile=".ant.properties">
        <filterchain>
          <linecontains>
            <contains value="forrest.home"/>
          </linecontains>
        </filterchain>
      </loadproperties>
      <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
    </target>
  
    <target name="forrest.home.defined" depends="forrest.sethome" unless="forrest.home.present">
      <property name="path" value="${user.home}/xml-forrest/build/dist/shbat"/>
      <pathconvert targetos="windows" property="winpath">
        <path>
          <pathelement location="${path}"/>
        </path>
      </pathconvert>
      <pathconvert targetos="unix" property="unixpath">
        <path>
          <pathelement
            location="${path}"/>
        </path>
      </pathconvert>
  
      <echo>
        ----------------------------------------------
        To run this target, you need Forrest installed.
        Please do the following:
  
        export CVSROOT=:pserver:anoncvs@cvs.apache.org:/home/cvspublic
        cvs checkout xml-forrest
        cd xml-forrest
        build      (Windows)
        ./build.sh (Unix)
  
        Then either:
  
        - Set FORREST_HOME as the Forrest build instructions describe
        - Create a project.properties, with the forrest.home property
          pointing to the forrest shbat directory, e.g.
  
          forrest.home=${winpath}  (Windows)
          forrest.home=${unixpath}  (Unix)
  
          (adjusting the path according to where your xml-forrest is)
        ----------------------------------------------
      </echo>
      <fail message="Need to define $${forrest.home}"/>
    </target>
  
  
  
  1.1                  db-ojb/forrest/forrest-targets.xml
  
  Index: forrest-targets.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 2002-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <!--
  This build.xml import contains Forrest targets for Ant 1.6.
  See the forrest-targets.ent file in this same dir for more info.
  
  Sample usage:
  
    <import file="forrest-targets.ent"/>
  
  If you already have in your build targets that are called like the
  forrest ones, you can still call the forrest ones by prepending
  "forrest."
  
  Example:
  
   <antcall target="forrest.site"/>
  -->
  <!DOCTYPE project [
  <!ENTITY forrest-targets SYSTEM "file:./forrest-targets.ent">
  ]>
  
  <project name="forrest" default="dist" basedir="."  >
      &forrest-targets;
  </project>
  
  
  
  1.1                  db-ojb/forrest/forrest.properties
  
  Index: forrest.properties
  ===================================================================
  # Copyright 2002-2004 The Apache Software Foundation
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  #
  #     http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
  ##############
  # Properties used by forrest.build.xml for building the website
  ##############
  
  # Prints out a summary of Forrest settings for this project
  forrest.echo=true
  
  # Project name (used to name .war file)
  #project.name=my-project
  
  # Specifies name of Forrest skin to use
  #project.skin=forrest-site
  #project.skin=forrest-css
  project.skin=krysalis-site
  #project.skin=tigris-style
  
  # comma seperated list, file:/// is supported
  #forrest.skins.descriptors=http://xml.apache.org/forrest/skins/skins.xml,file:///c:/myskins/skins.xml
  
  ##############
  # behavioural properties
  #project.menu-scheme=tab_attributes
  #project.menu-scheme=directories
  
  ##############
  # layout properties
  
  # Properties that must be set to override the default locations
  #
  # Parent properties must be set. This usually means uncommenting
  # project.content-dir if any other property using it is uncommented
  
  #project.status=status.xml
  #project.content-dir=src/documentation
  #project.conf-dir=${project.content-dir}/conf
  #project.sitemap-dir=${project.content-dir}
  #project.raw-content-dir=${project.content-dir}/content
  #project.xdocs-dir=${project.content-dir}/content/xdocs
  #project.resources-dir=${project.content-dir}/resources
  #project.stylesheets-dir=${project.resources-dir}/stylesheets
  #project.images-dir=${project.resources-dir}/images
  #project.schema-dir=${project.resources-dir}/schema
  #project.skins-dir=${project.content-dir}/skins
  #project.skinconf=${project.content-dir}/skinconf.xml
  #project.lib-dir=${project.content-dir}/lib
  #project.classes-dir=${project.content-dir}/classes
  
  
  ##############
  # Cocoon catalog entity resolver properties
  
  # A local OASIS catalog file to supplement the default Forrest catalog
  #project.catalog=${project.schema-dir}/catalog.xcat
  
  # The verbosity level for the entity resolver (1..10)
  #forrest.catalog.verbosity=1
  
  
  ##############
  # validation properties
  
  # Determine if validation is performed
  #forrest.validate=true
  
  # *.failonerror=(true|false)    stop when an XML file is invalid
  #forrest.validate.failonerror=true
  
  # *.excludes=(pattern)  Comma-separated list of path patterns to not validate
  # e.g.
  #forrest.validate.excludes=samples/subdir/**, samples/faq.xml
  #forrest.validate.excludes=
  
  
  ##############
  # General Forrest properties
  
  # The URL to start crawling from
  #project.start-uri=index.html
  # Set logging level for messages printed to the console
  # (DEBUG, INFO, WARN, ERROR, FATAL_ERROR)
  project.debuglevel=DEBUG
  # Max memory to allocate to Java
  #forrest.maxmemory=64m
  # Any other arguments to pass to the JVM. For example, to run on an X-less
  # server, set to -Djava.awt.headless=true
  #forrest.jvmargs=
  #project.bugtracking-url=http://nagoya.apache.org/bugzilla/show_bug.cgi?id=
  #I18n Property only works for the "forrest run" target.
  #project.i18n=true
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org