alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Commons Attributes example source code file (plugin.jelly)

This example Commons Attributes source code file (plugin.jelly) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Commons Attributes tags/keywords

apache, apache, conditions, foundation, i, i, is, license, license, of, see, the, the, you

The Commons Attributes plugin.jelly source code

<?xml version="1.0"?>
<!--
=
= Copyright 2003-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.
=
-->
<project xmlns:j="jelly:core"
  xmlns:define="jelly:define"
  xmlns:util="jelly:util"
  xmlns:maven="jelly:maven"
  xmlns:ant="jelly:ant">

    <ant:path id="plugin.class.path">
        <pathelement path="${plugin.getDependencyPath('commons-attributes:commons-attributes-api')}"/>
        <pathelement path="${plugin.getDependencyPath('commons-attributes:commons-attributes-compiler')}"/>

        <pathelement path="${plugin.getDependencyPath('qdox')}"/>
    </ant:path>

    <ant:taskdef 
        resource="org/apache/commons/attributes/anttasks.properties"
        classpathref="plugin.class.path"/>

    <goal name="commons-attributes:compile">
        <ant:mkdir dir="${maven.build.dir}/commons-attributes"/>

        <ant:attribute-compiler inMaven="true" sourcepathref="maven.compile.src.set"
            destdir="${maven.build.dir}/commons-attributes"
            attributepackages="${org.apache.commons.attributes.attributepackages}"/>

        <ant:path 
            id="jakarta.commons.attributes.generated.dir" 
            location="${maven.build.dir}/commons-attributes"/>

        <maven:addPath 
            id="maven.compile.src.set"  
            refid="jakarta.commons.attributes.generated.dir"/>
    </goal>

    <preGoal name="java:compile"> 
        <j:if test="${sourcesPresent == 'true'}">
            <j:set var="caEnabled" value="${org.apache.commons.attributes.enable}"/>
            <j:if test="${caEnabled == 'true'}">
                <attainGoal name="commons-attributes:compile"/>
            </j:if>            
        </j:if>
    </preGoal>

    <preGoal name="test:compile">
        <j:if test="${unitTestSourcesPresent == 'true'}">
            <j:set var="caEnabled" value="${org.apache.commons.attributes.enable}"/>
            <j:if test="${caEnabled == 'true'}">
                <attainGoal name="commons-attributes:test-compile"/>
            </j:if>            
        </j:if>
    </preGoal>

    <goal name="commons-attributes:test-compile">
        <ant:attribute-compiler 
            inMaven="true" 
            sourcepathref="maven.test.compile.src.set"
            destdir="${maven.build.dir}/commons-attributes-unittest"
            attributepackages="${org.apache.commons.attributes.attributepackages}"/>

        <ant:path 
            id="jakarta.commons.attributes.generated.dir.test" 
            location="${maven.build.dir}/commons-attributes-unittest"/>

        <maven:addPath 
            id="maven.test.compile.src.set"  
            refid="jakarta.commons.attributes.generated.dir.test"/>
    </goal>

    <postGoal name="jar:jar">
        <!--
        For the life of me I can't figure out how to get the
        filename of the snapshot jar that jar:jar has just created.

        The maven.final.name variable is only set locally by the jar:snapshot
        goal, and thus all I see here is the projectname-version.jar name.
        -->
        <j:set var="caIndexEnabled" value="${org.apache.commons.attributes.index.enable}"/>
        <j:if test="${caIndexEnabled == 'true'}">
            <ant:attribute-indexer baseName="${maven.build.dir}/${pom.artifactId}">
                <classpath>
                    <path refid="maven.dependency.classpath"/>
                </classpath>
            </ant:attribute-indexer>
        </j:if>
    </postGoal>
</project>

Other Commons Attributes examples (source code examples)

Here is a short list of links related to this Commons Attributes plugin.jelly source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.