<?xml version="1.0" encoding="UTF-8"?>
<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">
	<parent>
		<artifactId>gwt-material-parent</artifactId>
		<groupId>com.github.gwtmaterialdesign</groupId>
		<version>2.7.0</version>
	</parent>
	<modelVersion>4.0.0</modelVersion>

	<artifactId>gwt-material-themes</artifactId>
	<packaging>gwt-lib</packaging>
	<version>${parent.version}</version>

	<name>Gwt Material Themes</name>
	<description>Themes for gwt-material</description>

	<properties>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<maven-compiler-plugin.version>3.2</maven-compiler-plugin.version>
		<sass.source>${basedir}/src/main/sass/theme</sass.source>
		<sass.target>${basedir}/src/main/resources/gwt/material/design/themes</sass.target>
	</properties>

	<scm>
		<connection>scm:git:git@github.com:GwtMaterialDesign/gwt-material-themes.git</connection>
		<developerConnection>scm:git:git@github.com:GwtMaterialDesign/gwt-material-themes.git</developerConnection>
		<url>http://github.com/GwtMaterialDesign/gwt-material-themes</url>
		<tag>v2.7.0</tag>

	</scm>

	<licenses>
		<license>
			<name>Apache License Version 2</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
		</license>
	</licenses>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<name>Sonatype Nexus snapshot repository</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>sonatype-nexus-staging</id>
			<name>Sonatype Nexus release repository</name>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

	<dependencies>
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-user</artifactId>
			<version>${gwt.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-dev</artifactId>
			<version>${gwt.version}</version>
			<scope>provided</scope>
		</dependency>
	</dependencies>

	<repositories>
		<repository>
			<id>central</id>
			<name>Central Repository</name>
			<url>https://repo.maven.apache.org/maven2</url>
		</repository>
		<repository>
			<id>sonatype-nexus-snapshot</id>
			<name>Sonatype Nexus snapshot repository</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</repository>
	</repositories>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>${surefire.version}</version>
				<configuration>
					<excludes>
						<exclude>**/*Test.java</exclude>
					</excludes>
					<additionalClasspathElements>
						<additionalClasspathElement>${project.build.sourceDirectory}</additionalClasspathElement>
						<additionalClasspathElement>${project.build.testSourceDirectory}</additionalClasspathElement>
					</additionalClasspathElements>
					<useManifestOnlyJar>false</useManifestOnlyJar>
					<forkMode>always</forkMode>
				</configuration>
			</plugin>
			<plugin>
				<groupId>net.ltgt.gwt.maven</groupId>
				<artifactId>gwt-maven-plugin</artifactId>
				<version>${tbroyer.version}</version>
				<extensions>true</extensions>
				<configuration>
					<moduleName>gwt.material.design.themes.ThemeBase</moduleName>
					<style>OBFUSCATED</style>
					<logLevel>INFO</logLevel>
					<sourceLevel>1.8</sourceLevel>
					<jvmArgs>
						<jvmArg>-Xmx1g</jvmArg>
						<jvmArg>-Xms1g</jvmArg>
						<jvmArg>-XX:CompileThreshold=7000</jvmArg>
					</jvmArgs>
					<optimize>9</optimize>
					<compilerArgs>
						<compilerArg>-compileReport</compilerArg>
						<compilerArg>-XcompilerMetrics</compilerArg>
					</compilerArgs>
					<skipModule>true</skipModule>
					<classpathScope>compile+runtime</classpathScope>
					<failOnError>true</failOnError>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>compile</goal>
							<goal>test</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>generate-all-themes</id>

			<dependencies>
				<dependency>
					<groupId>com.samaxes.maven</groupId>
					<artifactId>minify-maven-plugin</artifactId>
					<version>1.7.4</version>
				</dependency>
			</dependencies>
			<build>
				<plugins>

					<!-- SASS Compiler -->
					<plugin>
						<groupId>com.github.warmuuh</groupId>
						<artifactId>libsass-maven-plugin</artifactId>
						<version>0.2.10-libsass_3.5.3</version>
						<executions>
							<!-- Amber Theme -->
							<execution>
								<id>amber-theme</id>
								<phase>package</phase>
								<goals>
									<goal>compile</goal>
								</goals>
								<configuration>
									<inputPath>${sass.source}/amber</inputPath>
									<outputPath>${sass.target}/amber/css</outputPath>
									<generateSourceMap>false</generateSourceMap>
								</configuration>
							</execution>
							<!-- Blue Theme -->
							<execution>
								<id>blue-theme</id>
								<phase>package</phase>
								<goals>
									<goal>compile</goal>
								</goals>
								<configuration>
									<inputPath>${sass.source}/blue</inputPath>
									<outputPath>${sass.target}/blue/css</outputPath>
									<generateSourceMap>false</generateSourceMap>
								</configuration>
							</execution>
							<!-- Brown Theme -->
							<execution>
								<id>brown-theme</id>
								<phase>package</phase>
								<goals>
									<goal>compile</goal>
								</goals>
								<configuration>
									<inputPath>${sass.source}/brown</inputPath>
									<outputPath>${sass.target}/brown/css</outputPath>
									<generateSourceMap>false</generateSourceMap>
								</configuration>
							</execution>
							<!-- Green Theme -->
							<execution>
								<id>green-theme</id>
								<phase>package</phase>
								<goals>
									<goal>compile</goal>
								</goals>
								<configuration>
									<inputPath>${sass.source}/green</inputPath>
									<outputPath>${sass.target}/green/css</outputPath>
									<generateSourceMap>false</generateSourceMap>
								</configuration>
							</execution>
							<!-- Grey Theme -->
							<execution>
								<id>grey-theme</id>
								<phase>package</phase>
								<goals>
									<goal>compile</goal>
								</goals>
								<configuration>
									<inputPath>${sass.source}/grey</inputPath>
									<outputPath>${sass.target}/grey/css</outputPath>
									<generateSourceMap>false</generateSourceMap>
								</configuration>
							</execution>
							<!-- Orange Theme -->
							<execution>
								<id>orange-theme</id>
								<phase>package</phase>
								<goals>
									<goal>compile</goal>
								</goals>
								<configuration>
									<inputPath>${sass.source}/orange</inputPath>
									<outputPath>${sass.target}/orange/css</outputPath>
									<generateSourceMap>false</generateSourceMap>
								</configuration>
							</execution>
							<!-- Pink Theme -->
							<execution>
								<id>pink-theme</id>
								<phase>package</phase>
								<goals>
									<goal>compile</goal>
								</goals>
								<configuration>
									<inputPath>${sass.source}/pink</inputPath>
									<outputPath>${sass.target}/pink/css</outputPath>
									<generateSourceMap>false</generateSourceMap>
								</configuration>
							</execution>
							<!-- Purple Theme -->
							<execution>
								<id>purple-theme</id>
								<phase>package</phase>
								<goals>
									<goal>compile</goal>
								</goals>
								<configuration>
									<inputPath>${sass.source}/purple</inputPath>
									<outputPath>${sass.target}/purple/css</outputPath>
									<generateSourceMap>false</generateSourceMap>
								</configuration>
							</execution>
							<!-- Red Theme -->
							<execution>
								<id>red-theme</id>
								<phase>package</phase>
								<goals>
									<goal>compile</goal>
								</goals>
								<configuration>
									<inputPath>${sass.source}/red</inputPath>
									<outputPath>${sass.target}/red/css</outputPath>
									<generateSourceMap>false</generateSourceMap>
								</configuration>
							</execution>
							<!-- Yellow Theme -->
							<execution>
								<id>yellow-theme</id>
								<phase>package</phase>
								<goals>
									<goal>compile</goal>
								</goals>
								<configuration>
									<inputPath>${sass.source}/yellow</inputPath>
									<outputPath>${sass.target}/yellow/css</outputPath>
									<generateSourceMap>false</generateSourceMap>
								</configuration>
							</execution>
							<!-- Custom Theme -->
							<execution>
								<id>custom-theme</id>
								<phase>package</phase>
								<goals>
									<goal>compile</goal>
								</goals>
								<configuration>
									<inputPath>${sass.source}/custom</inputPath>
									<outputPath>${sass.target}/custom/css</outputPath>
									<generateSourceMap>false</generateSourceMap>
								</configuration>
							</execution>
							<!-- Dark Theme -->
							<execution>
								<id>dark-theme</id>
								<phase>package</phase>
								<goals>
									<goal>compile</goal>
								</goals>
								<configuration>
									<inputPath>${sass.source}/dark</inputPath>
									<outputPath>${sass.target}/dark/css</outputPath>
									<generateSourceMap>false</generateSourceMap>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<!-- CSS Compressor -->
					<plugin>
						<groupId>com.samaxes.maven</groupId>
						<artifactId>minify-maven-plugin</artifactId>
						<version>1.7.4</version>
						<executions>
							<execution>
								<id>default-minify</id>
								<phase>package</phase>
								<goals>
									<goal>minify</goal>
								</goals>
								<configuration>
									<charset>UTF-8</charset>
									<webappSourceDir>${sass.target}</webappSourceDir>
									<webappTargetDir>${basedir}/src/main/resources/gwt/material/design/themes</webappTargetDir>
									<cssSourceDir>/</cssSourceDir>
									<cssSourceIncludes>
										<cssSourceInclude>**/css/*.css</cssSourceInclude>
									</cssSourceIncludes>

									<cssSourceExcludes>
										<cssSourceExclude>**/*.min.css</cssSourceExclude>
									</cssSourceExcludes>
									<skipMerge>true</skipMerge>
									<cssEngine>YUI</cssEngine>
									<jsEngine>CLOSURE</jsEngine>
									<closureCompilationLevel>SIMPLE_OPTIMIZATIONS</closureCompilationLevel>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
