<!--
 Copyright 2009 Google Inc.

 Licensed 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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.google.javascript</groupId>
  <artifactId>closure-compiler-main</artifactId>
  <packaging>pom</packaging>

  <name>Closure Compiler Main</name>
  <version>v20200406</version>

  <url>https://developers.google.com/closure/compiler/</url>
  <description>
    Closure Compiler is a JavaScript optimizing compiler. It parses your
    JavaScript, analyzes it, removes dead code and rewrites and minimizes
    what's left. It also checks syntax, variable references, and types, and
    warns about common JavaScript pitfalls. It is used in many of Google's
    JavaScript apps, including Gmail, Google Web Search, Google Maps, and
    Google Docs.
  </description>
  <inceptionYear>2009</inceptionYear>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.build.outputEncoding>UTF-8</project.build.outputEncoding>
    <jdk.version>1.8</jdk.version>
    <!-- for substitution in ParserConfig.properties -->
    <compiler.date>${maven.build.timestamp}</compiler.date>
    <maven.build.timestamp.format>yyyy-MM-dd HH\:mm</maven.build.timestamp.format>
    <compiler.version>${project.version}</compiler.version>
  </properties>

  <parent>
    <groupId>com.google.javascript</groupId>
    <artifactId>closure-compiler-parent</artifactId>
    <version>v20200406</version>
    <relativePath>pom.xml</relativePath>
  </parent>

  <modules>
    <module>pom-linter.xml</module>
    <module>pom-main-unshaded.xml</module>
    <module>pom-main-shaded.xml</module>
  </modules>

  <dependencies>
    <dependency>
      <groupId>com.google.javascript</groupId>
      <artifactId>closure-compiler-externs</artifactId>
      <version>v20200406</version>
    </dependency>

    <dependency>
      <groupId>args4j</groupId>
      <artifactId>args4j</artifactId>
      <version>2.0.26</version>
    </dependency>

    <dependency>
      <groupId>com.google.errorprone</groupId>
      <artifactId>error_prone_annotations</artifactId>
      <version>2.3.1</version>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <!-- See <dependencyManagement> in pom.xml for <version> -->
    </dependency>

    <dependency>
      <groupId>com.google.auto.value</groupId>
      <artifactId>auto-value</artifactId>
      <version>1.4.1</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.7</version>
    </dependency>

    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.1</version>
    </dependency>

    <dependency>
      <groupId>com.google.jsinterop</groupId>
      <artifactId>jsinterop-annotations</artifactId>
      <version>1.0.2</version>
    </dependency>

    <dependency>
      <groupId>com.google.jsinterop</groupId>
      <artifactId>base</artifactId>
      <version>1.0.0</version>
    </dependency>

    <dependency>
      <groupId>com.google.elemental2</groupId>
      <artifactId>elemental2-core</artifactId>
      <version>1.0.0-RC1</version>
    </dependency>

    <dependency>
      <groupId>com.google.truth</groupId>
      <artifactId>truth</artifactId>
      <version>0.45</version>
      <scope>test</scope>
    </dependency>

    <!-- Ant is a provided scope as it is only needed to compile; ant will provide itself when using the jar -->
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
      <scope>provided</scope>
      <version>1.9.7</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>2.2.21</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava-testlib</artifactId>
      <!-- See <dependencyManagement> in pom.xml for <version> -->
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.google.re2j</groupId>
      <artifactId>re2j</artifactId>
      <version>1.3</version>
    </dependency>
  </dependencies>

  <build>
    <defaultGoal>install</defaultGoal>
    <sourceDirectory>${basedir}/src</sourceDirectory>
    <testSourceDirectory>${basedir}/test</testSourceDirectory>

    <resources>
      <resource>
        <directory>src/</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
        <includes>
          <include>**/*</include>
        </includes>
        <filtering>true</filtering>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals><goal>add-source</goal></goals>
            <configuration>
              <sources>
                <source>gen</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-test-source</id>
            <phase>generate-test-sources</phase>
            <goals><goal>add-test-source</goal></goals>
            <configuration>
              <sources>
                <source>src/com/google/javascript/rhino/testing</source>
                <source>src/com/google/javascript/jscomp/testing</source>
                <source>src/com/google/javascript/jscomp/parsing/parser/testing</source>
                <source>src/com/google/javascript/refactoring/testing</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>target</directory>
            </fileset>
            <fileset>
              <directory>gen/target</directory>
            </fileset>
          </filesets>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>

        <!-- Move Messages.properties where ScriptRuntime.java expects it. -->
        <executions>
          <execution>
            <id>rhino_ast-custom</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/target/rhino_ast</outputDirectory>
              <resources>
                <resource>
                  <targetPath>${basedir}/target/classes</targetPath>
                  <directory>src</directory>
                  <includes>
                    <include>com/google/javascript/rhino/Messages.properties</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/debugger/**</exclude>
            <exclude>**/gwt/**</exclude>
            <exclude>**/super-gwt/**</exclude>
            <exclude>**/super/**</exclude>
            <exclude>**/testing/**</exclude>
            <exclude>**/webservice/**</exclude>
          </excludes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <!-- <parallel>classes</parallel>
          <threadCount>4</threadCount> -->
          <argLine>-Xmx1G</argLine>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <show>protected</show>
          <nohelp>true</nohelp>
          <source>${jdk.version}</source>
          <target>${jdk.version}</target>
          <encoding>${project.build.sourceEncoding}</encoding>
          <detectLinks>true</detectLinks>
          <excludePackageNames>*.resources.*:*.gwt.*:*.testing.*:*.debugger.*:*.webservice.*:*.debugging.*:*.ant.*</excludePackageNames>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <!-- reporting -->
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.19.1</version>
      </plugin>
    </plugins>
  </reporting>
</project>
