Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: terminatooor2
Fetching contributors…

Cannot retrieve contributors at this time

238 lines (197 sloc) 8.049 kB
<?xml version="1.0"?>
<project name="RubyStep 4.x" default="dist" basedir=".">
<description>
Build file for a Kettle plugin
</description>
<!-- you can use this file to set the kettle-dir property or change it directly below -->
<property file="build.properties" />
<!-- change these to adapt to your environment -->
<property name="kettle-dir" location="your_kettle_4.x.x_dir_here" />
<property name="swt-jar" location="${kettle-dir}/libswt/osx64/swt.jar" />
<available file="${swt-jar}" property="swt-jar.present" />
<available file="${kettle-dir}" type="dir" property="kettle-dir.present" />
<fail unless="kettle-dir.present" message="please specify the path to your kettle 4.x.x installation" />
<fail unless="swt-jar.present" message="please specify a valid jar for the swt-jar property" />
<!-- set global properties for this build -->
<property name="src" location="src" />
<property name="classes" location="classes" />
<property name="dist" location="dist" />
<property name="diststep" location="${dist}/steps/Ruby" />
<property name="distentry" location="${dist}/jobentries/Ruby" />
<property name="testsrc" location="test" />
<property name="testclasses" location="testclasses" />
<property name="testdist" location="testdist" />
<property name="package" location="package" />
<property name="pluginname" value="Ruby" />
<property name="jarstepfilename" value="ruby-step.jar" />
<property name="jarentryfilename" value="ruby-entry.jar" />
<property name="zipfilename" value="${pluginname}Plugin_Kettle_4.2.zip" />
<!-- used for running the tests -->
<path id="test.classpath">
<!-- the test cases -->
<pathelement location="${testclasses}" />
<!-- the plugin jar -->
<pathelement location="${testdist}/steps/${pluginname}/${jarstepfilename}" />
<!-- jruby -->
<fileset dir="${testdist}/steps/${pluginname}/lib">
<include name="**/*.jar" />
</fileset>
<!-- kettle libs (including jUnit) -->
<fileset dir="${kettle-dir}/lib">
<include name="**/*.jar" />
</fileset>
<fileset dir="${kettle-dir}/libext">
<include name="**/*.jar" />
</fileset>
<fileset dir="${kettle-dir}/libext/pentaho">
<include name="**/*.jar" />
</fileset>
<fileset dir="${kettle-dir}/libswt">
<include name="**/*.jar" />
</fileset>
</path>
<!-- used to compile code and tests -->
<path id="compile.classpath">
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
<fileset dir="${kettle-dir}/lib">
<include name="**/*.jar" />
</fileset>
<!-- <fileset dir="${kettle-dir}/libext">
<include name="**/*.jar" />
</fileset>
<fileset dir="${kettle-dir}/libext/pentaho">
<include name="**/*.jar" />
</fileset> -->
<fileset dir="${kettle-dir}/libswt">
<include name="**/*.jar" />
</fileset>
<fileset file="${swt-jar}" />
</path>
<target name="init">
<tstamp />
</target>
<target name="compile" depends="init" description="compile the source ">
<mkdir dir="${classes}" />
<javac target="1.6" source="1.6" srcdir="${src}" destdir="${classes}" debuglevel="lines,vars,source" debug="true">
<classpath refid="compile.classpath" />
</javac>
</target>
<target name="dist" depends="compile" description="generate the distribution">
<mkdir dir="${diststep}" />
<mkdir dir="${distentry}" />
<!-- jar things up, also add the properties files (messages) -->
<copy todir="${classes}">
<fileset dir="${src}" includes="**/*.properties" />
</copy>
<jar jarfile="${diststep}/${jarstepfilename}" basedir="${classes}" excludes="org/typeexit/kettle/plugin/entries/**/*.*"/>
<!--<jar jarfile="${distentry}/${jarentryfilename}" basedir="${classes}" excludes="org/typeexit/kettle/plugin/steps/**/*.*"/>-->
<!-- Put the plugin.xml and icon into dist folder -->
<copy todir="${diststep}">
<fileset dir="plugin" includes="**/*.*" />
<fileset dir="plugin" includes="**" />
</copy>
<!-- <copy todir="${distentry}">
<fileset dir="plugin_jobentry" includes="**/*.*" />
<fileset dir="plugin_jobentry" includes="**" />
</copy> -->
<!-- put the deps into lib subfolder -->
<mkdir dir="${diststep}/lib" />
<copy todir="${diststep}/lib">
<fileset dir="lib" includes="*.jar" />
</copy>
</target>
<target name="test-compile" depends="test-dist" description="compile the test sources">
<mkdir dir="${testclasses}" />
<javac target="1.6" srcdir="${testsrc}" destdir="${testclasses}" debuglevel="lines,vars,source" debug="true">
<classpath refid="test.classpath" />
</javac>
</target>
<target name="test-dist" depends="compile" description="generate the test distribution">
<mkdir dir="${testdist}/steps/${pluginname}" />
<!-- jar things up, also add the properties files (messages) -->
<copy todir="${classes}">
<fileset dir="${src}" includes="**/*.properties" />
</copy>
<jar jarfile="${testdist}/steps/${pluginname}/${jarstepfilename}" basedir="${classes}" />
<!-- Put the plugin.xml and icon into dist folder -->
<copy todir="${testdist}/steps/${pluginname}">
<fileset dir="plugin" includes="**/*.*" />
<fileset dir="plugin" includes="**" />
</copy>
<!-- put the deps into lib subfolder -->
<mkdir dir="${testdist}/steps/${pluginname}/lib" />
<copy todir="${testdist}/steps/${pluginname}/lib">
<fileset dir="lib" includes="*.jar" />
</copy>
</target>
<target name="install" depends="dist" description="install into local kettle">
<!-- remove previous installations -->
<delete dir="${kettle-dir}/plugins/steps/${pluginname}" />
<delete dir="${kettle-dir}/plugins/jobentries/${pluginname}" />
<!-- put fresh stuff in place -->
<mkdir dir="${kettle-dir}/plugins/steps/${pluginname}" />
<mkdir dir="${kettle-dir}/plugins/jobentries/${pluginname}" />
<copy todir="${kettle-dir}/plugins/steps/${pluginname}">
<fileset dir="${diststep}" includes="**/*.*" />
<fileset dir="${diststep}" includes="**" />
</copy>
<copy todir="${kettle-dir}/plugins/jobentries/${pluginname}">
<fileset dir="${distentry}" includes="**/*.*" />
<fileset dir="${distentry}" includes="**" />
</copy>
</target>
<target name="package" depends="dist" description="package for distribution">
<!-- clear previous installations -->
<delete dir="${package}" />
<mkdir dir="${package}" />
<mkdir dir="${package}/Sources" />
<mkdir dir="${package}/plugins" />
<!-- copy plugin -->
<copy todir="${package}/plugins">
<fileset dir="${dist}" includes="**/*.*" />
</copy>
<!-- prepare sources -->
<copy todir="${package}/Sources/plugin">
<fileset dir="plugin" includes="**/*.*" />
</copy>
<copy todir="${package}/Sources/src">
<fileset dir="src" includes="**/*.java" />
<fileset dir="src" includes="**/*.properties" />
</copy>
<copy todir="${package}/Sources/test">
<fileset dir="test" includes="**/*.*" />
</copy>
<copy todir="${package}/Sources/lib">
<fileset dir="lib" includes="**/*.*" />
</copy>
<copy todir="${package}/Sources">
<fileset dir="." includes="build.xml" />
<fileset dir="." includes="build.properties" />
</copy>
<!-- zip up the contents -->
<delete file="${package}/${zipfilename}" />
<zip destfile="${package}/${zipfilename}">
<zipfileset dir="${package}/plugins" prefix="${pluginname}" />
<zipfileset dir="${package}/Sources" prefix="Sources" />
<zipfileset dir="." includes="INSTALLATION.txt" />
<zipfileset dir="." includes="LICENSE.txt" />
</zip>
</target>
<target name="clean" description="clean up">
<!-- Delete the ${classes} and ${dist} directory trees -->
<delete dir="${classes}" />
<delete dir="${testclasses}" />
<delete dir="${dist}" />
<delete dir="${testdist}" />
<delete dir="${package}" />
</target>
<target name="test" depends="test-dist,test-compile">
<junit fork="yes" haltonfailure="yes" maxmemory="256m">
<test name="org.typeexit.kettle.plugin.steps.ruby.TestSuite" />
<formatter type="plain" usefile="false" />
<classpath refid="test.classpath" />
</junit>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.