<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2018, 2021 Jorel Ali (Skepter) - MIT License Permission is 
	hereby granted, free of charge, to any person obtaining a copy of this software 
	and associated documentation files (the "Software"), to deal in the Software 
	without restriction, including without limitation the rights to use, copy, 
	modify, merge, publish, distribute, sublicense, and/or sell copies of the 
	Software, and to permit persons to whom the Software is furnished to do so, 
	subject to the following conditions: The above copyright notice and this 
	permission notice shall be included in all copies or substantial portions 
	of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 
	KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
	MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 
	NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
	DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
	ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
	DEALINGS IN THE SOFTWARE. -->

<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">
	<parent>
		<artifactId>commandapi-nms</artifactId>
		<groupId>dev.jorel</groupId>
		<version>8.8.0</version>
	</parent>
	<modelVersion>4.0.0</modelVersion>

	<artifactId>commandapi-1.17</artifactId>

	<properties>
		<minecraft.mappings>1.17-R0.1-SNAPSHOT</minecraft.mappings>
		<spigot.version>1.17-R0.1-SNAPSHOT</spigot.version>
		<paper.version>1.17-R0.1-SNAPSHOT</paper.version>
	</properties>
	
	<repositories>
		<repository>
			<id>codemc-repo</id>
			<url>https://repo.codemc.io/repository/nms/</url>
		</repository>
		<repository>
			<id>papermc</id>
			<url>https://papermc.io/repo/repository/maven-public/</url>
		</repository>
	</repositories>

	<dependencies>
		<dependency>
			<groupId>dev.jorel</groupId>
			<artifactId>commandapi-1.17-common</artifactId>
			<version>${project.version}</version>
			<classifier>mojang-mapped</classifier>
			<scope>provided</scope>
		</dependency>
		
		<!-- We don't naturally inherit nms-common, so we declare it here -->
		<dependency>
			<groupId>dev.jorel</groupId>
			<artifactId>commandapi-nms-common</artifactId>
			<version>${project.version}</version>
			<classifier>mojang-mapped</classifier>
			<scope>provided</scope>
		</dependency>

		<!-- Spigot compilation -->
		<!-- Include both mojang mapped and unmapped spigot so 1_17 common can be accessed before and after it is remapped -->
		<dependency>
			<groupId>org.spigotmc</groupId>
			<artifactId>spigot</artifactId>
			<version>${spigot.version}</version>
			<classifier>remapped-mojang</classifier>
			<scope>provided</scope>
		</dependency>

		<!-- Libraries -->
		<dependency>
			<groupId>io.papermc.paper</groupId>
			<artifactId>paper-api</artifactId>
			<version>${paper.version}</version>
			<scope>provided</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>net.md-5</groupId>
				<artifactId>specialsource-maven-plugin</artifactId>
				<version>1.2.4</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>remap</goal>
						</goals>
						<id>remap-obf</id>
						<configuration>
							<srgIn>org.spigotmc:minecraft-server:${minecraft.mappings}:txt:maps-mojang</srgIn>
							<reverse>true</reverse>
							<remappedDependencies>org.spigotmc:spigot:${minecraft.mappings}:jar:remapped-mojang</remappedDependencies>
							<remappedArtifactAttached>true</remappedArtifactAttached>
							<remappedClassifierName>remapped-obf</remappedClassifierName>
						</configuration>
					</execution>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>remap</goal>
						</goals>
						<id>remap-spigot</id>
						<configuration>
							<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
							<srgIn>org.spigotmc:minecraft-server:${minecraft.mappings}:csrg:maps-spigot</srgIn>
							<remappedDependencies>org.spigotmc:spigot:${minecraft.mappings}:jar:remapped-obf</remappedDependencies>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>