<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

      https://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
  -->
<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>org.apache.plc4x</groupId>
    <artifactId>plc4x-protocols</artifactId>
    <version>0.10.0</version>
  </parent>

  <artifactId>plc4x-protocols-bacnetip</artifactId>

  <name>Protocols: BACNet/IP</name>
  <description>Base protocol specifications for the BACNet/IP protocol</description>

  <dependencies>
    <dependency>
      <groupId>org.apache.plc4x</groupId>
      <artifactId>plc4x-code-generation-protocol-base-mspec</artifactId>
      <version>0.10.0</version>
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- Fetch the vendor ids which will be used to translate venmdor ids to readable names -->
      <!--
        We're intentionally not using the download plugin as this would either download only once
        and not get any updates or it would try downloading for every build. This however might result
        in getting banned on the bacnet server.

        So this script makes sure the bacnet-vendorid.mspec is updated at most every 24h
      -->
      <plugin>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>groovy-maven-plugin</artifactId>
        <version>2.1.1</version>
        <executions>
          <!-- Do some pre-build checks and report any findings to the user -->
          <execution>
            <id>fetch-bacnet-vendor-ids</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <source>${project.basedir}/src/main/script/getVendorIds.groovy</source>
            </configuration>
          </execution>
          <execution>
            <id>generate-tagged-enums</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <source>${project.basedir}/src/main/script/produceTaggedEnums.groovy</source>
            </configuration>
          </execution>
          <execution>
            <id>generate-tagged-private-enums</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <source>${project.basedir}/src/main/script/produceTaggedPrivateEnums.groovy</source>
            </configuration>
          </execution>
          <execution>
            <id>generate-tagged-bit-strings</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <source>${project.basedir}/src/main/script/produceTaggedBitStrings.groovy</source>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy</artifactId>
            <version>${groovy.version}</version>
          </dependency>
          <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>1.15.3</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <excludedGroups>just-output</excludedGroups>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>