站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 4.0.0.11754MR2 manual 英文版使用指南文档

2.4. Build - JBoss RULES 4.0.0.11754MR2 manual 英文版使用指南文档

2.4. Build

2.4.1. Building the Source

Now that we have the source the next step is to build and install the source. We do this with Ant, which uses maven 2 under the covers to get the needed dependencies (you don't need to have maven 2 installed to build). Note that the plug in is built seperatly, but the build process will update the plug ins dependencies (refer to the section on building the plug in if you need to build a new version of the plug in).

Type 'ant' to get a listing of what capabilities the build script has (from the root of the project). You should then see a listing which contains further instructions:

C:\Projects\jboss-rules-new>ant
Buildfile: build.xml

help:
     [echo] Drools Build Help
     [echo] -----------------
     [echo]
     [echo] The build process is for the following four modules:
     [echo] drools-core
     [echo] drools-compiler
     [echo] drools-decisiontables
     [echo] drools-jsr94
     [echo]
     [echo] Further to this there are two Eclipse project:
     [echo] drools-examples - To use open Eclipse and import.
     [echo]                   Requires the Drools Eclipse plugin.
     [echo]                   Either build the plugin from drools-ide
     [echo]                   or install from the Eclipse update site
     [echo]                   http://anonsvn.labs.jboss.com/labs/jbossrules/updates
     [echo] drools-ide      - To use open Eclipse and import.
     [echo]                   Select export and plugin fragements to
     [echo]                   generate the Drools Eclipse plugin
     [echo]                   Depends on all the depencies being copied
     [echo]                   to its lib directory at the end of build-all,
     [echo]                   which calls copy-deps.
     [echo]
     [echo] Targets
     [echo] -----
     [echo]
     [echo] clean-all - cleans all directories
     [echo]
     [echo] build-all - builds all modules
     [echo]
     [echo] javadocs  - generates the javadoc at target/docs
     [echo]
     [echo] manual    - generates the docbook documentation in
     [echo]             html and single_html format at target/docs
     [echo]
     [echo] dist-all  - generates the distribution builds for
     [echo]             src, bin, bin-withdeps and examples
     [echo]
     [echo] Each module can individually be executed with clean, compile,
     [echo] test and build. To use simply use the following commands,
     [echo] replace ${module} with one of the module names:
     [echo] clean-${module}
     [echo] compile-${module}
     [echo] test-${module}
     [echo] build-${module}
     [echo]
     [echo] Generates specific distribution builds:
     [echo] dist-src
     [echo] dist-bin
     [echo] dist-bin-withdeps
     [echo] dist-examples
     [echo]
     [echo] You may also pass the following system properties:
     [echo] -Dtest.skip=true
     [echo] -Djavadocs.skip=true
     [echo] -Dmanual.skip=true
     [echo]
     [echo] Targets may be combined:
     [echo] ant -Dtest.skip clean-all build-all
     [echo]
     [echo] For more help use the build system to generate the manual
     [echo] or you can find the manual online at:
     [echo] http://labs.jboss.com/portal/jbossrules/docs/index.html

BUILD SUCCESSFUL


The most common pair of tasks to run is 'ant clean-all build-all' which will clear old artifacts, and then test and built the source, and report on any errors.

The resulting jars are put in the /target directory from the top level of the project.

As Ant builds each module it will install the resulting jars in the local Maven 2 repository automatically. Where it can be easily used from other project pom.xml or copied else where.

2.4.2. Building the Manual

Drools uses Docbook for this manual. Ant is used to build the documentation. The documentation produces four different formats, all share the same images directory. PDFs will attempt to use SVG images where possible.

  • html_single

    The entire manual in a single html document

  • html

    The manual is split into multiple documents and placed in a frameset. The left frame provides navigation

  • PDF (currently broken, due to layout issues with image sizes)

    A generated PDF, with nagivation.

  • eclipse

    Documentation suitable for including in an eclipse plugin

The manual can be generated from the project root's build.xml by calling 'ant manual', with the generated documentation being copied to 'target/docs'. What actually happens is a call to a separate ant build.xml for the manual, located at documentation/manual; the documentation is generated into documentation/manual/build before being copied to 'target/docs'.

C:\dev\jbossrules>ant manual
Buildfile: build.xml

manual:
   [delete] Deleting directory D:\dev\jbossrules\documentation\manual\build

clean:

all.doc:

lang.all:

lang.misc:
     [copy] Copying 102 files to C:\dev\jbossrules\documentation\manual\build\en\shared\images
     [copy] Copying 1 file to C:\dev\jbossrules\documentation\manual\build\en\shared\css
    [style] Transforming into C:\dev\jbossrules\documentation\manual\build\en\shared\images
    [style] Processing C:\dev\jbossrules\documentation\manual\en\Chapter-Papers\guests_at_table.svg to C:\dev\jbossrules
\documentation\manual\build\en\shared\images\Chapter-Papers\guests_at_table.svg
    [style] Loading stylesheet C:\dev\jbossrules\documentation\manual\en\styles\visio_svg.xsl
    [style] Processing C:\dev\jbossrules\documentation\manual\en\Chapter-Papers\make_path.svg to C:\dev\jbossrules\docum
entation\manual\build\en\shared\images\Chapter-Papers\make_path.svg
    [style] Processing C:\dev\jbossrules\documentation\manual\en\Chapter-Papers\manners_activity_diagram.svg to C:\dev\j
bossrules\documentation\manual\build\en\shared\images\Chapter-Papers\manners_activity_diagram.svg
    [style] Processing C:\dev\jbossrules\documentation\manual\en\Chapter-Performance_Tuning\beta_node.svg to C:\dev\jbos
...
snip
...
lang.dochtml:
    [mkdir] Created dir: C:\dev\jbossrules\documentation\manual\build\en\html
     [copy] Copying 1 file to C:\dev\jbossrules\documentation\manual\build\en\html
     [java] Writing bk01-toc.html for book
     [java] Writing pr01.html for preface(preface)
     [java] ID recommended on part: Reference Manual
     [java] ID recommended on chapter: The Rule Engine
     [java] ID recommended on section: What is a Rule Engine
     [java] ID recommended on section: Background
     [java] ID recommended on figure: Inference Engine
     [java] ID recommended on figure: SQL as a simplistic Inference Engine
     [java] ID recommended on figure: Additional Reading
     [java] ID recommended on section: Rules
     [java] ID recommended on figure: A Basic Rete network
     [java] ID recommended on figure: A Basic Rete network
...
snip
...
lang.dochtmlsingle:
    [mkdir] Created dir: C:\dev\jbossrules\documentation\manual\build\en\html_single
     [java] ID recommended on part: Reference Manual
     [java] ID recommended on chapter: The Rule Engine
     [java] ID recommended on section: What is a Rule Engine
     [java] ID recommended on section: Background
     [java] ID recommended on figure: Inference Engine
     [java] ID recommended on figure: SQL as a simplistic Inference Engine
     [java] ID recommended on figure: Additional Reading
     [java] ID recommended on section: Rules
     [java] ID recommended on figure: A Basic Rete network
     [java] ID recommended on figure: A Basic Rete network
     [java] ID recommended on section: Why use a Rule Engine
...
snip
...
     [java] ID recommended on section: Make Path and Path Done
     [java] ID recommended on figure: Rete Diagram
     [java] ID recommended on section: Continue and Are We Done
     [java] ID recommended on section: Conclusion
     [java] ID recommended on section: Output Summary
     [java] ID recommended on index
     [copy] Copying 142 files to C:\dev\jbossrules\target\docs

BUILD SUCCESSFUL
Total time: 54 seconds
C:\dev\jbossrules>

Figure 2.1. Generating the Manual with Ant


The generated manual can be found in the target\docs directory, a folder per each format.

The manual was first generated into the manual's build directory, as shown below, before being copied across.