Options

"build_extension.xml improvement"

jpercentjpercent Member Posts: 2 Contributor I
edited June 2019 in Help
Hello everyone, I had a problem building my fisher-price RapidMiner extension.  Fixed the problem, but it was annoying and I think the build files can be improved.

My adventure follows. I checked out the RapidMiner_Unuk branch and renamed it rapid-miner - if you're building an extension this will give you a headache.  I also created my extension in a directory that is not a sibiling of the RapidMiner_Unuk.

*stark*

Relative path names are hard-coded in the build files!

The fix is to use an env. var like Java does with JAVA_HOME.  You could even created a hard-coded default and then look for JAVA_HOME.  Anyway, I created RM_HOME and changed the hard-coded references in extension-dir/build.xml and RapidMiner_Unuk/build_extension.xml.  Below is the diff from RapidMiner_Unuk/build_extension.xml.

This fix will help reduce copious ibuprofen consumption and make the world a better place.

Best,
James Percent
james@syndeticlogic.net

Index: build_extension.xml
===================================================================
--- build_extension.xml (revision 844)
+++ build_extension.xml (working copy)

<project name="buildExtension" xmlns:ac="antlib:net.sf.antcontrib">
- <taskdef uri="antlib:net.sf.antcontrib" resource="net/sf/antcontrib/antlib.xml" classpath="../RapidMiner_Unuk/ant/ant-contrib-1.0b3.jar" />
+        <property environment="env"/>
+        <taskdef uri="antlib:net.sf.antcontrib" resource="net/sf/antcontrib/antlib.xml" classpath="${env.RM_HOME}/ant/ant-contrib-1.0b3.jar" />
<property file="build.properties" />
-
+
<property name="extension.updateServerId" value="rmx_${extension.namespace}" />

<property name="rm.ant" location="${rm.dir}/ant" />

<taskdef onerror="fail" resource="org/freecompany/redline/ant/antlib.xml" classpath="ant/redline-1.1.3.jar" />

<!-- FOR Tasks -->
- <taskdef onerror="fail" resource="net/sf/antcontrib/antlib.xml" classpath="../RapidMiner_Unuk/ant/ant-contrib-1.0b3.jar" />
+ <taskdef onerror="fail" resource="net/sf/antcontrib/antlib.xml" classpath="${env.RM_HOME}/ant/ant-contrib-1.0b3.jar" />

<!-- SCP Tasks -->
<copy file="ant/jsch-0.1.42.jar" todir="${ant.library.dir}" failonerror="false" />

Answers

  • Options
    SkirzynskiSkirzynski Member Posts: 164 Maven
    Hey James,

    You are right. The two hard-coded references in the "build_extension.xml" are ... yeah! Let us not talk about this! :) I have fixed that and if you are using the RapidMiner version from the sourceforge SVN this should be synced until tomorrow. Nevertheless you should not use ${env.RM_HOME} but ${rm.dir} like it is done everywhere else in "build_extension.xml". This property should be defined in the "build.xml" file of your extension.

    Best
      Marcin
  • Options
    jpercentjpercent Member Posts: 2 Contributor I
    Awesome!
Sign In or Register to comment.