Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [higgins-dev] ant builds for STS

Hi Jim,
 
Attached is a build file I have put togther that I use. Its based on your ant scripts but it is
one file and builds everything and correct dependencies. It creates jars and wars and has
a deploy target to copy the wars into tomcat. I am throwing this in case anyone else wants
to use it or if you want to include it in your ant scripts or if you find it useful...
I haven't syncronized for a while, so it might be broken for the newest stuff. I will
probably sync and post the fixes (if needed here) sometime next week...
 
The script is for tomcat 5.x only and probably needs to be fixed for other app servers. It needs
to have TOMCAT_HOME environment variable defined. I have used the same directory
layout you suggest in the mail below but i have added ./higgins.bin directory in which the
script is placed and in which the bits are created. The name is not important, just to be under
the sts root. If that needs to be changed, then some of the dir properties need to be altered.
 
"ant usage" will bring script usage. I personally use it in from a simple bat file, placed in the
same dir as the build.xml, that adds tomcat's servlet-api.jar to the ant classpath or the build fails:
build.bat:
-----------[start]-------
ant -lib %TOMCAT_HOME%\common\lib\servlet-api.jar %*
----------[end]---------
 
George Stanchev


From: higgins-dev-bounces@xxxxxxxxxxx [mailto:higgins-dev-bounces@xxxxxxxxxxx] On Behalf Of Jim Sermersheim
Sent: Wednesday, January 03, 2007 2:10 PM
To: Higgins (Trust Framework) Project developer discussions
Subject: RE: [higgins-dev] ant builds for STS

I noticed that I didn't give instructions for setting up for ant builds from the command line.  I'll probably do that in the morning.  Also, Mike's making more changes right now that will probably cause some further updates.
 
Jim

>>> "Jim Sermersheim" <jimse@xxxxxxxxxx> 1/3/07 2:00 PM >>>
I've update these instructions and checked in changes to get the ant scripts to work once again

1) Use the attached .psf file to get the projects (it will get you the
sts plus idas components)
2) You need one or more directories in which to place dependency jar
files.  Either follow my example, or put them all in one shared
directory, or split them up however you want:

depends.sts.binding.axis.core
    axiom-api-1.0.jar
    axis.jar
    commons-logging-1.0.4.jar
    jaxrpc.jar
    saaj.jar
    servlet-api.jar
    xmlsec-1.3.0.jar

depends.sts.binding.axis.service
    axiom-api-1.0.jar
    axis.jar
    commons-logging-1.0.4.jar
    jaxrpc.jar
    saaj.jar

depends.sts.binding.axis.transfer
    axis.jar
    commons-logging-1.0.4.jar
    jaxrpc.jar
    saaj.jar
    servlet-api.jar

depends.sts.binding.axis.types
    axis.jar
    jaxrpc.jar

depends.sts.core
    axiom-api-1.0.jar
    axis.jar
    commons-logging-1.0.4.jar
    jaxrpc.jar
    saaj.jar
    servlet-api.jar
    stax-api-1.0.jar
    xercesImpl.jar
    xmlsec-1.3.0.jar

depends.sts.extension.samltoken
    axiom-api-1.0.jar
    commons-logging-1.0.4.jar
    servlet-api.jar
    xmlsec-1.3.0.jar

depends.sts.extension.usernametoken
    axiom-api-1.0.jar
    commons-logging-1.0.4.jar
    servlet-api.jar
    xmlsec-1.3.0.jar

depends.sts.informationcardgenerator
    <nothing here yet>

If you add these directories at the root of your Eclipse workspace
directory it will save you a lot of time later.  If you at least put
them all in the same place it will save a little time later.

3) In Eclipse, do this: Window, Preferences..., Java, Build Path,
Classpath Variables.
3.1) For each name below, press New, enter the name, then enter the path
to the corresponding dependency directory you built above
STS_BINDING_AXIS_CORE_DEPENDS  (My path is
C:/Data/Higgins/depends.sts.binding.axis.core)
STS_BINDING_AXIS_SERVICE_DEPENDS (My path is
C:/Data/Higgins/depends.sts.binding.axis.service)
STS_BINDING_AXIS_TRANSFER_DEPENDS (My path is
C:/Data/Higgins/depends.sts.binding.axis.transfer)
STS_BINDING_AXIS_TYPES_DEPENDS (My path is
C:/Data/Higgins/depends.sts.binding.axis.types)
STS_CORE_DEPENDS (My path is C:/Data/Higgins/depends.sts.core)
STS_EXTENSION_SAML_TOKEN_DEPENDS (My path is
C:/Data/Higgins/depends.sts.extension.samltoken)
STS_EXTENSION_USERNAME_TOKEN_DEPENDS (My path is
C:/Data/Higgins/depends.sts.extension.usernametoken)
STS_INFORMATION_CARD_GENERATOR_DEPENDS (My path is
C:/Data/Higgins/depends.sts.informationcardgenerator)

4) <here's the redundant part>  In Eclipse, do this: Window,
Preferences..., Ant, Runtime, Properties (tab)
4.1) For each name below, press Add Property, enter the name, then enter
the path to the corresponding dependency directory you built above.
Note, you can use a variable here like I did.
sts.binding.axis.core.depends (My path is
${workspace_loc}/depends.sts.binding.axis.core/
sts.binding.axis.service.depends (My path is
${workspace_loc}/depends.sts.binding.axis.service/
sts.binding.axis.transfer.depends (My path is
${workspace_loc}/depends.sts.binding.axis.transfer/
sts.binding.axis.types.depends (My path is
${workspace_loc}/depends.sts.binding.axis.types/
sts.core.depends (My path is ${workspace_loc}/depends.sts.core/
sts.extension.samltoken.depends (My path is
${workspace_loc}/depends.sts.extension.samltoken/
sts.extension.usernametoken.depends (My path is
${workspace_loc}/depends.sts.extension.usernametoken/
sts.informationcardgenerator.depends (My path is
${workspace_loc}/depends.sts.informationcardgenerator/


That should be it unless I forgot something.  I'm sure there are tricks
to reduce the redundancy, I'll keep poking around.

Building the projects will cause the ant scripts to be used.  To build
manually or pick the target you want to execute, add the ant scripts
like this:
6) In Eclipse, do this: Window, Show View, Ant.  An Ant Browser appears.
Right-Click, Add Buildfiles..., browse to the buildfile (build.xml) you
want to add and select it.  You can double click the build file to build
the default target, or expand it to see all the targets available

Note that the STS Core build file has a jarAllSTS -- this will force all
the jars to be built.  I think I'll add a warAllSTS once I get a couple
more war targets done.

Jim

**********************************************************************
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

_______________________________________________
higgins-dev mailing list
higgins-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/higgins-dev
<project name="Higgins all build" default="usage" basedir=".">
  
  <property environment="env"/>
  
  <property name="depends.servlet-api.jar"              value="${env.TOMCAT_HOME}/common/lib/server-api.jar"/>
  
  <property name="sts.root.dir"                         value=".."/>
  <property name="target.dir"                           value="${basedir}"/>
  
  <!-- STS dependency dirs -->
  <property name="sts.binding.axis.core.depends"        value="${sts.root.dir}/depends.sts.binding.axis.core"/>
  <property name="sts.binding.axis.service.depends"     value="${sts.root.dir}/depends.sts.binding.axis.service"/>
  <property name="sts.binding.axis.transfer.depends"    value="${sts.root.dir}/depends.sts.binding.axis.transfer"/>
  <property name="sts.binding.axis.types.depends"       value="${sts.root.dir}/depends.sts.binding.axis.types"/>
  <property name="sts.core.depends"                     value="${sts.root.dir}/depends.sts.core"/>
  <property name="sts.extension.samltoken.depends"      value="${sts.root.dir}/depends.sts.extension.samltoken"/>
  <property name="sts.extension.usernametoken.depends"  value="${sts.root.dir}/depends.sts.extension.usernametoken"/>
  <property name="sts.informationcardgenerator.depends" value="${sts.root.dir}/depends.sts.informationcardgenerator"/>
  
  <!-- STS base dirs -->
  <property name="sts.idas.dir"                         value="${sts.root.dir}/org.eclipse.higgins.idas"/>
  <property name="sts.axis.service.dir"                 value="${sts.root.dir}/org.eclipse.higgins.sts.binding.axis1x.service"/>
  <property name="sts.axis.core.dir"                    value="${sts.root.dir}/org.eclipse.higgins.sts.binding.axis1x.core"/>
  <property name="sts.axis.types.dir"                   value="${sts.root.dir}/org.eclipse.higgins.sts.binding.axis1x.types"/>
  <property name="sts.axis.xfer.dir"                    value="${sts.root.dir}/org.eclipse.higgins.sts.binding.axis1x.xfer_temp"/>
  <property name="sts.core.dir"                         value="${sts.root.dir}/org.eclipse.higgins.sts.core"/>
  <property name="sts.samltoken.dir"                    value="${sts.root.dir}/org.eclipse.higgins.sts.extension.samltoken"/>
  <property name="sts.usernametoken.dir"                value="${sts.root.dir}/org.eclipse.higgins.sts.extension.usernametoken"/>
  <property name="sts.informationcardgenerator.dir"     value="${sts.root.dir}/org.eclipse.higgins.sts.informationcardgenerator"/>
  
  <target name="usage">
    <echo>
Available Build Targets:

        idas: Builds and copies Idas
        axis: Builds and copies Axis Core
     service: Builds and copies Axis Service
       types: Builds and copies Axis Types 
        xfer: Builds and copies Axis Transfer Service
        core: Builds and copies STS Core
        user: Builds and copies UsernameToken Extension
        saml: Builds and copies SAML Token Extension
        info: Builds and copies Informationcard Generator

       build: Builds all targets (without local clean)
       clean: Cleans target binaries
         all: Builds all
      deploy: Deploys build WAR files into Tomcat:

              ${env.TOMCAT_HOME}/webapps

       usage: Displays this message.
    </echo>
  </target>
    
  <!-- Convinience targets -->
  <target name="idas"     depends="sts.idas.build,sts.idas.copy"/>
  <target name="axis"     depends="sts.axis.core.build,sts.axis.core.copy"/>
  <target name="service"  depends="sts.axis.service.build,sts.axis.service.copy"/>
  <target name="types"    depends="sts.axis.types.build,sts.axis.types.copy"/>
  <target name="xfer"     depends="sts.axis.xfer.build,sts.axis.xfer.copy"/>
  <target name="core"     depends="sts.core.build,sts.core.copy"/>
  <target name="user"     depends="sts.usernametoken.build,sts.usernametoken.copy"/>
  <target name="saml"     depends="sts.samltoken.build,sts.samltoken.copy"/>
  <target name="info"     depends="sts.informationcardgenerator.build,sts.informationcardgenerator.copy"/>
  
  <target name="build"    depends="idas,core,types,axis,service,xfer,saml,user,info"/>
  <target name="all"      depends="clean,idas,core,types,axis,service,xfer,saml,user,info"/>
  
  <target name="clean">
    <delete quiet="true">
      <fileset dir="${target.dir}">
        <include name="*.jar"/>
        <include name="*.war"/>
      </fileset>
    </delete>
  </target>
    
  <target name="deploy">
    <copy todir="${env.TOMCAT_HOME}/webapps">
      <fileset dir="${target.dir}">
        <include name="*.war"/>
      </fileset>
    </copy>
  </target>
    
  <!-- ********************************************************************************************************* -->
  <!-- Idas                                                                                                      -->
  <!-- ********************************************************************************************************* -->

  <!-- build -->
  <target name="sts.idas.build">
    <ant dir="${sts.idas.dir}" target="clean" inheritAll="true"/>
    <ant dir="${sts.idas.dir}" target="jar" inheritAll="true"/>
  </target>    
 
  <!-- copy -->
  <target name="sts.idas.copy">
    <copy todir="${target.dir}">
      <fileset dir="${sts.idas.dir}/bin" includes="*.jar"/>
    </copy>
  </target>    
  
  <!-- ********************************************************************************************************* -->
  <!-- Axis Core                                                                                                 -->
  <!-- ********************************************************************************************************* -->
  
  <!-- build -->
  <target name="sts.axis.core.build">
    <ant dir="${sts.axis.core.dir}" target="clean" inheritAll="true" inheritRefs="true"/>
    <ant dir="${sts.axis.core.dir}" target="jar" inheritAll="true" inheritRefs="true"/>
  </target>    
  
  <!-- copy -->
  <target name="sts.axis.core.copy">
    <copy todir="${target.dir}">
      <fileset dir="${sts.axis.core.dir}/build" includes="*.jar"/>
    </copy>
  </target>    
  
  <!-- ********************************************************************************************************* -->
  <!-- Axis Service                                                                                              -->
  <!-- ********************************************************************************************************* -->
  
  <!-- build -->
  <target name="sts.axis.service.build">
    <ant dir="${sts.axis.service.dir}" target="clean" inheritAll="true" inheritRefs="true"/>
    <ant dir="${sts.axis.service.dir}" target="jar" inheritAll="true" inheritRefs="true"/>
    <ant dir="${sts.axis.service.dir}" target="war" inheritAll="true" inheritRefs="true"/>
  </target>
  
  <!-- copy -->
  <target name="sts.axis.service.copy">
    <copy todir="${target.dir}">
      <fileset dir="${sts.axis.service.dir}/build">
        <include name="*.jar"/>
        <include name="*.war"/>
      </fileset>
    </copy>
  </target>
  
  <!-- ********************************************************************************************************* -->
  <!-- Axis Types                                                                                                -->
  <!-- ********************************************************************************************************* -->
  
  <!-- build -->
  <target name="sts.axis.types.build">
    <ant dir="${sts.axis.types.dir}" target="clean" inheritAll="true" inheritRefs="true"/>
    <ant dir="${sts.axis.types.dir}" target="jar" inheritAll="true" inheritRefs="true"/>
  </target>
  
  <!-- copy -->
  <target name="sts.axis.types.copy">
    <copy todir="${target.dir}">
      <fileset dir="${sts.axis.types.dir}/build" includes="*.jar"/>
    </copy>
  </target>
  
  <!-- ********************************************************************************************************* -->
  <!-- Axis Transfer Service                                                                                     -->
  <!-- ********************************************************************************************************* -->
  
  <!-- build -->
  <target name="sts.axis.xfer.build">
    <ant dir="${sts.axis.xfer.dir}" target="clean" inheritAll="true" inheritRefs="true"/>
    <ant dir="${sts.axis.xfer.dir}" target="jar" inheritAll="true" inheritRefs="true"/>
    <ant dir="${sts.axis.xfer.dir}" target="war" inheritAll="true" inheritRefs="true"/>
  </target>
  
  <!-- copy -->
  <target name="sts.axis.xfer.copy">
    <copy todir="${target.dir}">
      <fileset dir="${sts.axis.xfer.dir}/build" includes="*.jar">
        <include name="*.jar"/>
        <include name="*.war"/>
      </fileset>
    </copy>
  </target>
  
  
  <!-- ********************************************************************************************************* -->
  <!-- STS Core                                                                                                  -->
  <!-- ********************************************************************************************************* -->
  
  <!-- build -->
  <target name="sts.core.build">
    <ant dir="${sts.core.dir}" target="clean" inheritAll="true" inheritRefs="true"/>
    <ant dir="${sts.core.dir}" target="jar" inheritAll="true" inheritRefs="true"/>
  </target>

  <!-- copy -->
  <target name="sts.core.copy">
    <copy todir="${target.dir}">
      <fileset dir="${sts.core.dir}/build" includes="*.jar"/>
    </copy>
  </target>
  
  <!-- ********************************************************************************************************* -->
  <!-- UsernameToken Extension                                                                                   -->
  <!-- ********************************************************************************************************* -->
  
  <!-- build -->  
  <target name="sts.usernametoken.build">
    <ant dir="${sts.usernametoken.dir}" target="clean" inheritAll="true" inheritRefs="true"/>
    <ant dir="${sts.usernametoken.dir}" target="jar" inheritAll="true" inheritRefs="true"/>
  </target>
  
  <!-- copy -->
  <target name="sts.usernametoken.copy">
    <copy todir="${target.dir}">
      <fileset dir="${sts.usernametoken.dir}/build" includes="*.jar"/>
    </copy>
  </target>
  
  <!-- ********************************************************************************************************* -->
  <!-- SAML Token Extension                                                                                      -->
  <!-- ********************************************************************************************************* -->
  
  <!-- build -->  
  <target name="sts.samltoken.build">
    <ant dir="${sts.samltoken.dir}" target="clean" inheritAll="true" inheritRefs="true"/>
    <ant dir="${sts.samltoken.dir}" target="jar" inheritAll="true" inheritRefs="true"/>
  </target>

  <!-- copy -->
  <target name="sts.samltoken.copy">
    <copy todir="${target.dir}">
      <fileset dir="${sts.samltoken.dir}/build" includes="*.jar"/>
    </copy>
  </target>
  
  <!-- ********************************************************************************************************* -->
  <!-- Informationcard Generator                                                                                 -->
  <!-- ********************************************************************************************************* -->
  
  <!-- build -->  
  <target name="sts.informationcardgenerator.build">
    <ant dir="${sts.informationcardgenerator.dir}" target="clean" inheritAll="true" inheritRefs="true"/>
    <ant dir="${sts.informationcardgenerator.dir}" target="jar" inheritAll="true" inheritRefs="true"/>
    <ant dir="${sts.informationcardgenerator.dir}" target="war" inheritAll="true" inheritRefs="true"/>
  </target>

  <!-- copy --> 
  <target name="sts.informationcardgenerator.copy">
    <copy todir="${target.dir}">
      <fileset dir="${sts.informationcardgenerator.dir}/build" includes="*.jar">
        <include name="*.jar"/>
        <include name="*.war"/>
      </fileset>
    </copy>
  </target>
  
</project>

Back to the top