blob: 5701d83c1825e05e4bd0378703d8d1a8d3792c8e [file]
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.9,+]" />
<ea:import mrid="org.apache.easyant.plugins#abstract-package;0.9" />
<target name="run-java:init">
<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...)" />
<condition property="project.main.classname.isset">
<not>
<isset property="project.main.classname"/>
</not>
</condition>
<ea:parameter property="run.main.classname" required="${project.main.classname.isset}" 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-java:run" depends="run-java:init,abstract-package:package-ready" 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>
</project>