| <!-- |
| |
| Copyright (c) 2002, 2018 Oracle and/or its affiliates. All rights reserved. |
| |
| This program and the accompanying materials are made available under the |
| terms of the Eclipse Public License v. 2.0, which is available at |
| http://www.eclipse.org/legal/epl-2.0. |
| |
| This Source Code may also be made available under the following Secondary |
| Licenses when the conditions for such availability set forth in the |
| Eclipse Public License v. 2.0 are satisfied: GNU General Public License, |
| version 2 with the GNU Classpath Exception, which is available at |
| https://www.gnu.org/software/classpath/license.html. |
| |
| SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 |
| |
| --> |
| |
| <!DOCTYPE project [ |
| <!ENTITY commonSetup SYSTEM "file:./../../../config/properties.xml"> |
| <!ENTITY commonBuild SYSTEM "file:./../../../config/common.xml"> |
| <!ENTITY commonRun SYSTEM "file:./../../../config/run.xml"> |
| <!ENTITY testproperties SYSTEM "file:./build.properties"> |
| ]> |
| |
| <project name="google test" default="all" basedir="."> |
| |
| <!-- include common.xml and testcommon.xml --> |
| &commonSetup; |
| &commonBuild; |
| &commonRun; |
| &testproperties; |
| |
| <target name="all" depends="clean,build,create-user,restart,deploy,run,undeploy,delete-user"/> |
| |
| |
| <target name="run.wscompile"> |
| <exec executable="${WSCOMPILE}" failonerror="true" > |
| <arg line="-source 1.1.2 ${wscompile.command}" /> |
| </exec> |
| </target> |
| |
| <target name="compile" depends=""> |
| <antcall target="compile-common"> |
| <param name="src" value="client"/> |
| </antcall> |
| <antcall target="compile-common"> |
| <param name="src" value="ejb"/> |
| </antcall> |
| <antcall target="compile-common"> |
| <param name="src" value="web"/> |
| </antcall> |
| </target> |
| |
| <target name="build" depends="init-common, clean"> |
| <antcall target="gen-mapping-appclient"/> |
| <antcall target="gen-mapping-ejb"/> |
| <antcall target="gen-mapping-web"/> |
| <antcall target="wscompile-appclient"/> |
| <antcall target="wscompile-ejb"/> |
| <antcall target="wscompile-web"/> |
| <antcall target="assemble"/> |
| <antcall target="build-appclient-file"/> |
| </target> |
| |
| <target name="wscompile-appclient" depends="init-common"> |
| <mkdir dir="output"/> |
| <antcall target="run.wscompile"> |
| <param name="wscompile.command" |
| value="-import -f:norpcstructures -keep -d output -s output -classpath . -model googleclient.model wscompile_config_appclient.xml"/> |
| </antcall> |
| <copy todir="${build.classes.dir}/googleclient"> |
| <fileset dir="output/googleclient" |
| includes="DirectoryCategory.class, GoogleSearchResult.class, GoogleSearchService.class, GoogleSearchPort.class, ResultElement.class"/> |
| </copy> |
| <!-- <delete dir="output"/> --> |
| </target> |
| |
| <target name="wscompile-ejb" depends="init-common"> |
| <mkdir dir="output"/> |
| <antcall target="run.wscompile"> |
| <param name="wscompile.command" |
| value="-import -f:norpcstructures -keep -d output -s output -classpath . wscompile_config_ejb.xml"/> |
| </antcall> |
| <copy todir="${build.classes.dir}/googleserver"> |
| <fileset dir="output/googleserver" |
| includes="DirectoryCategory.class, GoogleSearchResult.class, GoogleSearchPort.class, ResultElement.class"/> |
| </copy> |
| <delete dir="output"/> |
| </target> |
| |
| <target name="wscompile-web" depends="init-common"> |
| <mkdir dir="output"/> |
| <antcall target="run.wscompile"> |
| <param name="wscompile.command" |
| value="-import -f:norpcstructures -keep -d output -s output -model googleweb.model -classpath . wscompile_config_web.xml"/> |
| </antcall> |
| <copy todir="${build.classes.dir}/googleserverweb"> |
| <fileset dir="output/googleserverweb" |
| includes="DirectoryCategory.class, GoogleSearchResult.class, GoogleSearchPort.class, ResultElement.class"/> |
| </copy> |
| <delete dir="output"/> |
| </target> |
| |
| <target name="assemble" depends="init-common, compile"> |
| <!-- |
| EJB module creation |
| --> |
| <copy todir="${build.classes.dir}/META-INF/wsdl" |
| file="GoogleSearch.wsdl"/> |
| <copy todir="${build.classes.dir}/META-INF/wsdl" |
| file="GoogleSearch_types.wsdl"/> |
| <copy todir="${build.classes.dir}" |
| file="GoogleMapping_ejb.xml"/> |
| <antcall target="ejb-jar-common"> |
| <param name="ejbjar.classes" |
| value="GoogleMapping_ejb.xml,META-INF/wsdl/**,googleserver/*.class" /> |
| |
| </antcall> |
| <!-- |
| War module creation |
| --> |
| <antcall target="build-war-file"/> |
| <!-- |
| AppClient module creation |
| --> |
| <copy todir="${build.classes.dir}/META-INF/wsdl" |
| file="GoogleSearch.wsdl"/> |
| <copy todir="${build.classes.dir}/META-INF/wsdl" |
| file="GoogleSearch_types.wsdl"/> |
| <copy todir="${build.classes.dir}/META-INF/wsdl" |
| file="GoogleSearch_partial.wsdl"/> |
| <copy todir="${build.classes.dir}" |
| file="GoogleMapping_appclient.xml"/> |
| <copy todir="${build.classes.dir}" |
| file="googleclient.model"/> |
| <antcall target="appclient-jar-common"> |
| <param name="appclientjar.classes" |
| value="googleclient.model,GoogleMapping_appclient.xml,META-INF/wsdl/**,googleclient/*.class" /> |
| |
| </antcall> |
| <!-- |
| EAR file creation |
| --> |
| <antcall target="ear-common" /> |
| <copy todir="${build.classes.dir}/META-INF" |
| file="${sun-application.xml}"/> |
| <jar destfile = "${assemble.dir}/${appname}App.ear" |
| update="true"> |
| <fileset dir="${build.classes.dir}"> |
| <include name="META-INF/sun-application.xml"/> |
| </fileset> |
| </jar> |
| |
| </target> |
| |
| <target name="build-appclient-file" depends="init-common"> |
| </target> |
| |
| <target name="build-war-file" depends="init-common"> |
| <echo message="my build classes dir is:${build.classes.dir}"/> |
| <delete file="${war.file}"/> |
| <mkdir dir="${build.classes.dir}/tmp"/> |
| <mkdir dir="${build.classes.dir}/tmp/WEB-INF"/> |
| <copy todir="${build.classes.dir}/tmp/WEB-INF" |
| file="${web.xml}"/> |
| <copy todir="${build.classes.dir}/tmp/WEB-INF" |
| file="${sun-web.xml}"/> |
| <copy todir="${build.classes.dir}/tmp/WEB-INF" |
| file="${sun-webservices.xml}"/> |
| <mkdir dir="${build.classes.dir}/tmp/WEB-INF/classes"/> |
| <copy todir="${build.classes.dir}/tmp/WEB-INF/wsdl" |
| file="GoogleSearch.wsdl"/> |
| <copy todir="${build.classes.dir}/tmp/WEB-INF/wsdl" |
| file="GoogleSearch_types.wsdl"/> |
| <copy todir="${build.classes.dir}/tmp" |
| file="GoogleMapping_web.xml"/> |
| <copy todir="${build.classes.dir}/tmp" |
| file="googleweb.model"/> |
| <copy todir="${build.classes.dir}/tmp/WEB-INF/classes/googleserverweb"> |
| <fileset dir="${build.classes.dir}/googleserverweb"> |
| <include name="**/*.class"/> |
| </fileset> |
| </copy> |
| <jar jarfile="${assemble.dir}/${appname}-web.war" update="true"> |
| <fileset dir="${build.classes.dir}/tmp" casesensitive="yes"> |
| <include name="**/**"/> |
| </fileset> |
| </jar> |
| <delete dir="${build.classes.dir}/tmp"/> |
| </target> |
| |
| |
| <target name="deploy" |
| depends="init-common"> |
| <antcall target="deploy-common"/> |
| </target> |
| |
| <target name="clean" depends="init-common"> |
| <antcall target="clean-common"/> |
| <delete dir="output"/> |
| <delete dir="googleclient"/> |
| <delete dir="googleserver"/> |
| <delete dir="googleserverweb"/> |
| <delete> |
| <fileset dir="." includes="*.model"/> |
| </delete> |
| <delete file="GoogleMapping_ejb.xml"/> |
| <delete file="GoogleMapping_appclient.xml"/> |
| <delete file="GoogleMapping_web.xml"/> |
| </target> |
| |
| <target name="run" depends="init-common"> |
| <antcall target="runclient-common"> |
| <param name="appclient.application.args" value="forwardejb http://${http.host}:${http.port}/GoogleServlet/GoogleSearch"/> |
| </antcall> |
| <antcall target="runclient-common"> |
| <param name="appclient.application.args" value="forwardweb http://${http.host}:${http.port}/google/GoogleSearch"/> |
| </antcall> |
| <antcall target="run-standalone"/> |
| </target> |
| |
| <target name="build-standalone" depends="init-common"> |
| <antcall target="run.wscompile"> |
| <param name="wscompile.command" |
| value="-gen:client -keep -d ${build.classes.dir} -s ${build.classes.dir} -classpath . wscompile_config_standalone.xml"/> |
| </antcall> |
| <antcall target="compile-common"> |
| <param name="src" value="standalone"/> |
| </antcall> |
| </target> |
| |
| <target name="run-standalone" depends="init-common"> |
| <antcall target="build-standalone"/> |
| <java fork="true" classname="standalone.StandAloneClient" |
| failonerror="true"> |
| <arg line="spellng http://${http.host}:${http.port}/google/GoogleSearch"/> |
| <classpath> |
| <pathelement location="${env.S1AS_HOME}/lib/j2ee.jar"/> |
| <pathelement location="${env.S1AS_HOME}/lib/appserv-cmp.jar"/> |
| <pathelement location="${env.S1AS_HOME}/lib/appserv-ext.jar"/> |
| <pathelement location="${env.S1AS_HOME}/lib/appserv-rt.jar"/> |
| <pathelement location="${env.S1AS_HOME}/lib/webservices-rt.jar"/> |
| <pathelement location="${env.S1AS_HOME}/lib/webservices-tools.jar"/> |
| <pathelement location="${env.APS_HOME}/lib/reporter.jar"/> |
| <pathelement location="${build.classes.dir}"/> |
| </classpath> |
| |
| <sysproperty key="http.proxyHost" value="scaweb2.sfbay"/> |
| <sysproperty key="http.proxyPort" value="8080"/> |
| </java> |
| </target> |
| |
| <target name="undeploy" depends="init-common"> |
| <antcall target="undeploy-common"/> |
| </target> |
| |
| <target name="contactgoogle"> |
| <antcall target="runclient-common"> |
| <param name="appclient.application.args" value="spellng"/> |
| </antcall> |
| </target> |
| |
| <target name="gen-mapping-appclient" depends="init-common"> |
| <antcall target="run.wscompile"> |
| <param name="wscompile.command" |
| value="-gen -cp . -mapping GoogleMapping_appclient.xml wscompile_config_appclient.xml"/> |
| </antcall> |
| </target> |
| |
| <target name="gen-mapping-ejb" depends="init-common"> |
| <antcall target="run.wscompile"> |
| <param name="wscompile.command" |
| value="-gen -cp . -mapping GoogleMapping_ejb.xml wscompile_config_ejb.xml"/> |
| </antcall> |
| </target> |
| |
| <target name="gen-mapping-web" depends="init-common"> |
| <antcall target="run.wscompile"> |
| <param name="wscompile.command" |
| value="-gen -cp . -mapping GoogleMapping_web.xml wscompile_config_web.xml"/> |
| </antcall> |
| </target> |
| |
| <target name="create-user"> |
| <antcall target="create-user-common"> |
| <param name="user" value="j2ee"/> |
| <param name="password" value="j2ee"/> |
| <param name="groups" value="staff"/> |
| </antcall> |
| <antcall target="reconfig-common"/> |
| </target> |
| |
| <target name="delete-user"> |
| <!-- remove test users, just cleanup. --> |
| <antcall target="delete-user-common"> |
| <param name="user" value="j2ee"/> |
| </antcall> |
| </target> |
| |
| <target name="restart"> |
| <antcall target="restart-server-instance-common"/> |
| </target> |
| |
| <target name="usage"> |
| <echo> |
| Usage: |
| ant all (Executes the WebServices test) |
| ant contactgoogle (Executes the appclient contacting the Google.com WebServices) |
| </echo> |
| </target> |
| </project> |