2010-01-01 22:29:50 -05:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<!--
|
|
|
|
|
2011-08-16 21:14:30 -04:00
|
|
|
Licensed to jclouds, Inc. (jclouds) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file
|
|
|
|
distributed with this work for additional information
|
|
|
|
regarding copyright ownership. jclouds 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.
|
2010-01-01 22:29:50 -05:00
|
|
|
|
|
|
|
-->
|
2010-01-09 17:40:46 -05:00
|
|
|
<project name="sshjava" default="sshjava" basedir=".">
|
2010-01-01 22:29:50 -05:00
|
|
|
<description>
|
|
|
|
simple example build file
|
|
|
|
</description>
|
|
|
|
|
|
|
|
<!-- set global properties for this build -->
|
|
|
|
<property name="src" location="src"/>
|
|
|
|
<property name="build" location="build"/>
|
|
|
|
<property name="dist" location="dist"/>
|
|
|
|
|
|
|
|
<input
|
|
|
|
message="Please enter the ip or hostname of the ssh machine"
|
|
|
|
addproperty="host"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<input
|
|
|
|
message="Please enter the user you will connect as"
|
|
|
|
addproperty="username"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<input
|
|
|
|
message="Please enter the path to the dsa key"
|
|
|
|
addproperty="keyfile"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<input
|
|
|
|
message="Please enter the strings you'd like to test"
|
|
|
|
addproperty="line"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<target name="init">
|
|
|
|
<!-- Create the time stamp -->
|
|
|
|
<tstamp/>
|
|
|
|
<!-- Create the build directory structure used by compile -->
|
|
|
|
<mkdir dir="${build}"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="compile" depends="init" description="compile the source ">
|
|
|
|
<!-- Compile the java code from ${src} into ${build} -->
|
|
|
|
<javac srcdir="${src}" destdir="${build}"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="clean" description="clean up">
|
|
|
|
<!-- Delete the ${build} and ${dist} directory trees -->
|
|
|
|
<delete dir="${build}"/>
|
|
|
|
<delete dir="${dist}"/>
|
|
|
|
</target>
|
|
|
|
|
2010-01-09 17:40:46 -05:00
|
|
|
<taskdef name="sshjava" classname="org.jclouds.tools.ant.taskdefs.sshjava.SSHJava" />
|
2010-01-01 22:29:50 -05:00
|
|
|
|
2010-01-09 17:40:46 -05:00
|
|
|
<target name="sshjava" depends="compile" description="remote execute the java command">
|
2010-01-01 22:29:50 -05:00
|
|
|
<echo message="normal java task"/>
|
|
|
|
<java classname="TestClass" classpath="${build}" dir="${user.dir}" >
|
|
|
|
<arg line="${line}"/>
|
|
|
|
</java>
|
|
|
|
<echo message="java task over ssh"/>
|
2010-01-09 17:40:46 -05:00
|
|
|
<sshjava classname="TestClass" classpath="${build}" dir="${user.dir}" host="${host}" username="${username}" keyfile="${keyfile}" trust="true" remotebase="/tmp/test" >
|
2010-01-01 22:29:50 -05:00
|
|
|
<arg line="${line}"/>
|
2010-01-09 17:40:46 -05:00
|
|
|
</sshjava>
|
2010-01-01 22:29:50 -05:00
|
|
|
</target>
|
|
|
|
|
|
|
|
</project>
|