java/SuperPostak/nbproject/jnlp-impl.xml
author František Kučera <franta-hg@frantovo.cz>
Sun Nov 23 22:19:20 2008 +0100 (2008-11-23)
changeset 0 e76872ad5226
permissions -rw-r--r--
Přidání SuperPošťáka do Mercurialu (původně byl v Subversionu)
Postak – základ, knihovna
SuperPostak – GUI nadstavba
SuperPostak2 – pokus o implementaci aplikace jako modulu pro Netbeans, POZOR: není přidán do Mercurialu, možná později (pravděpodobně se ale nebude používat)
franta-hg@0
     1
<?xml version="1.0" encoding="UTF-8"?>
franta-hg@0
     2
<!--
franta-hg@0
     3
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
franta-hg@0
     4
franta-hg@0
     5
Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
franta-hg@0
     6
franta-hg@0
     7
franta-hg@0
     8
The contents of this file are subject to the terms of either the GNU
franta-hg@0
     9
General Public License Version 2 only ("GPL") or the Common
franta-hg@0
    10
Development and Distribution License("CDDL") (collectively, the
franta-hg@0
    11
"License"). You may not use this file except in compliance with the
franta-hg@0
    12
License. You can obtain a copy of the License at
franta-hg@0
    13
http://www.netbeans.org/cddl-gplv2.html
franta-hg@0
    14
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
franta-hg@0
    15
specific language governing permissions and limitations under the
franta-hg@0
    16
License.  When distributing the software, include this License Header
franta-hg@0
    17
Notice in each file and include the License file at
franta-hg@0
    18
nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
franta-hg@0
    19
particular file as subject to the "Classpath" exception as provided
franta-hg@0
    20
by Sun in the GPL Version 2 section of the License file that
franta-hg@0
    21
accompanied this code. If applicable, add the following below the
franta-hg@0
    22
License Header, with the fields enclosed by brackets [] replaced by
franta-hg@0
    23
your own identifying information:
franta-hg@0
    24
"Portions Copyrighted [year] [name of copyright owner]"
franta-hg@0
    25
franta-hg@0
    26
Contributor(s):
franta-hg@0
    27
franta-hg@0
    28
The Original Software is NetBeans. The Initial Developer of the Original
franta-hg@0
    29
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
franta-hg@0
    30
Microsystems, Inc. All Rights Reserved.
franta-hg@0
    31
franta-hg@0
    32
If you wish your version of this file to be governed by only the CDDL
franta-hg@0
    33
or only the GPL Version 2, indicate your decision by adding
franta-hg@0
    34
"[Contributor] elects to include this software in this distribution
franta-hg@0
    35
under the [CDDL or GPL Version 2] license." If you do not indicate a
franta-hg@0
    36
single choice of license, a recipient has the option to distribute
franta-hg@0
    37
your version of this file under either the CDDL, the GPL Version 2 or
franta-hg@0
    38
to extend the choice of license to its licensees as provided above.
franta-hg@0
    39
However, if you add GPL Version 2 code and therefore, elected the GPL
franta-hg@0
    40
Version 2 license, then the option applies only if the new code is
franta-hg@0
    41
made subject to such option by the copyright holder.
franta-hg@0
    42
-->
franta-hg@0
    43
franta-hg@0
    44
<project name="jnlp-impl" default="default" basedir="..">
franta-hg@0
    45
franta-hg@0
    46
    <property name="master.jnlp.file" location="master.jnlp"/>
franta-hg@0
    47
    <property name="launch.jnlp.file" value="launch.jnlp"/>
franta-hg@0
    48
    <property name="jnlp.dest.dir" location="dist"/>
franta-hg@0
    49
    
franta-hg@0
    50
    <!-- helper file to create list of arguments, etc. -->
franta-hg@0
    51
    <property name="helper.file" location="helper.txt"/>
franta-hg@0
    52
    
franta-hg@0
    53
    <target name="default">
franta-hg@0
    54
        <echo message="Default target is not set."/>
franta-hg@0
    55
    </target>
franta-hg@0
    56
    
franta-hg@0
    57
    <!-- Main target -->
franta-hg@0
    58
    
franta-hg@0
    59
    <target name="jnlp" depends="-init-check,-test-jnlp-enabled" if="is.jnlp.enabled">
franta-hg@0
    60
        <delete file="dist/lib/javaws.jar" failonerror="false"/>
franta-hg@0
    61
        <antcall target="generate-jnlp"/>
franta-hg@0
    62
    </target>
franta-hg@0
    63
    
franta-hg@0
    64
    <!-- Generate master -->
franta-hg@0
    65
    
franta-hg@0
    66
    <target name="-check-for-master.jnlp">
franta-hg@0
    67
        <available file="${master.jnlp.file}" property="master.jnlp.exists"/>
franta-hg@0
    68
    </target>
franta-hg@0
    69
    <target name="jnlp-init-generate-master" depends="-check-for-master.jnlp" unless="master.jnlp.exists">
franta-hg@0
    70
        <echo file="${master.jnlp.file}" encoding="UTF-8"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
franta-hg@0
    71
<jnlp spec="1.0+" codebase="$${jnlp.codebase}" href="launch.jnlp">
franta-hg@0
    72
    <information>
franta-hg@0
    73
        <title>$${APPLICATION.TITLE}</title>
franta-hg@0
    74
        <vendor>$${APPLICATION.VENDOR}</vendor>
franta-hg@0
    75
        <description>$${APPLICATION.DESC}</description>
franta-hg@0
    76
        <description kind="short">$${APPLICATION.DESC.SHORT}</description>
franta-hg@0
    77
        <homepage href="$${APPLICATION.HOMEPAGE}"/>
franta-hg@0
    78
<!--$${JNLP.ICONS}-->
franta-hg@0
    79
<!--$${JNLP.OFFLINE.ALLOWED}-->
franta-hg@0
    80
    </information>
franta-hg@0
    81
<!--$${JNLP.SECURITY}-->
franta-hg@0
    82
    <resources>
franta-hg@0
    83
<!--$${JNLP.RESOURCES.RUNTIME}-->
franta-hg@0
    84
<!--$${JNLP.RESOURCES.MAIN.JAR}-->
franta-hg@0
    85
<!--$${JNLP.RESOURCES.JARS}-->
franta-hg@0
    86
    </resources>
franta-hg@0
    87
    <application-desc main-class="$${jnlp.main.class}">
franta-hg@0
    88
<!--$${JNLP.APPLICATION.ARGS}-->
franta-hg@0
    89
    </application-desc>
franta-hg@0
    90
</jnlp>
franta-hg@0
    91
]]></echo>
franta-hg@0
    92
    </target>
franta-hg@0
    93
    
franta-hg@0
    94
    <!-- Initial check -->
franta-hg@0
    95
    
franta-hg@0
    96
    <target name="-init-check">
franta-hg@0
    97
        <fail unless="application.title" message="Must set application title."/>
franta-hg@0
    98
        <fail unless="application.vendor" message="Must set application vendor."/>
franta-hg@0
    99
    </target>
franta-hg@0
   100
    
franta-hg@0
   101
    <!-- Icons -->
franta-hg@0
   102
    
franta-hg@0
   103
    <target name="-init-icons" depends="-preinit-icons,-set-icon-elem,-set-splash-elem">
franta-hg@0
   104
        <property name="jnlp.icon.elem" value=""/>
franta-hg@0
   105
        <property name="application.splash.elem" value=""/>
franta-hg@0
   106
        <property name="icon.separator" value=""/>
franta-hg@0
   107
        <property name="jnlp.icons.value" value="${jnlp.icon.elem}${icon.separator}${application.splash.elem}"/>
franta-hg@0
   108
    </target>
franta-hg@0
   109
    <target name="-preinit-icons" depends="-copy-app-icon,-copy-app-splash"/>
franta-hg@0
   110
    <target name="-copy-app-icon" if="jnlp.icon" depends="-get-app-icon-name">
franta-hg@0
   111
        <copy file="${jnlp.icon}" todir="${jnlp.dest.dir}" failonerror="false"/>
franta-hg@0
   112
        <available file="${jnlp.dest.dir}${file.separator}${jnlp.icon.name}" property="jnlp.icon.copied"/>
franta-hg@0
   113
    </target>
franta-hg@0
   114
    <target name="-copy-app-splash" if="application.splash" depends="-get-app-splash-name">
franta-hg@0
   115
        <copy file="${application.splash}" todir="${jnlp.dest.dir}" failonerror="false"/>
franta-hg@0
   116
        <available file="${jnlp.dest.dir}${file.separator}${application.splash.name}" property="application.splash.copied"/>
franta-hg@0
   117
    </target>
franta-hg@0
   118
    <target name="-get-app-icon-name" if="jnlp.icon">
franta-hg@0
   119
        <dirname file="${jnlp.icon}" property="jnlp.icon.basedir"/>
franta-hg@0
   120
        <pathconvert property="jnlp.icon.name" setonempty="false">
franta-hg@0
   121
            <path location="${jnlp.icon}"/>
franta-hg@0
   122
            <map from="${jnlp.icon.basedir}${file.separator}" to=""/>
franta-hg@0
   123
        </pathconvert>
franta-hg@0
   124
    </target>
franta-hg@0
   125
    <target name="-get-app-splash-name" if="application.splash">
franta-hg@0
   126
        <dirname file="${application.splash}" property="application.splash.basedir"/>
franta-hg@0
   127
        <pathconvert property="application.splash.name" setonempty="false">
franta-hg@0
   128
            <path location="${application.splash}"/>
franta-hg@0
   129
            <map from="${application.splash.basedir}${file.separator}" to=""/>
franta-hg@0
   130
        </pathconvert>
franta-hg@0
   131
    </target>
franta-hg@0
   132
    <target name="-set-icon-elem" if="jnlp.icon.copied">
franta-hg@0
   133
        <property name="jnlp.icon.elem" value='        &lt;icon href="${jnlp.icon.name}" kind="default"/&gt;'/>
franta-hg@0
   134
    </target>
franta-hg@0
   135
    <target name="-set-splash-elem" if="application.splash.copied" depends="-set-icon-elem">
franta-hg@0
   136
        <property name="application.splash.elem" value='        &lt;icon href="${application.splash.name}" kind="splash"/&gt;'/>
franta-hg@0
   137
        <condition property="icon.separator" value="${line.separator}">
franta-hg@0
   138
            <isset property="jnlp.icon.elem"/>
franta-hg@0
   139
        </condition>
franta-hg@0
   140
    </target>
franta-hg@0
   141
    
franta-hg@0
   142
    <!-- Offline-Allowed -->
franta-hg@0
   143
    
franta-hg@0
   144
    <target name="-init-offline" if="offline.allowed.set" depends="-preinit-offline">
franta-hg@0
   145
        <property name="jnlp.offline.allowed.value" value="        &lt;offline-allowed/&gt;"/>
franta-hg@0
   146
    </target>
franta-hg@0
   147
    <target name="-preinit-offline">
franta-hg@0
   148
        <condition property="offline.allowed.set">
franta-hg@0
   149
            <equals arg1="${jnlp.offline-allowed}" arg2="true" trim="true"/>
franta-hg@0
   150
        </condition>
franta-hg@0
   151
    </target>
franta-hg@0
   152
    
franta-hg@0
   153
    <!-- Descriptions -->
franta-hg@0
   154
    
franta-hg@0
   155
    <target name="-init-descriptions" depends="-descriptions-props-check,-init-desc-value,-init-desc-value-short">
franta-hg@0
   156
        <property name="application.desc.value" value="${application.title}"/>
franta-hg@0
   157
        <property name="application.desc.short.value" value="${application.title}"/>
franta-hg@0
   158
    </target>
franta-hg@0
   159
    <target name="-descriptions-props-check">
franta-hg@0
   160
        <condition property="application.desc.set">
franta-hg@0
   161
            <and>
franta-hg@0
   162
                <isset property="application.desc"/>
franta-hg@0
   163
                <not>
franta-hg@0
   164
                    <equals arg1="${application.desc}" arg2="" trim="true"/>
franta-hg@0
   165
                </not>
franta-hg@0
   166
            </and>
franta-hg@0
   167
        </condition>
franta-hg@0
   168
        <condition property="application.desc.short.set">
franta-hg@0
   169
            <and>
franta-hg@0
   170
                <isset property="application.desc.short"/>
franta-hg@0
   171
                <not>
franta-hg@0
   172
                    <equals arg1="${application.desc.short}" arg2="" trim="true"/>
franta-hg@0
   173
                </not>
franta-hg@0
   174
            </and>
franta-hg@0
   175
        </condition>
franta-hg@0
   176
    </target>
franta-hg@0
   177
    <target name="-init-desc-value" if="application.desc.set">
franta-hg@0
   178
        <property name="application.desc.value" value="${application.desc}"/>
franta-hg@0
   179
    </target>
franta-hg@0
   180
    <target name="-init-desc-value-short" if="application.desc.short.set">
franta-hg@0
   181
        <property name="application.desc.short.value" value="${application.desc.short}"/>
franta-hg@0
   182
    </target>
franta-hg@0
   183
    
franta-hg@0
   184
    <!-- Security -->
franta-hg@0
   185
    
franta-hg@0
   186
    <target name="-init-security" depends="-check-signing-possible" if="jnlp.signed.true+signjarstask.available">
franta-hg@0
   187
        <property name="jnlp.security" value="    &lt;security&gt;${line.separator}        &lt;all-permissions/&gt;${line.separator}    &lt;/security&gt;"/>
franta-hg@0
   188
    </target>
franta-hg@0
   189
    <target name="-security-props-check">
franta-hg@0
   190
        <condition property="jnlp.signed.true">
franta-hg@0
   191
            <istrue value="${jnlp.signed}"/>
franta-hg@0
   192
        </condition>
franta-hg@0
   193
    </target>
franta-hg@0
   194
    <target name="-jnlp-init-keystore" depends="-jnlp-init-keystore-props,-check-keystore-exists" unless="jnlp.signjar.keystore.exists">
franta-hg@0
   195
        <echo message="${application.vendor}" file="${helper.file}"/>
franta-hg@0
   196
        <loadfile property="application.vendor.filtered" srcfile="${helper.file}">
franta-hg@0
   197
            <filterchain>
franta-hg@0
   198
                <deletecharacters chars=","/>
franta-hg@0
   199
            </filterchain>
franta-hg@0
   200
        </loadfile>
franta-hg@0
   201
        <delete file="${helper.file}"/>
franta-hg@0
   202
        <property name="jnlp.signjar.vendor" value="CN=${application.vendor.filtered}"/>
franta-hg@0
   203
        <echo message="Going to create default keystore in ${jnlp.signjar.keystore}"/>
franta-hg@0
   204
        <genkey dname="${jnlp.signjar.vendor}" alias="${jnlp.signjar.alias}" keystore="${jnlp.signjar.keystore}"
franta-hg@0
   205
            storepass="${jnlp.signjar.storepass}" keypass="${jnlp.signjar.keypass}"/>
franta-hg@0
   206
    </target>
franta-hg@0
   207
    <target name="-check-keystore-exists">
franta-hg@0
   208
        <available property="jnlp.signjar.keystore.exists" file="${jnlp.signjar.keystore}"/>
franta-hg@0
   209
    </target>
franta-hg@0
   210
    <target name="-jnlp-init-keystore-props">
franta-hg@0
   211
        <property name="jnlp.signjar.keystore" value="${basedir}/build/nb-jws.ks"/>
franta-hg@0
   212
        <property name="jnlp.signjar.storepass" value="storepass"/>
franta-hg@0
   213
        <property name="jnlp.signjar.keypass" value="keypass"/>
franta-hg@0
   214
        <property name="jnlp.signjar.alias" value="nb-jws"/>
franta-hg@0
   215
    </target>    
franta-hg@0
   216
    
franta-hg@0
   217
    <!-- Generating JNLP file -->
franta-hg@0
   218
    
franta-hg@0
   219
    <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">
franta-hg@0
   220
        <copy file="${master.jnlp.file}" tofile="${jnlp.dest.dir}/${launch.jnlp.file}__" overwrite="true" encoding="UTF-8">
franta-hg@0
   221
            <filterchain>
franta-hg@0
   222
                <replacestring from="$${jnlp.codebase}" to="${jnlp.codebase.value}"/>
franta-hg@0
   223
                <replacestring from="&lt;!--$${JNLP.ICONS}--&gt;" to="${jnlp.icons.value}"/>
franta-hg@0
   224
                <replacestring from="&lt;!--$${JNLP.SECURITY}--&gt;" to="${jnlp.security}"/>
franta-hg@0
   225
                <replacestring from="&lt;!--$${JNLP.OFFLINE.ALLOWED}--&gt;" to="${jnlp.offline.allowed.value}"/>
franta-hg@0
   226
                <replacestring from="&lt;!--$${JNLP.RESOURCES.RUNTIME}--&gt;" to="${jnlp.resources.runtime.value}"/>
franta-hg@0
   227
                <replacestring from="&lt;!--$${JNLP.RESOURCES.MAIN.JAR}--&gt;" to="${jnlp.resources.main.jar.value}"/>
franta-hg@0
   228
                <replacestring from="&lt;!--$${JNLP.RESOURCES.JARS}--&gt;" to="${jnlp.resources.jars.value}"/>
franta-hg@0
   229
                <replacestring from="&lt;!--$${JNLP.APPLICATION.ARGS}--&gt;" to="${jnlp.application.args.value}"/>
franta-hg@0
   230
                <replacestring from="$${APPLICATION.TITLE}" to="${application.title}"/>
franta-hg@0
   231
                <replacestring from="$${APPLICATION.VENDOR}" to="${application.vendor}"/>
franta-hg@0
   232
                <replacestring from="$${APPLICATION.DESC}" to="${application.desc.value}"/>
franta-hg@0
   233
                <replacestring from="$${APPLICATION.DESC.SHORT}" to="${application.desc.short.value}"/>
franta-hg@0
   234
                <replacestring from="$${APPLICATION.HOMEPAGE}" to="${application.homepage}"/>
franta-hg@0
   235
                <replacestring from="$${jnlp.main.class}" to="${main.class}"/>
franta-hg@0
   236
            </filterchain>
franta-hg@0
   237
        </copy>
franta-hg@0
   238
        <antcall target="-strip-empty-lines"/>
franta-hg@0
   239
        <antcall target="-generate-html-page"/>
franta-hg@0
   240
    </target>
franta-hg@0
   241
    <target name="jnlp-init-notinited">
franta-hg@0
   242
        <property name="jnlp.security" value=""/>
franta-hg@0
   243
        <property name="jnlp.offline.allowed.value" value=""/>
franta-hg@0
   244
        <property name="application.homepage" value=""/>
franta-hg@0
   245
        <property name="jnlp.application.args.value" value=""/>
franta-hg@0
   246
    </target>
franta-hg@0
   247
    <target name="-strip-empty-lines">
franta-hg@0
   248
        <move file="${jnlp.dest.dir}/${launch.jnlp.file}__" tofile="${jnlp.dest.dir}/${launch.jnlp.file}" overwrite="true" encoding="UTF-8">
franta-hg@0
   249
            <filterchain>
franta-hg@0
   250
                <linecontainsregexp>
franta-hg@0
   251
                    <regexp pattern=".+"/>
franta-hg@0
   252
                </linecontainsregexp>
franta-hg@0
   253
            </filterchain>
franta-hg@0
   254
        </move>
franta-hg@0
   255
    </target>
franta-hg@0
   256
    
franta-hg@0
   257
    <!-- Codebase processing -->
franta-hg@0
   258
    
franta-hg@0
   259
    <target name="-init-codebase" depends="-codebase-props-check,-init-non-user-codebase,-init-user-codebase"/>
franta-hg@0
   260
    <target name="-codebase-props-check">
franta-hg@0
   261
        <condition property="local.codebase">
franta-hg@0
   262
            <or>
franta-hg@0
   263
                <not>
franta-hg@0
   264
                    <isset property="jnlp.codebase.type"/>
franta-hg@0
   265
                </not>
franta-hg@0
   266
                <equals arg1="${jnlp.codebase.type}" arg2="local" trim="true"/>
franta-hg@0
   267
            </or>
franta-hg@0
   268
        </condition>
franta-hg@0
   269
        <condition property="non.user.codebase">
franta-hg@0
   270
            <or>
franta-hg@0
   271
                <not>
franta-hg@0
   272
                    <isset property="jnlp.codebase.type"/>
franta-hg@0
   273
                </not>
franta-hg@0
   274
                <equals arg1="${jnlp.codebase.type}" arg2="local" trim="true"/>
franta-hg@0
   275
                <equals arg1="${jnlp.codebase.type}" arg2="web" trim="true"/>
franta-hg@0
   276
            </or>
franta-hg@0
   277
        </condition>
franta-hg@0
   278
        <condition property="user.codebase">
franta-hg@0
   279
            <equals arg1="${jnlp.codebase.type}" arg2="user" trim="true"/>
franta-hg@0
   280
        </condition>
franta-hg@0
   281
    </target>
franta-hg@0
   282
    <target name="-init-non-user-codebase" if="non.user.codebase">
franta-hg@0
   283
        <property name="jnlp.codebase.value" value="${jnlp.codebase.url}"/>
franta-hg@0
   284
    </target>
franta-hg@0
   285
    <target name="-init-user-codebase" if="user.codebase">
franta-hg@0
   286
        <property name="jnlp.codebase.value" value="${jnlp.codebase.user}"/>
franta-hg@0
   287
    </target>
franta-hg@0
   288
    
franta-hg@0
   289
    <!-- j2se resources -->
franta-hg@0
   290
    
franta-hg@0
   291
    <target name="-init-resources-runtime" depends="-init-runtime-props">
franta-hg@0
   292
        <property name="run.jvmargs.value" value=""/>
franta-hg@0
   293
        <property name="initial-heap-size.value" value=""/>
franta-hg@0
   294
        <property name="max-heap-size.value" value=""/>
franta-hg@0
   295
        <property name="jnlp.resources.runtime.value" 
franta-hg@0
   296
            value='        &lt;j2se version="${javac.target}+"${initial-heap-size.value}${max-heap-size.value}${run.jvmargs.value}/&gt;'/>
franta-hg@0
   297
    </target>
franta-hg@0
   298
    <target name="-init-runtime-props" depends="-runtime-props-check,-init-run-jvmargs-value,-init-initial-heap-size-value,-init-max-heap-size-value"/>
franta-hg@0
   299
    <target name="-runtime-props-check">
franta-hg@0
   300
        <condition property="run.jvmargs.set">
franta-hg@0
   301
            <and>
franta-hg@0
   302
                <isset property="run.jvmargs"/>
franta-hg@0
   303
                <not>
franta-hg@0
   304
                    <equals arg1="${run.jvmargs}" arg2="" trim="true"/>
franta-hg@0
   305
                </not>
franta-hg@0
   306
            </and>
franta-hg@0
   307
        </condition>
franta-hg@0
   308
        <condition property="jnlp.initial-heap-size.set">
franta-hg@0
   309
            <and>
franta-hg@0
   310
                <isset property="jnlp.initial-heap-size"/>
franta-hg@0
   311
                <not>
franta-hg@0
   312
                    <equals arg1="${jnlp.initial-heap-size}" arg2="" trim="true"/>
franta-hg@0
   313
                </not>
franta-hg@0
   314
            </and>
franta-hg@0
   315
        </condition>
franta-hg@0
   316
        <condition property="jnlp.max-heap-size.set">
franta-hg@0
   317
            <and>
franta-hg@0
   318
                <isset property="jnlp.max-heap-size"/>
franta-hg@0
   319
                <not>
franta-hg@0
   320
                    <equals arg1="${jnlp.max-heap-size}" arg2="" trim="true"/>
franta-hg@0
   321
                </not>
franta-hg@0
   322
            </and>
franta-hg@0
   323
        </condition>
franta-hg@0
   324
    </target>
franta-hg@0
   325
    <target name="-init-run-jvmargs-value" if="run.jvmargs.set">
franta-hg@0
   326
        <property name="run.jvmargs.value" value=' java-vm-args="${run.jvmargs}"'/>
franta-hg@0
   327
    </target>
franta-hg@0
   328
    <target name="-init-initial-heap-size-value" if="jnlp.initial-heap-size.set">
franta-hg@0
   329
        <property name="initial-heap-size.value" value=' initial-heap-size="${jnlp.initial-heap-size}"'/>
franta-hg@0
   330
    </target>
franta-hg@0
   331
    <target name="-init-max-heap-size-value" if="jnlp.max-heap-size.set">
franta-hg@0
   332
        <property name="max-heap-size.value" value=' max-heap-size="${jnlp.max-heap-size}"'/>
franta-hg@0
   333
    </target>
franta-hg@0
   334
    
franta-hg@0
   335
    <!-- JAR resources -->
franta-hg@0
   336
    
franta-hg@0
   337
    <target name="-init-resources-jars" depends="-preinit-resources-unsigned-jars,-preinit-resources-signed-jars,-preinit-resources-main-jar"/>
franta-hg@0
   338
    <target name="-preinit-resources-unsigned-jars" depends="-exclude-javaws-from-cp,-check-signing-possible" unless="jnlp.signed.true+signjarstask.available">
franta-hg@0
   339
        <pathconvert pathsep="${line.separator}" property="jnlp.resources.jars.value">
franta-hg@0
   340
            <path path="${run.classpath.without.javaws.jar}"/>
franta-hg@0
   341
            <mapper type="regexp" from="^.*[/\\]([^/\\]+\.jar)"
franta-hg@0
   342
                to='        &lt;jar href="lib/\1" download="eager"/&gt;'/>
franta-hg@0
   343
        </pathconvert>
franta-hg@0
   344
    </target>
franta-hg@0
   345
    <target name="-preinit-resources-main-jar">
franta-hg@0
   346
        <pathconvert pathsep="${line.separator}" property="jnlp.resources.main.jar.value">
franta-hg@0
   347
            <path location="${dist.jar}"/>
franta-hg@0
   348
            <mapper type="regexp" from="^.*[/\\]([^/\\]+\.jar)"
franta-hg@0
   349
                to='        &lt;jar href="\1" main="true" download="eager"/&gt;'/>
franta-hg@0
   350
        </pathconvert>
franta-hg@0
   351
    </target>
franta-hg@0
   352
    <target name="-exclude-javaws-from-cp">
franta-hg@0
   353
        <pathconvert property="path.element.to.be.removed">
franta-hg@0
   354
            <path path="${run.classpath}"/>
franta-hg@0
   355
            <mapper type="regexp" from="(^.*[/\\]javaws.jar)" to="\1"/>
franta-hg@0
   356
        </pathconvert>
franta-hg@0
   357
        <pathconvert property="run.classpath.without.javaws.jar">
franta-hg@0
   358
            <path path="${run.classpath}"/>
franta-hg@0
   359
            <map from="${path.element.to.be.removed}" to=""/>
franta-hg@0
   360
        </pathconvert>
franta-hg@0
   361
    </target>
franta-hg@0
   362
    <target name="-check-task-available">
franta-hg@0
   363
        <condition property="signjarstask.available">
franta-hg@0
   364
            <isset property="netbeans.home"/>
franta-hg@0
   365
        </condition>
franta-hg@0
   366
    </target>
franta-hg@0
   367
    <target name="-check-signing-possible" depends="-security-props-check,-check-task-available">
franta-hg@0
   368
        <condition property="jnlp.signed.true+signjarstask.available">
franta-hg@0
   369
            <and>
franta-hg@0
   370
                <isset property="jnlp.signed.true"/>
franta-hg@0
   371
                <isset property="signjarstask.available"/>
franta-hg@0
   372
            </and>
franta-hg@0
   373
        </condition>
franta-hg@0
   374
    </target>
franta-hg@0
   375
    <target name="-unavailable-task-warning" depends="-check-task-available" unless="signjarstask.available">
franta-hg@0
   376
        <echo message="Signtask is not available, jar files will not be signed. Task is available only when running inside NetBeans IDE."/>
franta-hg@0
   377
    </target>
franta-hg@0
   378
    <target name="-preinit-resources-signed-jars" depends="-unavailable-task-warning,-sign-jars" if="jnlp.signed.true+signjarstask.available">
franta-hg@0
   379
        <property name="jnlp.resources.jars.value" value="${jnlp.signed.jars}${jnlp.components}"/>
franta-hg@0
   380
    </target>
franta-hg@0
   381
    <target name="-sign-jars" depends="-jnlp-init-keystore,-check-signing-possible" if="jnlp.signed.true+signjarstask.available">
franta-hg@0
   382
        <jnlpsignjars keystore="${jnlp.signjar.keystore}" storepass="${jnlp.signjar.storepass}" 
franta-hg@0
   383
                keypass="${jnlp.signjar.keypass}" alias="${jnlp.signjar.alias}" mainjar="${dist.jar}" destdir="dist"
franta-hg@0
   384
                codebase="${jnlp.codebase.value}" signedjarsprop="jnlp.signed.jars"
franta-hg@0
   385
                componentsprop="jnlp.components">
franta-hg@0
   386
            <fileset dir="dist/lib">
franta-hg@0
   387
                <include name="*.jar"/>
franta-hg@0
   388
            </fileset>
franta-hg@0
   389
        </jnlpsignjars>
franta-hg@0
   390
    </target>
franta-hg@0
   391
    
franta-hg@0
   392
    <!-- Application arguments -->
franta-hg@0
   393
    
franta-hg@0
   394
    <target name="-init-application-args" if="application.args">
franta-hg@0
   395
        <echo message="${application.args}" file="${helper.file}"/>
franta-hg@0
   396
        <loadfile srcfile="${helper.file}" property="jnlp.application.args.value">
franta-hg@0
   397
            <filterchain>
franta-hg@0
   398
                <tokenfilter delimoutput="\n">
franta-hg@0
   399
                    <stringtokenizer/>
franta-hg@0
   400
                    <replaceregex pattern="(.+)" replace="        &lt;argument&gt;\1&lt;/argument&gt;"/>
franta-hg@0
   401
                </tokenfilter>
franta-hg@0
   402
            </filterchain>
franta-hg@0
   403
        </loadfile>
franta-hg@0
   404
        <delete file="${helper.file}"/>
franta-hg@0
   405
    </target>
franta-hg@0
   406
    
franta-hg@0
   407
    <!-- Running/Debugging -->
franta-hg@0
   408
    
franta-hg@0
   409
    <target name="jws-run" depends="jar,-verify-jnlp-enabled,-verify-codebase" description="Start javaws execution">
franta-hg@0
   410
        <exec executable="${java.home}/bin/javaws">
franta-hg@0
   411
            <arg file="${jnlp.dest.dir}/${launch.jnlp.file}"/>
franta-hg@0
   412
        </exec>
franta-hg@0
   413
    </target>
franta-hg@0
   414
    <target name="jws-debug" if="netbeans.home" depends="jar,-verify-jnlp-enabled,-verify-codebase,-debug-start-debugger,-debug-javaws-debuggee" 
franta-hg@0
   415
        description="Debug javaws project in IDE"/>
franta-hg@0
   416
    <target name="-debug-javaws-debuggee">
franta-hg@0
   417
        <exec executable="${java.home}/bin/javaws">
franta-hg@0
   418
            <env key="JAVAWS_VM_ARGS" value="-Xdebug -Xnoagent -Djava.compiler=none -Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
franta-hg@0
   419
            <arg file="${jnlp.dest.dir}/${launch.jnlp.file}"/>
franta-hg@0
   420
        </exec>
franta-hg@0
   421
    </target>
franta-hg@0
   422
    <target name="-verify-codebase" depends="-codebase-props-check" unless="local.codebase">
franta-hg@0
   423
        <fail message="Project cannot be run with non-local codebase. Open project properties dialog and set Web Start Codebase to Local Execution."/>
franta-hg@0
   424
    </target>
franta-hg@0
   425
    <target name="-verify-jnlp-enabled" depends="-test-jnlp-enabled" unless="is.jnlp.enabled">
franta-hg@0
   426
        <fail message="Project cannot be run with selected Run Configuration when Java Web Start is disabled."/>
franta-hg@0
   427
    </target>
franta-hg@0
   428
    
franta-hg@0
   429
    <!-- Test JNLP enabled-->
franta-hg@0
   430
    
franta-hg@0
   431
    <target name="-test-jnlp-enabled">
franta-hg@0
   432
        <condition property="is.jnlp.enabled">
franta-hg@0
   433
            <equals arg1="${jnlp.enabled}" arg2="true" casesensitive="false" trim="true"/>
franta-hg@0
   434
        </condition>
franta-hg@0
   435
    </target>
franta-hg@0
   436
    
franta-hg@0
   437
    <!-- Generate simple HTML test page -->
franta-hg@0
   438
    
franta-hg@0
   439
    <target name="-generate-html-page">
franta-hg@0
   440
        <echo file="${jnlp.dest.dir}/launch.html"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
franta-hg@0
   441
<html>
franta-hg@0
   442
    <head>
franta-hg@0
   443
        <title>Test page for launching the application via JNLP</title>
franta-hg@0
   444
    </head>
franta-hg@0
   445
    <body>
franta-hg@0
   446
        <h3>Test page for launching the application via JNLP</h3>
franta-hg@0
   447
        <a href="launch.jnlp">Launch the application</a>
franta-hg@0
   448
    </body>
franta-hg@0
   449
</html>
franta-hg@0
   450
]]></echo>
franta-hg@0
   451
    </target>
franta-hg@0
   452
    
franta-hg@0
   453
</project>