Thema dieser Dokumentation
Thema dieser Dokumentation

Thema dieser Dokumentation / Das FirstSpirit 5 Modul- / Komponenten-Modell / Beispiel: Implementierung einer Eingabekomponente / Ant build.xml - Komplettes Beispiel

Ant build.xml - Komplettes Beispiel

Listing: ant build.xml mit den Targets main-jar, main-fsm, deploy

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
to generate fsm module file call
ant -f src/de/espirit/firstspirit/opt/example/editor/simple/build.xml [TARGET]

Targets:
jar         builds the jar file.
fsm         builds the module file.
deploy      deploys the module file.
-->
<project name="SimpleEditorExample" default="fsm">

<property environment="env"/>
<property name="env.PROJECT_HOME" value=”/path/to/your/module/project_home"/>
<property name="path" value="de/espirit/firstspirit/opt/example/editor/simple"/>
<property name="classes-dir" value="${env.PROJECT_HOME}/classes.modules"/>
<property name="main-jar-file" value="fs-seditor-example.jar"/>
<property name="main-fsm-file" value="fs-seditor-example.fsm"/>
<property name="main-tmp-dir" value="${env.PROJECT_HOME}/tmp/fs-editor-example"/>
<path id="class.path">
<pathelement path="${env.PROJECT_HOME}/classes"/>
</path>

<fileset id="classes.main" dir="${classes-dir}">
<include name="de/espirit/firstspirit/opt/example/editor/simple/*.class"/>
</fileset>

<target name="main-jar" description="Builds all jar files.">
<mkdir dir="${classes-dir}"/>
<javac debug="on" srcdir="${env.PROJECT_HOME}/src" destdir="${classes-dir}"
includes="${path}/**" target="1.5" source="1.5">
<classpath refid="class.path"/>
</javac>
<jar jarfile="${env.PROJECT_HOME}/${main-jar-file}"
excludes="**/*.dependency" duplicate="preserve"
keepcompression="true">
<fileset refid="classes.main"/>
</jar>
</target>

<target name="deploy" depends="fsm" description="Deploys the module file
(*.fsm) to the server.">
<copy file="${env.PROJECT_HOME}/${main-fsm-file}"
todir="${env.CMS_SERVER_HOME}/data/modules" overwrite="true"/>
</target>

<target name="fsm" depends="main-fsm"
description="Builds all module files (*.fsm)."/>

<target name="main-fsm" depends="main-jar "
description="Builds the main module file (*.fsm).">
<mkdir dir="${main-tmp-dir}/lib"/>
<mkdir dir="${main-tmp-dir}/META-INF"/>
<copy file="${env.PROJECT_HOME}/${main-jar-file}"
todir="${main-tmp-dir}/lib" preservelastmodified="true"
overwrite="true" />
<copy file="module.xml" tofile="${main-tmp-dir}/META-INF/module.xml"
overwrite="true">
<filterset>
<filter token="VERSION" value="1.1.1"/>
</filterset>
</copy>
<jar jarfile="${env.PROJECT_HOME}/${main-fsm-file}"
basedir="${main-tmp-dir}" excludes="**/*.dependency"
duplicate="preserve" keepcompression="true"/>
</target>
</project>

© 2005 - 2020 e-Spirit AG | Alle Rechte vorbehalten. | FirstSpirit 2020-07 | Datenschutz | Impressum | Kontakt