<?xml version="1.0" encoding="UTF-8"?>
<!--
*** GENERATED FROM project.xml - DO NOT EDIT  ***
***         EDIT ../build.xml INSTEAD         ***

        -->
<project name="HelloWorld-impl" basedir="..">
    <property file="nbproject/project.properties"/>
    <!--nbproject/private.properties contains a pointer to the IDE's global build.properties-->
    <property file="nbproject/private/private.properties"/>
    <!--Load that, and it in turn will contain a pointer to the properties file representing the active platform, named jcproject.$PLATFORM_ACTIVE-->
    <property file="${user.properties.file}"/>
    <!--Load *that* file and we've got keys and values for the bootclasspath and everything else we need to know about the javacard platform-->
    <property name="platform.properties.file.key" value="jcplatform.${platform.active}"/>
    <!--Resolve a nested property so we can read the card platform definition-->
    <macrodef name="resolveProperty">
        <attribute name="property"/>
        <attribute name="value"/>
        <sequential>
            <property name="tmp1.@{property}" value="@{value}"/>
            <doResolveProperty property="@{property}" value="${tmp1.@{property}}"/>
        </sequential>
    </macrodef>
    <macrodef name="doResolveProperty">
        <attribute name="property"/>
        <attribute name="value"/>
        <sequential>
            <property name="@{property}" value="${@{value}}"/>
        </sequential>
    </macrodef>
    <macrodef name="resolvePropertyWithoutBrackets">
        <attribute name="property"/>
        <attribute name="value"/>
        <sequential>
            <property name="tmp1.@{property}" value="@{value}"/>
            <doResolvePropertyWithoutBrackets property="@{property}" value="tmp1.@{property}"/>
        </sequential>
    </macrodef>
    <macrodef name="doResolvePropertyWithoutBrackets">
        <attribute name="property"/>
        <attribute name="value"/>
        <sequential>
            <property name="@{property}" value="${@{value}}"/>
        </sequential>
    </macrodef>
    <resolveProperty property="computed.file.path" value="${platform.properties.file.key}"/>
    <echo>Using JavaCard Platform Definition at ${computed.file.path}</echo>
    <property file="${computed.file.path}"/>
    <echo>Java Card Home is ${javacard.home} (${javacard.name})</echo>
    <property name="platform.device.folder.path" value="jcplatform.${platform.active}.devicespath"/>
    <echo>Platform device property name is ${platform.device.folder.path}</echo>
    <resolveProperty property="computed.device.folder.path" value="${platform.device.folder.path}"/>
    <echo>Computed device folder path is ${computed.device.folder.path}</echo>
    <property name="platform.device.file.path" value="${computed.device.folder.path}${file.separator}${active.device}.${javacard.device.file.extension}"/>
    <echo>Platform device file path property name is ${platform.device.file.path}</echo>
    <property file="${platform.device.file.path}"/>
    <echo>Deploying to device ${javacard.device.name} http port ${javacard.device.httpPort}</echo>
    <property environment="env"/>
    <available file="${user.properties.file}" property="user.properties.file.set"/>
    <available file="${computed.file.path}" property="platform.properties.found"/>
    <available file="${platform.device.file.path}" property="device.properties.found"/>
    <available file="${javacard.home}" property="javacard.home.found"/>
    <property name="deployment.type.arg" value="web"/>
    <property name="keystore.unresolved" value="${sign.keystore}"/>
    <resolvePropertyWithoutBrackets property="keystore.resolved" value="${keystore.unresolved}"/>
    <echo>Keystore is ${keystore.resolved}</echo>
    <target name="__set_for_debug__">
        <property name="_fordebug_" value="true"/>
    </target>
    <property name="emulator.executable" value="${javacard.emulator}"/>
    <available file="${emulator.executable}" property="emulator.found"/>
    <target name="--init-jcdevkit-home-from-private-properties">
        <property file="nbproject/private/platform-private.properties"/>
        <fail unless="user.properties.file.set">

user.properties.file not set in nbproject/private/private.properties.
This should be set to the path on disk to the global NetBeans build.properties
(usually ${user.home}/.netbeans/7.0/build.properties or similar).

This file in turn contains a property jcplatform.${platform.active} which is a
path to a properties file which contains properties of the Java Card
platform this project will be run on, such as the path to the emulator
and other data.

To fix this problem, open this project in the NetBeans IDE.  In
Tools | Java Platforms, click Add Platform.  Select Java Card Platform from
the choices of platform kinds.  Locate your copy of a Java Card runtime on
disk.  Then right click this project in the Project tab, and make sure
the project is set up to use the Java Card Platform you have just defined.

Data about the path to the emulator is not stored in version control by
default, as it will differ between user machines.

                </fail>
        <fail unless="platform.properties.found">

Java Card platform properties file not found.  Was expecting to find an
entry named jcplatform.${platform.active} in ${user.properties.file} which
would point to a properties file containing the path to the Java Card
runtime and other information such as memory settings.

To fix this problem, open this project in the NetBeans IDE.  In
Tools | Java Platforms, click Add Platform.  Select Java Card Platform from
the choices of platform kinds.  Locate your copy of a Java Card runtime on
disk.  Then right click this project in the Project tab, and make sure
the project is set up to use the Java Card Platform you have just defined.

Data about the path to the emulator is not stored in version control by
default, as it will differ between user machines.

                </fail>
        <fail unless="javacard.home">
javacard.home not set.  This property should be set to a valid path on disk
to a Java Card Runtime install.

                </fail>
        <fail unless="javacard.home.found">
javacard.home set to ${javacard.home} in ${computed.file.path},
but ${javacard.home} does not exist on disk.
                </fail>
        <fail unless="emulator.found">
No emulator found at ${emulator.executable}
                </fail>
        <fail unless="device.properties.found">
                    No device definition (properties-format) file found at
                    ${platform.device.file.path}
                </fail>
    </target>
    <target name="-init" depends="--init-jcdevkit-home-from-private-properties">
        <property name="jcdk.lib" location="${javacard.home}/lib"/>
        <path id="javacard.classpath">
            <pathelement location="${javacard.bootclasspath}"/>
        </path>
        <path id="javacard.tasks.path">
            <pathelement path="${javacard.nbtasksClassPath}"/>
            <pathelement path="${javacard.toolClasspath}"/>
        </path>
        <taskdef name="jc-load" classname="${javacard.tasks.loadTaskClass}">
            <classpath>
                <path refid="javacard.tasks.path"/>
            </classpath>
        </taskdef>
        <taskdef name="jc-create" classname="${javacard.tasks.createTaskClass}">
            <classpath>
                <path refid="javacard.tasks.path"/>
            </classpath>
        </taskdef>
        <taskdef name="jc-delete" classname="${javacard.tasks.deleteTaskClass}">
            <classpath>
                <path refid="javacard.tasks.path"/>
            </classpath>
        </taskdef>
        <taskdef name="jc-unload" classname="${javacard.tasks.unloadTaskClass}">
            <classpath>
                <path refid="javacard.tasks.path"/>
            </classpath>
        </taskdef>
        <taskdef name="jc-browse" classname="${javacard.tasks.browseTaskClass}">
            <classpath>
                <path refid="javacard.tasks.path"/>
            </classpath>
        </taskdef>
        <mkdir dir="${build.dir}"/>
        <mkdir dir="${build.meta.inf.dir}"/>
        <mkdir dir="${build.classes.dir}"/>
        <mkdir dir="${dist.dir}"/>
        <mkdir dir="${build.web.inf.dir}"/>
    </target>
    <target name="__reset_for_debug__">
        <property name="_fordebug_" value="false"/>
    </target>
    <target name="create-descriptors">
        <copy todir="${build.web.inf.dir}">
            <fileset dir="${web.inf.dir}"/>
        </copy>
        <copy todir="${build.meta.inf.dir}">
            <fileset dir="${meta.inf.dir}"/>
        </copy>
    </target>
    <target name="pack" depends="unpack-dependencies,pack-unsigned,pack-signed"/>
    <target name="pack-unsigned" unless="sign.bundle">
        <java classname="${javacard.packagerClass}" dir="${javacard.home}/bin" classpath="${javacard.toolClassPath}" fork="true" failonerror="true">
            <arg value="create"/>
            <arg value="--type"/>
            <arg value="${deployment.type.arg}"/>
            <arg value="--out"/>
            <arg file="${dist.bundle}"/>
            <arg file="${build.dir}"/>
            <arg value="--force"/>
            <sysproperty key="jc.home" value="${javacard.home}"/>
        </java>
    </target>
    <target name="pack-signed" if="sign.bundle">
        <java classname="${javacard.packagerClass}" dir="${javacard.home}/bin" classpath="${javacard.toolClassPath}" fork="true" failonerror="true">
            <arg value="create"/>
            <arg value="--type"/>
            <arg value="${deployment.type.arg}"/>
            <arg value="--out"/>
            <arg file="${dist.bundle}"/>
            <arg value="--sign"/>
            <arg value="-K"/>
            <arg file="${keystore.resolved}"/>
            <arg value="-P"/>
            <arg value="password"/>
            <arg value="-S"/>
            <arg value="password"/>
            <arg value="-A"/>
            <arg value="ri"/>
            <arg file="${build.dir}"/>
            <arg value="--force"/>
            <sysproperty key="jc.home" value="${javacard.home}"/>
        </java>
    </target>
    <target name="run" depends="__reset_for_debug__, build, load-bundle, create-instance, run-client"/>
    <target name="run-for-debug" depends="__set_for_debug__, build, load-bundle, create-instance, run-client"/>
    <target name="build" depends="compile, create-descriptors, create-static-pages, pack"/>
    <target name="load-bundle" depends="-init,load-dependencies">
        <waitfor>
            <http url="${javacard.device.cardmanagerurl}"/>
        </waitfor>
        <jc-delete failonerror="no"/>
        <jc-unload failonerror="no"/>
        <jc-load failonerror="yes"/>
    </target>
    <target name="create-instance" depends="-init">
        <waitfor>
            <http url="${javacard.device.cardmanagerurl}"/>
        </waitfor>
        <jc-create failonerror="yes"/>
    </target>
    <target name="delete-instance" depends="-init">
        <waitfor>
            <http url="${javacard.device.cardmanagerurl}"/>
        </waitfor>
        <jc-delete failonerror="yes"/>
    </target>
    <target name="unload-bundle" depends="-init">
        <waitfor>
            <http url="${javacard.device.cardmanagerurl}"/>
        </waitfor>
        <antcall target="unload-dependencies"/>
        <jc-unload failonerror="yes"/>
    </target>
    <target name="run-client" if="run.browser" depends="-browse-servlet, -browse-page, -browse-explicit"/>
    <target name="-browse-servlet" if="use.servlet">
        <!---->
        <jc-browse url="${javacard.device.serverurl}${webcontextpath}${run.servlet.url}"/>
    </target>
    <target name="-browse-page" if="use.page">
        <!---->
        <jc-browse url="${javacard.device.serverurl}${webcontextpath}${run.page.url}"/>
    </target>
    <target name="-browse-explicit" if="use.url">
        <!---->
        <jc-browse url="${run.explicit.url}"/>
    </target>
    <target name="help">
        <echo>
help  - Displays this help message
clean - Cleans the project
build - Creates the deployable bundle (This is default target)
run   - Builds and deploys the application and starts the browser.

                </echo>
    </target>
    <target name="clean">
        <delete dir="${build.dir}"/>
        <delete dir="${dist.dir}"/>
    </target>
    <target name="compile" depends="-init">
        <javac destdir="${build.classes.dir}" source="${javac.source}" target="${javac.target}" nowarn="${javac.deprecation}" debug="${javac.debug}" optimize="no" bootclasspathref="javacard.classpath" includeAntRuntime="no">
            <src path="${src.dir}"/>
            <classpath/>
        </javac>
        <copy todir="${build.classes.dir}">
            <fileset dir="${src.dir}" includes="${includes}" excludes="${excludes}"/>
        </copy>
    </target>
    <target name="all" depends="build"/>
    <target name="create-static-pages" depends="-init">
        <copy todir="${build.dir}">
            <fileset dir="${staticpages.dir}"/>
        </copy>
    </target>
    <target name="load-dependencies" depends="build-dependencies,pack"/>
    <target name="unload-dependencies"/>
    <target name="unpack-dependencies" depends="-init">
        <mkdir dir="${build.classes.dir}"/>
    </target>
    <target name="build-dependencies" depends="-init" unless="dont.build.dependencies"/>
    <target name="clean-dependencies" depends="-init" unless="dont.build.dependencies"/>
    <target name="clean-with-dependencies" description="Cleans this project and any projects it depends on" depends="clean,clean-dependencies"/>
    <target name="build-with-dependencies" description="Builds any projects this project depends on, then builds this project" depends="build-dependencies,pack"/>
</project>
