<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>
	<artifactId>client</artifactId>

	<parent>
		<groupId>ctbrec</groupId>
		<artifactId>master</artifactId>
		<version>4.4.4</version>
		<relativePath>../master</relativePath>
	</parent>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>15</maven.compiler.source>
		<maven.compiler.target>15</maven.compiler.target>
		<name.final>${project.groupId}-${project.version}-final</name.final>
	</properties>

	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>false</filtering>
			</resource>
			<resource>
				<directory>src/main/java</directory>
				<filtering>false</filtering>
				<includes>
					<include>**/*.css</include>
				</includes>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
				<includes>
					<include>version</include>
				</includes>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<executions>
					<execution>
						<id>assembly</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<finalName>${name.final}</finalName>
							<appendAssemblyId>false</appendAssemblyId>
							<descriptorRefs>
								<descriptorRef>jar-with-dependencies</descriptorRef>
							</descriptorRefs>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<dependencies>
		<dependency>
			<groupId>ctbrec</groupId>
			<artifactId>common</artifactId>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.openjfx</groupId>
			<artifactId>javafx-controls</artifactId>
		</dependency>
		<dependency>
			<groupId>org.openjfx</groupId>
			<artifactId>javafx-media</artifactId>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-servlet</artifactId>
		</dependency>
		<dependency>
			<groupId>com.vladsch.flexmark</groupId>
			<artifactId>flexmark</artifactId>
			<version>0.40.34</version>
		</dependency>
	</dependencies>

	<profiles>
		<profile>
			<id>win</id>
			<activation>
				<property>
					<name>javafx.platform</name>
					<value>win</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>com.akathist.maven.plugins.launch4j</groupId>
						<artifactId>launch4j-maven-plugin</artifactId>
						<version>1.7.25</version>
						<executions>
							<execution>
								<id>l4j-win</id>
								<phase>package</phase>
								<goals>
									<goal>launch4j</goal>
								</goals>
								<configuration>
									<headerType>gui</headerType>
									<outfile>target/ctbrec.exe</outfile>
									<jar>${name.final}.jar</jar>
									<dontWrapJar>true</dontWrapJar>
									<icon>src/main/resources/icon.ico</icon>
									<errTitle>ctbrec</errTitle>
									<classPath>
										<mainClass>ctbrec.ui.Launcher</mainClass>
										<addDependencies>false</addDependencies>
										<preCp>.</preCp>
									</classPath>
									<downloadUrl>https://jdk.java.net/</downloadUrl>
									<jre>
										<path>jre</path>
										<bundledJre64Bit>true</bundledJre64Bit>
										<minVersion>15</minVersion>
										<maxHeapSize>512</maxHeapSize>
										<opts>
											<opt>-Dfile.encoding=utf-8</opt>
										</opts>
									</jre>
									<versionInfo>
										<fileVersion>4.0.0.0</fileVersion>
										<txtFileVersion>4.0.0.0</txtFileVersion>
										<fileDescription>Software to record live streams</fileDescription>
										<copyright>2021 0xb00bface</copyright>
										<productVersion>4.0.0.0</productVersion>
										<txtProductVersion>4.0.0.0</txtProductVersion>
										<productName>CTB Recorder</productName>
										<internalName>ctbrec</internalName>
										<originalFilename>ctbrec.exe</originalFilename>
									</versionInfo>
									<splash>
										<file>src/main/resources/splash.bmp</file>
										<waitForWindow>true</waitForWindow>
										<timeout>60</timeout>
										<timeoutErr>true</timeoutErr>
									</splash>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-assembly-plugin</artifactId>
						<version>3.1.0</version>
						<executions>
							<execution>
								<id>zip</id>
								<phase>verify</phase>
								<goals>
									<goal>single</goal>
								</goals>
								<configuration>
									<finalName>ctbrec-${project.version}</finalName>
									<descriptors>
										<descriptor>src/assembly/win64-jre.xml</descriptor>
									</descriptors>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>linux</id>
			<activation>
				<property>
					<name>javafx.platform</name>
					<value>linux</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-assembly-plugin</artifactId>
						<version>3.1.0</version>
						<executions>
							<execution>
								<id>zip</id>
								<phase>verify</phase>
								<goals>
									<goal>single</goal>
								</goals>
								<configuration>
									<finalName>ctbrec-${project.version}</finalName>
									<descriptors>
										<descriptor>src/assembly/linux-jre.xml</descriptor>
									</descriptors>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>macos</id>
			<activation>
				<property>
					<name>javafx.platform</name>
					<value>mac</value>
				</property>
			</activation>
			<build>
				<plugins>
				<!-- 
					<plugin>
						<groupId>de.perdian.maven.plugins</groupId>
						<artifactId>macosappbundler-maven-plugin</artifactId>
						<version>1.10.1</version>
						<configuration>
							<plist>
								<CFBundleIconFile>src/main/resources/icon.icns</CFBundleIconFile>
								<CFBundleDisplayName>CTB Recorder</CFBundleDisplayName>
								<CFBundleDevelopmentRegion>English</CFBundleDevelopmentRegion>
								<CFBundleName>ctbrec</CFBundleName>
								<CFBundleURLTypes>
									<string>msa</string>
								</CFBundleURLTypes>
								<JVMMainClassName>ctbrec.ui.Launcher</JVMMainClassName>
								<JVMVersion>11+</JVMVersion>
								<JVMOptions>
									<string>-Dfile.encoding=utf-8</string>
								</JVMOptions>
								<JVMRuntimePath>Contents/Java/jdk/Contents/Home</JVMRuntimePath>
							</plist>
							<jdk>
								<include>true</include>
								<location>jre/jdk_macos</location>
							</jdk>
						</configuration>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>bundle</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-assembly-plugin</artifactId>
						<version>3.1.0</version>
						<executions>
							<execution>
								<id>zip</id>
								<phase>verify</phase>
								<goals>
									<goal>single</goal>
								</goals>
								<configuration>
									<finalName>ctbrec-${project.version}</finalName>
									<descriptors>
										<descriptor>src/assembly/macos-bundle.xml</descriptor>
									</descriptors>
								</configuration>
							</execution>
						</executions>
					</plugin>
				 -->
				 					<plugin>
						<artifactId>maven-assembly-plugin</artifactId>
						<version>3.1.0</version>
						<executions>
							<execution>
								<id>zip</id>
								<phase>verify</phase>
								<goals>
									<goal>single</goal>
								</goals>
								<configuration>
									<finalName>ctbrec-${project.version}</finalName>
									<descriptors>
										<descriptor>src/assembly/macos-jre.xml</descriptor>
									</descriptors>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>