avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/merlin-smp/src/tutorial/includes/src/config block.xml composite.xml config.xml include-config.xml include.xml
Date Sun, 20 Apr 2003 12:50:10 GMT
mcconnell    2003/04/20 05:50:10

  Added:       merlin/merlin-smp/src/tutorial/includes .cvsignore
                        README.TXT build.xml
               merlin/merlin-smp/src/tutorial/includes/src/config block.xml
                        composite.xml config.xml include-config.xml
                        include.xml
  Log:
  Sources demonstrating block composition via include directives.
  
  Revision  Changes    Path
  1.1                  avalon-sandbox/merlin/merlin-smp/src/tutorial/includes/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  build
  logs
  tutorial.jar
  
  
  1.1                  avalon-sandbox/merlin/merlin-smp/src/tutorial/includes/README.TXT
  
  Index: README.TXT
  ===================================================================
  
  Block Includes
  --------------
  
  This tutorial demonstrates the manegement of block include directive - including one block
inside the defintion of another and controlling nested configuration sources.
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-smp/src/tutorial/includes/build.xml
  
  Index: build.xml
  ===================================================================
  
  <!-- 
  Test application
  -->
  
  <project name="tutorial" default="jar" basedir=".">
  
    <property name="src.dir"  value="${basedir}/src" />
    <property name="java.dir"  value="${src.dir}/java" />
    <property name="build.dir"  value="${basedir}/build" />
    <property name="classes.dir"  value="${build.dir}/classes" />
    <property name="config.dir"  value="${src.dir}/config" />
  
    <property environment="env"/>
    <property name="merlin.home"  value="${env.MERLIN_HOME}"/>
  
    <property name="framework.jar"
      value="${merlin.home}/lib/shared/avalon-framework-4.1.4.jar" />
    <property name="meta-spi.jar"
      value="${merlin.home}/lib/shared/avalon-meta-spi-1.0.jar" />
    <property name="assembly-spi.jar"
      value="${merlin.home}/lib/shared/avalon-assembly-spi-1.0.jar" />
  
    <path id="project.class.path">
      <pathelement path="${java.class.path}" />
      <pathelement location="${framework.jar}"/>
      <pathelement location="${meta-spi.jar}"/>
      <pathelement location="${assembly-spi.jar}"/>
      <fileset dir="${classes.dir}"/>
    </path>
  
    <target name="compile" >
      <mkdir dir="${classes.dir}" />
      <copy toDir="${classes.dir}">
        <fileset dir="${java.dir}">
          <include name="**/*.xinfo"/>
          <include name="**/*.xprofile"/>
        </fileset>
      </copy>
      <mkdir dir="${classes.dir}/BLOCK-INF" />
      <copy toDir="${classes.dir}/BLOCK-INF">
        <fileset dir="${config.dir}">
          <include name="*.xml"/>
        </fileset>
      </copy>
      <mkdir dir="${classes.dir}" />
      <javac debug="on" destdir="${classes.dir}" >
          <classpath>
            <path refid="project.class.path"/>
  	  </classpath>
          <src path="${src.dir}" />
      </javac>
    </target>
  
    <target name="jar" depends="compile">
      <jar jarfile="tutorial.jar" basedir="${classes.dir}"/>
    </target>
  
    <target name="install" depends="jar">
      <property environment="env"/>
      <mkdir dir="${env.MERLIN_HOME}/repository/tutorial/jars"/>
      <echo>Updating tutorial libraries: ${env.MERLIN_HOME}</echo>
      <copy file="tutorial.jar" 
        toFile="${env.MERLIN_HOME}/repository/tutorial/jars/tutorial-1.0.jar"/>
    </target>
  
    <target name="clean">
      <delete dir="${build.dir}"/>
      <delete file="tutorial.jar"/>
    </target>
  
   </project>
  
  
  1.1                  avalon-sandbox/merlin/merlin-smp/src/tutorial/includes/src/config/block.xml
  
  Index: block.xml
  ===================================================================
  
  <block>
  
     <info>
       <name>tutorial</name>
     </info>
  
     <implementation>
  
       <engine>
         <classpath>
           <repository>
             <resource id="tutorial:tutorial" version="1.0"/>
           </repository>
         </classpath>
       </engine>
  
       <component name="test1" class="tutorial.TestComponent" activation="startup">
         <configuration>
           <source>configuration from block directive</source>
         </configuration>
       </component>
  
       <container name="subcontainer">
         <component name="test2" class="tutorial.TestComponent" activation="startup"/>
         <include path="include.xml" config="include-config.xml"/>
         <include path="composite.xml"/>
       </container>
  
    </implementation>
  
  </block>
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-smp/src/tutorial/includes/src/config/composite.xml
  
  Index: composite.xml
  ===================================================================
  
  <block>
  
     <info>
       <name>composite</name>
     </info>
  
     <implementation>
       <include path="include.xml"/>
       <container name="test">
         <include path="include.xml" config="include-config.xml"/>
       </container>
    </implementation>
  
  </block>
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-smp/src/tutorial/includes/src/config/config.xml
  
  Index: config.xml
  ===================================================================
  
  <targets>
  
    <!-- classic target configuration override declarations -->
    <target path="/test1">
      <configuration>
        <source>config.xml</source>
      </configuration>
    </target>
    <target path="/subcontainer/test2">
      <configuration>
        <source>config.xml</source>
      </configuration>
    </target>
  
    <!-- this target will override the config referenced in the include -->
    <target path="/subcontainer/composite/inclusion/test3">
      <configuration>
        <source>config.xml</source>
      </configuration>
    </target>
  
    <!-- this target sets the configuration on another include -->
    <target path="/subcontainer/inclusion/test3">
      <configuration>
        <source>config.xml</source>
      </configuration>
    </target>
  
  </targets>
  
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-smp/src/tutorial/includes/src/config/include-config.xml
  
  Index: include-config.xml
  ===================================================================
  
  <targets>
    <target path="/test3">
      <configuration>
        <source>include-config.xml</source>
      </configuration>
    </target>
  </targets>
  
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-smp/src/tutorial/includes/src/config/include.xml
  
  Index: include.xml
  ===================================================================
  
  <block>
  
     <info>
       <name>inclusion</name>
     </info>
  
     <implementation>
  
       <engine>
         <classpath>
           <repository>
             <resource id="tutorial:tutorial" version="1.0"/>
           </repository>
         </classpath>
       </engine>
  
       <component name="test3" class="tutorial.TestComponent" 
         activation="startup"/>
  
    </implementation>
  
  </block>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message