New module to download appengine-sdk and install in yoru local maven repo. This is to avoid checken-egg thing, where you start from a clean maven repo and the dependency is not there yet failing the module before you could download and install it

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@830807 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
lresende 2009-10-29 00:23:25 +00:00
parent 72551516cb
commit b62097b160
2 changed files with 177 additions and 0 deletions

View file

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
-->
<project name="AppEngineSDKInstaller">
<property name="appengine.version" value="1.2.6"/>
<property name="appengine.distribution.location" value="http://googleappengine.googlecode.com/files/appengine-java-sdk-${appengine.version}.zip" />
<property name="unpack.location" value="${basedir}/target/appengine-java-sdk-${appengine.version}"/>
<property name="appengine.tools.api" value="${basedir}/target/appengine-java-sdk-${appengine.version}/lib/appengine-tools-api.jar"/>
<property name="appengine.api" value="${basedir}/target/appengine-java-sdk-${appengine.version}/lib/impl/appengine-api.jar"/>
<property name="appengine.local.runtime.shared" value="${basedir}/target/appengine-java-sdk-${appengine.version}/lib/shared/appengine-local-runtime-shared.jar"/>
<property name="localRepository" value="${user.home}/.m2/repository"/>
<target name="check-installed">
<condition property="already.installed" >
<available file="${localRepository}/com/google/appengine-java-sdk/${appengine.version}/appengine-java-sdk-${appengine.version}.zip"/>
</condition>
<condition property="maven.suffix" value="">
<os family="unix"/>
</condition>
<condition property="maven.suffix" value=".bat">
<os family="windows"/>
</condition>
</target>
<target name="check-unpacked">
<condition property="already.unpacked" >
<available file="${unpack.location}"/>
</condition>
</target>
<target name="install" depends="check-installed" unless="already.installed">
<mkdir dir="${basedir}/target/appengine-download/"/>
<get src="${appengine.distribution.location}"
dest="${basedir}/target/appengine-download/appengine-java-sdk-${appengine.version}.zip"
verbose="true"
usetimestamp="true"/>
<exec executable="mvn${maven.suffix}" dir="${basedir}" failonerror="false">
<arg line="install:install-file -DgroupId=com.google -DartifactId=appengine-java-sdk -Dversion=${appengine.version} -Dpackaging=zip -DgeneratePom=true -Dfile=${basedir}/target/appengine-download/appengine-java-sdk-${appengine.version}.zip"/>
</exec>
<antcall target="unpack-appengine-sdk"/>
<exec executable="mvn${maven.suffix}" dir="${basedir}" failonerror="false">
<arg line="install:install-file -DgroupId=com.google.appengine -DartifactId=appengine-tools -Dversion=${appengine.version} -Dpackaging=jar -DgeneratePom=true -Dfile=${appengine.tools.api}"/>
</exec>
<exec executable="mvn${maven.suffix}" dir="${basedir}" failonerror="false">
<arg line="install:install-file -DgroupId=com.google.appengine -DartifactId=appengine-api -Dversion=${appengine.version} -Dpackaging=jar -DgeneratePom=true -Dfile=${appengine.api}"/>
</exec>
<exec executable="mvn${maven.suffix}" dir="${basedir}" failonerror="false">
<arg line="install:install-file -DgroupId=com.google.appengine -DartifactId=appengine-local-runtime-shared -Dversion=${appengine.version} -Dpackaging=jar -DgeneratePom=true -Dfile=${appengine.local.runtime.shared}"/>
</exec>
</target>
<target name="unpack-appengine-sdk" depends="check-installed, check-unpacked" unless="already.unpacked">
<fail message="AppEngine SDK zip file not installed in local repository: ${localRepository}" unless="already.installed"/>
<mkdir dir="${basedir}/target/appengine-unpack-temp/"/>
<unzip src="${localRepository}/com/google/appengine-java-sdk/${appengine.version}/appengine-java-sdk-${appengine.version}.zip"
dest="${basedir}/target/appengine-unpack-temp/"
overwrite="false">
</unzip>
<move todir="${unpack.location}">
<fileset dir="${basedir}/target/appengine-unpack-temp/appengine-java-sdk-${appengine.version}"/>
</move>
<delete dir="${basedir}/target/appengine-unpack-temp/"/>
</target>
<target name="clean-appengine-files">
<delete dir="${unpack.location}"/>
</target>
</project>

View file

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
-->
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-modules</artifactId>
<version>2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>tuscany-cloud-appengine-sdk</artifactId>
<packaging>pom</packaging>
<name>Apache Tuscany SCA Cloud API Google AppEngine SDK</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<!-- version>1.1</version -->
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-trax</artifactId>
<version>1.6.5</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>install-appengine</id>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<ant antfile="./build-appengine.xml" target="install">
<property name="localRepository" value="${settings.localRepository}"/>
</ant>
</tasks>
</configuration>
</execution>
<execution>
<id>clean-appengine-files</id>
<phase>clean</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<ant antfile="./build-appengine.xml" target="clean-appengine-files">
<property name="localRepository" value="${settings.localRepository}"/>
</ant>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>