NAME

XML::Ant::BuildFile::Project - consume Ant build files

VERSION

version 0.204

SYNOPSIS

use XML::Ant::BuildFile::Project;

my $project = XML::Ant::BuildFile::Project->new( file => 'build.xml' );
print 'Project name: ', $project->name, "\n";
print "File lists:\n";
for my $list_ref (@{$project->file_lists}) {
    print 'id: ', $list_ref->id, "\n";
    print join "\n", @{$list_ref->files};
    print "\n\n";
}

DESCRIPTION

This class uses XML::Rabbit to consume Ant build files using a Moose object-oriented interface.

ATTRIBUTES

file

On top of XML::Rabbit's normal behavior, this class will also coerce Path::Class::File objects to the strings expected by XML::Rabbit::Role::Document.

name

Name of the Ant project.

filelists

Array reference of XML::Ant::BuildFile::Project::FileLists.

targets

Hash reference of XML::Ant::BuildFile::Project::Targets from the build file. The keys are the target names.

properties

Read-only hash reference to properties set by the build file. This also contains the following predefined properties as per the Ant documentation:

os.name
basedir
ant.file
ant.project.name

METHODS

target_names

Returns a list of the target names from the build file.

get_target

Given a target name, return the corresponding XML::Ant::BuildFile::Project::Target object.

has_target

Given a target name, returns true or false if the target exists.

num_targets

Returns a count of the number of targets in the build file.

BUGS

Please report any bugs or feature requests on the bugtracker website http://github.com/mjgardner/XML-Ant-BuildFile/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

Mark Gardner <mjgardner@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by GSI Commerce.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.