<!--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/overlay</directory>
        <outputDirectory>/</outputDirectory>      
        <includes>
          <include>**/*.sh</include>
        </includes>   
        <fileMode>755</fileMode>  
    </fileSet> 
          
    <fileSet>
        <directory>target/kits/jboss-as7/overlay</directory>
        <outputDirectory>/</outputDirectory>      
        <excludes>
          <exclude>**/*.sh</exclude>
        </excludes>      
    </fileSet>
    
    <fileSet>
        <directory>target/kits/jboss-as7/overlay</directory>
        <outputDirectory>/</outputDirectory>      
        <excludes>
          <exclude>**/*.properties</exclude>
        </excludes>      
    </fileSet>  
    
    <fileSet>
        <directory>target/kits/jboss-as7/modules</directory>
        <outputDirectory>${jbossas-module-root}</outputDirectory>      
        <includes>
          <include>**/*.sh</include>
        </includes>   
        <fileMode>755</fileMode>  
    </fileSet> 
          
    <fileSet>
        <directory>target/kits/jboss-as7/modules</directory>
        <outputDirectory>${jbossas-module-root}</outputDirectory>      
        <excludes>
          <exclude>**/*.sh</exclude>
        </excludes>      
    </fileSet>
    
    <fileSet>
        <directory>target/kits/jboss-as7/modules</directory>
        <outputDirectory>${jbossas-module-root}</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>${jbossas-module-root}/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>${jbossas-module-root}/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>${jbossas-module-root}/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>${jbossas-module-root}/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>${jbossas-module-root}/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>${jbossas-module-root}/org/jboss/teiid/olingo/main</outputDirectory>
      </binaries>
    </moduleSet>
    
    <moduleSet>
      <useAllReactorProjects>true</useAllReactorProjects>
      <includes>
        <include>org.jboss.teiid:teiid-jboss-security</include>   
      </includes>
      <binaries>
        <includeDependencies>false</includeDependencies>
        <unpack>false</unpack>
        <outputDirectory>${jbossas-module-root}/org/jboss/teiid/security/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>${jbossas-module-root}/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>
                        <exclude>net.sf.saxon:Saxon-HE</exclude>
                        <exclude>nux:nux</exclude>
                        <exclude>org.wololo:jts2geojson</exclude>
                        <exclude>org.osgeo:proj4j</exclude>
                        <exclude>com.vividsolutions:jts</exclude>
                        <exclude>io.swagger:*</exclude>
                        <exclude>com.fasterxml.jackson.dataformat:*</exclude>
                        <exclude>com.fasterxml.jackson.module:jackson-module-jaxb-annotations</exclude>
                        <exclude>com.fasterxml.jackson.datatype:jackson-datatype-joda</exclude>
                        <exclude>com.fasterxml.jackson.jaxrs:*</exclude>
                        <exclude>org.reflections:reflections</exclude>
                        <exclude>com.google.code.findbugs:annotations</exclude>
                    </excludes>
                    <useProjectArtifact>true</useProjectArtifact>
                    <unpack>false</unpack>
                    <useTransitiveDependencies>true</useTransitiveDependencies>
                </dependencySet>
                <dependencySet>
                    <includes>
                        <include>org.apache.olingo:*</include>
                    </includes>
                    <outputDirectory>${jbossas-module-root}/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>
                <dependencySet>
                    <includes>
                        <include>net.sf.saxon:Saxon-HE</include>
                    </includes>
                    <outputDirectory>${jbossas-module-root}/net/sf/saxon/main</outputDirectory>
                </dependencySet>
                <dependencySet>
                    <includes>
                        <include>nux:nux</include>
                    </includes>
                    <outputDirectory>${jbossas-module-root}/nux/nux/main</outputDirectory>
                </dependencySet>
                <dependencySet>
                    <includes>
                        <include>org.wololo:jts2geojson</include>
                    </includes>
                    <outputDirectory>${jbossas-module-root}/org/wololo/jts2geojson/main</outputDirectory>
                </dependencySet>
                <dependencySet>
                    <includes>
                        <include>org.osgeo:proj4j</include>
                    </includes>
                    <outputDirectory>${jbossas-module-root}/org/osgeo/proj4j/main</outputDirectory>
                </dependencySet>
                <dependencySet>
                    <includes>
                        <include>com.vividsolutions:jts</include>
                    </includes>
                    <outputDirectory>${jbossas-module-root}/com/vividsolutions/jts/main</outputDirectory>
                </dependencySet>
                <dependencySet>
                    <useTransitiveDependencies>true</useTransitiveDependencies>
                    <includes>
                         <include>io.swagger:swagger-jaxrs</include>
                         <include>io.swagger:swagger-core</include>
                         <include>io.swagger:swagger-models</include>
                         <include>io.swagger:swagger-annotations</include>
                    </includes>
                    <outputDirectory>${jbossas-module-root}/io/swagger/main</outputDirectory>
                </dependencySet>
                <dependencySet>
                    <includes>
                        <include>com.fasterxml.jackson.dataformat:jackson-dataformat-yaml</include>
                    </includes>
                    <outputDirectory>${jbossas-module-root}/com/fasterxml/jackson/dataformat/yaml/main</outputDirectory>
                </dependencySet> 
                <dependencySet>
                    <includes>
                        <include>com.fasterxml.jackson.dataformat:jackson-dataformat-xml</include>
                        <include>com.fasterxml.jackson.module:jackson-module-jaxb-annotations</include>
                    </includes>
                    <outputDirectory>${jbossas-module-root}/com/fasterxml/jackson/dataformat/xml/main</outputDirectory>
                </dependencySet>
                <dependencySet>
                    <includes>
                        <include>com.fasterxml.jackson.datatype:jackson-datatype-joda</include>
                    </includes>
                    <outputDirectory>${jbossas-module-root}/com/fasterxml/jackson/datatype/main</outputDirectory>
                </dependencySet>
                <dependencySet>
                    <includes>
                        <include>com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider</include>
                        <include>com.fasterxml.jackson.jaxrs:jackson-jaxrs-base</include>
                    </includes>
                    <outputDirectory>${jbossas-module-root}/com/fasterxml/jackson/jaxrs/main</outputDirectory>
                </dependencySet>
                <dependencySet>
                    <includes>
                        <include>com.google.code.findbugs:annotations</include>
                    </includes>
                    <outputDirectory>${jbossas-module-root}/com/google/code/findbugs/main</outputDirectory>
                </dependencySet>
                <dependencySet>
                    <includes>
                        <include>org.reflections:reflections</include>
                    </includes>
                    <outputDirectory>${jbossas-module-root}/org/reflections/main</outputDirectory>
                </dependencySet>                                                                                     
            </dependencySets>
            <outputDirectory>${jbossas-module-root}/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>${jbossas-module-root}/org/jboss/teiid/admin/main</outputDirectory>
      </binaries>
    </moduleSet>    

    <moduleSet>
      <useAllReactorProjects>true</useAllReactorProjects>
      <includes>
        <include>org.jboss.teiid:teiid-jboss-admin</include>   
      </includes>
      <binaries>
        <includeDependencies>false</includeDependencies>
        <unpack>false</unpack>
        <outputDirectory>${jbossas-module-root}/org/jboss/teiid/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>
