<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>org.jsweet</groupId>
	<artifactId>j4ts</artifactId>
	<version>2.0.0</version>
	<name>j4ts</name>
	<description>JS runtime for Java API support used wrapped as a JSweet candy</description>
	<url>http://www.jsweet.org</url>
	
<developers>
		<developer>
			<id>rpawlak</id>
			<name>Renaud Pawlak</name>
			<email>renaud.pawlak@gmail.com</email>
		</developer>
		<developer>
			<id>lgrignon</id>
			<name>Louis Grignon</name>
			<email>louis.grignon@gmail.com</email>
		</developer>
	</developers>
	<issueManagement>
		<url>https://github.com/j4ts/j4ts/issues</url>
		<system>GitHub Issues</system>
	</issueManagement>
<scm>
		<url>https://github.com/j4ts/j4ts</url>
		<connection>scm:git:git://github.com/j4ts/j4ts.git</connection>
		<developerConnection>scm:git:git@github.com:j4ts/j4ts.git</developerConnection>
	</scm>
	<properties>
		<jsweet.transpiler.version>3.0.0</jsweet.transpiler.version>
		
		<java.version.release>8</java.version.release>
		<java.version>1.${java.version.release}</java.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>
	
	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	<repositories>
		<repository>
			<id>jsweet-central</id>
			<name>libs-release</name>
			<url>http://repository.jsweet.org/artifactory/libs-release-local</url>
		</repository>
		<repository>
			<snapshots />
			<id>jsweet-snapshots</id>
			<name>libs-snapshot</name>
			<url>http://repository.jsweet.org/artifactory/libs-snapshot-local</url>
		</repository>
	</repositories>
	<pluginRepositories>
		<pluginRepository>
			<id>jsweet-plugins-release</id>
			<name>plugins-release</name>
			<url>http://repository.jsweet.org/artifactory/plugins-release-local</url>
		</pluginRepository>
		<pluginRepository>
			<snapshots />
			<id>jsweet-plugins-snapshots</id>
			<name>plugins-snapshot</name>
			<url>http://repository.jsweet.org/artifactory/plugins-snapshot-local</url>
		</pluginRepository>
	</pluginRepositories>
	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
				<configuration>
					<release>${java.version.release}</release>
					<compilerVersion>${java.version}</compilerVersion>
					<source>${java.version}</source>
					<target>${java.version}</target>
					<encoding>${project.build.sourceEncoding}</encoding>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.jsweet</groupId>
				<artifactId>jsweet-maven-plugin</artifactId>
				<version>${jsweet.transpiler.version}</version>
				<configuration>
					<verbose>true</verbose>
					<sourceMap>false</sourceMap>
					<outDir>target/js</outDir>
					<tsserver>true</tsserver>
					<targetVersion>ES6</targetVersion>
					<candiesJsOut>target/candies</candiesJsOut>
				</configuration>
				<executions>
					<execution>
						<id>generate-js</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>jsweet</goal>
						</goals>
					</execution>
					<execution>
						<id>clean</id>
						<phase>clean</phase>
						<goals>
							<goal>clean</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
 			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.8</version>
				<executions>
					<execution>
						<phase>prepare-package</phase>
						<configuration>
							<target>
								<echo message="copying js files to artifact's JSweet dir" />
								<delete dir="src/main/resources/META-INF/resources"></delete>
								<copy
									file="src/main/js/bundle.js"
									tofile="src/main/resources/META-INF/resources/webjars/${project.artifactId}/${project.version}/bundle.js"
									verbose="true" />
								<copy
									file="target/js/org/jsweet/j4ts/Manifest.js"
									todir="src/main/resources/META-INF/resources/webjars/${project.artifactId}/${project.version}"
									verbose="true" />
								<copy
									file="src/main/js/bundle.d.ts"
									tofile="src/main/resources/META-INF/resources/typings/${project.artifactId}/${project.version}/bundle.d.ts"
									verbose="true" />
									
								<echo message="copying generated bundles to dist..." />
								<copy
									file="src/main/js/bundle.js"
									tofile="dist/${project.artifactId}.js" verbose="true" />
								<copy
									file="target/js/org/jsweet/j4ts/Manifest.js"
									todir="dist" verbose="true" />
								<copy
									file="src/main/js/bundle.d.ts"
									tofile="dist/${project.artifactId}.d.ts" verbose="true" />
							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.1.0</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.1.1</version>
				<configuration>
					<sourcepath>src/main/java</sourcepath>
					<encoding>${project.build.sourceEncoding}</encoding>
					<skip>${skipJavadoc}</skip>
					<excludePackageNames>org.jsweet.transpiler.model.support</excludePackageNames>
					<fixTags>all</fixTags>
					<failOnError>false</failOnError>
					<destDir>jsweet-transpiler-${project.version}</destDir>
					<header><![CDATA[<a href="http://www.jsweet.org" target="_blank" style="text-transform: lowercase">http://www.jsweet.org<a>]]></header>
					<bottom><![CDATA[<center>Copyright 2015, <a href="http://www.cincheo.org" target="_blank">Cinchéo SAS<a> - Web site: <a href="http://www.jsweet.org" target="_blank">http://www.jsweet.org<a><center>]]></bottom>
					<stylesheetfile>/var/www/apidocs/stylesheet.css</stylesheetfile>
				</configuration>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>1.6</version>
				<configuration>
					<skip>${skipSigning}</skip>
				</configuration>
				<executions>
					<execution>
						<id>sign-artifacts</id>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

		</plugins>
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.jsweet
										</groupId>
										<artifactId>
											jsweet-maven-plugin
										</artifactId>
										<versionRange>
											[1.1.0-SNAPSHOT,)
										</versionRange>
										<goals>
											<goal>jsweet</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jsweet</groupId>
			<artifactId>jsweet-transpiler</artifactId>
			<version>${jsweet.transpiler.version}</version>
		</dependency>
	</dependencies>

	<distributionManagement>
		<repository>
			<id>jsweet-release</id>
			<name>libs-release</name>
			<url>http://repository.jsweet.org/artifactory/libs-release-local</url>
		</repository>
		<snapshotRepository>
			<id>jsweet-snapshots</id>
			<name>libs-snapshot</name>
			<url>http://repository.jsweet.org/artifactory/libs-snapshot-local</url>
		</snapshotRepository>
	</distributionManagement>
	<organization>
		<name>JSweet</name>
		<url>http://www.jsweet.org</url>
	</organization>

</project>
