Skip to content

${scala.lib} instead of ${env.SCALA_HOME}/lib in build.xml #1

Description

@tgraham-antenna

The Scala 2.9.2 RPM puts the Scala jars in /usr/share/java, so there is no possible ${env.SCALA_HOME}/lib (without copying or symlinking multiple files). Adding a ${scala.lib} that defaults to ${env.SCALA_HOME}/lib makes it possible to build using the RPM-installed jars by overriding ${scala.lib} when running Ant.

I couldn't branch when this project was used as a submodule, and GitHub won't let me attach a patch file, so the patch is below:

diff --git a/build.xml b/build.xml
index 89b92e1..e9ef6c3 100644
--- a/build.xml
+++ b/build.xml
@@ -18,13 +18,15 @@ We are using the meta-target 'all' for configurability.
     <!-- Load the properties file containing the project-specific configuration. -->
     <loadproperties srcFile="build.properties"/>
     <property environment="env"/>
+    <property name="scala.home" value="${env.SCALA_HOME}"/>
+    <property name="scala.lib" value="${scala.home}/lib"/>

     <property name="x-jarfile" location="${dist}/${ant.project.name}.jar"/>

     <taskdef resource="scala/tools/ant/antlib.xml">
         <classpath>
-            <pathelement location="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
-            <pathelement location="${env.SCALA_HOME}/lib/scala-library.jar"/>
+            <pathelement location="${scala.lib}/scala-compiler.jar"/>
+            <pathelement location="${scala.lib}/scala-library.jar"/>
         </classpath>
     </taskdef>

@@ -61,8 +63,8 @@ We are using the meta-target 'all' for configurability.
                 >
             <!-- Include these libraries in the classpath. -->
             <classpath>
-                <pathelement location="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
-                <pathelement location="${env.SCALA_HOME}/lib/scala-library.jar"/>
+                <pathelement location="${scala.lib}/scala-compiler.jar"/>
+                <pathelement location="${scala.lib}/scala-library.jar"/>
                 <pathelement path="${libs}"/>
                 <fileset dir="${lib}">
                     <include name="**/*.jar"/>
@@ -80,8 +82,8 @@ We are using the meta-target 'all' for configurability.
                 >
             <!-- Include these libraries in the classpath. -->
             <classpath>
-                <pathelement location="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
-                <pathelement location="${env.SCALA_HOME}/lib/scala-library.jar"/>
+                <pathelement location="${scala.lib}/scala-compiler.jar"/>
+                <pathelement location="${scala.lib}/scala-library.jar"/>
                 <pathelement path="${libs}"/>
                 <fileset dir="${lib}">
                     <include name="**/*.jar"/>
@@ -97,8 +99,8 @@ We are using the meta-target 'all' for configurability.
                 destdir="${build}"
                 >
             <classpath>
-                <pathelement location="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
-                <pathelement location="${env.SCALA_HOME}/lib/scala-library.jar"/>
+                <pathelement location="${scala.lib}/scala-compiler.jar"/>
+                <pathelement location="${scala.lib}/scala-library.jar"/>
                 <pathelement path="${build}"/>
                 <pathelement path="${junit.path}"/>
                 <pathelement path="${libs}"/>
@@ -192,8 +194,8 @@ We are using the meta-target 'all' for configurability.
             unchecked="yes"
             >
             <classpath>
-                <pathelement location="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
-                <pathelement location="${env.SCALA_HOME}/lib/scala-library.jar"/>
+                <pathelement location="${scala.lib}/scala-compiler.jar"/>
+                <pathelement location="${scala.lib}/scala-library.jar"/>
                 <pathelement path="${libs}"/>
                 <fileset dir="${lib}">
                     <include name="**/*.jar"/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions