Skip to content

Commit

Permalink
Simplify build process
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Apr 15, 2021
1 parent dd45b96 commit b63aa8c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 111 deletions.
15 changes: 3 additions & 12 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,15 @@ set -e
echo '==========================='
echo 'Build Modes'
echo '------'
echo 'Java 8'
echo ' 1. Full build with tests'
echo ' 2. Fast build with no tests'
echo ' 1. Build with tests (Slow)'
echo ' 2. Build with no tests (Fast)'
echo '------'
echo 'Java 11 or higher'
echo ' 3. Full build with tests'
echo ' 4. Fast build with no tests'
echo '------'
echo ' 5. Exit'
echo ' 3. Exit'
echo '==========================='
echo -n 'Enter build mode: '
read mode
if [[ $mode == '1' ]]; then
./mvnw clean package;
elif [[ $mode == '2' ]]; then
./mvnw clean package -Dmaven.test.skip -Dcheckstyle.skip;
elif [[ $mode == '3' ]]; then
./mvnw clean package -P java11;
elif [[ $mode == '4' ]]; then
./mvnw clean package -Dmaven.test.skip -Dcheckstyle.skip -P java11;
fi;
28 changes: 7 additions & 21 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,18 @@
ECHO ===========================
ECHO Build Modes
ECHO ------
ECHO Java 8
ECHO 1. Full build with tests
ECHO 2. Fast build with no tests
ECHO 1. Build with tests (Slow)
ECHO 2. Build with no tests (Fast)
ECHO ------
ECHO Java 11 or higher
ECHO 3. Full build with tests
ECHO 4. Fast build with no tests
ECHO ------
ECHO 5. Exit
ECHO 3. Exit
ECHO ===========================
SET /P MODE=Mode:
IF %MODE%==1 GOTO FULL8
IF %MODE%==2 GOTO FAST8
IF %MODE%==3 GOTO FULL11
IF %MODE%==4 GOTO FAST11
IF %MODE%==5 GOTO END
:FULL8
IF %MODE%==1 GOTO FULL
IF %MODE%==2 GOTO FAST
:FULL
call mvnw clean package
GOTO END
:FAST8
:FAST
call mvnw clean package -Dmaven.test.skip -Dcheckstyle.skip
GOTO END
:FULL11
call mvnw clean package -P java11
GOTO END
:FAST11
call mvnw clean package -Dmaven.test.skip -Dcheckstyle.skip -P java11
GOTO END
:END
118 changes: 40 additions & 78 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,84 +41,6 @@
<url>https://github.com/Col-E/jdk-tools-mirror/raw/master/repository/</url>
</repository>
</repositories>
<!-- Profiles, for version-specific dependencies / build plugin config -->
<profiles>
<profile>
<id>java8</id>
<properties>
<target.version>J8</target.version>
</properties>
<activation>
<!-- Use this profile for JDK 8 -->
<jdk>1.8</jdk>
</activation>
<build>
<plugins>
<!-- Compiler version -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<arg>-Xlint:unchecked</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>java11</id>
<properties>
<target.version>J11</target.version>
</properties>
<activation>
<!-- Use this profile for JDK 11 and newer -->
<jdk>[11, 13]</jdk>
</activation>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-base -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>${jfx.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-graphics -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>${jfx.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-controls -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${jfx.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-media -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-media</artifactId>
<version>${jfx.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Compiler version -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<!-- Dependencies, not jdk version specific -->
<dependencies>
<!-- Functionality -->
Expand Down Expand Up @@ -312,6 +234,34 @@
<version>8.0</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-base -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>${jfx.version}</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-graphics -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>${jfx.version}</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-controls -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${jfx.version}</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-media -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-media</artifactId>
<version>${jfx.version}</version>
<scope>provided</scope>
</dependency>
<!--- Testing -->
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
Expand Down Expand Up @@ -372,6 +322,18 @@
</resource>
</resources>
<plugins>
<!-- Compiler version -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<arg>-Xlint:unchecked</arg>
</compilerArgs>
</configuration>
</plugin>
<!-- Maven version enforcement -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down

0 comments on commit b63aa8c

Please sign in to comment.