<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.    
-->

<assembly>
  <id>bin</id>
  <formats>
    <format>tar.gz</format>  
    <format>zip</format>
  </formats>
  
  <baseDirectory>apache-uima-as-${project.version}</baseDirectory> 
  <includeBaseDirectory>true</includeBaseDirectory>
  
  <!-- UIMA-AS is built on top of base UIMA -->
  <!-- The Base UIMA is from a particular version 
       That version is unzipped into a temporary 
       build spot, which is then copyied to this 
       distr using a fileSet (see below)-->
   
  <dependencySets>  
            
    <!-- UIMA-AS -->
    
    
    <dependencySet>
      <includes>
        <include>org.apache.uima:uimaj-as-activemq</include>
        <include>org.apache.uima:uimaj-as-core</include>
        <include>org.apache.uima:uimaj-as-jms</include>
        <include>org.apache.uima:uimaj-as-camel</include>
      </includes>      
      <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
      <outputDirectory>lib</outputDirectory>
      <useProjectArtifact>false</useProjectArtifact>
      <fileMode>644</fileMode> 
      <directoryMode>755</directoryMode>        
    </dependencySet>

    <!-- UIMA-AS included other projects -->

    <dependencySet>
      <includes>
        <include>org.apache.activemq:activemq-all</include>
      </includes>
      <useTransitiveDependencies>false</useTransitiveDependencies>
      <outputDirectory>apache-activemq-5.4.1</outputDirectory>
      <useProjectArtifact>false</useProjectArtifact>
      <fileMode>644</fileMode> 
      <directoryMode>755</directoryMode>        
    </dependencySet>


    <dependencySet>
      <includes>
        <include>commons-logging:commons-logging</include>
        <include>org.springframework:spring-core</include>  
        <include>org.apache.activemq:activemq-camel</include>
        <include>org.apache.activemq:kahadb</include>
        <include>org.apache.activemq:activemq-console</include>
        <include>org.apache.activemq:activemq-core</include>
        <include>org.apache.activemq:activemq-spring</include>
        <include>org.apache.geronimo.specs:geronimo-jms_1.1_spec</include>
        <include>org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec</include>
        <include>org.springframework:spring-asm</include>  
        <include>org.springframework:spring-aop</include>  
        <include>org.springframework:spring-context</include>  
        <include>org.springframework:spring-tx</include>  
        <include>org.springframework:spring-beans</include>  
        <include>org.springframework:spring-expression</include>  
        <include>org.springframework:spring-jms</include>  
        <include>org.apache.xbean:xbean-spring</include>
      </includes>
      <useTransitiveDependencies>false</useTransitiveDependencies>
      <outputDirectory>apache-activemq-5.4.1/lib</outputDirectory>
      <useProjectArtifact>false</useProjectArtifact>
      <fileMode>644</fileMode> 
      <directoryMode>755</directoryMode>        
    </dependencySet>

    
    <dependencySet>
      <includes>
        <include>commons-codec:commons-codec</include>
        <include>commons-httpclient:commons-httpclient</include>
        <include>org.eclipse.jetty.aggregate:jetty-all-server</include> 
        <include>com.thoughtworks.xstream:xstream</include> 
        <include>xmlpull:xmlpull</include> 
        <include>org.apache.geronimo.specs:geronimo-servlet_2.5_spec</include>
        <include>log4j:log4j</include>
      </includes>
      <useTransitiveDependencies>false</useTransitiveDependencies>
      <outputDirectory>apache-activemq-5.4.1/lib/optional</outputDirectory>
      <useProjectArtifact>false</useProjectArtifact>
      <fileMode>644</fileMode> 
      <directoryMode>755</directoryMode>        
    </dependencySet>
   
    <!-- Copy each eclipse plugin into the /eclipsePlugins dir of the distribution -->
    <dependencySet>
      <includes>
        <include>org.apache.uima:uimaj-ep-deployeditor</include>
        <include>org.apache.uima:uimaj-ep-runtime-deployeditor</include>
        <include>org.apache.uima:uimaj-as-osgi-runtime</include>
      </includes>
      <outputDirectory>eclipsePlugins</outputDirectory>
      <outputFileNameMapping>${artifact.build.finalName}.jar</outputFileNameMapping>
      <useProjectArtifact>false</useProjectArtifact>
      <fileMode>644</fileMode> 
      <directoryMode>755</directoryMode>        
    </dependencySet>
    
  </dependencySets>
  
  <!-- Add other files - scripts, documentation, examples -->
  <fileSets>
    <!-- base UIMA -->

    <fileSet>
      <directory>target/uimaj/apache-uima/lib</directory>
      <outputDirectory>lib</outputDirectory>
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>
      <excludes>
        <exclude>uimaj-examples.jar</exclude>
      </excludes> 
    </fileSet>
    
    <fileSet>
      <directory>target/uimaj/apache-uima/examples</directory>
      <outputDirectory>examples</outputDirectory>
      <!-- 
          Remove the following exclude for future releases. It is a temp measure to 
          include changes to the Collection Reader made after base release 2.3.1
       -->
      <excludes>
        <exclude>descriptors/collection_reader/FileSystemCollectionReader.xml</exclude>
        <!--  These ought to be excluded always. We need UIMA AS versions of these
              from eclipseProject folder under uima-as  -->
        <exclude>.classpath</exclude>
      </excludes> 
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>
    </fileSet>

    <fileSet>
      <directory>target/uimaj/apache-uima/eclipsePlugins</directory>
      <outputDirectory>eclipsePlugins</outputDirectory>
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>
    </fileSet>
   
    <fileSet>
      <directory>target/uimaj/apache-uima/bin</directory>
      <includes><include>*.sh</include></includes>
      <excludes>
          <exclude>setUimaClassPath.*</exclude>
          <exclude>runUimaClass.*</exclude>
      </excludes>
      <outputDirectory>bin</outputDirectory>
      <fileMode>755</fileMode>
      <directoryMode>755</directoryMode>
    </fileSet>
    
    <fileSet>
      <directory>target/uimaj/apache-uima/bin</directory>
      <excludes>
        <exclude>*.sh</exclude>
          <exclude>runUimaClass.*</exclude>
        <exclude>setUimaClassPath.*</exclude>
      </excludes>
      <outputDirectory>bin</outputDirectory>
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>
    </fileSet>
        
    <fileSet>
      <directory>target/uimaj/apache-uima/config</directory>
      <outputDirectory>config</outputDirectory>      
    </fileSet>
    
    <fileSet>
      <directory>target/uimaj/apache-uima/issuedFixed</directory>
      <outputDirectory>issuesFixed.uimaj</outputDirectory>
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>
    </fileSet>
    
    <fileSet>
      <directory>target/uimaj/apache-uima/docs</directory>
      <outputDirectory>docs</outputDirectory>
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>        
    </fileSet>
     
     
    <!-- End of UIMA base files -->
    
     
    <!-- Copy binary license / notice to top level --> 
    <fileSet>
      <directory>src/main/readme</directory>
      <!-- to get things into the base dir, use this form
           If you use <outputDirectory>.</outputDirectory> - 
           it also puts into the base dir, but creates an
           extra (empty) version of the base dir - probably 
           a bug. -->
      <outputDirectory/>
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>
    </fileSet>
    
    <!-- files that should be copied from the top level project to the top of the archive -->
    <fileSet>
      <directory>.</directory>
      <outputDirectory/>
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>
      <excludes>
        <exclude>LicNoticeAnalysisActiveMQ.txt</exclude>
      </excludes>
      
      <includes>
        <include>README*</include>
        <include>readme*</include>
        <include>RELEASE_NOTES*</include>
        <include>Release-Notes*</include>
        <include>issuesFixed/**</include>
      </includes>        
      
    </fileSet>
    
    <fileSet>
      <directory>src/main/scripts</directory>
      <outputDirectory>bin</outputDirectory>
      <includes><include>**/*.sh</include></includes>
      <fileMode>755</fileMode>
      <directoryMode>755</directoryMode>        
    </fileSet>
    <fileSet>
      <directory>src/main/scripts</directory>
      <outputDirectory>bin</outputDirectory>
      <excludes><exclude>**/*.sh</exclude></excludes>
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>        
    </fileSet>
    
    
    <fileSet>
      <directory>src/main/config</directory>
      <outputDirectory>as_config</outputDirectory>
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>        
    </fileSet>
    
    <fileSet>
      <directory>target/site/apidocs</directory>
      <outputDirectory>docs/d/api-uima-as</outputDirectory>
      <excludes>
        <exclude>options</exclude>
        <exclude>packages</exclude>
        <exclude>files</exclude>
        <exclude>argfile</exclude>        
      </excludes>
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>        
    </fileSet>
    
    <fileSet>
      <directory>../uima-as-docbooks/target/site/d</directory>
      <outputDirectory>docs/d</outputDirectory>
      <excludes>
        <exclude>css/*</exclude>
      </excludes>
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>        
    </fileSet> 
       
       
    <!-- uima-as additions -->
    <fileSet>
      <directory>src/main/examples</directory>
      <outputDirectory>examples</outputDirectory>
      <includes>
          <include>deploy/as/*</include>
          <include>descriptors/as/*</include>
          <include>run_configuration/*</include>
      </includes>
      <excludes>
        <exclude>.classpath</exclude>
      </excludes>
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>        
    </fileSet>
    <fileSet>
      <directory>../uimaj-as-activemq/src/main/java/org/apache/uima/examples/as</directory>
      <outputDirectory>examples/src/org/apache/uima/examples/as</outputDirectory>
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>        
    </fileSet>
    
    <!-- activemq -->
    <fileSet>
      <directory>src/main/apache-activemq-5.4.1</directory>
      <outputDirectory>apache-activemq-5.4.1</outputDirectory>
      <includes>
          <include>conf/**</include>
          <include>README.txt</include>
      </includes>
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>        
    </fileSet>  

    <fileSet>
      <directory>src/main/apache-activemq-5.4.1</directory>
      <outputDirectory>apache-activemq-5.4.1</outputDirectory>
      <includes>
         <include>bin/*</include>
         <include>bin/**/*</include>
      </includes>
      <fileMode>755</fileMode>
      <directoryMode>755</directoryMode>        
    </fileSet>
    <!-- saxon 8.9 -->    
    <fileSet>
      <directory>src/main/saxon</directory>
      <outputDirectory>saxon</outputDirectory>
      <fileMode>644</fileMode>
      <directoryMode>755</directoryMode>        
    </fileSet>
        
  </fileSets>
  
  <files>
  
    <!-- Main uima files -->
    
    <file>
      <source>target/uimaj/apache-uima/README</source>
      <outputDirectory/>
      <destName>README.uimaj.txt</destName>
      <fileMode>644</fileMode>
    </file>
    <file>
      <source>target/uimaj/apache-uima/examples/.project</source>
      <outputDirectory>examples</outputDirectory>
      <fileMode>644</fileMode> 
    </file>
    <file>
      <source>target/uimaj/apache-uima/RELEASE_NOTES.html</source>
      <outputDirectory/>
      <destName>RELEASE_NOTES.uimaj.html</destName>
      <fileMode>644</fileMode>
    </file>
    
    <file>
      <source>target/uimaj/apache-uima/LICENSE</source>
      <outputDirectory/>
      <destName>LICENSE.uimaj.txt</destName>
      <fileMode>644</fileMode>
    </file>

    <file>
      <source>target/uimaj/apache-uima/NOTICE</source>
      <outputDirectory/>
      <destName>NOTICE.uimaj.txt</destName>
      <fileMode>644</fileMode>
    </file>
    
    
    <file>
      <source>src/main/eclipseProject/classpath</source>
      <outputDirectory>examples</outputDirectory>
      <destName>.classpath</destName>
      <fileMode>644</fileMode> 
    </file>

    <!-- The following should be removed when deploying AS with the Base at the same
         time. This is a temporary measure for releasing AS 2.3.1 after the Base. There
         is a change made to the CollectionReader descriptor to fix a missing Language
         parameter value. The change was made after the base was released. 
     -->
    <file>
      <source>../uimaj-as-activemq/src/test/resources/descriptors/collection_reader/FileSystemCollectionReader.xml</source>
      <outputDirectory>examples/descriptors/collection_reader</outputDirectory>
      <fileMode>644</fileMode>
    </file>
    
    <!-- put readme file with altered name at the top level -->
    <!-- file>
      <source>src/main/readme/README</source>
      <outputDirectory></outputDirectory>
      <destName>README-uima-as</destName>
      <fileMode>644</fileMode>
    </file-->
    
  </files>
</assembly>
