<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
-->
<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">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.myfaces.tobago</groupId>
    <artifactId>tobago-theme</artifactId>
    <version>4.4.1</version>
  </parent>
  <artifactId>tobago-theme-standard</artifactId>
  <packaging>jar</packaging>
  <name>Tobago Theme Standard</name>

  <properties>
    <theme.name>standard</theme.name>
  </properties>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>strip-javascript</id>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>compile</phase>
            <configuration>
              <target>
                <copy todir="${project.build.directory}/javascript-min">
                  <fileset file="${basedir}/src/main/resources/META-INF/resources/tobago/${theme.name}/tobago-bootstrap/_version/js/tobago*.js" />
                </copy>
                <replaceregexp match="^.*//.*@DEV_ONLY.*$" replace="" byline="true">
                  <fileset dir="${project.build.directory}/javascript-min">
                    <include name="**/tobago*.js" />
                  </fileset>
                </replaceregexp>
              </target>
            </configuration>
          </execution>
          <execution>
            <id>remove-local-part-from-map</id>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>prepare-package</phase>
            <configuration>
              <target>
                <replaceregexp match="${project.build.outputDirectory}/META-INF/resources/tobago/standard/tobago-bootstrap/${project.version}/js/" replace="" flags="g">
                  <fileset dir="${project.build.outputDirectory}/META-INF/resources/tobago/${theme.name}/tobago-bootstrap/${project.version}/js/">
                    <include name="*.map" />
                  </fileset>
                </replaceregexp>
                <replaceregexp match="${project.build.directory}/javascript-min/" replace="" flags="g">
                  <fileset dir="${project.build.outputDirectory}/META-INF/resources/tobago/${theme.name}/tobago-bootstrap/${project.version}/js/">
                    <include name="*.map" />
                  </fileset>
                </replaceregexp>
                <echo file="${project.build.outputDirectory}/META-INF/resources/tobago/${theme.name}/tobago-bootstrap/${project.version}/js/tobago.min.js" append="yes">
                  //# sourceMappingURL=tobago.min.js.map
                </echo>
              </target>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>ant</groupId>
            <artifactId>ant-apache-regexp</artifactId>
            <version>1.6.5</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.4.0</version>
        <executions>
          <execution>
            <id>compress-standard</id>
            <goals>
              <goal>exec</goal>
            </goals>
            <phase>compile</phase>
            <configuration>
              <executable>java</executable>
              <arguments>
                <argument>-jar</argument>
                <argument>${project.build.directory}/javascript-min/closure-compiler.jar</argument>
                <argument>--js</argument>
                <argument>${project.build.directory}/javascript-min/tobago-jsf.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago-deltaspike.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago-deltaspike.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago-dropdown.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago-calendar.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago-in.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago-layout.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago-overlay.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago-popup.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago-sheet.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago-stars.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago-suggest.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago-tab.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago-tree.js</argument>
                <argument>${project.build.directory}/javascript-min/tobago-utils.js</argument>
                <argument>--warning_level</argument>
                <argument>QUIET</argument>
                <argument>--js_output_file</argument>
                <argument>${project.build.outputDirectory}/META-INF/resources/tobago/${theme.name}/tobago-bootstrap/${project.version}/js/tobago.min.js</argument>
                <argument>--create_source_map</argument>
                <argument>%outname%.map</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.apache.myfaces.core</groupId>
      <artifactId>myfaces-api</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.apache.myfaces.tobago</groupId>
      <artifactId>tobago-core</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.myfaces.test</groupId>
      <artifactId>myfaces-test20</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.myfaces.tobago</groupId>
      <artifactId>tobago-core</artifactId>
      <version>${project.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
  </dependencies>

</project>
