<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>
  <artifactId>jsupload</artifactId>
  <packaging>jar</packaging>
  <name>JsUpload library</name>
  <description>JsUpload library: JavaScript ready to use in non gwt web apps and cgi-bin server script.</description>

  <parent>
    <groupId>com.googlecode.gwtupload</groupId>
    <artifactId>gwtupload-project</artifactId>
    <version>0.6.4</version>
  </parent>
  <properties>
    <gwt.style>OBF</gwt.style>
    <gwt.module.suffix />
  </properties>
  <profiles>
     <profile>
       <id>pretty</id>
       <properties>
         <gwt.style>PRETTY</gwt.style>
       </properties>
     </profile>
     <profile>
       <id>xs</id>
       <properties>
         <gwt.module.suffix>Xs</gwt.module.suffix>
       </properties>
     </profile>
  </profiles>

  <dependencies>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>2.4.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-dev</artifactId>
      <version>2.4.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>${groupId}</groupId>
      <artifactId>gwtupload</artifactId>
      <version>${version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.timepedia.exporter</groupId>
      <artifactId>gwtexporter</artifactId>
      <version>${gwtExporterVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>gwtchismes</groupId>
      <artifactId>gwtchismes</artifactId>
      <version>${gwtChismesVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-incubator</artifactId>
      <version>${gwtIncubatorVersion}</version>
      <scope>provided</scope>
    </dependency>
    <!-- gwt-2.3.0 needs these -->
    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
      <version>1.0.0.GA</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
      <version>1.0.0.GA</version>
      <classifier>sources</classifier>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource><directory>src/main/java</directory></resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptors>
            <descriptor>${basedir}/assembly.xml</descriptor>
          </descriptors>
        </configuration>
        <executions>
          <execution>
            <id>jsupload.zip</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>${gwtMaven}</version>
        <executions>
          <execution>
            <phase>prepare-package</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <hostedWebApp>${project.build.directory}/${project.build.finalName}</hostedWebApp>
          <runTarget>jsupload/JsUpload.html</runTarget>
          <soyc>true</soyc>
          <style>${gwt.style}</style>
          <module>jsupload.JsUpload${gwt.module.suffix}</module>
          <compileReport>true</compileReport>
          <disableCastChecking>true</disableCastChecking>
        </configuration>
      </plugin>      
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <configuration>
              <tasks>
                <exec dir="." executable="perl">
                  <arg line="css_compress.pl target/${project.build.finalName}/jsupload/JsUpload.css" />
                </exec>
                <exec dir="." executable="perl">
                  <arg line="-pi -e 's#^\s*(containerId: .*)$#$1 action: &quot;/cgi-bin/jsupload.cgi.pl&quot;, #g' target/${project.build.finalName}/jsupload/JsUpload.html" />
                </exec>
                <exec dir="target" executable="svn">
                  <arg line="co https://gwtupload.googlecode.com/svn/wiki" />
                </exec>
                <exec dir="." executable="perl">
                  <arg line="gjslib.pl" />
                </exec>
                <exec dir="target/wiki" executable="${wikiSvnExec}">
                  <arg line="commit -m updated_wiki_pages" />
                </exec>
              </tasks>
            </configuration>
            <phase>prepare-package</phase>
            <goals><goal>run</goal></goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
           <downloadSources>true</downloadSources>
           <downloadJavadocs>false</downloadJavadocs>
           <additionalBuildcommands>
             <buildCommand>
               <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
             </buildCommand>
           </additionalBuildcommands>
           <additionalProjectnatures>
             <projectnature>com.google.gwt.eclipse.core.gwtNature</projectnature>
           </additionalProjectnatures>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.5</version>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
              <resources>          
                <resource>
                  <directory>src/main/webapp</directory>
                  <filtering>true</filtering>
                </resource>
              </resources>              
            </configuration>            
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <distributionManagement>
    <site>
      <id>googlecode</id>
      <url>svn:https://gwtupload.googlecode.com/svn/site/${artifactId}</url>
    </site>
  </distributionManagement>

</project>
