<?xml version="1.0" encoding="UTF-8"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.mule.alsp</groupId>
		<artifactId>org.mule.alsp.parent</artifactId>
		<version>2.1.0-SNAPSHOT</version>
	</parent>

	<artifactId>LSPEclipseUpdateSite</artifactId>
	<packaging>eclipse-repository</packaging>
	<properties>
		<s3.serverId>mulesoft-s3</s3.serverId>
		<s3.update-bucket-name>api-editor</s3.update-bucket-name>
		<branch.name>latest</branch.name>
		<s3.updater-path-in-update-bucket>alsp/${branch.name}</s3.updater-path-in-update-bucket>
	</properties>
	<build>
		<plugins>
			<plugin>
		        <groupId>org.eclipse.tycho</groupId>
		        <artifactId>tycho-p2-repository-plugin</artifactId>		        
		        <configuration>
		            <compress>false</compress>
		            <includeAllDependencies>false</includeAllDependencies>		     		            
		        </configuration>
            </plugin>		
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-p2-publisher-plugin</artifactId>
				<configuration>
					<publishArtifacts>true</publishArtifacts>					
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.7</version>
				<executions>
					<execution>
						<id>upload-expanded-update-site-to-s3</id>
						<phase>deploy</phase>
						<configuration>
							<skip>${noS3Upload}</skip> <!-- Disable until S3 buckets etc. are created -->
							<failOnError>false</failOnError>
							<tasks>
								<taskdef resource="org/mule/ant/tasks.properties"
									classpathref="maven.plugin.classpath" />
								<s3delete endpoint="s3.amazonaws.com" key="${aws.key}"
									secret="${aws.secret}" bucket="${s3.update-bucket-name}"
									dir="${s3.updater-path-in-update-bucket}/" />
								<s3upload endpoint="s3.amazonaws.com" key="${aws.key}"
									secret="${aws.secret}" bucket="${s3.update-bucket-name}"
									publicRead="true" dest="${s3.updater-path-in-update-bucket}"
									contentType="application/x-whatever">
									<fileset dir="target/repository" />
								</s3upload>
							</tasks>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>org.mule</groupId>
						<artifactId>s3-ant-tasks</artifactId>
						<version>0.1-SNAPSHOT</version>
					</dependency>
					<dependency>
						<groupId>org.apache.ant</groupId>
						<artifactId>ant</artifactId>
						<version>1.7.1</version>
					</dependency>
					<dependency>
						<groupId>org.apache.ant</groupId>
						<artifactId>ant-jsch</artifactId>
						<version>1.7.1</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
		<extensions>
			<extension>
				<groupId>com.github.shyiko.servers-maven-extension</groupId>
				<artifactId>servers-maven-extension</artifactId>
				<version>1.2.0</version>
			</extension>
		</extensions>
	</build>

    <dependencies>  
       <dependency>
           <artifactId>org.mule.alsp</artifactId>
           <groupId>org.mule.alsp</groupId>
           <version>${project.version}</version>           
       </dependency>
       <dependency>
           <artifactId>org.mule.apieditor</artifactId>
           <groupId>org.mule.alsp</groupId>
           <version>${project.version}</version>           
       </dependency>
    </dependencies>

	<name>API Editor Update Site</name>

</project>
