<?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">
    <parent>
        <artifactId>meringue</artifactId>
        <groupId>edu.neu.ccs.prl.meringue</groupId>
        <version>1.1.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>meringue-examples</artifactId>
    <name>meringue-examples</name>
    <packaging>pom</packaging>
    <dependencies>
        <dependency>
            <groupId>org.mozilla</groupId>
            <artifactId>rhino</artifactId>
            <version>1.7.13</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.bcel</groupId>
            <artifactId>bcel</artifactId>
            <version>6.5.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.10.11</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-model-builder</artifactId>
            <version>3.8.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.javascript</groupId>
            <artifactId>closure-compiler</artifactId>
            <version>v20180204</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>edu.berkeley.cs.jqf</groupId>
            <artifactId>jqf-fuzz</artifactId>
            <version>1.7</version>
            <exclusions>
                <exclusion>
                    <groupId>org.jacoco</groupId>
                    <artifactId>org.jacoco.report</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jacoco</groupId>
                    <artifactId>org.jacoco.core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>edu.berkeley.cs.jqf</groupId>
            <artifactId>jqf-examples</artifactId>
            <version>1.7</version>
            <exclusions>
                <exclusion>
                    <groupId>org.jacoco</groupId>
                    <artifactId>org.jacoco.report</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jacoco</groupId>
                    <artifactId>org.jacoco.core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <!-- Compile test source files -->
                <executions>
                    <execution>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <!--Copy the resources for the test source code to the test output directory-->
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>testResources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>zest</id>
            <build>
                <plugins>
                    <plugin>
                        <executions>
                            <execution>
                                <id>execute</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>fuzz</goal>
                                    <goal>analyze</goal>
                                </goals>
                            </execution>
                        </executions>
                        <groupId>edu.neu.ccs.prl.meringue</groupId>
                        <artifactId>meringue-maven-plugin</artifactId>
                        <configuration>
                            <testMethod>testWithGenerator</testMethod>
                            <framework>edu.neu.ccs.prl.meringue.ZestFramework</framework>
                            <javaOptions>
                                <option>-Djqf.ei.MAX_INPUT_SIZE=10240</option>
                                <option>-ea</option>
                                <option>-Xmx8g</option>
                                <option>-Djanala.conf=${project.build.testOutputDirectory}/janala.conf</option>
                            </javaOptions>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jazzer</id>
            <build>
                <plugins>
                    <plugin>
                        <executions>
                            <execution>
                                <id>execute</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>fuzz</goal>
                                    <goal>analyze</goal>
                                </goals>
                            </execution>
                        </executions>
                        <groupId>edu.neu.ccs.prl.meringue</groupId>
                        <artifactId>meringue-maven-plugin</artifactId>
                        <configuration>
                            <testMethod>test</testMethod>
                            <framework>edu.neu.ccs.prl.meringue.JazzerFramework</framework>
                            <frameworkArguments>
                                <argLine>
                                    --instrumentation_excludes=org.mozilla.javascript.gen.**
                                    -max_len=10240
                                    -use_value_profile=1
                                </argLine>
                            </frameworkArguments>
                            <javaOptions>
                                <option>-ea</option>
                                <option>-Xmx8g</option>
                            </javaOptions>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>rhino</id>
            <dependencies>
                <dependency>
                    <groupId>org.mozilla</groupId>
                    <artifactId>rhino</artifactId>
                    <version>1.7.13</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>edu.neu.ccs.prl.meringue</groupId>
                        <artifactId>meringue-maven-plugin</artifactId>
                        <configuration>
                            <testClass>edu.neu.ccs.prl.meringue.RhinoTest</testClass>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>ant</id>
            <dependencies>
                <dependency>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant</artifactId>
                    <version>1.10.11</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>edu.neu.ccs.prl.meringue</groupId>
                        <artifactId>meringue-maven-plugin</artifactId>
                        <configuration>
                            <testClass>edu.neu.ccs.prl.meringue.AntTest</testClass>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>bcel</id>
            <dependencies>
                <dependency>
                    <groupId>org.apache.bcel</groupId>
                    <artifactId>bcel</artifactId>
                    <version>6.5.0</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>edu.neu.ccs.prl.meringue</groupId>
                        <artifactId>meringue-maven-plugin</artifactId>
                        <configuration>
                            <testClass>edu.neu.ccs.prl.meringue.BcelTest</testClass>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>closure</id>
            <dependencies>
                <dependency>
                    <groupId>com.google.javascript</groupId>
                    <artifactId>closure-compiler</artifactId>
                    <version>v20180204</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>edu.neu.ccs.prl.meringue</groupId>
                        <artifactId>meringue-maven-plugin</artifactId>
                        <configuration>
                            <testClass>edu.neu.ccs.prl.meringue.ClosureTest</testClass>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>maven</id>
            <dependencies>
                <dependency>
                    <groupId>org.apache.maven</groupId>
                    <artifactId>maven-model-builder</artifactId>
                    <version>3.8.1</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>edu.neu.ccs.prl.meringue</groupId>
                        <artifactId>meringue-maven-plugin</artifactId>
                        <configuration>
                            <testClass>edu.neu.ccs.prl.meringue.MavenTest</testClass>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>