Skip to content
Snippets Groups Projects
build.xml 9.94 KiB
Newer Older
  • Learn to ignore specific revisions
  • tpylak's avatar
    tpylak committed
    <project name="screening" default="ci" basedir="..">
    
      <import file="../../openbis/build/build.xml" />
      <import file="../../datastore_server/build/build.xml" />
      <project-classpath name="ecp" classes="${classes}" />
    
    	<project-classpath name="ecp.gwt" classes="${targets}/www/WEB-INF/classes" />
      
    
      <property name="original.dist" value="dist" />
      <property name="mainfolder" value="screening" />
      <property name="variant" value="-screening" />
    
    tpylak's avatar
    tpylak committed
    
    
    tpylak's avatar
    tpylak committed
      <property name="dist.screening-api" value="${dist}/screening_api" />
    
      <property name="dist.screening-api.lib" value="${dist.screening-api}" />
    
    tpylak's avatar
    tpylak committed
      <property name="dist.screening-api.jar" value="${dist.screening-api.lib}/openbis_screening_api.jar" />
    
      <property name="dist.screening-api.src" value="${dist.screening-api}/openbis_screening_api_source.zip" />
    
    tpylak's avatar
    tpylak committed
    	<property name="dist.screening-api.javadoc" value="${dist.screening-api}/doc" />
    
      <property name="dist.screening-api.javadoc.zip" value="${dist.screening-api}/openbis_screening_api_javadoc.zip" />
    
    tpylak's avatar
    tpylak committed
    	<property name="classes.screening" value="../screening/targets/ant/classes" />
    
    tpylak's avatar
    tpylak committed
    	<property name="classes.common-server" value="../server-common/targets/ant/classes" />
    
      <property name="classes.common" value="../common/targets/ant/classes" />
    
      <target name="compile" depends="build-common.compile, clean" />
    
    tpylak's avatar
    tpylak committed
    
    
    tpylak's avatar
    tpylak committed
            // Task for creating distributions
            -->
    
      <target name="dist" depends="openbis.make-dist, datastore_server.make-dist, screening-api" />
    
    tpylak's avatar
    tpylak committed
            // Task for continuous integration server.
            -->
    
      <target name="ci" depends="build-common.ci, dist, check-dependencies" />
    
      <!--
    
    tpylak's avatar
    tpylak committed
            // Compiles the javascript using GWT compiler.
            -->
    
      <target name="compile-javascript" depends="prepare-web-client" description="Compiles the javascript using GWT compiler.">
        <antcall target="compile-gwt-module">
          <param name="gwt.module.name" value="ch.systemsx.cisd.openbis.plugin.screening.OpenBIS" />
        </antcall>
      </target>
    
    tpylak's avatar
    tpylak committed
    
    
    tpylak's avatar
    tpylak committed
            // Creates WAR file.
            -->
    
      <target name="war" depends="openbis.war" description="Creates project war file.">
        <war warfile="${webapp.file}" update="true">
          <classes prefix="WEB-INF/classes/screening" dir="source">
            <include name="**/*.sql" />
          </classes>
          <classes dir="../openbis/${sources}">
            <include name="**/*.xml" />
            <exclude name="**/*.gwt.xml" />
          </classes>
          <lib dir="${lib}/jaxb">
            <include name="*.jar" />
          </lib>
          <lib dir="${lib}/eodsql">
            <include name="*.jar" />
          </lib>
    
          <lib dir="${lib}/csv">
            <include name="*.jar" />
          </lib>
    
        </war>
      </target>
    
      <target name="check-dictionary-syntax" description="Parse *-dictionary.js and check that the syntax is correct.">
        <antcall target="check-javascript-syntax">
          <param name="javascript-file"
            value="../screening/${sources}/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js" />
        </antcall>
      </target>
    
      <!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxx API xxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
        
    
    tpylak's avatar
    tpylak committed
      <target name="screening-api-doc">
    
    tpylak's avatar
    tpylak committed
          destdir="${dist.screening-api.javadoc}" 
    
          access="public" 
          author="false" 
          version="false" 
    
    tpylak's avatar
    tpylak committed
          classpath="${ecp}:${classes.screening}">
    
          <fileset dir="${sources}">
    
    tpylak's avatar
    tpylak committed
            <include name="ch/systemsx/cisd/openbis/plugin/screening/client/api/v1/*" />
            <include name="ch/systemsx/cisd/openbis/plugin/screening/shared/api/v1/dto/*" />
    
          </fileset>
        </javadoc>
    
        <zip destfile="${dist.screening-api.javadoc.zip}">
    
          <zipfileset dir="${dist.screening-api.javadoc}" includes="**" />
    
        <delete dir="${dist.screening-api.javadoc}" />
    
        <zip destfile="${dist.screening-api.src}">
          <zipfileset dir="${sources}" includes="ch/systemsx/cisd/openbis/plugin/screening/shared/api/v1/dto/**" />
          <zipfileset dir="${sources}" includes="ch/systemsx/cisd/openbis/plugin/screening/client/api/v1/*Facade.java" />
        </zip>
    
    tpylak's avatar
    tpylak committed
      <!-- 
      		To test the API you can use
      		   java -jar lib/openbis_screening_api.jar USER PASSWD OPENBIS_SERVER_URL
       -->
    
    tpylak's avatar
    tpylak committed
      <target name="screening-api-libs">
        <mkdir dir="${dist.screening-api.lib}" />
        <build-info revision="revision.number" version="version.number" clean="clean.flag" />
        <echo file="${build.info.file}">${version.number}:${revision.number}:${clean.flag}</echo>
        <recursive-jar destfile="${dist.screening-api.jar}">
    
    tpylak's avatar
    tpylak committed
          <fileset dir="${classes.screening}">
    
    tpylak's avatar
    tpylak committed
            <include name="ch/systemsx/cisd/openbis/dss/screening/shared/api/v1/**/*.class" />
          	<include name="ch/systemsx/cisd/openbis/plugin/screening/shared/api/v1/**/*.class" />
    
    tpylak's avatar
    tpylak committed
           	<include name="ch/systemsx/cisd/openbis/plugin/screening/client/api/v1/**/*.class" />
           	<include name="${build.info.filename}" />
    
    tpylak's avatar
    tpylak committed
          </fileset>
    
    tpylak's avatar
    tpylak committed
        	<manifest>
    
    tpylak's avatar
    tpylak committed
          	<attribute name="Main-Class" value="ch.systemsx.cisd.openbis.plugin.screening.client.api.v1.ScreeningClientApiTest" />
    
            <attribute name="Class-Path" value="spring-ext.jar" />
    
    tpylak's avatar
    tpylak committed
            <attribute name="Version" value="${version.number}" />
            <attribute name="Build-Number"
                       value="${version.number} (r${revision.number},${clean.flag})" />
          </manifest>
        </recursive-jar>
    
    tpylak's avatar
    tpylak committed
      	<jar update="true" destfile="${dist.screening-api.jar}">
      		<fileset dir="${classes.common-server}">
    
      		     	<include name="ch/systemsx/cisd/common/spring/HttpInvokerUtils.class" />
    
    tpylak's avatar
    tpylak committed
      		</fileset> 
    
          <fileset dir="${classes.common}">
                <include name="ch/systemsx/cisd/common/exceptions/**/*.class" />
    
                <include name="ch/systemsx/cisd/common/io/ConcatFileOutputStreamWriter.class" />
    
          </fileset> 
        </jar>
        <recursive-jar destfile="${dist.screening-api.lib}/spring-ext.jar">
    
    tpylak's avatar
    tpylak committed
          <zipfileset src="${lib}/spring/spring.jar" />
          <zipfileset src="${lib}/spring/third-party/stream-supporting-httpinvoker.jar" />
          <zipfileset src="${lib}/commons-logging/commons-logging.jar" />
          <zipfileset src="${lib}/commons-httpclient/commons-httpclient.jar" />
          <zipfileset src="${lib}/commons-codec/commons-codec.jar" />
          <zipfileset src="${lib}/log4j/log4j.jar" />     
    
    tpylak's avatar
    tpylak committed
      </target>
    	
    	<target name="screening-api" depends="screening-api-doc, screening-api-libs" />
    
      
      <!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxx END API xxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
      
      <!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxx ECLIPSE TEST MODE xxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
    
    
      <!-- This is a copy of the openBIS version, the only difference is the value of ecp.gwt variable  -->
      
    
      <!--
        // // Compile Java to javscript, assuming that prepare-gwt has already been run // // Must pass in module-test.path
        and module-test.module as arguments // e.g., // <{property,param} name="module-test.path" value="openbis-test" /> //
        <{property,param} name="module-test.module" value="ch.systemsx.cisd.openbis.OpenBIS" /> //
      -->
      <target name="screening-compile-module-test" description="Compile the module test mode">
        <delete dir="${targets.www}/${module-test.path}" />
        <java classpath="${ecp}:${ecp.gwt}:${gwt.lib}/gwt-dev.jar:${gwt.user.lib}:../openbis/${sources}:${sources}"
          classname="com.google.gwt.dev.Compiler" fork="true">
          <jvmarg value="-Xmx512M" />
          <arg value="-war" />
          <arg value="${targets.www}" />
          <arg value="${module-test.module}Firefox" />
          <arg value="-draftCompile" />
          <arg value="-style" />
          <arg value="PRETTY" />
        </java>
        <move todir="${targets.www}/${module-test.path}">
          <fileset dir="${targets.www}/${module-test.module}" />
        </move>
      </target>
    
      <!--
        // // Run the production mode, assuming compile-module-test has already been run // // Must pass in
        module-test.path, module-test.module, and module-test.db-kind as arguments // e.g., // <{property,param}
        name="module-test.path" value="openbis-test" /> // <{property,param} name="module-test.module"
        value="ch.systemsx.cisd.openbis.OpenBIS" /> //
      -->
      <target name="screening-run-module-test" description="Run the module test mode">
        <java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode">
          <classpath>
            <pathelement location="${sources}" />
            <pathelement location="../openbis/${sources}" />
            <pathelement path="${ecp}" />
            <pathelement path="${ecp.gwt}" />
            <pathelement location="${gwt.lib}/gwt-dev.jar" />
            <pathelement location="${gwt.lib}/gwt-user.jar" />
          </classpath>
          <jvmarg value="-Xmx512M" />
          <jvmarg value="-ea" />
          <sysproperty key="log4j.configuration" file="etc/log.xml" />
          <sysproperty key="javax.net.ssl.trustStore" file="dist/server/openBIS.keystore" />
    
          <!-- Arguments to com.google.gwt.dev.DevMode -->
          <!-- Provide two startup urls : one for the compiled version, one for the normal dev version -->
          <arg value="-startupUrl" />
          <arg value="${module-test.path}/index.html" />
          <arg value="-startupUrl" />
          <arg value="${module-test.module}/index.html" />
    
          <arg value="${module-test.module}" />
          <arg value="-war" />
          <arg value="targets/www" />
          <arg value="-logLevel" />
          <arg value="WARN" />
        </java>
      </target>
    
      <target name="screening-test-compile-and-run" description="Compile and run the screening openbis from Eclipse">
        <antcall target="screening-compile-module-test">
          <param name="module-test.path" value="openbis-test-screening" />
          <param name="module-test.module" value="ch.systemsx.cisd.openbis.plugin.screening.OpenBIS" />
        </antcall>
        <antcall target="screening-test-run" />
      </target>
    
      <target name="screening-test-run" description="run the screening openbis from Eclipse">
        <antcall target="screening-run-module-test">
          <param name="module-test.path" value="openbis-test-screening" />
          <param name="module-test.module" value="ch.systemsx.cisd.openbis.plugin.screening.OpenBIS" />
        </antcall>
      </target>
      
      <!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxx END ECLIPSE TEST MODE xxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
      
      
    
    tpylak's avatar
    tpylak committed
    </project>