Together with Alex Mizrahi, I'm working on resurrecting (and improving) ABCL-web, the Java<->ABCL servlet bridge.
Because the ABCL-web project consists of both Java and lisp files which need to be distributed in compiled form in a JAR, I'm looking at ways to extend the (NetBeans generated) Ant based build for the ABCL-web project.
So far, I've come up with 2 solutions (the third approach turns out to be no solution):
1. Create a custom Ant task - which isn't exactly a lot of work, but still... 2. Integrate with Ant using our JSR-223 implementation based on the Ant SCRIPT tag
The latter turned out to be two minutes work for a trivial project file (run from the ABCL project directory root):
================= <project name="squares" default="main" basedir="."> <target name="main"> <script language="ABCL" classpath="dist/abcl.jar"> <![CDATA[ (print "ok") ]]> </script> </target> </project> =================
However, the output is a bit peculiar [note the 4 characters each being on their own line!]:
C:\Users\Erik\Documents\abcl-j>ant -f b.xml Buildfile: b.xml
main: [script] #<PACKAGE "ABCL-SCRIPT"> [script] #<PACKAGE "ABCL-SCRIPT-USER"> [script] #<PACKAGE "ABCL-SCRIPT"> [script] +GLOBAL-SCOPE+ [script] +ENGINE-SCOPE+ [script] +PUT-BINDING+ [script] +GET-BINDINGS+ [script] GENERATE-BINDINGS [script] GENERATE-SPECIAL-DECLARATIONS [script] GENERATE-JAVA-BINDINGS [script] EVAL-IN-SCRIPT-CONTEXT [script] EVAL-FUNCTION [script] EVAL-SCRIPT [script] EVAL-COMPILED-SCRIPT [script] COMPILE-SCRIPT [script] *INTERFACE-IMPLEMENTATION-MAP* [script] FIND-JAVA-INTERFACE-IMPLEMENTATION [script] REGISTER-JAVA-INTERFACE-IMPLEMENTATION [script] REMOVE-JAVA-INTERFACE-IMPLEMENTATION [script] ("CLOS" "PRINT-OBJECT" "FORMAT" "PPRINT" "ASDF") [script] #<PACKAGE "ABCL-SCRIPT"> [script] *LAUNCH-SWANK-AT-STARTUP* [script] *SWANK-DIR* [script] *SWANK-PORT* [script] *USE-THROWING-DEBUGGER* [script] CONFIGURE-ABCL [script] ABCL: configured [script] [script] [script] " [script] o [script] k [script] " [script]
BUILD SUCCESSFUL Total time: 5 seconds
So, now I have two questions:
1. Can we silence the ABCL+Script boot up? 2. What's happening with the 1-character-per-line output of my script????
Any help would be appreciated!
Bye,
Erik.
Erik Huelsmann wrote:
- What's happening with the 1-character-per-line output of my script????
Having been around Ant task and JSR-223 code, my suspicion is that there is a flush being done for each character in ABCL. The Ant outputStream wrappings log each of those flushes as a complete line of output.
Jim
Hi Jim!
On Sun, Dec 12, 2010 at 7:07 AM, Jim White jim@pagesmiths.com wrote:
Erik Huelsmann wrote:
- What's happening with the 1-character-per-line output of my script????
Having been around Ant task and JSR-223 code, my suspicion is that there is a flush being done for each character in ABCL. The Ant outputStream wrappings log each of those flushes as a complete line of output.
Thanks for your help! With the current trunk version of ABCL, I'm able to embed the following script in ABCL-web's build.xml; it's the basis for a script to add lisp-file compilation: now it only prints output (which is how I found the issue I was writing about earlier).
<script language="ABCL" classpath="lib/abcl.jar"><![CDATA[
(require "JAVA") (let* ((the-project (jcall "getProject" self)) (the-fileset (jcall "getReference" the-project "lisp-files")) (files-iterator (jcall (jmethod "org.apache.tools.ant.types.Path" "iterator") the-fileset))) (loop while (jcall "hasNext" files-iterator) do (print (jcall "next" files-iterator)))) ]]></script>
Bye,
Erik.
armedbear-devel@common-lisp.net