<?xml version="1.0" encoding="UTF-8"?>
<project name="workspace-base" default="workspace-base">
    <description>
        Holds common imported definitions for ANT build.xml file(s)
    </description>

    <dirname property="module.root.folder" file="${ant.file}" />
    <basename property="module.artifact.name" file="${module.root.folder}" />
    <property name="jna.parent.folder" value="${module.root.folder}" />
    <dirname property="jna.root.folder" file="${jna.parent.folder}" />
    <property name="workspace.root.folder" value="${jna.root.folder}" />

    <!-- user-specific overrides - not part of version control system -->
    <property name="build.local.properties.filename" value="build.local.properties" />
    <property file="${jna.parent.folder}${file.separator}${build.local.properties.filename}" />

    <!-- version control system settings for the specific version -->
    <property name="build.version.properties.filename" value="build.version.properties" />
    <property file="${jna.parent.folder}${file.separator}${build.version.properties.filename}" />

    <!-- import the environment -->
    <property environment="env"/>
        <!-- NOTE: must match the parent super-POM version -->
    <property name="project.version" value="4.3.0-SNAPHSOT" />

    <!-- detect type of O/S -->
    <condition property="win32.local.shell" value="true" else="false">
        <contains string="${os.name}" substring="windows" casesensitive="false" />
    </condition>
    <condition property="linux.local.shell" value="true" else="false">
        <isfalse value="${win32.local.shell}" />
    </condition>
    <condition property="shell.script.suffix" value="sh" else="bat">
        <isfalse value="${win32.local.shell}" />
    </condition>

    <!-- some useful general sub-folders names -->
    <property name="lib.sub.folder.name" value="lib"/>
    <property name="bin.sub.folder.name" value="bin"/>
    <property name="metainf.sub.folder.name" value="META-INF"/>
    <property name="webinf.sub.folder.name" value="WEB-INF"/>

        <!-- default name of manifest file -->
    <property name="manifest.file.name" value="MANIFEST.MF"/>

    <!-- useful file(s) suffixes -->
    <property name="jar.file.suffix" value="jar"/>
    <property name="zip.file.suffix" value="zip"/>
    <property name="war.file.suffix" value="war"/>

    <property name="module.artifact.version" value="${project.version}" />
    <property name="module.artifact.jar.name" value="${module.artifact.name}-${module.artifact.version}.${jar.file.suffix}" />
    <property name="module.artifact.zip.name" value="${module.artifact.name}-${module.artifact.version}.${zip.file.suffix}" />

    <!-- some useful module(s) sub-folders names -->
    <property name="target.sub.folder.name" value="target" />
    <property name="src.sub.folder.name" value="src" />
    <property name="main.sub.folder.name" value="main" />
    <property name="resources.sub.folder.name" value="resources" />
    <property name="classes.sub.folder.name" value="classes" />
    <property name="java.sub.folder.name" value="java" />
    <property name="webapp.sub.folder.name" value="webapp" />
    <property name="test.sub.folder.name" value="test"/>
    <property name="test.classes.sub.folder.name" value="${test.sub.folder.name}-${classes.sub.folder.name}" />
    <property name="lib.sub.folder.name" value="lib" />

    <!-- specific module/project relative locations to the build.xml file -->
    <property name="module.main.sub.folder.path" value="${src.sub.folder.name}${file.separator}${main.sub.folder.name}" />
    <property name="module.java.sub.folder.path" value="${module.main.sub.folder.path}${file.separator}${java.sub.folder.name}" />
    <property name="module.resources.sub.folder.path" value="${module.main.sub.folder.path}${file.separator}${resources.sub.folder.name}" />
    <property name="module.webapp.sub.folder.path" value="${module.main.sub.folder.path}${file.separator}${webapp.sub.folder.name}" />
    <property name="module.webinf.sub.folder.path" value="${module.webapp.sub.folder.path}${file.separator}${webinf.sub.folder.name}" />
    <property name="module.test.sub.folder.path" value="${src.sub.folder.name}${file.separator}${test.sub.folder.name}" />
    <property name="module.test.java.sub.folder" value="${module.test.sub.folder.path}${file.separator}${java.sub.folder.name}" />
    <property name="module.test.resources.sub.folder" value="${module.test.sub.folder.path}${file.separator}${resources.sub.folder.name}" />
    <property name="module.test.webapp.sub.folder" value="${module.test.sub.folder.path}${file.separator}${webapp.sub.folder.name}" />
    <property name="module.test.webinf.sub.folder" value="${module.test.webapp.sub.folder}${file.separator}${webinf.sub.folder.name}" />

    <!-- specific module/project absolute locations -->
    <property name="module.src.folder" value="${module.root.folder}${file.separator}${src.sub.folder.name}" />
    <property name="module.main.folder" value="${module.root.folder}${file.separator}${module.main.sub.folder.path}" />
    <property name="module.java.folder" value="${module.root.folder}${file.separator}${module.java.sub.folder.path}" />
    <property name="module.resources.folder" value="${module.root.folder}${file.separator}${module.resources.sub.folder.path}" />
    <property name="module.webapp.folder" value="${module.root.folder}${file.separator}${module.webapp.sub.folder.path}" />
    <property name="module.webinf.folder" value="${module.webapp.folder}${file.separator}${webinf.sub.folder.name}" />

    <property name="module.test.folder" value="${module.root.folder}${file.separator}${module.test.sub.folder.path}" />
    <property name="module.test.java" value="${module.root.folder}${file.separator}${module.test.java.sub.folder}" />
    <property name="module.test.resources" value="${module.root.folder}${file.separator}${module.test.resources.sub.folder}" />

    <!-- useful sub-folder - under which the module's classes and META-INF sub-folder(s) reside -->
    <property name="module.target.folder" value="${module.root.folder}${file.separator}${target.sub.folder.name}" />
    <property name="module.target.classes" value="${module.target.folder}${file.separator}${classes.sub.folder.name}" />

    <property name="module.artifact.jar.path" value="${module.target.folder}${file.separator}${module.artifact.jar.name}" />
    <property name="module.artifact.zip.path" value="${module.target.folder}${file.separator}${module.artifact.zip.name}" />

    <target name="workspace-base" />
</project>
