<!--
This file is part of the Meeds project (https://meeds.io/).
Copyright (C) 2020 Meeds Association
contact@meeds.io
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

-->
<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>
    <artifactId>maven-parent-pom</artifactId>
    <groupId>org.exoplatform</groupId>
    <version>24-M02</version>
    <relativePath />
  </parent>
  <groupId>org.exoplatform.wallet</groupId>
  <artifactId>ert-contract</artifactId>
  <version>1.3.x-SNAPSHOT</version>
  <packaging>jar</packaging>
  <name>eXo Wallet - ERT Contract</name>
  <description>eXo Wallet - Contracts</description>
  <scm>
    <connection>scm:git:git://github.com/exoplatform/ert-contract.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/exoplatform/ert-contract.git</developerConnection>
    <url>https://github.com/exoplatform/ert-contract</url>
    <tag>HEAD</tag>
  </scm>
  <properties>
    <!-- Ethereum We3j for Java library -->
    <org.web3j.version>4.8.7</org.web3j.version>

    <!-- **************************************** -->
    <!-- Jenkins Settings -->
    <jenkins.job.name>ert-contract-master-ci</jenkins.job.name>
    <!-- **************************************** -->
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.web3j</groupId>
      <artifactId>core</artifactId>
      <version>${org.web3j.version}</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <finalName>ert-contract</finalName>
    <sourceDirectory>target/generated-sources</sourceDirectory>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <excludes>
          <exclude>**/*</exclude>
        </excludes>
      </resource>
      <resource>
        <directory>target/generated-sources</directory>
        <includes>
          <include>**/*.json</include>
          <include>**/*.bin</include>
        </includes>
        <excludes>
          <exclude>org.exoplatform.wallet.contract/**</exclude>
          <exclude>**/Migrations.json</exclude>
          <exclude>**/Migrations.bin</exclude>
          <exclude>**/Test*.*</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.web3j</groupId>
        <artifactId>web3j-maven-plugin</artifactId>
        <version>${org.web3j.version}</version>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>generate-sources</goal>
            </goals>
            <configuration>
              <packageName>org.exoplatform.wallet.contract</packageName>
              <sourceDestination>target/generated-sources</sourceDestination>
              <nativeJavaType>true</nativeJavaType>
              <outputFormat>java,bin,abi</outputFormat>
              <soliditySourceFiles>
                <directory>src/main/resources</directory>
                <includes>
                  <include>**/*.sol</include>
                </includes>
                <excludes>
                  <exclude>**/Migrations.sol</exclude>
                  <exclude>**/Test*.sol</exclude>
                </excludes>
              </soliditySourceFiles>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>target/generated-sources/org/exoplatform/wallet/contract</outputDirectory>
              <resources>
                <resource>
                  <directory>target/generated-sources/org.exoplatform.wallet.contract</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>project-repositories</id>
      <activation>
        <property>
          <name>!skip-project-repositories</name>
        </property>
      </activation>
      <repositories>
        <repository>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
          <id>repository.exoplatform.org</id>
          <url>https://repository.exoplatform.org/public</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
          <id>repository.exoplatform.org</id>
          <url>https://repository.exoplatform.org/public</url>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>

</project>
