<?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>org.taxilang</groupId>
      <artifactId>parent</artifactId>
      <version>1.36.0</version>
   </parent>

   <artifactId>taxi-lang-server</artifactId>
   <packaging>pom</packaging>

   <!--
   If you're reading this trying to manually build the vscode plugin,
   make sure you run maven with the shade profile enabled.  (-P shade)
   That is used to create a fat jar.  Enable by default in ci/cd,
   disabled by default locally
   -->
   <modules>
      <module>taxi-lang-service</module>
      <module>taxi-lang-server-app</module>
      <module>taxi-lang-server-standalone</module>
      <module>vscode-extension</module>
   </modules>

   <properties>
      <taxi.version>${project.version}</taxi.version>
      <lsp4j.version>0.9.0</lsp4j.version>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>

   <dependencies>
      <!-- https://mvnrepository.com/artifact/org.eclipse.lsp4j/org.eclipse.lsp4j -->
      <dependency>
         <groupId>org.eclipse.lsp4j</groupId>
         <artifactId>org.eclipse.lsp4j</artifactId>
         <version>${lsp4j.version}</version>
      </dependency>
      <dependency>
         <groupId>org.taxilang</groupId>
         <artifactId>compiler</artifactId>
         <version>${taxi.version}</version>
      </dependency>


      <dependency>
         <groupId>org.jetbrains.kotlin</groupId>
         <artifactId>kotlin-stdlib-jdk8</artifactId>
         <version>${kotlin.version}</version>
      </dependency>
      <dependency>
         <groupId>org.jetbrains.kotlin</groupId>
         <artifactId>kotlin-test</artifactId>
         <version>${kotlin.version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.jetbrains.kotlin</groupId>
         <artifactId>kotlin-reflect</artifactId>
         <version>${kotlin.version}</version>
      </dependency>
      <dependency>
         <groupId>com.winterbe</groupId>
         <artifactId>expekt</artifactId>
         <version>0.5.0</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.mockito.kotlin</groupId>
         <artifactId>mockito-kotlin</artifactId>
         <version>4.1.0</version>
         <scope>test</scope>
      </dependency>
      <!-- https://mvnrepository.com/artifact/org.assertj/assertj-core -->
      <dependency>
         <groupId>org.assertj</groupId>
         <artifactId>assertj-core</artifactId>
         <version>3.24.2</version>
         <scope>test</scope>
      </dependency>

   </dependencies>

   <dependencyManagement>
      <dependencies>
         <dependency>
            <groupId>org.taxilang</groupId>
            <artifactId>compiler</artifactId>
            <version>${taxi.version}</version>
         </dependency>

         <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>${kotlin.version}</version>
         </dependency>
         <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
            <version>${kotlin.version}</version>
         </dependency>
         <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-reflect</artifactId>
            <version>${kotlin.version}</version>
         </dependency>
      </dependencies>
   </dependencyManagement>
   <build>
      <extensions>
         <extension>
            <groupId>org.springframework.build</groupId>
            <artifactId>aws-maven</artifactId>
            <version>5.0.0.RELEASE</version>
         </extension>
      </extensions>
      <plugins>
         <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.22.2</version>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
               <scmCommentPrefix>[ci skip] [mvn-release]</scmCommentPrefix>
               <tagNameFormat>v@{project.version}</tagNameFormat>
            </configuration>
         </plugin>
         <plugin>
            <artifactId>kotlin-maven-plugin</artifactId>
            <groupId>org.jetbrains.kotlin</groupId>
            <version>${kotlin.version}</version>
            <executions>
               <execution>
                  <id>kapt</id>
                  <goals>
                     <goal>kapt</goal>
                  </goals>
               </execution>
               <execution>
                  <id>compile</id>
                  <goals>
                     <goal>compile</goal>
                  </goals>
               </execution>

               <execution>
                  <id>test-compile</id>
                  <goals>
                     <goal>test-compile</goal>
                  </goals>
                  <configuration>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.11.0</version>
            <executions>
               <!-- Replacing default-compile as it is treated specially by maven -->
               <execution>
                  <id>default-compile</id>
                  <phase>none</phase>
               </execution>
               <!-- Replacing default-testCompile as it is treated specially by maven -->
               <execution>
                  <id>default-testCompile</id>
                  <phase>none</phase>
               </execution>
               <execution>
                  <id>java-compile</id>
                  <phase>compile</phase>
                  <goals>
                     <goal>compile</goal>
                  </goals>
               </execution>
               <execution>
                  <id>java-test-compile</id>
                  <phase>test-compile</phase>
                  <goals>
                     <goal>testCompile</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.2.1</version>
            <executions>
               <execution>
                  <id>attach-sources</id>
                  <goals>
                     <goal>jar</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>com.amashchenko.maven.plugin</groupId>
            <artifactId>gitflow-maven-plugin</artifactId>
            <version>1.19.0</version>
            <configuration>
               <!-- whether to push to the git remote. Very useful for testing locally -->
               <pushRemote>true</pushRemote>
               <!-- Set to true to immediately bump the development version when creating a release branch -->
               <commitDevelopmentVersionAtStart>false</commitDevelopmentVersionAtStart>
               <!-- Execute mvn compile before release -->
               <preReleaseGoals>compile</preReleaseGoals>
               <commitMessages>
                  <releaseStartMessage>Update versions for release @{version}</releaseStartMessage>
                  <releaseFinishMessage>[skip ci] Update for next development version @{version}</releaseFinishMessage>
                  <releaseVersionUpdateMessage>[skip ci] Update for next development version @{version}
                  </releaseVersionUpdateMessage>
               </commitMessages>
               <!-- Configure branches -->
               <gitFlowConfig>
                  <productionBranch>master</productionBranch>
                  <!-- default is develop, but we use development -->
                  <developmentBranch>develop</developmentBranch>
               </gitFlowConfig>
            </configuration>
         </plugin>
      </plugins>
   </build>
</project>
