Add a development build profile

This commit is contained in:
fullwall 2023-06-15 00:23:33 +08:00
parent 6750225f5d
commit 98cb901a79
3 changed files with 228 additions and 68 deletions

View File

@ -6,16 +6,16 @@ Sign the CLA [here](https://cla-assistant.io/CitizensDev/Citizens2)
Development environment setup
=============================
1. Clone Citizens2 and CitizensAPI repos to your machine
2. Import the maven project to your IDE of choice. Citizens targets Java 8, and Java 9+ code should not be used.
2. Import the maven project to your IDE of choice. Citizens targets Java 8 - Java 9+ code should not be used.
Citizens is structured using an overarching maven project with several submodules for different parts of the codebase
`api` - the API, with a loosely defined boundary but mainly containing interfaces and events that are agnostic to the lifecycle of a Spigot plugin
`main` - the main Citizens codebase which implements commands and Spigot plugin-specific code
`dist` - the distribution subproject which will actually build your Citizens JAR
NMS submodules, from 1.8.8 - the current Minecraft version (excluding 1.9)
`dist` - the distribution subproject which will actually build your Citizens JAR with relevant submodules
3. Next, run Spigot's BuildTools.jar for all the currently supported Minecraft versions to install the Spigot JARs to your local maven repo (see `dist/pom.xml` for the current list)
Try to build your first Citizens2 JAR using `mvn install dist/pom.xml`
3. Next, run Spigot's BuildTools.jar for all supported Minecraft versions to install the Spigot JARs to your local maven repo (see `dist/pom.xml` for the current list)
We recommend using the `dev` maven build profile which will only build for the latest Minecraft version. This saves you having to install 10 different old versions.
Try to build your first Citizens2 JAR using `mvn install dist/pom.xml -P dev`
Now you're ready to start creating a pull request!

123
dist/pom.xml vendored
View File

@ -49,6 +49,12 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>spigot-release</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
@ -100,4 +106,121 @@
<scope>compile</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>full</id>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>citizens-main</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>citizens-v1_8_R3</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>citizens-v1_10_R1</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>citizens-v1_11_R1</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>citizens-v1_12_R1</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>citizens-v1_13_R2</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>citizens-v1_14_R1</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>citizens-v1_15_R1</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>citizens-v1_16_R3</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>citizens-v1_17_R1</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>citizens-v1_18_R2</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>citizens-v1_19_R3</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>citizens-v1_20_R1</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>dev</id>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>citizens-main</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>citizens-v1_20_R1</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>

39
pom.xml
View File

@ -1,5 +1,7 @@
<?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">
<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>
<packaging>pom</packaging>
<groupId>net.citizensnpcs</groupId>
@ -30,6 +32,12 @@
<build>
<defaultGoal>clean package install</defaultGoal>
</build>
<profiles>
<profile>
<id>spigot-release</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<modules>
<module>main</module>
<module>v1_8_R3</module>
@ -40,4 +48,33 @@
<module>v1_20_R1</module>
<module>dist</module>
</modules>
</profile>
<profile>
<id>full</id>
<modules>
<module>main</module>
<module>v1_8_R3</module>
<module>v1_10_R1</module>
<module>v1_11_R1</module>
<module>v1_12_R1</module>
<module>v1_13_R2</module>
<module>v1_14_R1</module>
<module>v1_15_R1</module>
<module>v1_16_R3</module>
<module>v1_17_R1</module>
<module>v1_18_R2</module>
<module>v1_19_R3</module>
<module>v1_20_R1</module>
<module>dist</module>
</modules>
</profile>
<profile>
<id>dev</id>
<modules>
<module>main</module>
<module>v1_20_R1</module>
<module>dist</module>
</modules>
</profile>
</profiles>
</project>