<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.gwtplatform</groupId>
        <artifactId>gwtp-core</artifactId>
        <version>0.6</version>
    </parent>

    <groupId>com.gwtplatform</groupId>
    <artifactId>gwtp-dispatch-shared</artifactId>
    <name>GWTP Dispatch Shared</name>

    <build>
        <resources>
            <!-- bundle sources with the jar, so they are visible to GWT's compiler -->
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.java</include>
                </includes>
            </resource>
            <!-- bundle module descriptor with the jar, so it is visible to GWT's compiler -->
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.Processor</include>
                    <include>**/*.gwt.xml</include>
                </includes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <configuration>
                    <useProjectReferences>true</useProjectReferences>
                    <additionalBuildcommands>
                        <buildcommand>net.sf.eclipsecs.core.CheckstyleBuilder</buildcommand>
                    </additionalBuildcommands>
                    <additionalProjectnatures>
                        <projectnature>net.sf.eclipsecs.core.CheckstyleNature</projectnature>
                    </additionalProjectnatures>
                    <additionalConfig>
                        <file>
                            <name>.factorypath</name>
                            <content><![CDATA[
                                <factorypath>
                                <factorypathentry kind="VARJAR" id="M2_REPO/com/gwtplatform/gwtp-processors/${project.version}/gwtp-processors-${project.version}.jar" enabled="true" runInBatchMode="false" />
                                </factorypath>
                            ]]></content>
                        </file>
                        <file>
                            <name>.settings/org.eclipse.jdt.apt.core.prefs</name>
                            <content><![CDATA[
                                eclipse.preferences.version=1
                                org.eclipse.jdt.apt.aptEnabled=true
                                org.eclipse.jdt.apt.genSrcDir=target/generated-sources/apt-test
                                org.eclipse.jdt.apt.reconcileEnabled=true
                            ]]></content>
                        </file>
                        <file>
                            <name>.checkstyle</name>
                            <location>/gwtp-eclipse-checkstyle.xml</location>
                        </file>
                    </additionalConfig>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.gwtplatform</groupId>
                        <artifactId>gwtp-build-tools</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!-- Disable annotation processors during normal compilation -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <proc>none</proc>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <!-- Run annotation processors on src/test/java sources -->
                <executions>
                    <execution>
                        <id>process-test</id>
                        <goals>
                            <goal>process-test</goal>
                        </goals>
                        <phase>generate-test-sources</phase>
                        <configuration>
                            <processors>
                                <!-- list of processors to use -->
                                <processor>com.gwtplatform.dispatch.annotation.processor.GenDtoProcessor</processor>
                                <processor>com.gwtplatform.dispatch.annotation.processor.GenEventProcessor</processor>
                                <processor>com.gwtplatform.dispatch.annotation.processor.GenDispatchProcessor</processor>
                            </processors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
        </dependency>

        <!-- Needed for @BindingAnnotation in SecurityCookie, can safely be ignored when using Spring -->
        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <version>${guice.version}</version>
            <optional>true</optional>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>gwtp-processors</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>