java/nekurak.net-rest/nbproject/ant-deploy.xml
changeset 188 74d06a8a4948
parent 187 e7b3ef7aaef4
child 189 fcd69520f12d
     1.1 --- a/java/nekurak.net-rest/nbproject/ant-deploy.xml	Tue Jul 19 15:20:47 2011 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,111 +0,0 @@
     1.4 -<?xml version="1.0" encoding="UTF-8"?>
     1.5 -<project default="-deploy-ant" basedir=".">
     1.6 -    <target name="-init-cl-deployment-env" if="deploy.ant.enabled">
     1.7 -        <property file="${deploy.ant.properties.file}" />
     1.8 -        <available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/>
     1.9 -        <available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/>
    1.10 -        <available file="${deploy.ant.resource.dir}" property="has.setup"/>
    1.11 -        <tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/>  <!-- do not forget to delete this! -->
    1.12 -        <echo message="AS_ADMIN_PASSWORD=${gfv3.password}" file="${gfv3.password.file}"/>
    1.13 -    </target>
    1.14 -    
    1.15 -    <target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present">
    1.16 -        <tempfile prefix="gfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/>
    1.17 -        <copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/>
    1.18 -        <!-- The doctype triggers resolution which can fail -->
    1.19 -        <replace file="${temp.sun.web}">
    1.20 -            <replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
    1.21 -            <replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
    1.22 -        </replace>
    1.23 -        <replace file="${temp.sun.web}">
    1.24 -            <replacetoken><![CDATA[<sun-web-app]]></replacetoken>
    1.25 -            <replacevalue><![CDATA[--> <sun-web-app]]></replacevalue>
    1.26 -        </replace>
    1.27 -        <xmlproperty file="${temp.sun.web}" validate="false">
    1.28 -        </xmlproperty>    
    1.29 -        <delete file="${temp.sun.web}"/>
    1.30 -        <condition property="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}" else="${gfv3.url}/${ant.project.name}">
    1.31 -            <isset property="sun-web-app.context-root"/>
    1.32 -        </condition>
    1.33 -        <condition property="deploy.context.root.argument" value="&amp;contextroot=${sun-web-app.context-root}" else="/${ant.project.name}">
    1.34 -            <isset property="sun-web-app.context-root"/>
    1.35 -        </condition>
    1.36 -    </target>
    1.37 -    <target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present">
    1.38 -        <tempfile prefix="gfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/>
    1.39 -        <copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/>
    1.40 -        <!-- The doctype triggers resolution which can fail -->
    1.41 -        <replace file="${temp.gf.web}">
    1.42 -            <replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
    1.43 -            <replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
    1.44 -        </replace>
    1.45 -        <replace file="${temp.gf.web}">
    1.46 -            <replacetoken><![CDATA[<glassfish-web-app]]></replacetoken>
    1.47 -            <replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue>
    1.48 -        </replace>
    1.49 -        <xmlproperty file="${temp.gf.web}" validate="false">
    1.50 -        </xmlproperty>
    1.51 -        <delete file="${temp.gf.web}"/>
    1.52 -        <condition property="deploy.ant.client.url" value="${gfv3.url}${glassfish-web-app.context-root}" else="${gfv3.url}/${ant.project.name}">
    1.53 -            <isset property="glassfish-web-app.context-root"/>
    1.54 -        </condition>
    1.55 -        <condition property="deploy.context.root.argument" value="&amp;contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}">
    1.56 -            <isset property="glassfish-web-app.context-root"/>
    1.57 -        </condition>
    1.58 -    </target>
    1.59 -    <target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present">
    1.60 -        <property name="deploy.context.root.argument" value=""/>
    1.61 -    </target>
    1.62 -    <target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup">
    1.63 -        <tempfile prefix="gfv3" property="gfv3.resources.dir" destdir="${java.io.tmpdir}"/>
    1.64 -        <mkdir dir="${gfv3.resources.dir}"/>
    1.65 -        <mkdir dir="${gfv3.resources.dir}/META-INF"/>
    1.66 -        <copy todir="${gfv3.resources.dir}/META-INF">
    1.67 -            <fileset dir="${deploy.ant.resource.dir}"/>
    1.68 -        </copy>
    1.69 -        <jar destfile="${deploy.ant.archive}" update="true">
    1.70 -            <fileset dir="${gfv3.resources.dir}"/>
    1.71 -        </jar>
    1.72 -        <delete dir="${gfv3.resources.dir}"/>
    1.73 -    </target>
    1.74 -    <target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled">
    1.75 -        <antcall target="-deploy-without-pw"/>
    1.76 -        <antcall target="-deploy-with-pw"/>
    1.77 -    </target>
    1.78 -
    1.79 -    <target name="-deploy-without-pw" unless="gfv3.password">
    1.80 -        <echo message="Deploying ${deploy.ant.archive}"/>
    1.81 -        <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/>  <!-- do not forget to delete this! -->
    1.82 -        <property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
    1.83 -        <get src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&amp;force=true&amp;name=${ant.project.name}"
    1.84 -            dest="${gfv3.results.file}"/>
    1.85 -        <delete file="${gfv3.results.file}"/>    
    1.86 -    </target>
    1.87 -    <target name="-deploy-with-pw" if="gfv3.password">
    1.88 -        <echo message="Deploying ${deploy.ant.archive}"/>
    1.89 -        <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/>  <!-- do not forget to delete this! -->
    1.90 -        <property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
    1.91 -        <get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&amp;force=true&amp;name=${ant.project.name}"
    1.92 -            dest="${gfv3.results.file}"/>
    1.93 -        <delete file="${gfv3.results.file}"/>
    1.94 -    </target>
    1.95 -    <target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled">
    1.96 -        <antcall target="-undeploy-without-pw"/>
    1.97 -        <antcall target="-undeploy-with-pw"/>
    1.98 -    </target>
    1.99 -
   1.100 -    <target name="-undeploy-without-pw" unless="gfv3.password">
   1.101 -        <echo message="Undeploying ${deploy.ant.archive}"/>
   1.102 -        <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/>  <!-- do not forget to delete this! -->
   1.103 -        <get src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
   1.104 -            dest="${gfv3.results.file}"/>
   1.105 -        <delete file="${gfv3.results.file}"/>    
   1.106 -    </target>
   1.107 -    <target name="-undeploy-with-pw" if="gfv3.password">
   1.108 -        <echo message="Undeploying ${deploy.ant.archive}"/>
   1.109 -        <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/>  <!-- do not forget to delete this! -->
   1.110 -        <get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
   1.111 -            dest="${gfv3.results.file}"/>
   1.112 -        <delete file="${gfv3.results.file}"/>
   1.113 -    </target>
   1.114 -</project>