summaryrefslogtreecommitdiffstats
path: root/sandbox/sca-cloud-tutorial/cloud-google/build-appengine.xml
blob: 1472279a1f096a760faf30ba2573b1495571e7ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?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"/>

    <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>

    	<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>

    </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>