<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>ch.trick17.better-checks</groupId>
        <artifactId>better-checks</artifactId>
        <version>1.0</version>
    </parent>
    <artifactId>better-checks-core-gwt</artifactId>
    <name>Better Checks Core GWT</name>

    <properties>
        <gwtVersion>2.6.0</gwtVersion>
        <maven.main.skip>true</maven.main.skip>
        <maven.test.skip>true</maven.test.skip>
        <maven.site.skip>true</maven.site.skip>
        <maven.site.deploy.skip>true</maven.site.deploy.skip>
    </properties>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>better-checks-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>${gwtVersion}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>${project.build.directory}/gwt-sources</directory>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target name="copy-gwt-sources">
                                <copy toDir="${project.build.directory}/gwt-sources" overwrite="true">
                                    <fileset dir="${project.basedir}/../core/src/main/java">
                                        <contains text="@GwtCompatible" />
                                    </fileset>
                                    <fileset dir="${project.basedir}/../core/src/main/java">
                                        <include name="**/package-info.java" />
                                    </fileset>
                                </copy>
                                <copy toDir="${project.build.directory}/gwt-sources" overwrite="true">
                                    <fileset dir="${project.build.sourceDirectory}" />
                                </copy>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>${gwtVersion}</version>
                <executions>
                    <execution>
                        <id>gwt-compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <module>ch.trick17.betterchecks.ForceCompilation</module>
                            <strict>true</strict>
                            <validateOnly>true</validateOnly>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <configuration>
                    <javadocDirectory>${project.basedir}/../src/main/javadoc</javadocDirectory>
                    <overview>${project.basedir}/../src/main/javadoc/overview.html</overview>
                    <sourcepath>${project.build.directory}/gwt-sources</sourcepath>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>