<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>wcomponents-theme</artifactId>

	<parent>
		<groupId>com.github.bordertech.wcomponents</groupId>
		<artifactId>wcomponents-parent</artifactId>
		<version>1.5.21</version>
	</parent>

	<packaging>jar</packaging>

	<description>
		Core client-side WComponents.
	</description>

	<properties>
		<theme.skip.antrun>false</theme.skip.antrun>
		<sonar.sources>src/main</sonar.sources>
		<node.download.root>http://nodejs.org/dist/</node.download.root>
		<npm.download.root>http://registry.npmjs.org/npm/-/</npm.download.root>
		<yarn.download.root>https://github.com/yarnpkg/yarn/releases/download/</yarn.download.root>
		<nodejs.version>v10.16.3</nodejs.version><!-- the version of node to be installed -->
		<npmjs.version>6.9.0</npmjs.version><!-- the version of npm to be installed - should be the version that goes with your version of node -->
		<yarn.version>v1.19.0</yarn.version>
	</properties>
	<name>wcomponents-theme</name>
	<build>
		<plugins>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>3.1.1</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<ignoreMissingDescriptor>true</ignoreMissingDescriptor>
					<descriptors>
						<descriptor>sources.xml</descriptor>
					</descriptors>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.github.eirslett</groupId>
				<artifactId>frontend-maven-plugin</artifactId>
				<version>1.8.0</version>
				<configuration>
					<workingDirectory>${basedir}</workingDirectory>
				</configuration>
				<executions>
					<execution>
						<id>install node and yarn</id>
						<goals>
							<goal>install-node-and-yarn</goal>
						</goals>
						<phase>generate-resources</phase>
						<configuration>
							<skip>${theme.skip.antrun}</skip>
							<nodeVersion>${nodejs.version}</nodeVersion>
							<yarnVersion>${yarn.version}</yarnVersion>
							<nodeDownloadRoot>${node.download.root}</nodeDownloadRoot>
							<yarnDownloadRoot>${yarn.download.root}</yarnDownloadRoot>
						</configuration>
					</execution>
					<execution>
						<id>yarn install</id>
						<goals>
							<goal>yarn</goal>
						</goals>
						<configuration>
							<skip>${theme.skip.antrun}</skip>
						</configuration>
					</execution>
					<execution>
						<id>yarn version</id>
						<goals>
							<goal>yarn</goal>
						</goals>
						<configuration>
							<skip>${theme.skip.antrun}</skip>
							<arguments>version --no-git-tag-version --new-version ${project.version}</arguments>
							<!--<arguments>version ${project.version} - -allow-same-version true</arguments>-->
						</configuration>
					</execution>
					<execution>
						<id>yarn run build</id>
						<phase>compile</phase>
						<goals>
							<goal>yarn</goal>
						</goals>
						<configuration>
							<skip>${theme.skip.antrun}</skip>
							 <arguments>run build</arguments>
						</configuration>
					</execution>
					<execution>
						<id>yarn run test</id>
						<phase>test</phase>
						<goals>
							<goal>yarn</goal>
						</goals>
						<configuration>
							<skip>${theme.skip.antrun}</skip>
							 <arguments>run test</arguments>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
