<?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">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>guru.nidi</groupId>
        <artifactId>graphviz-java-parent</artifactId>
        <version>0.18.0</version>
    </parent>

    <artifactId>graphviz-java</artifactId>
    <name>${project.artifactId}</name>

    <properties>
        <module.name>guru.nidi.graphviz</module.name>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>guru.nidi</groupId>
                <artifactId>code-assert-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>assert</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>guru.nidi.maven.plugins</groupId>
                <artifactId>snippets-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>snippets</goal>
                        </goals>
                        <configuration>
                            <inputs>
                                <input>
                                    src/test/java/guru/nidi/graphviz/model
                                </input>
                            </inputs>
                            <outputs>
                                <output>../README.md</output>
                            </outputs>
                            <prefix>\n```java</prefix>
                            <postfix>```\n</postfix>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- Only needed for Graal Javascript engine -->
        <dependency>
            <groupId>org.graalvm.js</groupId>
            <artifactId>js</artifactId>
            <version>20.0.0</version>
            <optional>true</optional>
        </dependency>
        <!-- Only needed for Javascript Graphviz Engines -->
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>viz.js-for-graphviz-java</artifactId>
        </dependency>
        <!-- Only needed for SALAMANDER renderer -->
        <dependency>
            <groupId>guru.nidi.com.kitfox</groupId>
            <artifactId>svgSalamander</artifactId>
        </dependency>
        <!-- Only needed for Nashorn Javascript Engine -->
        <dependency>
            <groupId>net.arnx</groupId>
            <artifactId>nashorn-promise</artifactId>
        </dependency>
        <!-- Only needed for GraphvizCmlLineEngine -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-exec</artifactId>
        </dependency>
        <!-- this must come before batik because code-assert->bcel-findbugs
       conflicts with batik->xalan which inlines another version of bcel-->
        <dependency>
            <groupId>guru.nidi</groupId>
            <artifactId>code-assert</artifactId>
        </dependency>
        <!-- Only needed for BATIK renderer -->
        <dependency>
            <groupId>org.apache.xmlgraphics</groupId>
            <artifactId>batik-rasterizer</artifactId>
            <version>1.13</version>
            <optional>true</optional>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.2</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.6</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>macos</id>
            <activation>
                <os>
                    <name>mac os x</name>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.eclipsesource.j2v8</groupId>
                    <artifactId>j2v8_macosx_x86_64</artifactId>
                    <scope>compile</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>linux</id>
            <activation>
                <os>
                    <name>linux</name>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.eclipsesource.j2v8</groupId>
                    <artifactId>j2v8_linux_x86_64</artifactId>
                    <scope>compile</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>win32</id>
            <activation>
                <os>
                    <family>windows</family>
                    <arch>x86</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.eclipsesource.j2v8</groupId>
                    <artifactId>j2v8_win32_x86</artifactId>
                    <scope>compile</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>win64</id>
            <activation>
                <os>
                    <family>windows</family>
                    <arch>amd64</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.eclipsesource.j2v8</groupId>
                    <artifactId>j2v8_win32_x86_64</artifactId>
                    <scope>compile</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

</project>
