Ant task package hinzugefuegt. Erstellt Repo aus binary modules. Basis f. zukuenftige distribution.
git-svn-id: https://svn.libreccm.org/ccm/trunk@147 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
e351309e2b
commit
6fa618b948
|
|
@ -870,7 +870,7 @@
|
||||||
|
|
||||||
<xsl:template name="TargetDeploy">
|
<xsl:template name="TargetDeploy">
|
||||||
<xsl:variable name="name" select="@name"/>
|
<xsl:variable name="name" select="@name"/>
|
||||||
<!-- Deploy hooks -->
|
|
||||||
<xsl:for-each select="/ccm:project/ccm:build/ccm:application">
|
<xsl:for-each select="/ccm:project/ccm:build/ccm:application">
|
||||||
<xsl:variable name="name" select="@name"/>
|
<xsl:variable name="name" select="@name"/>
|
||||||
<xsl:variable
|
<xsl:variable
|
||||||
|
|
@ -886,6 +886,8 @@
|
||||||
<xsl:variable name="hassrcdir"
|
<xsl:variable name="hassrcdir"
|
||||||
select="$application/ccm:directories/ccm:directory[@name='src'] or
|
select="$application/ccm:directories/ccm:directory[@name='src'] or
|
||||||
not($application/ccm:directories)"/>
|
not($application/ccm:directories)"/>
|
||||||
|
|
||||||
|
<!-- Deploy hooks -->
|
||||||
<xsl:if test="$application/@buildHooks">
|
<xsl:if test="$application/@buildHooks">
|
||||||
<target name="deploy-{$name}-hook" depends="init">
|
<target name="deploy-{$name}-hook" depends="init">
|
||||||
<ant target="deploy-hook" dir="{$name}" inheritRefs="true">
|
<ant target="deploy-hook" dir="{$name}" inheritRefs="true">
|
||||||
|
|
@ -895,19 +897,7 @@
|
||||||
</ant>
|
</ant>
|
||||||
</target>
|
</target>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<!-- Deploy War -->
|
|
||||||
<target name="deploy-war-{$name}" depends="init,jar-classes-{$name}">
|
|
||||||
<mkdir dir="${{deploy.war.dir}}"/>
|
|
||||||
<mkdir dir="{$name}/${{lib.dir}}"/>
|
|
||||||
<war destfile="${{deploy.war.dir}}/${{apps.{$name}.name}}-${{apps.{$name}.version}}.war"
|
|
||||||
webxml="{$name}/${{web.dir}}/WEB-INF/web.xml">
|
|
||||||
<fileset dir="{$name}/${{web.dir}}">
|
|
||||||
<exclude name="WEB-INF/web.xml"/>
|
|
||||||
</fileset>
|
|
||||||
<lib dir="{$name}/${{lib.dir}}"/>
|
|
||||||
<classes dir="{$name}/${{build.classes.dir}}"/>
|
|
||||||
</war>
|
|
||||||
</target>
|
|
||||||
<!-- Deploy Jar -->
|
<!-- Deploy Jar -->
|
||||||
<target name="deploy-jar-classes-{$name}" depends="init,jar-classes-{$name}">
|
<target name="deploy-jar-classes-{$name}" depends="init,jar-classes-{$name}">
|
||||||
<mkdir dir="${{deploy.lib.dir.{$name}}}"/>
|
<mkdir dir="${{deploy.lib.dir.{$name}}}"/>
|
||||||
|
|
@ -920,6 +910,7 @@
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- Deploy classes -->
|
<!-- Deploy classes -->
|
||||||
<xsl:if test="$hassrcdir or $haspdldir">
|
<xsl:if test="$hassrcdir or $haspdldir">
|
||||||
<target name="deploy-classes-{$name}" depends="init,build-{$name}">
|
<target name="deploy-classes-{$name}" depends="init,build-{$name}">
|
||||||
|
|
@ -1118,6 +1109,148 @@
|
||||||
<xsl:template name="TargetPackage">
|
<xsl:template name="TargetPackage">
|
||||||
<xsl:variable name="name" select="@name"/>
|
<xsl:variable name="name" select="@name"/>
|
||||||
|
|
||||||
|
<!-- Step through the list of modules to compile and package as specified in project.xml -->
|
||||||
|
<xsl:for-each select="/ccm:project/ccm:build/ccm:application">
|
||||||
|
|
||||||
|
<xsl:variable name="name" select="@name"/>
|
||||||
|
<xsl:variable name="application"
|
||||||
|
select="document(concat(@name,'/application.xml'),/ccm:project)/ccm:application"/>
|
||||||
|
<xsl:variable name="buildhooks" select="$application/@buildHooks"/>
|
||||||
|
<!-- Check if module uses pdl -->
|
||||||
|
<xsl:variable name="haspdldir"
|
||||||
|
select="$application/ccm:directories/ccm:directory[@name='pdl'] or
|
||||||
|
not($application/ccm:directories)"/>
|
||||||
|
<!-- Check if module uses sql -->
|
||||||
|
<xsl:variable name="hassqldir"
|
||||||
|
select="$application/ccm:directories/ccm:directory[@name='sql'] or
|
||||||
|
not($application/ccm:directories)"/>
|
||||||
|
<!-- Check if module uses an additional src dir to compile -->
|
||||||
|
<xsl:variable name="hassrcdir"
|
||||||
|
select="$application/ccm:directories/ccm:directory[@name='src'] or
|
||||||
|
not($application/ccm:directories)"/>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Package hooks -->
|
||||||
|
<xsl:if test="$application/@buildHooks">
|
||||||
|
<target name="package-{$name}-hook" depends="init">
|
||||||
|
<ant target="deploy-hook" dir="{$name}" inheritRefs="true">
|
||||||
|
<xsl:attribute name="antfile">
|
||||||
|
<xsl:value-of select="$application/@buildHooks"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
</ant>
|
||||||
|
</target>
|
||||||
|
</xsl:if>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Package Jar Classes -->
|
||||||
|
<target name="package-jar-classes-{$name}" depends="init,jar-classes-{$name}">
|
||||||
|
<mkdir dir="${{package.dir}}/binaries/"/>
|
||||||
|
<copy todir="${{package.dir}}/binaries/"
|
||||||
|
file="{$name}/${{build.dir}}/${{apps.{$name}.name}}-${{apps.{$name}.version}}.jar"/>
|
||||||
|
<!--
|
||||||
|
<xsl:for-each select="$application/ccm:systemPackages/ccm:package">
|
||||||
|
<xsl:call-template name="TargetDeploySystemJar">
|
||||||
|
<xsl:with-param name="name" select="$name"/>
|
||||||
|
<xsl:with-param name="package" select="@path"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:for-each>
|
||||||
|
-->
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- Package pdl -->
|
||||||
|
<xsl:if test="$haspdldir">
|
||||||
|
<target name="package-pdl-{$name}" depends="init,jar-pdl-{$name}">
|
||||||
|
|
||||||
|
<mkdir dir="${{package.dir}}/binaries/"/>
|
||||||
|
<copy todir="${{package.dir}}/binaries/">
|
||||||
|
<fileset dir="{$name}/${{build.dir}}">
|
||||||
|
<include name="*pdl.jar"/>
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
|
||||||
|
</target>
|
||||||
|
</xsl:if>
|
||||||
|
|
||||||
|
<!-- Package sql -->
|
||||||
|
<xsl:if test="$hassqldir or $haspdldir">
|
||||||
|
<target name="package-sql-{$name}"
|
||||||
|
depends="init,generate-ddl-{$name},jar-sql-{$name}">
|
||||||
|
<mkdir dir="${{package.dir}}/binaries/"/>
|
||||||
|
<copy todir="${{package.dir}}/binaries/">
|
||||||
|
<fileset dir="{$name}/${{build.dir}}">
|
||||||
|
<include name="*sql.jar"/>
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
</xsl:if>
|
||||||
|
|
||||||
|
<!-- Package external libs, not developed by the CCM project.
|
||||||
|
Located in a modules lib directory. -->
|
||||||
|
<target name="package-lib-{$name}" depends="init">
|
||||||
|
<mkdir dir="${{package.dir}}/binaries/{$name}/lib/"/>
|
||||||
|
<copy todir="${{package.dir}}/binaries/{$name}/lib/" preservelastmodified="true">
|
||||||
|
<fileset dir="{$name}">
|
||||||
|
<include name="${{lib.dir}}/**"/>
|
||||||
|
</fileset>
|
||||||
|
<mapper type="glob" to="*" from="${{lib.dir}}${{file.separator}}*"/>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- Package web directory -->
|
||||||
|
<target name="package-web-{$name}" depends="init">
|
||||||
|
<mkdir dir="${{package.dir}}/binaries/{$name}/web/"/>
|
||||||
|
<copy todir="${{package.dir}}/binaries/{$name}/web/">
|
||||||
|
<fileset dir="{$name}">
|
||||||
|
<include name="${{web.dir}}/**"/>
|
||||||
|
</fileset>
|
||||||
|
<mapper type="glob" to="*" from="${{web.dir}}${{file.separator}}*"/>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Package an app by combining all necessary steps -->
|
||||||
|
<target name="package-{$name}" description="Packages the '{$name}' application">
|
||||||
|
<xsl:attribute name="depends">
|
||||||
|
<xsl:text>init</xsl:text>
|
||||||
|
<xsl:text>,build-</xsl:text><xsl:value-of select="@name"/>
|
||||||
|
<xsl:if test="$buildhooks"><xsl:value-of
|
||||||
|
select="concat(',package-',$name,'-hook')"/></xsl:if>
|
||||||
|
<xsl:value-of select="concat(',package-jar-classes-',$name)"/>
|
||||||
|
<xsl:if test="$haspdldir">
|
||||||
|
<xsl:value-of select="concat(',package-pdl-',$name)"/>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="$hassqldir or $haspdldir">
|
||||||
|
<xsl:value-of select="concat(',package-sql-',$name)"/>
|
||||||
|
</xsl:if>
|
||||||
|
<!--
|
||||||
|
<xsl:if test="$hassrcdir or $haspdldir"><xsl:value-of
|
||||||
|
select="concat(',package-classes-',$name)"/></xsl:if>
|
||||||
|
<xsl:value-of select="concat(',package-bin-',$name)"/>
|
||||||
|
-->
|
||||||
|
<xsl:value-of select="concat(',package-lib-',$name)"/>
|
||||||
|
<xsl:value-of select="concat(',package-web-',$name)"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
<echo message="Package created for '{$name}' in ${{package.dir}}/binaries/"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</xsl:for-each>
|
||||||
|
|
||||||
|
<!-- Master package -->
|
||||||
|
<!-- depends="init,deploy-global,deploy-local,copy-webxml" -->
|
||||||
|
<!-- Step through the list of modules and package each one built -->
|
||||||
|
<target name="package">
|
||||||
|
<xsl:attribute name="description">
|
||||||
|
Builds all applications and creates binary packages for each module
|
||||||
|
</xsl:attribute>
|
||||||
|
<xsl:attribute name="depends">
|
||||||
|
<xsl:text>init</xsl:text>
|
||||||
|
<xsl:for-each select="/ccm:project/ccm:build/ccm:application">
|
||||||
|
<xsl:variable name="name" select="@name"/>
|
||||||
|
<xsl:text>,package-</xsl:text><xsl:value-of select="@name"/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:attribute>
|
||||||
|
<!-- <mkdir dir="${{package.dir}}"/> -->
|
||||||
|
</target>
|
||||||
|
|
||||||
</xsl:template> <!-- TargetPackage -->
|
</xsl:template> <!-- TargetPackage -->
|
||||||
|
|
||||||
|
|
@ -1152,7 +1285,7 @@
|
||||||
<xsl:variable name="context" select="@webxml"/>
|
<xsl:variable name="context" select="@webxml"/>
|
||||||
|
|
||||||
<!-- web.xml will be copied implicitly from deployed WEB-INF! -->
|
<!-- web.xml will be copied implicitly from deployed WEB-INF! -->
|
||||||
<war>
|
<war needxmlfile="False" >
|
||||||
<xsl:attribute name="destfile">
|
<xsl:attribute name="destfile">
|
||||||
<xsl:text>${ccm.project.dir}/</xsl:text><xsl:value-of select="@name"/>
|
<xsl:text>${ccm.project.dir}/</xsl:text><xsl:value-of select="@name"/>
|
||||||
<xsl:text>-</xsl:text><xsl:value-of select="@version"/>
|
<xsl:text>-</xsl:text><xsl:value-of select="@version"/>
|
||||||
|
|
|
||||||
|
|
@ -41,34 +41,47 @@ Oracle 10g RDBMS or PostgresQL up to version 8.2
|
||||||
(c) If you don't already have a project.xml file in place, copy the file
|
(c) If you don't already have a project.xml file in place, copy the file
|
||||||
project.xml.complete, too, and rename it to project.xml
|
project.xml.complete, too, and rename it to project.xml
|
||||||
Comment out those modules to don't need. Keep the included modules in sync
|
Comment out those modules to don't need. Keep the included modules in sync
|
||||||
with the bundles application file! (see later)
|
with the bundles application file! (see later).
|
||||||
|
Specify name, version, release as you need, don't alter the other
|
||||||
|
attributes (exp. ccmVersion and webapps)!
|
||||||
|
|
||||||
(d) Edit the file local.ccm.properties and replace the specified bundle name
|
(d) Edit the file local.ccm.properties and replace the specified bundle name
|
||||||
by your working bundle
|
by your working bundle. Keep the list of modules in sync with
|
||||||
|
project.xml!
|
||||||
|
|
||||||
(e) ant install-tomcat will install a test environment (Tomcat 6) into
|
(e) ant install-tomcat
|
||||||
the runtime directory
|
will create a runtime directory and install Tomcat 6 for testing.
|
||||||
|
|
||||||
(f) ant configure will create the compile and deploy tasks
|
(f) ant configure
|
||||||
|
will create the compile and deploy tasks
|
||||||
|
|
||||||
(g) ant deploy will compile and deploy into your test environment (runtime)
|
(g) ant deploy
|
||||||
|
will compile and deploy into your test environment (runtime)
|
||||||
|
|
||||||
(h) ant load-bundle will load the database. May take several minutes!
|
(h) ant load-bundle
|
||||||
|
will load the database. May take several minutes!
|
||||||
|
|
||||||
(i) ant start will start tomcat
|
(i) ant start
|
||||||
|
will start tomcat
|
||||||
|
|
||||||
(j) Open your browser:
|
(j) Open your browser:
|
||||||
http://localhost:8080/
|
http://localhost:8080/
|
||||||
http://localhost:8080/ccm/content-center/
|
http://localhost:8080/ccm/content-center/
|
||||||
|
|
||||||
(k) ant create-war will create a war file of the deployed project for
|
(k) ant create-war
|
||||||
|
will create a war file from the deployed project for
|
||||||
installation in any Tomcat 6 compliant servlet container.
|
installation in any Tomcat 6 compliant servlet container.
|
||||||
|
|
||||||
|
(l) ant package
|
||||||
|
will create a repository of binary modules which may serve
|
||||||
|
as a base for distribution and user install & maintenance
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
4. NOTES
|
4. NOTES
|
||||||
|
|
||||||
Configuration:
|
Configuration:
|
||||||
ccm-ldn-aplaws/bundles/* ("complete" bundle is default)
|
ccm-ldn-aplaws/bundles/* ("devel" bundle is default)
|
||||||
local.build.properties
|
local.build.properties
|
||||||
local.runtime.properties
|
local.runtime.properties
|
||||||
local.ccm.properties
|
local.ccm.properties
|
||||||
|
|
|
||||||
|
|
@ -7,16 +7,17 @@
|
||||||
Comment out those modules to don't need. Keep the included modules in sync
|
Comment out those modules to don't need. Keep the included modules in sync
|
||||||
with the bundles application file! -->
|
with the bundles application file! -->
|
||||||
|
|
||||||
<ccm:project name="aplaws-svn"
|
<ccm:project xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
||||||
prettyName="aplaws-svn"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
ccmVersion="6.1"
|
xsi:schemaLocation="http://ccm.redhat.com/ccm-project file:tools/devel/xsd/project.xsd"
|
||||||
type="application"
|
ccmVersion="6.1"
|
||||||
webxml="web.xml-aplaws"
|
name="aplaws"
|
||||||
xsi:schemaLocation="http://ccm.redhat.com/ccm-project file:tools/devel/xsd/project.xsd"
|
prettyName="APLAWS plus"
|
||||||
xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
type="application"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
version="1-0-5"
|
||||||
version="2.9.2"
|
release="alpha-1"
|
||||||
release="1">
|
webxml="web.xml-aplaws"
|
||||||
|
webapp="ROOT" >
|
||||||
|
|
||||||
<!-- List all target databases here -->
|
<!-- List all target databases here -->
|
||||||
<ccm:databases>
|
<ccm:databases>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue