MPGENAPP-23: added property maven.genapp.repackage.dir as base directory for maven.genapp.repackage

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@328520 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
felipeal
2005-10-26 01:20:50 +00:00
parent a9ae608139
commit ecaf4b11f5
8 changed files with 156 additions and 6 deletions

View File

@@ -131,9 +131,9 @@
<!-- copy resources that need repackaged, eg java files -->
<j:forEach var="res" items="${maven.genapp.repackage.split}">
<ant:copy todir="${generatedBasedir}/src/${res}/${appPath}"
<ant:copy todir="${generatedBasedir}/${maven.genapp.repackage.dir}/${res}/${appPath}"
filtering="true">
<ant:fileset dir="${maven.genapp.resources}/src/${res}" />
<ant:fileset dir="${maven.genapp.resources}/${maven.genapp.repackage.dir}/${res}" />
</ant:copy>
</j:forEach>
@@ -145,17 +145,15 @@
</j:forEach>
</ant:fileset>
</ant:copy>
<!-- copy rest of app unfiltered -->
<ant:copy todir="${generatedBasedir}">
<ant:fileset dir="${maven.genapp.resources}">
<ant:exclude name="src/java"/>
<ant:exclude name="src/test"/>
<j:forEach var="res" items="${maven.genapp.filter}">
<ant:exclude name="${res}"/>
</j:forEach>
<j:forEach var="res" items="${maven.genapp.repackage.split}">
<ant:exclude name="src/${res}/**"/>
<ant:exclude name="${maven.genapp.repackage.dir}/${res}/**"/>
</j:forEach>
</ant:fileset>
</ant:copy>

View File

@@ -32,3 +32,7 @@ maven.genapp.default.user=${user.name}
# directory where the artefacts will be created
maven.genapp.basedir=${basedir}
# base directory for the maven.genapp.repackage
maven.genapp.repackage.dir=src

View File

@@ -0,0 +1,52 @@
<!--
/*
* Copyright 2005 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.
*/
-->
<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:assert="assert" default="testPlugin">
<goal name="testPlugin" prereqs="test-genapp">
<attainGoal name="clean"/>
</goal>
<goal name="prepare-template">
<ant:copy todir="${maven.genapp.template.dir}">
<ant:fileset dir="${basedir}/../../plugin-resources/default/">
<ant:exclude name="template.properties"/>
</ant:fileset>
</ant:copy>
<ant:move todir="${maven.genapp.template.dir}/template-resources/my_src">
<ant:fileset dir="${maven.genapp.template.dir}/template-resources/src"/>
</ant:move>
<ant:move todir="${maven.genapp.template.dir}/template-resources/my_src/my_java">
<ant:fileset dir="${maven.genapp.template.dir}/template-resources/my_src/java"/>
</ant:move>
<ant:move todir="${maven.genapp.template.dir}/template-resources/my_src/my_test">
<ant:fileset dir="${maven.genapp.template.dir}/template-resources/my_src/test"/>
</ant:move>
<ant:copy todir="${maven.genapp.template.dir}" file="${basedir}/template.properties"/>
</goal>
<goal name="test-genapp" prereqs="clean">
<attainGoal name="prepare-template"/>
<attainGoal name="genapp"/>
<assert:assertFileExists file="${maven.genapp.basedir}"/>
<assert:assertFileExists file="${maven.genapp.basedir}/project.xml"/>
<assert:assertFileExists file="${maven.genapp.basedir}/project.properties"/>
<assert:assertFileExists file="${maven.genapp.basedir}/${mySrc}"/>
<assert:assertFileExists file="${maven.genapp.basedir}/${mySrc}/${myJava}"/>
<assert:assertFileExists file="${maven.genapp.basedir}/${mySrc}/${myTest}"/>
</goal>
</project>

View File

@@ -0,0 +1,30 @@
# -------------------------------------------------------------------
# Copyright 2005 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.
# -------------------------------------------------------------------
# where is the template
maven.genapp.template.dir=${maven.build.dir}/non-standard-template
# directory where it should be generated
maven.genapp.basedir=${maven.build.dir}/my_genapp
# properties that set non-standard directories
mySrc=my_src
maven.genapp.repackage.dir=${mySrc}
# properties necessary to skip the prompt
template=default
maven.genapp.template.id=myId
maven.genapp.template.name="Genapp testcase"
maven.genapp.template.package=org.apache.genapp

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* Copyright 2005 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.
*/
-->
<project xmlns="http://maven.apache.org/POM/3.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/3.0.0
http://maven.apache.org/maven-v3_0_0.xsd">
<pomVersion>3</pomVersion>
<name>Genapp Plugin - Non-Standard Directories Test</name>
<artifactId>test-maven-genapp-plugin-basedirTest</artifactId>
<inceptionYear>2005</inceptionYear>
<shortDescription>Tests maven.genapp.basedir property</shortDescription>
<description>Tests maven.genapp.basedir property</description>
<url/>
<developers>
<developer>
<name>Felipe Leme</name>
<id>felipeal</id>
<email>maven@felipeal.net</email>
<organization>Falcon Informatica</organization>
</developer>
</developers>
</project>

View File

@@ -0,0 +1,20 @@
# -------------------------------------------------------------------
# Copyright 2005 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.
# -------------------------------------------------------------------
maven.genapp.repackage=my_java,my_test
maven.genapp.filter=project.xml
maven.genapp.default.package=example.app

View File

@@ -22,6 +22,7 @@
</properties>
<body>
<release version="2.3-SNAPSHOT" date="in SVN">
<action dev="felipeal" type="add" issue="MPGENAPP-23">Added property <code>maven.genapp.repackage.dir</code> as base directory for <code>maven.genapp.repackage</code>.</action>
<action dev="felipeal" type="add" issue="MPGENAPP-24">Added new property <code>maven.genapp.basedir property</code>.</action>
<action dev="aheritier" type="update" issue="MAVEN-1712">Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependencies are updated :
<ul>

View File

@@ -104,6 +104,15 @@
${basedir}
</td>
</tr>
<tr>
<td>maven.genapp.repackage.dir</td>
<td>
Base directory for the <code>maven.genapp.repackage</code> property.
</td>
<td>
${src}
</td>
</tr>
</table>
</section>
<section name="Application Generation Filter Settings">