<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>
  <groupId>de.uni-muenchen.phonetik</groupId>
  <artifactId>ips.speechrecorder.manual</artifactId>
  <version>6.2.7</version>
  <licenses>
		<license>
			<name>GNU Lesser General Public License version 3</name>
			<url>https://www.gnu.org/licenses/lgpl-3.0.en.html</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	<repositories>
		<repository>
			<id>IPS-WWW</id>
			<name>IPS</name>
			<url>https://www.phonetik.uni-muenchen.de/Bas/software/repos/maven/</url>
		</repository>
	</repositories>
	<distributionManagement>
		<repository>
			<id>IPS-WWW-files</id>
			<url>${ips.distributionManagementURL}</url>
		</repository>
	</distributionManagement>
	<properties>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>

	</properties>
	<organization>
		<name>Institute of Phonetics and Speech Processing</name>
		<url>https://www.phonetik.uni-muenchen.de</url>
	</organization>
	<dependencies>
	<!--  Only required for  ipsk.apps.speechrecorder.utils.TextToJavaHelpGraphicsHelper -->
		<dependency>
			<groupId>de.uni-muenchen.phonetik</groupId>
			<artifactId>ips.speechrecorder</artifactId>
			<version>6.8.5</version>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>3.3.0</version>
				<executions>
					<execution>
						<id>copy-manual-for-build</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>

						<configuration>
							<outputDirectory>${basedir}/src/manual/build</outputDirectory>
							<resources>
								<resource>
									<directory>src/manual/source</directory>

								</resource>
							</resources>
						</configuration>
					</execution>
					
					<execution>
						<id>copy-manual-for-JAR</id>
						<phase>process-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>

						<configuration>
							<outputDirectory>${project.build.directory}/generated-resources/ipsk/apps/speechrecorder/manual</outputDirectory>
							<resources>
								<resource>
									<directory>${basedir}/src/manual/build/SpeechRecorderUserManual_jh-doc</directory>

								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>copy-generated-manual</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>

						<configuration>
						<outputDirectory>${project.build.outputDirectory}</outputDirectory>
							<resources>
								<resource>
									<directory>${project.build.directory}/generated-resources</directory>
								</resource>
							</resources>
						</configuration>
					</execution>
						
				</executions>
			</plugin>

			<plugin>
				<artifactId>exec-maven-plugin</artifactId>
				<groupId>org.codehaus.mojo</groupId>
				<version>3.1.0</version>
				<executions>

					<!-- Note for Eclispe: Window > Preferences > Maven > Errors/Warnings 
						> Plugin execution not covered by lifecycle configuration. Select Ignore 
						/ Warning / Error as you wish. -->
 
					<execution>
						<id>manual-pdflatex1</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>exec</goal>
						</goals>
						<configuration>
							<workingDirectory>${basedir}/src/manual/build</workingDirectory>
							<executable>pdflatex</executable>
							<arguments>
								<argument>SpeechRecorderUserManual.tex</argument>
							</arguments>
						</configuration>
					</execution>
					<execution>
						<id>manual-bibtex</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>exec</goal>
						</goals>
						<configuration>
							<workingDirectory>${basedir}/src/manual/build</workingDirectory>
							<executable>bibtex</executable>
							<arguments>
								<argument>SpeechRecorderUserManual</argument>
							</arguments>
						</configuration>
					</execution>
					<execution>
						<id>manual-pdflatex2</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>exec</goal>
						</goals>
						<configuration>
							<workingDirectory>${basedir}/src/manual/build</workingDirectory>
							<executable>pdflatex</executable>
							<arguments>
								<argument>SpeechRecorderUserManual.tex</argument>
							</arguments>
						</configuration>
					</execution>
					<execution>
						<id>manual-pdflatex3</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>exec</goal>
						</goals>
						<configuration>
							<workingDirectory>${basedir}/src/manual/build</workingDirectory>
							<executable>pdflatex</executable>
							<arguments>
								<argument>SpeechRecorderUserManual.tex</argument>
							</arguments>
						</configuration>
					</execution>
					<execution>
						<id>manual-html</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>exec</goal>
						</goals>
						<configuration>

							<workingDirectory>${basedir}/src/manual/build</workingDirectory>
							<executable>latex2html</executable>
							<arguments>
								<argument>-local_icons</argument>
								<argument>SpeechRecorderUserManual.tex</argument>
							</arguments>
						</configuration>
					</execution>
  
					<execution>
						<id>manual-text-to-javahelp-graphics-helper</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>java</goal>
						</goals>
						<configuration>

							<mainClass>ipsk.apps.speechrecorder.utils.TextToJavaHelpGraphicsHelper</mainClass>
							<workingDirectory>${basedir}/src/manual/build</workingDirectory>
							<arguments>
								
								<argument>${basedir}/src/manual/build/SpeechRecorderUserManual.tex</argument>
								<argument>${basedir}/src/manual/build/SpeechRecorderUserManual_jh.tex</argument>
								<argument>${basedir}/src/manual/build/SpeechRecorderUserManual_jh-doc</argument>
								
							</arguments>
						</configuration>
					</execution>
					
					<!-- <target name="manual_javahelp_htlatex"> <mkdir dir="${manual}/build/${javaHelpBuild}" 
						/> <exec dir="${manual}/build" executable="htlatex" > <arg value="SpeechRecorderUserManual_jh.tex" 
						/> <arg value="html,3.2,xml,javahelp,3,unicode" /> <arg value=" -cmozhtf 
						-u10" /> <arg value="-d${javaHelpBuild}/ -cjavahelp" /> </exec> </target> -->
	  
	  				<!--  
					<execution>
						<id>manual-javahelp</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>exec</goal>
						</goals>
						<configuration>

							<workingDirectory>${project.build.directory}/manual</workingDirectory>
							<executable>htlatex</executable>
							<toolchain></toolchain>
							<commandlineArgs>SpeechRecorderUserManual_jh.tex "html,3.2,xml,javahelp,unicode" " -cmozhtf -u10"  "-dSpeechRecorderUserManual_jh-doc/ -cjavahelp"</commandlineArgs>
							
						</configuration>
					</execution>
					-->
					</executions>
					</plugin>
	<plugin>
		<artifactId>maven-antrun-plugin</artifactId>
		<version>3.0.0</version>
		<executions>
			<execution>
			<id>Build-JavaHelp-manual</id>
				<phase>generate-resources</phase>
				<configuration>
					<target>
					
					
					
					
						<mkdir dir="${basedir}/src/manual/build/SpeechRecorderUserManual_jh-doc" />
			
			<exec dir="${basedir}/src/manual/build" executable="htlatex" >
				<arg value="SpeechRecorderUserManual_jh.tex" />
				<arg value="html,3.2,xml,javahelp,3,unicode" />
				<arg value=" -cmozhtf -u10" />
				<arg value="-dSpeechRecorderUserManual_jh-doc/ -cjavahelp" />
			</exec>
						
						<fileset id="jhHtmlSet"
							dir="${basedir}/src/manual/build/SpeechRecorderUserManual_jh-doc">
							<include name="*.html" />
						</fileset>

						<!-- Converts set to path, path separator is a blank, flattenmappaer 
							converts full pathes to flat file name -->
						<pathconvert refid="jhHtmlSet" property="jhHtmlInline"
							pathsep=" ">
							<flattenmapper />
						</pathconvert>
						<!-- call jhindexer -->
						<exec
							dir="${basedir}/src/manual/build/SpeechRecorderUserManual_jh-doc"
							executable="jhindexer">
							<arg value="-db" />
							<arg value="SpeechRecorderUserManual_jh-jhs" />
							<arg line="${jhHtmlInline}" />
						</exec>
					</target>
				</configuration>
				<goals>
					<goal>run</goal>
				</goals>
			</execution>
			<execution>
			<!--  TODO folder for each major version -->
			<id>Deploy-to-WWW</id>
						<phase>deploy</phase>
						<configuration>
							<target>
								<copy toDir="${test.ips.apps.speechrecorder.deploy.dir}/manual">
									<fileset dir="src/manual/build" />
								</copy>
							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
		</executions>
	</plugin>
	<plugin>
			<artifactId>maven-assembly-plugin</artifactId>
						<version>3.1.1</version>
						<configuration>
							<descriptors>
								<descriptor>src/assembly/document.xml</descriptor>
								<descriptor>src/assembly/html.xml</descriptor>
							</descriptors>
						</configuration>
						<executions>
							<execution>
								<id>make-assembly</id> 
								<phase>package</phase>
								<goals>
									<goal>single</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
		<plugin>
    <artifactId>maven-clean-plugin</artifactId>
    <version>3.2.0</version>
    <configuration>
      <filesets>
        <fileset>
          <directory>src/manual/build</directory>
         
          <followSymlinks>false</followSymlinks>
        </fileset>
      </filesets>
    </configuration>
  </plugin>
		</plugins>
	
	</build>
</project>
