java/SuperPostak/nbproject/jnlp-impl.xml
changeset 0 e76872ad5226
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/java/SuperPostak/nbproject/jnlp-impl.xml	Sun Nov 23 22:19:20 2008 +0100
     1.3 @@ -0,0 +1,453 @@
     1.4 +<?xml version="1.0" encoding="UTF-8"?>
     1.5 +<!--
     1.6 +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     1.7 +
     1.8 +Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
     1.9 +
    1.10 +
    1.11 +The contents of this file are subject to the terms of either the GNU
    1.12 +General Public License Version 2 only ("GPL") or the Common
    1.13 +Development and Distribution License("CDDL") (collectively, the
    1.14 +"License"). You may not use this file except in compliance with the
    1.15 +License. You can obtain a copy of the License at
    1.16 +http://www.netbeans.org/cddl-gplv2.html
    1.17 +or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    1.18 +specific language governing permissions and limitations under the
    1.19 +License.  When distributing the software, include this License Header
    1.20 +Notice in each file and include the License file at
    1.21 +nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
    1.22 +particular file as subject to the "Classpath" exception as provided
    1.23 +by Sun in the GPL Version 2 section of the License file that
    1.24 +accompanied this code. If applicable, add the following below the
    1.25 +License Header, with the fields enclosed by brackets [] replaced by
    1.26 +your own identifying information:
    1.27 +"Portions Copyrighted [year] [name of copyright owner]"
    1.28 +
    1.29 +Contributor(s):
    1.30 +
    1.31 +The Original Software is NetBeans. The Initial Developer of the Original
    1.32 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
    1.33 +Microsystems, Inc. All Rights Reserved.
    1.34 +
    1.35 +If you wish your version of this file to be governed by only the CDDL
    1.36 +or only the GPL Version 2, indicate your decision by adding
    1.37 +"[Contributor] elects to include this software in this distribution
    1.38 +under the [CDDL or GPL Version 2] license." If you do not indicate a
    1.39 +single choice of license, a recipient has the option to distribute
    1.40 +your version of this file under either the CDDL, the GPL Version 2 or
    1.41 +to extend the choice of license to its licensees as provided above.
    1.42 +However, if you add GPL Version 2 code and therefore, elected the GPL
    1.43 +Version 2 license, then the option applies only if the new code is
    1.44 +made subject to such option by the copyright holder.
    1.45 +-->
    1.46 +
    1.47 +<project name="jnlp-impl" default="default" basedir="..">
    1.48 +
    1.49 +    <property name="master.jnlp.file" location="master.jnlp"/>
    1.50 +    <property name="launch.jnlp.file" value="launch.jnlp"/>
    1.51 +    <property name="jnlp.dest.dir" location="dist"/>
    1.52 +    
    1.53 +    <!-- helper file to create list of arguments, etc. -->
    1.54 +    <property name="helper.file" location="helper.txt"/>
    1.55 +    
    1.56 +    <target name="default">
    1.57 +        <echo message="Default target is not set."/>
    1.58 +    </target>
    1.59 +    
    1.60 +    <!-- Main target -->
    1.61 +    
    1.62 +    <target name="jnlp" depends="-init-check,-test-jnlp-enabled" if="is.jnlp.enabled">
    1.63 +        <delete file="dist/lib/javaws.jar" failonerror="false"/>
    1.64 +        <antcall target="generate-jnlp"/>
    1.65 +    </target>
    1.66 +    
    1.67 +    <!-- Generate master -->
    1.68 +    
    1.69 +    <target name="-check-for-master.jnlp">
    1.70 +        <available file="${master.jnlp.file}" property="master.jnlp.exists"/>
    1.71 +    </target>
    1.72 +    <target name="jnlp-init-generate-master" depends="-check-for-master.jnlp" unless="master.jnlp.exists">
    1.73 +        <echo file="${master.jnlp.file}" encoding="UTF-8"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
    1.74 +<jnlp spec="1.0+" codebase="$${jnlp.codebase}" href="launch.jnlp">
    1.75 +    <information>
    1.76 +        <title>$${APPLICATION.TITLE}</title>
    1.77 +        <vendor>$${APPLICATION.VENDOR}</vendor>
    1.78 +        <description>$${APPLICATION.DESC}</description>
    1.79 +        <description kind="short">$${APPLICATION.DESC.SHORT}</description>
    1.80 +        <homepage href="$${APPLICATION.HOMEPAGE}"/>
    1.81 +<!--$${JNLP.ICONS}-->
    1.82 +<!--$${JNLP.OFFLINE.ALLOWED}-->
    1.83 +    </information>
    1.84 +<!--$${JNLP.SECURITY}-->
    1.85 +    <resources>
    1.86 +<!--$${JNLP.RESOURCES.RUNTIME}-->
    1.87 +<!--$${JNLP.RESOURCES.MAIN.JAR}-->
    1.88 +<!--$${JNLP.RESOURCES.JARS}-->
    1.89 +    </resources>
    1.90 +    <application-desc main-class="$${jnlp.main.class}">
    1.91 +<!--$${JNLP.APPLICATION.ARGS}-->
    1.92 +    </application-desc>
    1.93 +</jnlp>
    1.94 +]]></echo>
    1.95 +    </target>
    1.96 +    
    1.97 +    <!-- Initial check -->
    1.98 +    
    1.99 +    <target name="-init-check">
   1.100 +        <fail unless="application.title" message="Must set application title."/>
   1.101 +        <fail unless="application.vendor" message="Must set application vendor."/>
   1.102 +    </target>
   1.103 +    
   1.104 +    <!-- Icons -->
   1.105 +    
   1.106 +    <target name="-init-icons" depends="-preinit-icons,-set-icon-elem,-set-splash-elem">
   1.107 +        <property name="jnlp.icon.elem" value=""/>
   1.108 +        <property name="application.splash.elem" value=""/>
   1.109 +        <property name="icon.separator" value=""/>
   1.110 +        <property name="jnlp.icons.value" value="${jnlp.icon.elem}${icon.separator}${application.splash.elem}"/>
   1.111 +    </target>
   1.112 +    <target name="-preinit-icons" depends="-copy-app-icon,-copy-app-splash"/>
   1.113 +    <target name="-copy-app-icon" if="jnlp.icon" depends="-get-app-icon-name">
   1.114 +        <copy file="${jnlp.icon}" todir="${jnlp.dest.dir}" failonerror="false"/>
   1.115 +        <available file="${jnlp.dest.dir}${file.separator}${jnlp.icon.name}" property="jnlp.icon.copied"/>
   1.116 +    </target>
   1.117 +    <target name="-copy-app-splash" if="application.splash" depends="-get-app-splash-name">
   1.118 +        <copy file="${application.splash}" todir="${jnlp.dest.dir}" failonerror="false"/>
   1.119 +        <available file="${jnlp.dest.dir}${file.separator}${application.splash.name}" property="application.splash.copied"/>
   1.120 +    </target>
   1.121 +    <target name="-get-app-icon-name" if="jnlp.icon">
   1.122 +        <dirname file="${jnlp.icon}" property="jnlp.icon.basedir"/>
   1.123 +        <pathconvert property="jnlp.icon.name" setonempty="false">
   1.124 +            <path location="${jnlp.icon}"/>
   1.125 +            <map from="${jnlp.icon.basedir}${file.separator}" to=""/>
   1.126 +        </pathconvert>
   1.127 +    </target>
   1.128 +    <target name="-get-app-splash-name" if="application.splash">
   1.129 +        <dirname file="${application.splash}" property="application.splash.basedir"/>
   1.130 +        <pathconvert property="application.splash.name" setonempty="false">
   1.131 +            <path location="${application.splash}"/>
   1.132 +            <map from="${application.splash.basedir}${file.separator}" to=""/>
   1.133 +        </pathconvert>
   1.134 +    </target>
   1.135 +    <target name="-set-icon-elem" if="jnlp.icon.copied">
   1.136 +        <property name="jnlp.icon.elem" value='        &lt;icon href="${jnlp.icon.name}" kind="default"/&gt;'/>
   1.137 +    </target>
   1.138 +    <target name="-set-splash-elem" if="application.splash.copied" depends="-set-icon-elem">
   1.139 +        <property name="application.splash.elem" value='        &lt;icon href="${application.splash.name}" kind="splash"/&gt;'/>
   1.140 +        <condition property="icon.separator" value="${line.separator}">
   1.141 +            <isset property="jnlp.icon.elem"/>
   1.142 +        </condition>
   1.143 +    </target>
   1.144 +    
   1.145 +    <!-- Offline-Allowed -->
   1.146 +    
   1.147 +    <target name="-init-offline" if="offline.allowed.set" depends="-preinit-offline">
   1.148 +        <property name="jnlp.offline.allowed.value" value="        &lt;offline-allowed/&gt;"/>
   1.149 +    </target>
   1.150 +    <target name="-preinit-offline">
   1.151 +        <condition property="offline.allowed.set">
   1.152 +            <equals arg1="${jnlp.offline-allowed}" arg2="true" trim="true"/>
   1.153 +        </condition>
   1.154 +    </target>
   1.155 +    
   1.156 +    <!-- Descriptions -->
   1.157 +    
   1.158 +    <target name="-init-descriptions" depends="-descriptions-props-check,-init-desc-value,-init-desc-value-short">
   1.159 +        <property name="application.desc.value" value="${application.title}"/>
   1.160 +        <property name="application.desc.short.value" value="${application.title}"/>
   1.161 +    </target>
   1.162 +    <target name="-descriptions-props-check">
   1.163 +        <condition property="application.desc.set">
   1.164 +            <and>
   1.165 +                <isset property="application.desc"/>
   1.166 +                <not>
   1.167 +                    <equals arg1="${application.desc}" arg2="" trim="true"/>
   1.168 +                </not>
   1.169 +            </and>
   1.170 +        </condition>
   1.171 +        <condition property="application.desc.short.set">
   1.172 +            <and>
   1.173 +                <isset property="application.desc.short"/>
   1.174 +                <not>
   1.175 +                    <equals arg1="${application.desc.short}" arg2="" trim="true"/>
   1.176 +                </not>
   1.177 +            </and>
   1.178 +        </condition>
   1.179 +    </target>
   1.180 +    <target name="-init-desc-value" if="application.desc.set">
   1.181 +        <property name="application.desc.value" value="${application.desc}"/>
   1.182 +    </target>
   1.183 +    <target name="-init-desc-value-short" if="application.desc.short.set">
   1.184 +        <property name="application.desc.short.value" value="${application.desc.short}"/>
   1.185 +    </target>
   1.186 +    
   1.187 +    <!-- Security -->
   1.188 +    
   1.189 +    <target name="-init-security" depends="-check-signing-possible" if="jnlp.signed.true+signjarstask.available">
   1.190 +        <property name="jnlp.security" value="    &lt;security&gt;${line.separator}        &lt;all-permissions/&gt;${line.separator}    &lt;/security&gt;"/>
   1.191 +    </target>
   1.192 +    <target name="-security-props-check">
   1.193 +        <condition property="jnlp.signed.true">
   1.194 +            <istrue value="${jnlp.signed}"/>
   1.195 +        </condition>
   1.196 +    </target>
   1.197 +    <target name="-jnlp-init-keystore" depends="-jnlp-init-keystore-props,-check-keystore-exists" unless="jnlp.signjar.keystore.exists">
   1.198 +        <echo message="${application.vendor}" file="${helper.file}"/>
   1.199 +        <loadfile property="application.vendor.filtered" srcfile="${helper.file}">
   1.200 +            <filterchain>
   1.201 +                <deletecharacters chars=","/>
   1.202 +            </filterchain>
   1.203 +        </loadfile>
   1.204 +        <delete file="${helper.file}"/>
   1.205 +        <property name="jnlp.signjar.vendor" value="CN=${application.vendor.filtered}"/>
   1.206 +        <echo message="Going to create default keystore in ${jnlp.signjar.keystore}"/>
   1.207 +        <genkey dname="${jnlp.signjar.vendor}" alias="${jnlp.signjar.alias}" keystore="${jnlp.signjar.keystore}"
   1.208 +            storepass="${jnlp.signjar.storepass}" keypass="${jnlp.signjar.keypass}"/>
   1.209 +    </target>
   1.210 +    <target name="-check-keystore-exists">
   1.211 +        <available property="jnlp.signjar.keystore.exists" file="${jnlp.signjar.keystore}"/>
   1.212 +    </target>
   1.213 +    <target name="-jnlp-init-keystore-props">
   1.214 +        <property name="jnlp.signjar.keystore" value="${basedir}/build/nb-jws.ks"/>
   1.215 +        <property name="jnlp.signjar.storepass" value="storepass"/>
   1.216 +        <property name="jnlp.signjar.keypass" value="keypass"/>
   1.217 +        <property name="jnlp.signjar.alias" value="nb-jws"/>
   1.218 +    </target>    
   1.219 +    
   1.220 +    <!-- Generating JNLP file -->
   1.221 +    
   1.222 +    <target name="generate-jnlp" depends="jnlp-init-generate-master,-init-codebase,-init-resources-runtime,-init-security,-init-resources-jars,-init-application-args,-init-icons,-init-offline,-init-descriptions,jnlp-init-notinited">
   1.223 +        <copy file="${master.jnlp.file}" tofile="${jnlp.dest.dir}/${launch.jnlp.file}__" overwrite="true" encoding="UTF-8">
   1.224 +            <filterchain>
   1.225 +                <replacestring from="$${jnlp.codebase}" to="${jnlp.codebase.value}"/>
   1.226 +                <replacestring from="&lt;!--$${JNLP.ICONS}--&gt;" to="${jnlp.icons.value}"/>
   1.227 +                <replacestring from="&lt;!--$${JNLP.SECURITY}--&gt;" to="${jnlp.security}"/>
   1.228 +                <replacestring from="&lt;!--$${JNLP.OFFLINE.ALLOWED}--&gt;" to="${jnlp.offline.allowed.value}"/>
   1.229 +                <replacestring from="&lt;!--$${JNLP.RESOURCES.RUNTIME}--&gt;" to="${jnlp.resources.runtime.value}"/>
   1.230 +                <replacestring from="&lt;!--$${JNLP.RESOURCES.MAIN.JAR}--&gt;" to="${jnlp.resources.main.jar.value}"/>
   1.231 +                <replacestring from="&lt;!--$${JNLP.RESOURCES.JARS}--&gt;" to="${jnlp.resources.jars.value}"/>
   1.232 +                <replacestring from="&lt;!--$${JNLP.APPLICATION.ARGS}--&gt;" to="${jnlp.application.args.value}"/>
   1.233 +                <replacestring from="$${APPLICATION.TITLE}" to="${application.title}"/>
   1.234 +                <replacestring from="$${APPLICATION.VENDOR}" to="${application.vendor}"/>
   1.235 +                <replacestring from="$${APPLICATION.DESC}" to="${application.desc.value}"/>
   1.236 +                <replacestring from="$${APPLICATION.DESC.SHORT}" to="${application.desc.short.value}"/>
   1.237 +                <replacestring from="$${APPLICATION.HOMEPAGE}" to="${application.homepage}"/>
   1.238 +                <replacestring from="$${jnlp.main.class}" to="${main.class}"/>
   1.239 +            </filterchain>
   1.240 +        </copy>
   1.241 +        <antcall target="-strip-empty-lines"/>
   1.242 +        <antcall target="-generate-html-page"/>
   1.243 +    </target>
   1.244 +    <target name="jnlp-init-notinited">
   1.245 +        <property name="jnlp.security" value=""/>
   1.246 +        <property name="jnlp.offline.allowed.value" value=""/>
   1.247 +        <property name="application.homepage" value=""/>
   1.248 +        <property name="jnlp.application.args.value" value=""/>
   1.249 +    </target>
   1.250 +    <target name="-strip-empty-lines">
   1.251 +        <move file="${jnlp.dest.dir}/${launch.jnlp.file}__" tofile="${jnlp.dest.dir}/${launch.jnlp.file}" overwrite="true" encoding="UTF-8">
   1.252 +            <filterchain>
   1.253 +                <linecontainsregexp>
   1.254 +                    <regexp pattern=".+"/>
   1.255 +                </linecontainsregexp>
   1.256 +            </filterchain>
   1.257 +        </move>
   1.258 +    </target>
   1.259 +    
   1.260 +    <!-- Codebase processing -->
   1.261 +    
   1.262 +    <target name="-init-codebase" depends="-codebase-props-check,-init-non-user-codebase,-init-user-codebase"/>
   1.263 +    <target name="-codebase-props-check">
   1.264 +        <condition property="local.codebase">
   1.265 +            <or>
   1.266 +                <not>
   1.267 +                    <isset property="jnlp.codebase.type"/>
   1.268 +                </not>
   1.269 +                <equals arg1="${jnlp.codebase.type}" arg2="local" trim="true"/>
   1.270 +            </or>
   1.271 +        </condition>
   1.272 +        <condition property="non.user.codebase">
   1.273 +            <or>
   1.274 +                <not>
   1.275 +                    <isset property="jnlp.codebase.type"/>
   1.276 +                </not>
   1.277 +                <equals arg1="${jnlp.codebase.type}" arg2="local" trim="true"/>
   1.278 +                <equals arg1="${jnlp.codebase.type}" arg2="web" trim="true"/>
   1.279 +            </or>
   1.280 +        </condition>
   1.281 +        <condition property="user.codebase">
   1.282 +            <equals arg1="${jnlp.codebase.type}" arg2="user" trim="true"/>
   1.283 +        </condition>
   1.284 +    </target>
   1.285 +    <target name="-init-non-user-codebase" if="non.user.codebase">
   1.286 +        <property name="jnlp.codebase.value" value="${jnlp.codebase.url}"/>
   1.287 +    </target>
   1.288 +    <target name="-init-user-codebase" if="user.codebase">
   1.289 +        <property name="jnlp.codebase.value" value="${jnlp.codebase.user}"/>
   1.290 +    </target>
   1.291 +    
   1.292 +    <!-- j2se resources -->
   1.293 +    
   1.294 +    <target name="-init-resources-runtime" depends="-init-runtime-props">
   1.295 +        <property name="run.jvmargs.value" value=""/>
   1.296 +        <property name="initial-heap-size.value" value=""/>
   1.297 +        <property name="max-heap-size.value" value=""/>
   1.298 +        <property name="jnlp.resources.runtime.value" 
   1.299 +            value='        &lt;j2se version="${javac.target}+"${initial-heap-size.value}${max-heap-size.value}${run.jvmargs.value}/&gt;'/>
   1.300 +    </target>
   1.301 +    <target name="-init-runtime-props" depends="-runtime-props-check,-init-run-jvmargs-value,-init-initial-heap-size-value,-init-max-heap-size-value"/>
   1.302 +    <target name="-runtime-props-check">
   1.303 +        <condition property="run.jvmargs.set">
   1.304 +            <and>
   1.305 +                <isset property="run.jvmargs"/>
   1.306 +                <not>
   1.307 +                    <equals arg1="${run.jvmargs}" arg2="" trim="true"/>
   1.308 +                </not>
   1.309 +            </and>
   1.310 +        </condition>
   1.311 +        <condition property="jnlp.initial-heap-size.set">
   1.312 +            <and>
   1.313 +                <isset property="jnlp.initial-heap-size"/>
   1.314 +                <not>
   1.315 +                    <equals arg1="${jnlp.initial-heap-size}" arg2="" trim="true"/>
   1.316 +                </not>
   1.317 +            </and>
   1.318 +        </condition>
   1.319 +        <condition property="jnlp.max-heap-size.set">
   1.320 +            <and>
   1.321 +                <isset property="jnlp.max-heap-size"/>
   1.322 +                <not>
   1.323 +                    <equals arg1="${jnlp.max-heap-size}" arg2="" trim="true"/>
   1.324 +                </not>
   1.325 +            </and>
   1.326 +        </condition>
   1.327 +    </target>
   1.328 +    <target name="-init-run-jvmargs-value" if="run.jvmargs.set">
   1.329 +        <property name="run.jvmargs.value" value=' java-vm-args="${run.jvmargs}"'/>
   1.330 +    </target>
   1.331 +    <target name="-init-initial-heap-size-value" if="jnlp.initial-heap-size.set">
   1.332 +        <property name="initial-heap-size.value" value=' initial-heap-size="${jnlp.initial-heap-size}"'/>
   1.333 +    </target>
   1.334 +    <target name="-init-max-heap-size-value" if="jnlp.max-heap-size.set">
   1.335 +        <property name="max-heap-size.value" value=' max-heap-size="${jnlp.max-heap-size}"'/>
   1.336 +    </target>
   1.337 +    
   1.338 +    <!-- JAR resources -->
   1.339 +    
   1.340 +    <target name="-init-resources-jars" depends="-preinit-resources-unsigned-jars,-preinit-resources-signed-jars,-preinit-resources-main-jar"/>
   1.341 +    <target name="-preinit-resources-unsigned-jars" depends="-exclude-javaws-from-cp,-check-signing-possible" unless="jnlp.signed.true+signjarstask.available">
   1.342 +        <pathconvert pathsep="${line.separator}" property="jnlp.resources.jars.value">
   1.343 +            <path path="${run.classpath.without.javaws.jar}"/>
   1.344 +            <mapper type="regexp" from="^.*[/\\]([^/\\]+\.jar)"
   1.345 +                to='        &lt;jar href="lib/\1" download="eager"/&gt;'/>
   1.346 +        </pathconvert>
   1.347 +    </target>
   1.348 +    <target name="-preinit-resources-main-jar">
   1.349 +        <pathconvert pathsep="${line.separator}" property="jnlp.resources.main.jar.value">
   1.350 +            <path location="${dist.jar}"/>
   1.351 +            <mapper type="regexp" from="^.*[/\\]([^/\\]+\.jar)"
   1.352 +                to='        &lt;jar href="\1" main="true" download="eager"/&gt;'/>
   1.353 +        </pathconvert>
   1.354 +    </target>
   1.355 +    <target name="-exclude-javaws-from-cp">
   1.356 +        <pathconvert property="path.element.to.be.removed">
   1.357 +            <path path="${run.classpath}"/>
   1.358 +            <mapper type="regexp" from="(^.*[/\\]javaws.jar)" to="\1"/>
   1.359 +        </pathconvert>
   1.360 +        <pathconvert property="run.classpath.without.javaws.jar">
   1.361 +            <path path="${run.classpath}"/>
   1.362 +            <map from="${path.element.to.be.removed}" to=""/>
   1.363 +        </pathconvert>
   1.364 +    </target>
   1.365 +    <target name="-check-task-available">
   1.366 +        <condition property="signjarstask.available">
   1.367 +            <isset property="netbeans.home"/>
   1.368 +        </condition>
   1.369 +    </target>
   1.370 +    <target name="-check-signing-possible" depends="-security-props-check,-check-task-available">
   1.371 +        <condition property="jnlp.signed.true+signjarstask.available">
   1.372 +            <and>
   1.373 +                <isset property="jnlp.signed.true"/>
   1.374 +                <isset property="signjarstask.available"/>
   1.375 +            </and>
   1.376 +        </condition>
   1.377 +    </target>
   1.378 +    <target name="-unavailable-task-warning" depends="-check-task-available" unless="signjarstask.available">
   1.379 +        <echo message="Signtask is not available, jar files will not be signed. Task is available only when running inside NetBeans IDE."/>
   1.380 +    </target>
   1.381 +    <target name="-preinit-resources-signed-jars" depends="-unavailable-task-warning,-sign-jars" if="jnlp.signed.true+signjarstask.available">
   1.382 +        <property name="jnlp.resources.jars.value" value="${jnlp.signed.jars}${jnlp.components}"/>
   1.383 +    </target>
   1.384 +    <target name="-sign-jars" depends="-jnlp-init-keystore,-check-signing-possible" if="jnlp.signed.true+signjarstask.available">
   1.385 +        <jnlpsignjars keystore="${jnlp.signjar.keystore}" storepass="${jnlp.signjar.storepass}" 
   1.386 +                keypass="${jnlp.signjar.keypass}" alias="${jnlp.signjar.alias}" mainjar="${dist.jar}" destdir="dist"
   1.387 +                codebase="${jnlp.codebase.value}" signedjarsprop="jnlp.signed.jars"
   1.388 +                componentsprop="jnlp.components">
   1.389 +            <fileset dir="dist/lib">
   1.390 +                <include name="*.jar"/>
   1.391 +            </fileset>
   1.392 +        </jnlpsignjars>
   1.393 +    </target>
   1.394 +    
   1.395 +    <!-- Application arguments -->
   1.396 +    
   1.397 +    <target name="-init-application-args" if="application.args">
   1.398 +        <echo message="${application.args}" file="${helper.file}"/>
   1.399 +        <loadfile srcfile="${helper.file}" property="jnlp.application.args.value">
   1.400 +            <filterchain>
   1.401 +                <tokenfilter delimoutput="\n">
   1.402 +                    <stringtokenizer/>
   1.403 +                    <replaceregex pattern="(.+)" replace="        &lt;argument&gt;\1&lt;/argument&gt;"/>
   1.404 +                </tokenfilter>
   1.405 +            </filterchain>
   1.406 +        </loadfile>
   1.407 +        <delete file="${helper.file}"/>
   1.408 +    </target>
   1.409 +    
   1.410 +    <!-- Running/Debugging -->
   1.411 +    
   1.412 +    <target name="jws-run" depends="jar,-verify-jnlp-enabled,-verify-codebase" description="Start javaws execution">
   1.413 +        <exec executable="${java.home}/bin/javaws">
   1.414 +            <arg file="${jnlp.dest.dir}/${launch.jnlp.file}"/>
   1.415 +        </exec>
   1.416 +    </target>
   1.417 +    <target name="jws-debug" if="netbeans.home" depends="jar,-verify-jnlp-enabled,-verify-codebase,-debug-start-debugger,-debug-javaws-debuggee" 
   1.418 +        description="Debug javaws project in IDE"/>
   1.419 +    <target name="-debug-javaws-debuggee">
   1.420 +        <exec executable="${java.home}/bin/javaws">
   1.421 +            <env key="JAVAWS_VM_ARGS" value="-Xdebug -Xnoagent -Djava.compiler=none -Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
   1.422 +            <arg file="${jnlp.dest.dir}/${launch.jnlp.file}"/>
   1.423 +        </exec>
   1.424 +    </target>
   1.425 +    <target name="-verify-codebase" depends="-codebase-props-check" unless="local.codebase">
   1.426 +        <fail message="Project cannot be run with non-local codebase. Open project properties dialog and set Web Start Codebase to Local Execution."/>
   1.427 +    </target>
   1.428 +    <target name="-verify-jnlp-enabled" depends="-test-jnlp-enabled" unless="is.jnlp.enabled">
   1.429 +        <fail message="Project cannot be run with selected Run Configuration when Java Web Start is disabled."/>
   1.430 +    </target>
   1.431 +    
   1.432 +    <!-- Test JNLP enabled-->
   1.433 +    
   1.434 +    <target name="-test-jnlp-enabled">
   1.435 +        <condition property="is.jnlp.enabled">
   1.436 +            <equals arg1="${jnlp.enabled}" arg2="true" casesensitive="false" trim="true"/>
   1.437 +        </condition>
   1.438 +    </target>
   1.439 +    
   1.440 +    <!-- Generate simple HTML test page -->
   1.441 +    
   1.442 +    <target name="-generate-html-page">
   1.443 +        <echo file="${jnlp.dest.dir}/launch.html"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
   1.444 +<html>
   1.445 +    <head>
   1.446 +        <title>Test page for launching the application via JNLP</title>
   1.447 +    </head>
   1.448 +    <body>
   1.449 +        <h3>Test page for launching the application via JNLP</h3>
   1.450 +        <a href="launch.jnlp">Launch the application</a>
   1.451 +    </body>
   1.452 +</html>
   1.453 +]]></echo>
   1.454 +    </target>
   1.455 +    
   1.456 +</project>