<!--This script builds a zip for Teiid Server Installation -->
<assembly>
  
  <id>jboss-dist</id>
  
  <formats>
    <format>zip</format>
    <format>dir</format>
  </formats>
  
  <includeBaseDirectory>false</includeBaseDirectory>
  <baseDirectory>teiid-${project.version}</baseDirectory>

  <fileSets>
          
    <fileSet>
        <directory>target/kits/jboss-as7</directory>
        <outputDirectory>/</outputDirectory>      
        <includes>
          <include>**/*.sh</include>
        </includes>   
        <fileMode>755</fileMode>  
    </fileSet> 
          
    <fileSet>
        <directory>target/kits/jboss-as7</directory>
        <outputDirectory>/</outputDirectory>      
        <excludes>
          <exclude>**/*.sh</exclude>
        </excludes>      
    </fileSet>
    
    <fileSet>
        <directory>target/kits/jboss-as7</directory>
        <outputDirectory>/</outputDirectory>      
        <excludes>
          <exclude>**/*.properties</exclude>
        </excludes>      
    </fileSet>    
          
    <fileSet>
        <directory>../client/src/main/resources</directory>
        <includes>
            <include>vdb-deployer.xsd</include>
        </includes>                
        <outputDirectory>docs/teiid/schema</outputDirectory>
    </fileSet>
    
    <fileSet>
        <directory>../jboss-integration/src/main/resources/schema</directory>
        <includes>
            <include>jboss-teiid.xsd</include>
        </includes>                
        <outputDirectory>docs/schema</outputDirectory>
    </fileSet>    
    	
  </fileSets>
  
  <!--  these have external dependent clients like connectors-->
  <moduleSets>

    <moduleSet>
      <useAllReactorProjects>true</useAllReactorProjects>
      <includes>
        <include>org.jboss.teiid:teiid-common-core</include>   
      </includes>
      <binaries>
        <includeDependencies>false</includeDependencies>
        <unpack>false</unpack>
        <outputDirectory>modules/system/layers/base/org/jboss/teiid/common-core/main</outputDirectory>
      </binaries>
    </moduleSet>

    <moduleSet>
      <useAllReactorProjects>true</useAllReactorProjects>
      <includes>
        <include>org.jboss.teiid:teiid-api</include>   
      </includes>
      <binaries>
        <includeDependencies>false</includeDependencies>
        <unpack>false</unpack>
        <outputDirectory>modules/system/layers/base/org/jboss/teiid/api/main</outputDirectory>
      </binaries>
    </moduleSet>
    
    <moduleSet>
      <useAllReactorProjects>true</useAllReactorProjects>
      <includes>
        <include>org.jboss.teiid:teiid-client</include>   
      </includes>
      <binaries>
        <includeDependencies>false</includeDependencies>
        <unpack>false</unpack>
        <outputDirectory>modules/system/layers/base/org/jboss/teiid/client/main</outputDirectory>
      </binaries>
    </moduleSet>    
            
    <moduleSet>
      <useAllReactorProjects>true</useAllReactorProjects>
      <includes>
      	<include>org.jboss.teiid:teiid-hibernate-dialect</include>   
      </includes>
      <binaries>
		<includeDependencies>false</includeDependencies>
		<unpack>false</unpack>
        <outputDirectory>modules/system/layers/base/org/jboss/teiid/client/main</outputDirectory>
      </binaries>
    </moduleSet>
    
    <moduleSet>
      <useAllReactorProjects>true</useAllReactorProjects>
      <includes>
        <include>org.jboss.teiid:teiid-odata</include>   
      </includes>
      <binaries>
        <includeDependencies>false</includeDependencies>
        <unpack>false</unpack>
        <outputDirectory>modules/system/layers/base/org/jboss/teiid/main/deployments</outputDirectory>
      </binaries>
    </moduleSet>
    
    <moduleSet>
      <useAllReactorProjects>true</useAllReactorProjects>
      <includes>
        <include>org.jboss.teiid:teiid-olingo</include>   
      </includes>
      <binaries>
        <includeDependencies>false</includeDependencies>
        <unpack>false</unpack>
        <outputDirectory>modules/system/layers/base/org/jboss/teiid/olingo/main</outputDirectory>
      </binaries>
    </moduleSet>

    <moduleSet>
        <useAllReactorProjects>true</useAllReactorProjects>
        <includes>
            <include>org.jboss.teiid:teiid-olingo</include>
        </includes>
        <binaries>
            <includeDependencies>false</includeDependencies>
            <unpack>false</unpack>
            <outputDirectory>modules/system/layers/base/org/jboss/teiid/main/deployments</outputDirectory>
            <attachmentClassifier>odata4</attachmentClassifier>
        </binaries>
    </moduleSet> 
    
    <moduleSet>
        <useAllReactorProjects>true</useAllReactorProjects>
        <includes>
            <include>org.jboss.teiid:teiid-olingo</include>
        </includes>
        <binaries> 
          <includeDependencies>false</includeDependencies>
          <unpack>true</unpack>
          <outputDirectory>.</outputDirectory>
          <attachmentClassifier>dependencies</attachmentClassifier>
        </binaries>
    </moduleSet>              

    <!-- These are Teiid internal dependencies; to make JCA work -->
    <moduleSet>
        <includeSubModules>true</includeSubModules>
        <useAllReactorProjects>true</useAllReactorProjects>

        <includes>
            <include>org.jboss.teiid:teiid-jboss-integration</include>            
        </includes>

        <binaries>
            <includeDependencies>true</includeDependencies>
            <unpack>false</unpack>
            <dependencySets>
                <dependencySet>
                    <excludes>
                        <exclude>javax.resource:connector-api</exclude>
                        <exclude>javax.transaction:jta</exclude>
                        <exclude>org.jboss.teiid:teiid-common-core</exclude>
                        <exclude>org.jboss.teiid:teiid-api</exclude>
                        <exclude>org.jboss.teiid:teiid-client</exclude>                        
                        <exclude>xom:xom</exclude>                        
                        <exclude>jaxen:jaxen</exclude>
                        <exclude>org.jboss:staxmapper</exclude>
                        <exclude>io.netty:netty</exclude>
                        <exclude>org.apache.olingo:*</exclude>
                        <exclude>com.fasterxml.jackson.core:*</exclude>
                    </excludes>
                    <useProjectArtifact>true</useProjectArtifact>
                    <unpack>false</unpack>
                    <useTransitiveDependencies>true</useTransitiveDependencies>
                </dependencySet>
                <dependencySet>
                    <includes>
                        <include>org.apache.olingo:*</include>
                    </includes>
                    <outputDirectory>modules/system/layers/base/org/apache/olingo</outputDirectory>
                </dependencySet>
                <dependencySet>
                    <useTransitiveDependencies>true</useTransitiveDependencies>
                    <includes>
                         <include>com.fasterxml.jackson.core:jackson-databind</include>
                         <include>com.fasterxml.jackson.core:jackson-annotations</include>
                         <include>com.fasterxml.jackson.core:jackson-core</include>
                    </includes>
                    <outputDirectory>${jbossas-module-root}/com/fasterxml/jackson/main</outputDirectory>
                </dependencySet>
            </dependencySets>
            <outputDirectory>modules/system/layers/base/org/jboss/teiid/main</outputDirectory>
        </binaries>
    </moduleSet>
    
    <!-- This is separated out so that we can avoid dragging in transitive dependencies, using pom build the adminshell correctly -->
    <moduleSet>
      <useAllReactorProjects>true</useAllReactorProjects>
      <includes>
        <include>org.jboss.teiid:teiid-admin</include>   
      </includes>
      <binaries>
        <includeDependencies>false</includeDependencies>
        <unpack>false</unpack>
        <outputDirectory>modules/system/layers/base/org/jboss/teiid/admin/main</outputDirectory>
      </binaries>
    </moduleSet>    

  
     
    <!-- ******************************************************** 
        These are built in resource-adapters  
        *********************************************************-->
    <moduleSet>
        <useAllReactorProjects>true</useAllReactorProjects>
        
        <includes>
            <include>org.jboss.teiid.connectors:connector-*</include>
        </includes>
                
        <binaries> 
          <includeDependencies>false</includeDependencies>
          <unpack>true</unpack>
          <outputDirectory>.</outputDirectory>
          <attachmentClassifier>jboss-as7-dist</attachmentClassifier>
        </binaries>
      
    </moduleSet>
    
    
    <!-- **************************************************************************
                        These are built in translators  
         **************************************************************************-->
    <moduleSet>
        <useAllReactorProjects>true</useAllReactorProjects>
        
        <includes>
            <include>org.jboss.teiid.connectors:translator-*</include>
        </includes>
                
        <binaries> 
          <includeDependencies>false</includeDependencies>
          <unpack>true</unpack>
          <outputDirectory>.</outputDirectory>
          <attachmentClassifier>jboss-as7-dist</attachmentClassifier>
        </binaries>
      
    </moduleSet>
        
    </moduleSets>  
</assembly>
