diff options
Diffstat (limited to 'verigraph/gRPC-build.xml')
-rw-r--r-- | verigraph/gRPC-build.xml | 216 |
1 files changed, 216 insertions, 0 deletions
diff --git a/verigraph/gRPC-build.xml b/verigraph/gRPC-build.xml new file mode 100644 index 0000000..7ff5549 --- /dev/null +++ b/verigraph/gRPC-build.xml @@ -0,0 +1,216 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (c) 2017 Politecnico di Torino and others. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> +<project name="gRPC-Verigraph" default="gRPC-run" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant"> + <description> + Script for gRPC-Verigraph + </description> + + <!-- The location of this assignment --> + <property name="grpc.location" location="." /> + <!-- The location to be used for class files --> + <property name="build.dir" location="${grpc.location}/build" /> + <!-- The location for source files --> + <property name="src.dir" location="${grpc.location}/src" /> + <!-- The location for solutions --> + <property name="grpc.dir" value="src/it/polito/verigraph/grpc" /> + <!-- The location for jar files --> + <property name="lib.dir" location="${grpc.location}/lib" /> + <!-- The location for jar files --> + <property name="other_lib.dir" location="${grpc.location}/service/build" /> + <!-- The location for generated files --> + <property name="generated.dir" location="${basedir}/gen-protobuf" /> + <!-- The default test class --> + <property name="test1.class" value="it.polito.verigraph.grpc.test.GrpcServerTest" /> + <property name="test2.class" value="it.polito.verigraph.grpc.test.GrpcTest" /> + <property name="test3.class" value="it.polito.verigraph.grpc.test.MultiThreadTest" /> + <property name="test4.class" value="it.polito.verigraph.grpc.test.ReachabilityTest" /> + <!-- The name to be given to the final zip --> + <property name="sol.zip" value="grpc.zip" /> + <!-- Java compiler settings --> + <property name="debug" value="true" /> + <property name="debuglevel" value="source,lines,vars" /> + <property name="target" value="1.8" /> + <property name="source" value="1.8" /> + + <!-- The classpath to be used for running the tests --> + <path id="test.classpath"> + <pathelement path="${build.dir}" /> + <fileset dir="${grpc.location}/lib"> + <include name="com.microsoft.z3.jar" /> + </fileset> + <fileset refid="mvn-dependencies" /> + </path> + + <!-- Here starts part for Maven --> + <path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.3.jar" /> + <typedef resource="org/apache/maven/artifact/ant/antlib.xml" + uri="antlib:org.apache.maven.artifact.ant" + classpathref="maven-ant-tasks.classpath" /> + <property file="build.properties"/> + + <!-- Load pom.xml for dependencies --> + <artifact:pom id="pomfile" file="pom.xml" /> + <artifact:dependencies filesetId="mvn-dependencies" pomRefId="pomfile" /> + + <!-- Grab the HSQLDB jar and add it to the classpath + <artifact:dependencies filesetId="warDeps"> + <dependency groupId="org.glassfish.jersey" artifactId="jersey-bom" version="2.22.1" /> + </artifact:dependencies>--> + + <path id="build.classpath"> + <fileset refid="mvn-dependencies" /> + </path> + + <!-- target name="init"> + <mkdir dir="${build.dir}" /> + </target--> + + + <!-- The target for compiling the gRPC application --> + <!--target name="gRPC-build" depends="init" description="Build the sources"--> + <target name="gRPC-build" description="Build the sources"> + <echo>Building gRPC (if needed)...</echo> + <javac + debug="${debug}" + debuglevel="${debuglevel}" + source="${source}" + target="${target}" + destdir="${build.dir}" + classpathref="build.classpath" + includeantruntime="false"> + <src path="${generated.dir}" /> + <src path="${src.dir}" /> + <src path="${grpc.location}/gen-src"/> + <compilerarg value="-Xlint:unchecked"/> + <classpath> + <pathelement path="${grpc.location}/lib/com.microsoft.z3.jar"/> + </classpath> + <include name="$it/polito/**/**/*.java"/> + <!-- classpath> + <pathelement path="${other_lib.dir}/qjutils.jar"/> + </classpath--> + </javac> + <echo>Done.</echo> + </target> + + + <!-- The target for running the gRPC application --> + <target name="gRPC-run" depends="gRPC-build" description="Run gRPC"> + <parallel> + <sequential> + <java classname="it.polito.verigraph.grpc.Service" failonerror="true" classpathref="build.classpath" fork="yes"> + <classpath> + <pathelement path="${build.dir}"/> + </classpath> + </java> + </sequential> + <sequential> + <sleep milliseconds="500"/> + <java classname="it.polito.verigraph.grpc.Client" failonerror="true" classpathref="build.classpath" fork="yes"> + <classpath> + <pathelement path="${build.dir}"/> + </classpath> + </java> + </sequential> + </parallel> + </target> + + + <target name="gRPC-run-client" depends="gRPC-build" description="Run gRPC client"> + <java classname="it.polito.verigraph.grpc.client.Client" failonerror="true" classpathref="build.classpath" fork="yes"> + <classpath> + <pathelement path="${build.dir}"/> + </classpath> + </java> + </target> + + + <target name="gRPC-run-server" depends="gRPC-build" description="Run gRPC server"> + <java classname="it.polito.verigraph.grpc.server.Service" failonerror="true" classpathref="build.classpath" fork="yes"> + <classpath> + <pathelement path="${build.dir}"/> + </classpath> + </java> + </target> + + + <target name="gRPC-run-tests" description="Run tests for gRPC"> + <echo>Running functional tests</echo> + <antcall target="runFuncTest.real"> + <param name="exit.code1" value="126" /> + <param name="exit.code2" value="125" /> + <param name="exit.code3" value="124" /> + <param name="exit.code4" value="123" /> + </antcall> + </target> + + + <!-- Target runFuncTest.real --> + <target name="runFuncTest.real" depends="gRPC-build"> + <echo>Running First set of Junit tests...</echo> + <junit printsummary="yes" dir="." fork="yes" haltonfailure="no" showoutput="no" filtertrace="true" timeout="120000"> + <jvmarg value="-Djava.awt.headless=true" /> + <formatter type="brief" usefile="false"/> + <test haltonfailure="no" failureproperty="test_failed" name="${test1.class}"/> + <classpath> + <path refid="test.classpath" /> + </classpath> + </junit> + <fail if="test_failed" status="${exit.code1}" message="*** First set of Junit tests: Some Tests FAILED ***"/> + <echo>*** First set of Junit tests: All Tests PASSED ***</echo> + + <echo>Running Second set of Junit tests...</echo> + <junit printsummary="yes" dir="." fork="yes" haltonfailure="no" showoutput="no" filtertrace="true" timeout="120000"> + <jvmarg value="-Djava.awt.headless=true" /> + <formatter type="brief" usefile="false"/> + <test haltonfailure="no" failureproperty="test_failed" name="${test2.class}"/> + <classpath> + <path refid="test.classpath" /> + </classpath> + </junit> + <fail if="test_failed" status="${exit.code2}" message="*** Second set of Junit tests: Some Tests FAILED ***"/> + <echo>*** Second set of Junit tests: All Tests PASSED ***</echo> + + <!--echo>Running Third set of Junit tests...</echo> + <junit printsummary="yes" dir="." fork="yes" haltonfailure="no" showoutput="no" filtertrace="true" timeout="120000"> + <jvmarg value="-Djava.awt.headless=true" /> + <formatter type="brief" usefile="false"/> + <test haltonfailure="no" failureproperty="test_failed" name="${test3.class}"/> + <classpath> + <path refid="test.classpath" /> + </classpath> + </junit> + <fail if="test_failed" status="${exit.code3}" message="*** Third set of Junit tests: Some Tests FAILED ***"/> + <echo>*** Third set of Junit tests: All Tests PASSED ***</echo--> + + <echo>Running Fourth set of Junit tests...</echo> + <junit printsummary="yes" dir="." fork="yes" haltonfailure="no" showoutput="no" filtertrace="true" timeout="120000"> + <jvmarg value="-Djava.awt.headless=true" /> + <formatter type="brief" usefile="false"/> + <test haltonfailure="no" failureproperty="test_failed" name="${test4.class}"/> + <classpath> + <path refid="test.classpath" /> + <fileset dir="${lib.dir}"> + <include name="*.jar" /> + </fileset> + </classpath> + </junit> + <fail if="test_failed" status="${exit.code4}" message="*** Fourth set of Junit tests: Some Tests FAILED ***"/> + <echo>*** Fourth set of Junit tests: All Tests PASSED ***</echo> + <echo>***************************************************</echo> + <echo>*************** All Tests PASSED *****************</echo> + </target> + + + <!-- target for cleaning --> + <!-- target name="clean"> + <delete dir="${build.dir}" /> + </target--> +</project>
\ No newline at end of file |