Welcome! Please see the About page for a little more info on how this works.

0 votes
ago in Compiler by

I have an old script that gets the Clojure source from github and calls ./antsetup.sh and then ant to build and test. With Clojure 1.12.1, it fails trying to compile the recently modified SwissArmy.java. My work-around was to modify the build.xml so that the java compiler would see the build directory on the classpath. (It's likely there's a better fix. I'm no expert with ant.)

diff --git a/build.xml b/build.xml index 1464b69e..8ce4a961 100644
--- a/build.xml
+++ b/build.xml @@ -99,6 +99,7 @@

       unless="maven.test.skip">
 <mkdir dir="${test-classes}"/>
 <javac srcdir="${jtestsrc}" destdir="${test-classes}" includeJavaRuntime="yes"
  • classpath="${maven.test.classpath}:${build}"
            debug="true" source="1.8" target="1.8" includeantruntime="no"/>
     <echo>Direct linking = ${directlinking}</echo>
     <java classname="clojure.lang.Compile"
    

I think it's probably better to use mvn test in my script as I'm only making sure I can build Clojure from source. However, technically this looks like a regression and it may break some old automation. Perhaps, ant is more trouble than it's worth at this point. Up to you. I'm fine with dropping support. I just wanted to point out the issue so you were aware of it.

1 Answer

0 votes
ago by
edited ago by
 
Best answer

Hey Steve, the official build for Clojure is the Maven build (it does actually call out to the ant build for parts of its work but it uses the maven classpaths when doing so). To run the Clojure tests you should do mvn clean test and to package you can do mvn clean package (or install to make a local version).

The Ant build is as I mentioned still wrapped for some parts of the Maven build (some day maybe that will eventually get cleaned up).

ago by
Maven works for me.  I suggest that you remove the ant instructions from the readme.txt to avoid confusion about expectations for ant support and build.xml maintenance.
ago by
I think the specific instructions in the readme still work fine?
ago by
Yes, `ant local` worked for me so that is not currently a problem.  But `ant` by itself runs all and compile-tests specifically fails now with Clojure 1.12.1.  I'm just saying that if I see instructions to use ant, and there are a number of common targets in build.xml, I kind of expect them all to work.  At this point, that's an unwarranted assumption on my part as maven is the official build tool.  Of course, this is a minor issue and I think you have a good handle on what works and doesn't so I don't want to belabor the point.  Thanks.
ago by
Fair point, will look at adjusting that.
...