• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.server
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Changeset
  • Next Changeset →

Changeset 1359

Show
Ignore:
Timestamp:
03/13/07 17:13:03 (21 months ago)
Author:
jmoore
Message:

#613 Significant refactoring of slice build needed for #614

Location:
trunk
Files:
7 modified

  • build.xml (modified) (1 diff)
  • components/antlib/resources/lifecycle.xml (modified) (3 diffs)
  • components/antlib/resources/macros.xml (modified) (2 diffs)
  • components/antlib/resources/messages.properties (modified) (1 diff)
  • components/app/build.xml (modified) (1 diff)
  • components/blitz/build.xml (modified) (3 diffs)
  • components/tools/licenses/build.xml (modified) (1 diff)

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r1340 r1359  
    176176                </copy> 
    177177 
     178                <useServices dir="${dist.dir}/blitz/"/> 
     179 
    178180                <copy todir="${dist.dir}/client"> 
    179181                        <fileset dir="${common.comp}/${target.rel}" includes="*.jar"/> 
  • trunk/components/antlib/resources/lifecycle.xml

    r1325 r1359  
    3838                <copyResource file="${root.dir}/etc/log4j.properties"/> 
    3939                <copyResource file="${root.dir}/etc/jndi.properties"/> 
    40         </target> 
    41  
    42  
    43         <target name="generate" depends="prepare"> 
     40                <available property="slice2java-exists" filepath="${env.PATH}" file="slice2java" /> 
     41                <available property="slice2java-exists" filepath="${env.PATH}" file="slice2java.exe" /> 
     42                <condition property="skip.ice"> 
     43                   <equals arg1="${no.ice}" arg2="true" trim="true"/> 
     44                </condition> 
     45                <fail message="${msg.macro.missing_fail} slice2java"> 
     46                  <condition><and> 
     47                    <not><isset property="skip.ice"/></not> 
     48                    <not><isset property="slice2java-exists"/></not> 
     49                  </and></condition> 
     50                </fail> 
     51                <fail message="${msg.prepare.bad.ice.home}"> 
     52                  <condition><and> 
     53                    <not><isset property="skip.ice"/></not> 
     54                    <not><available file="${ice.home}" type="dir"/></not> 
     55                  </and></condition> 
     56                </fail> 
     57        </target> 
     58 
     59 
     60        <target name="slice-init" depends="prepare"> 
     61                <fileset dir="${basedir}" id="slice.generated"> 
     62                        <include name="resources/slice/${ice.pat}"/> 
     63                        <include name="target/generated/resources/${ice.pat}"/> 
     64                </fileset> 
     65                <pathconvert pathsep=" "   property="slice.files" refid="slice.generated"/> 
     66                <is-done name="slice2java" srcdir="${basedir}" includes="${ice.pat}" /> 
     67                <condition property="skip.ice.or.no.slice2java"> 
     68                    <or> 
     69                        <isset property="slice2java.not.required"/> 
     70                        <isset property="skip.ice"/> 
     71                    </or> 
     72                </condition> 
     73                <condition property="test.skip"> 
     74                    <isset property="skip.ice"/> 
     75                </condition> 
     76                <condition property="skip.compile"> 
     77                    <and> 
     78                    <isset property="uses.ice"/> 
     79                    <isset property="skip.ice"/> 
     80                    </and> 
     81                </condition> 
     82        </target> 
     83 
     84        <macrodef name="slice-macro"> 
     85           <attribute name="lang"/> 
     86           <attribute name="files"/> 
     87           <attribute name="suffix" default=""/> 
     88           <attribute name="ice.slice" default="${ice.home}/slice"/> 
     89           <attribute name="output" default="${src.dest}/@{exec}/@{suffix}"/> 
     90           <sequential> 
     91                 <mkdir dir="@{output}"/> 
     92                 <exec executable="slice2@{lang}"  
     93                    failonerror="true" failifexecutionfails="true" 
     94                    output="@{output}/.output.log"> 
     95                        <arg value="--tie"/> 
     96                        <arg value="--output-dir"/> 
     97                        <arg value="@{output}"/> 
     98                        <arg value="-I${resrc.dest}"/> 
     99                        <arg value="-I${resrc.dir}/slice"/> 
     100                        <arg value="-I${blitz.comp}/resources/slice"/> 
     101                        <arg value="-I${blitz.comp}target/generated/resources"/> 
     102                        <arg value="-I@{ice.slice}"/> 
     103                        <arg line="@{files}"/> 
     104                 </exec> 
     105                <done name="slice2@{lang}"/> 
     106           </sequential> 
     107        </macrodef> 
     108 
     109        <target name="slice" depends="slice-init" if="slice2java-exists" unless="skip.ice.or.no.slice2java"> 
     110                <slice-macro lang="java" files="${slice.files}" output="${src.dest}"/> 
     111        </target> 
     112 
     113        <target name="generate" depends="prepare,slice"> 
    44114                <echo file="${resrc.dest}/Classpath.sh"> 
    45115                  export CLASSPATH=${omero.path} 
    … …  
    71141        </macrodef> 
    72142 
    73         <target name="compile" depends="generate"> 
     143        <target name="compile" depends="generate" unless="skip.compile"> 
    74144                <myjavac> 
    75145                  <src path="${src.dir}"/> 
    … …  
    162232                <jar destfile="${target.dir}/${artifact.final.name}"> 
    163233                        <manifest> 
    164                                 <attribute name="Class-Path" value="${mf.classpath} extensions.jar"/> 
     234                                <attribute name="Class-Path" value="${mf.classpath} services.jar extensions.jar"/> 
    165235                                <attribute name="Main-Class" value="${main.class}"/> 
    166236                        </manifest> 
  • trunk/components/antlib/resources/macros.xml

    r1322 r1359  
    145145                </sequential> 
    146146        </macrodef> 
     147 
     148      <macrodef name="makeManifest"> 
     149          <attribute name="property"/> 
     150          <sequential> 
     151          <pathconvert property="mf.classpath" 
     152              refid="omero.classpath"  
     153              pathsep=" " dirsep="/"> 
     154              <flattenmapper/> 
     155          </pathconvert> 
     156          </sequential> 
     157      </macrodef> 
     158 
     159      <!-- Gather all compiled services together into a single 
     160      services.jar.  Also, make all application jars available to the 
     161      services.jar via the MANIFEST file *AND* add one additional 
     162      (possibly non-extant) extensions.jar which can be created by 3rd 
     163      parties and added to the EAR file (top-level) for runtime class 
     164      lookups. 
     165 
     166      services.jar is placed in the specified directory. Optionally, a 
     167      manifest string can be specified. It defaults to the empty 
     168      string, but a manifest can be generated via makeManifest if 
     169      omero.classpath has been defined.--> 
     170 
     171      <macrodef name="useServices"> 
     172          <attribute name="dir"/> 
     173          <attribute name="manifest" default=""/> 
     174          <sequential> 
     175          <jar destfile="@{dir}/services.jar" basedir="${tools.unjar}"> 
     176            <manifest> 
     177              <attribute name="Class-Path" value="@{manifest} extensions.jar"/> 
     178            </manifest> 
     179          </jar> 
     180          </sequential> 
     181      </macrodef> 
    147182         
    148183    <!-- = = = = = = = = = = = = = = = = = 
    … …  
    168203        </sequential> 
    169204    </macrodef>  
    170          
    171     <!-- = = = = = = = = = = = = = = = = = 
    172           slice code-gen    
    173          = = = = = = = = = = = = = = = = = --> 
    174  
    175         <macrodef name="slice"> 
    176            <attribute name="lang"/> 
    177            <attribute name="files"/> 
    178            <attribute name="suffix" default=""/> 
    179            <attribute name="ice.slice" default="${ice.home}/slice"/> 
    180            <attribute name="output" default="${src.dest}/@{exec}/@{suffix}"/> 
    181            <sequential> 
    182                  <mkdir dir="@{output}"/> 
    183                  <exec executable="slice2@{lang}"  
    184                     failonerror="true" failifexecutionfails="true" 
    185                     output="@{output}/.output.log"> 
    186                         <arg value="--tie"/> 
    187                         <arg value="--output-dir"/> 
    188                         <arg value="@{output}"/> 
    189                         <arg value="-I${resrc.dest}"/> 
    190                         <arg value="-I${resrc.dir}/slice"/> 
    191                         <arg value="-I@{ice.slice}"/> 
    192                         <arg line="@{files}"/> 
    193                  </exec> 
    194                 <done name="slice2@{lang}"/> 
    195            </sequential> 
    196         </macrodef> 
    197205 
    198206</project> 
  • trunk/components/antlib/resources/messages.properties

    r1327 r1359  
    138138msg.prepare.bad.ice.home = \n\ 
    139139ice.home=${ice.home} does not exist. \n\ 
    140 "ice.home" must be set to a valid directory unless "no.ice" is set.\n\ 
     140"ice.home" must be set to a valid directory unless "no.ice" is true.\n\ 
    141141                                \n\ 
  • trunk/components/app/build.xml

    r1217 r1359  
    3333      </delete> 
    3434 
    35       <!-- Gather all compiled services together into a single services.jar.  
    36       Also, make all application jars available to the services.jar via the 
    37       MANIFEST file *AND* add one additional (possibly non-extant) extensions.jar 
    38       which can be created by 3rd parties and added to the EAR file (top-level) 
    39       for runtime class lookups. --> 
    40  
    41       <pathconvert property="mf.classpath" 
    42               refid="omero.classpath"  
    43               pathsep=" " dirsep="/"> 
    44               <flattenmapper/> 
    45       </pathconvert> 
    46       <jar destfile="${target.dir}/libs/services.jar" basedir="${tools.unjar}"> 
    47         <manifest> 
    48           <attribute name="Class-Path" value="${mf.classpath} extensions.jar"/> 
    49         </manifest> 
    50       </jar> 
     35      <useServices dir="${target.dir}/libs"/> 
    5136       
    5237      <!-- DataSource with replacement. --> 
  • trunk/components/blitz/build.xml

    r1342 r1359  
    88    <!-- Local properties --> 
    99    <property name="ice.file" value="omero.ice"/> 
     10    <property name="uses.ice" value="true"/> 
    1011 
    1112 
    12 <target name="grv" depends="lifecycle.prepare,load-groovy"> 
     13<target name="grv" depends="prepare,load-groovy"> 
    1314 
    1415  <taskdef classname="ome.dsl.GroovyTask" classpathref="omero.classpath" name="grv"/> 
    … …  
    2627    <!-- TODO Be sure to remove the warning messages and macros --> 
    2728                         
    28         <target name="prepare" depends="lifecycle.prepare,load-groovy"> 
    29                 <available property="slice2java-exists" filepath="${env.PATH}" file="slice2java" /> 
    30                 <available property="slice2java-exists" filepath="${env.PATH}" file="slice2java.exe" /> 
    31                 <condition property="skip.ice"> 
    32                    <equals arg1="${no.ice}" arg2="true" trim="true"/> 
    33                 </condition> 
    34                 <fail message="${msg.macro.missing_fail} slice2java"> 
    35                   <condition><and> 
    36                     <not><isset property="skip.ice"/></not> 
    37                     <not><isset property="slice2java-exists"/></not> 
    38                   </and></condition> 
    39                 </fail> 
    40                 <fail message="${msg.prepare.bad.ice.home}"> 
    41                   <condition><and> 
    42                     <not><isset property="skip.ice"/></not> 
    43                     <not><available file="${ice.home}" type="dir"/></not> 
    44                   </and></condition> 
    45                 </fail> 
    46         </target> 
    47  
    48         <target name="generate" depends="lifecycle.generate,icegen,slice"/> 
    49  
    50         <target name="compile" depends="generate" unless="skip.ice"> 
    51           <antcall inheritAll="true" inheritRefs="true" target="lifecycle.compile"/> 
    52         </target> 
    53  
    54         <target name="test" depends="compile" unless="skip.ice"> 
    55           <antcall inheritAll="true" inheritRefs="true" target="lifecycle.test"/> 
    56         </target> 
     29        <target name="generate" depends="prepare,icegen,lifecycle.generate"/> 
    5730 
    5831        <target name="install" depends="test,lifecycle.install,standalone"/> 
    … …  
    9366        </target> 
    9467 
    95  
    96         <target name="slice-init" depends="prepare"> 
    97                 <fileset dir="${basedir}" id="slice.generated"> 
    98                         <include name="resources/slice/${ice.pat}"/> 
    99                         <include name="target/generated/resources/${ice.pat}"/> 
    100                 </fileset> 
    101                 <pathconvert pathsep=" "   property="slice.files" refid="slice.generated"/> 
    102                 <is-done name="slice2java" srcdir="${basedir}" includes="${ice.pat}" /> 
    103                 <condition property="skip.ice.or.no.slice2java"> 
    104                     <or> 
    105                         <isset property="slice2java.not.required"/> 
    106                         <isset property="skip.ice"/> 
    107                     </or> 
    108                 </condition> 
    109         </target> 
    110  
    111         <target name="slice" depends="slice-init" if="slice2java-exists" unless="skip.ice.or.no.slice2java"> 
    112                         <slice lang="java" files="${slice.files}" output="${src.dest}"/> 
    113         </target> 
    114          
    11568</project> 
  • trunk/components/tools/licenses/build.xml

    r1355 r1359  
    88        </description>     
    99 
     10        <property name="uses.ice" value="true"/> 
    1011        <property name="classpath.file" value="classpath.xml"/> 
    1112        <dirname property="up-two" file="${basedir}"/> 

Download in other formats:

  • Unified Diff
  • Zip Archive

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/