<?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>com.mulesoft.connectivity</groupId>
        <artifactId>interpreted-connectivity-link-weave</artifactId>
        <version>1.7.0-68.develop</version>
    </parent>

    <artifactId>connectivity-language</artifactId>
    <packaging>dw-library</packaging>

    <properties>
        <oldVersion>1.5.0</oldVersion>
        <revapi.version>0.15.1</revapi.version>
        <build.helper.maven.plugin.version>3.6.1</build.helper.maven.plugin.version>
        <pathToTop>..</pathToTop>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>${build.helper.maven.plugin.version}</version>
                <executions>
                    <execution>
                        <id>add-dw-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/main/dw</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-dw-test-source</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/test/dw</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.mule.weave</groupId>
                <artifactId>data-weave-maven-plugin</artifactId>
                <version>${data.weave.maven.plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <binaryCompilation>true</binaryCompilation>
                    <tests>
                        <htmlReport>false</htmlReport>
                        <coverageEnabled>true</coverageEnabled>
                        <coverageFormat>sonar</coverageFormat>
                    </tests>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.revapi</groupId>
                <artifactId>revapi-maven-plugin</artifactId>
                <version>${revapi.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>com.mulesoft.connectivity</groupId>
                        <artifactId>connectivity-weave-revapi</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.mule.weave</groupId>
                        <artifactId>http-module</artifactId>
                        <version>${data.weave.http.module.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <oldArtifacts>
                        <oldArtifact>${project.groupId}:${project.artifactId}:jar:dw-library:${oldVersion}</oldArtifact>
                    </oldArtifacts>
                    <newArtifacts>
                        <newArtifact>${project.groupId}:${project.artifactId}:jar:dw-library:${project.version}</newArtifact>
                    </newArtifacts>
                    <failOnUnresolvedArtifacts>true</failOnUnresolvedArtifacts>
                    <checkDependencies>false</checkDependencies>
                    <resolveTransitiveProvidedDependencies>false</resolveTransitiveProvidedDependencies>
                    <failOnMissingConfigurationFiles>false</failOnMissingConfigurationFiles>
                    <analysisConfiguration>
                        <dw-analyzer>
                            <resolveIntersections>true</resolveIntersections>
                            <resolveReferences>false</resolveReferences>
                        </dw-analyzer>
                        <revapi.versions>
                            <enabled>true</enabled>
                            <semantic0>false</semantic0>
                            <versionIncreaseAllows>
                                <major>
                                    <severity>BREAKING</severity>
                                </major>
                                <minor>
                                    <severity>NON_BREAKING</severity>
                                </minor>
                                <patch>
                                    <severity>EQUIVALENT</severity>
                                </patch>
                            </versionIncreaseAllows>
                        </revapi.versions>
                    </analysisConfiguration>
                    <analysisConfigurationFiles>
                        <configurationFile>
                            <path>${project.basedir}/src/main/resources/api-changes.json</path>
                        </configurationFile>
                    </analysisConfigurationFiles>
                </configuration>
                <executions>
                    <execution>
                        <id>api-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.mule.weave</groupId>
            <artifactId>wlang</artifactId>
            <version>${data.weave.version}</version>
        </dependency>

        <dependency>
            <groupId>org.mule.weave</groupId>
            <artifactId>http-module</artifactId>
            <version>${data.weave.http.module.version}</version>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>org.mule.weave</groupId>
            <artifactId>runtime</artifactId>
            <version>${data.weave.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mule.weave</groupId>
            <artifactId>core-modules</artifactId>
            <version>${data.weave.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mule.weave</groupId>
            <artifactId>data-weave-testing-framework</artifactId>
            <version>${data.weave.testing.framework.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mule.weave</groupId>
            <artifactId>http-netty-module</artifactId>
            <version>${data.weave.http.netty.module.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mule.weave</groupId>
            <artifactId>java-module</artifactId>
            <version>${data.weave.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
