<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <parent>
        <groupId>org.codehaus.openxma</groupId>
        <artifactId>dsl-parent</artifactId>
        <version>3.6.3</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>dsl-platform</artifactId>
    <packaging>jar</packaging>
    <name>openXma DSL Platform</name>
    <scm>
        <developerConnection>scm:svn:https://svn.codehaus.org/openxma/org.openxma.dsl.platform/trunk</developerConnection>
    </scm>
    <build>
        <resources>
            <resource>
                <directory>src/main/model</directory>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <plugins>
          <plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <executions>
              <execution>
                <id>client</id>
                <goals><goal>jar</goal></goals>
                <phase>package</phase>
                <configuration>
                  <classifier>client</classifier>
                  <includes>
                    <include>at/spardat/xma/**/*</include>
                    <include>org/openxma/dsl/platform/xma/client/**/*</include>
                  </includes>
                </configuration>
              </execution>
              <execution>
                <id>server</id>
                <goals><goal>jar</goal></goals>
                <phase>package</phase>
                <configuration>
                  <classifier>server</classifier>
                  <includes>
                    <include>org/openxma/dsl/platform/xma/**/*</include>
                  </includes>
                  <excludes>
                    <exclude>org/openxma/dsl/platform/xma/client</exclude>                  
                    <exclude>org/openxma/dsl/platform/xma/client/**/*</exclude>
                  </excludes>                  
                </configuration>
              </execution>
			  <execution>
                <id>service</id>
                <goals><goal>jar</goal></goals>
                <phase>package</phase>
                <configuration>
                  <classifier>service</classifier>
                  <includes>
                    <include>org/openxma/dsl/platform/**/*</include>
                  </includes>
                  <excludes>
                    <exclude>org/openxma/dsl/platform/xma</exclude>                  
                    <exclude>org/openxma/dsl/platform/xma/**/*</exclude>
                  </excludes>                        
                </configuration>
              </execution>              
            </executions>
            </plugin>
        </plugins>
        <!--
                 mvn org.codehaus.mojo:antlr-maven-plugin:generate -Dgrammars=rewrite-hql.g
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>antlr-maven-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <grammars>rewrite-hql.g</grammars>
                    <outputDirectory>${basedir}/src/main/java</outputDirectory>
                </configuration>
            </plugin>
        </plugins>
         -->
    </build>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.openxma</groupId>
            <artifactId>xmabootrt</artifactId>
            <version>1.10.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate</artifactId>
            <version>3.2.6.ga</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring</artifactId>
            <version>2.5.6</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.openxma</groupId>
            <artifactId>properties</artifactId>
            <version>1.0.3</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.openxma</groupId>
            <artifactId>xmartserver</artifactId>
            <version>2.3.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.openxma</groupId>
            <artifactId>xmartclient</artifactId>
            <version>2.3.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.openxma</groupId>
            <artifactId>epclient</artifactId>
            <version>5.0.6</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.openxma</groupId>
            <artifactId>guidesigner</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
            <version>2.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>linux.x86</id>
            <activation>
                <os>
                    <family>unix</family>
                    <arch>i386</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.eclipse.swt</groupId>
                    <artifactId>gtk.linux.x86</artifactId>
                    <version>3.6.1</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>linux.amd64</id>
            <activation>
                <os>
                    <family>unix</family>
                    <arch>amd64</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.eclipse.swt</groupId>
                    <artifactId>gtk.linux.x86_64</artifactId>
                    <version>3.6.1</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>windows</id>
            <activation>
                <os>
                    <family>windows</family>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.eclipse.swt</groupId>
                    <artifactId>win32.win32.x86</artifactId>
                    <version>3.6.1</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>mac</id>
            <activation>
                <os>
                    <family>mac</family>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.eclipse.swt</groupId>
                    <artifactId>carbon.macosx</artifactId>
                    <version>3.6.1</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>ant-release</id>
            <activation>
                <property>
                    <name>ANT_INSTALL_URL</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>1.4</version>
                        <executions>
                            <execution>
                                <id>release-snapshot</id>
                                <phase>install</phase>
                                <configuration>
                                    <tasks>
                                        <tstamp />
                                        <property environment="env" />
                                        <condition property="internal_version" value="${insttool_version}" else="99_99_99">
                                          <and>
                                            <isset property="insttool_version" />
                                            <length string="${insttool_version}" trim="true" when="greater" length="0" />
                                          </and>
                                        </condition>
                                        <echo message="internal_version: ${internal_version}"/>
                                        <condition property="JAVADEV_HOME" value=".."
                                            else="${env.JAVADEV_HOME}">
                                            <not>
                                                <isset property="env.JAVADEV_HOME" />
                                            </not>
                                        </condition>
                                        <property name="commonIncl"
                                            value="${JAVADEV_HOME}/antvariables.properties" />
                                        <available type="file" file="${commonIncl}"
                                            property="commonInclOK" value="on" />
                                        <fail message="Missing include file: ${commonIncl}"
                                            unless="commonInclOK" />
                                        <property file="${commonIncl}" />
                                        <path id="svnant.classpath">
                                            <fileset dir="${TOOLS}/svnant/lib">
                                                <include name="**/*.jar" />
                                            </fileset>
                                        </path>
                                        <typedef resource="org/tigris/subversion/svnant/svnantlib.xml"
                                            classpathref="svnant.classpath" />
                                        <path id="release.classpath">
                                            <path refid="svnant.classpath" />
                                            <pathelement location="${TOOLS}/releaseant/99_99_99/releaseant.jar" />
                                        </path>
                                        <taskdef name="svnGetLatest" taskname="svnGetLatest"
                                            classname="at.spardat.tools.releaseant.svnant.commands.GetLatest"
                                            classpathref="release.classpath" />
                                        <taskdef name="svnRelease" taskname="svnRelease"
                                            classname="at.spardat.tools.releaseant.svnant.commands.Release"
                                            classpathref="release.classpath" />
                                        <!-- needed for propertyregex -->
                                        <taskdef resource="net/sf/antcontrib/antcontrib.properties">
                                          <classpath>
                                            <pathelement location="${TOOLS}/anttasks/Contrib/ant-contrib-1.0b3.jar"/>
                                          </classpath>
                                        </taskdef>
                                        <propertyregex property="version_dir" input="${internal_version}" regexp="\." replace="_"
                                            defaultValue="${internal_version}" />
                                        <svnGetLatest baseUrl="${ANT_INSTALL_URL}" trunkDir="${version_dir}"
                                            localPath="${project.build.directory}/checkout" />
                                        <!-- Can't use svnGetLatest attribute 'clearWorkingCopy=true' because it would
                                             delete the package.xml file, therefor we delete 'manually': -->
                                        <delete verbose="true">
                                          <fileset dir="${project.build.directory}/checkout/${version_dir}" includes="**/*" excludes=".svn" />
                                        </delete >
                                        <echo
                                            message="copy ${project.build.finalName} to '${version_dir}' directory"></echo>
                                        <copy overwrite="true"
                                            file="${project.build.directory}/${project.build.finalName}.jar"
                                            tofile="${project.build.directory}/checkout/${version_dir}/org.openxma.dsl.platform.jar" />
                                        <copy overwrite="true"
                                            file="${project.build.directory}/${project.build.finalName}-client.jar"
                                            tofile="${project.build.directory}/checkout/${version_dir}/platform-client.jar" />
                                        <copy overwrite="true"
                                            file="${project.build.directory}/${project.build.finalName}-server.jar"
                                            tofile="${project.build.directory}/checkout/${version_dir}/platform-server.jar" />
                                        <copy overwrite="true" failonerror="false"
                                            file="${project.build.directory}/${project.build.finalName}-sources.jar"
                                            tofile="${project.build.directory}/checkout/${version_dir}/src.zip" />
                                        <svnRelease baseUrl="${ANT_INSTALL_URL}" trunkDir="${version_dir}" withoutPom="true"
                                            localPath="${project.build.directory}/checkout" version="${internal_version}"
                                            message="ant build releasing version (${internal_version})" />
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
