<?xml version="1.0"?>
<!--
  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 default="build-feature" basedir="." name="Wookie_features_build_file">
	<property name="wookie.features.dir" location="."/>
	<property name="project.build.classes.dir" location="${project.build.dir}/classes" />
	<property name="feature.shared.dir" value="${servletEngine.webapp.dir}/wookie/shared/feature/${feature.shortname}"/>   
	
	<target name="_clean">
     </target>
   
   <target name="_init" depends="_validate, _clean">
   </target>

	<target name="_validate">
		<fail unless="feature.shortname" message="Property feature.shortname has not been set"/>
	</target>
   
    <target name="build-feature" depends="_init">
		<!-- compile classes -->
		<javac 
			source="${java.source.version}" 
			target="${java.target.version}" 
		    destdir="${project.build.classes.dir}" 
			debug="${compile.debug}" 
			>
			<src path="${wookie.features.dir}/${feature.shortname}/src" />
		</javac>
    	<!-- copy to classes dir -->
    </target>
	
	<target name="deploy-feature">
		<echo>Deploying feature: ${feature.shortname}</echo>
		<!-- copy shared resources -->
	    <mkdir dir="${feature.shared.dir}"/>
		<copy todir="${feature.shared.dir}">
			<fileset dir="${wookie.features.dir}/${feature.shortname}/shared/"/>
		</copy>
	</target>
</project>
