<?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>io.github.deripas</groupId>
        <artifactId>chrome-devtools-java</artifactId>
        <version>0.0.12</version>
    </parent>

    <artifactId>chrome-devtools-client</artifactId>

    <name>Chrome DevTools Java: Client</name>
    <description>
        Chrome DevTools Java Client is the main module of the project, providing a Java API for interacting with the Chrome DevTools Protocol.
        This module allows developers to automate and control the Google Chrome browser using Java.
    </description>
    <url>https://github.com/deripas/chrome-devtools-java</url>

    <properties>
        <origSourceDir>${project.basedir}/src/main/java</origSourceDir>
        <sourceDir>${origSourceDir}</sourceDir>
        <delombokedSourceDir>${project.build.directory}/delombok</delombokedSourceDir>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.github.deripas</groupId>
            <artifactId>chrome-devtools-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>build</id>
            <properties>
                <sourceDir>${delombokedSourceDir}</sourceDir>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.projectlombok</groupId>
                        <artifactId>lombok-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>delombok</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <sourceDirectory>${origSourceDir}</sourceDirectory>
                            <outputDirectory>${delombokedSourceDir}</outputDirectory>
                            <addOutputDirectory>false</addOutputDirectory>
                            <encoding>UTF-8</encoding>
                            <formatPreferences>
                                <generateDelombokComment>skip</generateDelombokComment>
                                <javaLangAsFQN>skip</javaLangAsFQN>
                            </formatPreferences>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <doclint>all,-missing</doclint>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>