<?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.vaadin</groupId>
        <artifactId>flow-components-parent</artifactId>
        <version>1.0.0.alpha2</version>
    </parent>
    <artifactId>flow-generated-components</artifactId>
    <name>Flow Generated Component</name>
    <description>Package with the generated Java Components for Flow</description>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>flow-data</artifactId>
            <version>${flow.version}</version>
        </dependency>
    </dependencies>

    <properties>
        <!-- Skip Sonar and javadoc checks for generated components -->
        <maven.javadoc.skip>true</maven.javadoc.skip>
        <sonar.skip>true</sonar.skip>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <!-- When javadocs are created, let's not fail since we cannot guarantee perfect syntax for now -->
                    <failOnError>false</failOnError>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>generator</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-clean-plugin</artifactId>
                        <version>${maven.clean.plugin.version}</version>
                        <configuration>
                            <filesets>
                                <fileset>
                                    <directory>src/main/java</directory>
                                </fileset>
                            </filesets>
                        </configuration>
                    </plugin>

                    <!-- Code generator configuration -->
                    <plugin>
                        <groupId>com.vaadin</groupId>
                        <artifactId>flow-code-generator</artifactId>
                        <version>${flow.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <basePackage>com.vaadin.ui</basePackage>
                                    <classNamePrefix>Generated</classNamePrefix>
                                    <licenseFile>license_header</licenseFile>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
