<?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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.ow2.mind</groupId>
        <artifactId>mind-compiler</artifactId>
        <version>1.0</version>
    </parent>

    <artifactId>annotations</artifactId>
    <packaging>jar</packaging>
    <name>Common Annotations</name>
    
    <description>
        Common ADL and IDL annotations of the Mind programming model.
    </description>
    
    <properties>
        <mind.test.cflags>-g -Wall -Werror -Wredundant-decls -Wunreachable-code
            -Wstrict-prototypes -Wwrite-strings</mind.test.cflags>
        <mind.test.compiler>gcc</mind.test.compiler>
        <mind.test.compiler.gcc4>gcc4</mind.test.compiler.gcc4>
    </properties>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>adl-backend</artifactId>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>idl-backend</artifactId>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <classifier>jdk15</classifier>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>fractal-runtime</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>adl-frontend</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>common-frontend</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>adl-backend</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <groups>${test.groups}</groups>
                    <systemPropertyVariables>
                        <default.file.level>FINEST</default.file.level>
                        <loggers.outfile>${project.build.testOutputDirectory}/test-log.txt</loggers.outfile>
                        <mind.test.cflags>${mind.test.cflags}</mind.test.cflags>
                        <mind.test.compiler>${mind.test.compiler}</mind.test.compiler>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>
    
    <profiles>
        <profile>
            <id>stdc89</id>

            <activation>
                <property>
                    <name>allTests</name>
                    <value>true</value>
                </property>
            </activation>

            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>stdc89</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <reportsDirectory>${project.build.directory}/surefire-reports-stdc89</reportsDirectory>
                                    <groups>${test.groups}</groups>
                                    <systemPropertyVariables>
                                        <default.file.level>FINEST</default.file.level>
                                        <loggers.outfile>${project.build.testOutputDirectory}/test-log-stdc89.txt</loggers.outfile>
                                        <mind.test.cflags>-std=c89 -D__MIND_NO_INLINE
                                            ${mind.test.cflags}</mind.test.cflags>
                                        <mind.test.compiler>${mind.test.compiler}</mind.test.compiler>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>gcc4</id>

            <activation>
                <property>
                    <name>allTests</name>
                    <value>true</value>
                </property>
            </activation>

            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>gcc4</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <reportsDirectory>${project.build.directory}/surefire-reports-gcc4</reportsDirectory>
                                    <groups>${test.groups}</groups>
                                    <systemPropertyVariables>
                                        <default.file.level>FINEST</default.file.level>
                                        <loggers.outfile>${project.build.testOutputDirectory}/test-log-gcc4.txt</loggers.outfile>
                                        <mind.test.cflags>${mind.test.cflags}</mind.test.cflags>
                                        <mind.test.compiler>${mind.test.compiler.gcc4}</mind.test.compiler>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
