| <!-- |
| Copyright 2008-2010 the EasyAnt project |
| |
| See the NOTICE file distributed with this work for additional information |
| regarding copyright ownership. |
| |
| 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 name="org.apache.easyant.plugins#run-java" xmlns:ea="antlib:org.apache.easyant"> |
| |
| <ea:core-version requiredrevision="[0.8,+]" /> |
| |
| <target name=":init" phase="validate"> |
| <ea:parameter phase="validate" /> |
| <ea:parameter phase="compile" /> |
| |
| <ea:parameter property="target.main.classes" required="true" description="directory where main compiled classes are" /> |
| |
| <ea:parameter property="project.main.classname" description="Used to define the project main class. The mainclass will then be used by many plugins (manifest, run-java, etc...)" /> |
| <ea:parameter property="run.main.classname" required="true" default="${project.main.classname}"> |
| Name of the main class to run. |
| By default this property take the same value as 'project.main.classname' property. |
| If you are looking for a way to reference your mainclass one time for all plugins you should set project.main.classname instead. |
| </ea:parameter> |
| |
| <ea:parameter path="compile.main.classpath" required="true" description="path used to compile main sources" /> |
| |
| <path id="run.main.classpath"> |
| <pathelement location="${target.main.classes}" /> |
| <path refid="compile.main.classpath" /> |
| </path> |
| |
| </target> |
| |
| <target name=":run" depends="validate, compile, process-resources" description="run the application"> |
| <available classname="${run.main.classname}" property="is.run.main.classname.configured" classpathref="run.main.classpath"/> |
| <fail unless="is.run.main.classname.configured" message="the 'run.main.classname' property is not properly configured. By default this property take the same value as 'project.main.classname' property. If you're looking for a way to reference your mainclass one time for all plugins you should set project.main.classname instead."/> |
| |
| <java classpathref="run.main.classpath" classname="${run.main.classname}" /> |
| </target> |
| |
| <target name=":doit" depends=":init, :run" /> |
| </project> |