<?xml version="1.0" encoding="UTF-8"?>
<!--

    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.

-->

<!--
  This is the build script for the helloworld product package.

  It inherits most of the functionality from the base script for building nbi
  product packages, while providing this instance-specific values for several
  core properties. For more details on the values of these properties see
  the build.properties file.
-->
<project name="helloworld-product" default="usage" basedir=".">
    <!-- import the properties that are specific to this environment -->
    <property file="${environment.properties}"/>

    <!-- import the properties that are specific to this product package -->
    <property file="build.properties"/>

    <!-- import the base script for building product packages -->
    <import file="${common.dir}/product.xml" optional="false"/>

    <target name="-pre-package">
        <mkdir dir="${data.directory}/__tmpdir__"/>

        <move todir="${data.directory}/__tmpdir__">
            <fileset dir="${data.directory}/${product.data.sub.dir}">
                <include name="**"/>
            </fileset>
        </move>
        
        <delete dir="${data.directory}/${product.data.sub.dir}" includeemptydirs="true"/>

        <move todir="${data.directory}">
            <fileset dir="${data.directory}/__tmpdir__">
                <include name="**"/>
            </fileset>
        </move>
        <delete dir="${data.directory}/__tmpdir__" includeemptydirs="true"/>
        <!--
        <exec executable="sh" failonerror="false" dir="${data.directory}">
            <arg value="-c"/>
            <arg value="chmod a+x bin/*.sh"/>
        </exec>
        -->
    </target>

    <!--
      The default target. 
      
      Does nothing except printing the usage information.
    -->
    <target name="usage">
        <echo>
            In order to 'clean', 'checkout' and 'build' the group use the 
            'build-all' target. To 'clean', 'checkout', 'build' and 
            'release' - use 'release-all'.
            
            For more details, please see the source of this build script.
        </echo>
    </target>
</project>
