Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- You'll need a cross-compiled ECL and 'adb' from the android command line tools.
- * copy 'ecl', 'libecl.so' and all prebuilt contribs to the device like this:
- adb push bin/ecl /data/local/tmp/
- adb push lib/libecl.so /data/local/tmp/
- adb push lib/ecl-xx.x.x/encodings /data/local/tmp/
- adb push lib/ecl-xx.x-x/*.doc /data/local/tmp/
- adb push lib/ecl-xx.x.x/*.asd /data/local/tmp/
- adb push lib/ecl-xx.x.x/*.fas /data/local/tmp/
- * copy the cloned 'cl-test-grid' directory:
- adb push cl-test-grid /data/local/tmp/
- * copy the modified 'run-agent.sh' and 'run-agent.lisp' (after editing your email in 'run-agent.lisp'); both files are included here, see below
- adb push run-agent.sh /data/local/tmp/cl-test-grid/
- adb push run-agent.lisp /data/local/tmp/cl-test-grid/
- * start 'adb shell' and run:
- $ cd /data/local/tmp
- $ mv cl-test-grid/* .
- $ export LD_LIBRARY_PATH=/data/local/tmp
- $ chmod a+x ecl
- $ chmod a+x run-agent.sh
- $ ./run-agent.sh
- --- contents of 'run-agent.sh' ------------------------------------------------
- # Ensure the current directory is where this file is located
- cd "`dirname $0`"
- # Update to the recent cl-test-grid version (required).
- #git pull
- # Start your run-agent.lisp script. We suppose
- # Quicklisp is installed and added to the init
- # file of your lisp.
- # (EDIT THE PATH TO CCL)
- ./ecl --load run-agent.lisp --eval "(quit)"
- # CCL is the recommented choice, as it is the test grid development platform.
- # As for other lisps, see docs/agent-portability.txt.
- --- contents of 'run-agent.lisp' ----------------------------------------------
- ;;;; -*- Mode: LISP; Syntax: COMMON-LISP; indent-tabs-mode: nil; coding: utf-8; show-trailing-whitespace: t -*-
- ;;;; Copyright (C) 2011 Anton Vodonosov ([email protected])
- ;;;; See LICENSE for details.
- ;;;;
- ;;;; Example file for how to configure and run cl-test-grid agent.
- ;;;; Load the file by:
- ;;;; (load "run-agent.lisp")
- ;;;;
- ;; *** hack for android/ECL ***
- (in-package :cl-user)
- (ext:package-lock :common-lisp nil)
- (defun user-homedir-pathname (&optional host)
- *default-pathname-defaults*)
- (ext:package-lock :common-lisp t)
- (dolist (el '(("XDG_DATA_HOME" . "")
- ("XDG_CONFIG_HOME" . "")
- ("XDG_DATA_DIRS" . "")
- ("XDG_CONFIG_DIRS" . "")
- ("XDG_CACHE_HOME" . ".cache")))
- (ext:setenv (car el) (namestring (merge-pathnames (cdr el) (user-homedir-pathname)))))
- (ext:install-bytecodes-compiler)
- ;; *** end hack ***
- (defparameter *this-dir*
- (make-pathname :name nil :type nil :defaults *load-truename*))
- ;; If quicklisp is absent, install and load it
- (load (merge-pathnames "agent/require-quicklisp.lisp" *this-dir*))
- (tg-require-quicklisp:require :agent-work-dir (merge-pathnames "work-dir/agent/" *this-dir*))
- (let ((asdf:*central-registry* (cons *this-dir* asdf:*central-registry*)))
- (ql:quickload :test-grid-agent))
- (defparameter *ecl-bytecode* (make-instance 'lisp-exe:ecl
- :exe-path "./ecl"
- :compiler :bytecode))
- ;; create agent instance
- (defparameter *agent*
- (test-grid-agent:make-agent
- :lisps (list *ecl-bytecode*)
- :preferred-lisp *ecl-bytecode*
- ;;
- ;; If you are strongly opposed to publishing you email, please provide
- ;; just some nickname.
- :user-email "[email protected]"
- ;;; --- the settings below are not required ---
- ;; You may specify custom working directory for
- ;; the agent. By default it is <source-code-base>/work-dir/agent/
- ;;
- ;; :work-dir #P"/my/cl-test-grid/work-dir/agent/"
- ;; Only if you run several agents, give each of them
- ;; different work-dir (above) and lock port:
- ;;
- ;; :singleton-lock-port 7686
- ))
- ;;; Ask agent to do its work
- (test-grid-agent:main *agent*)
Advertisement
Add Comment
Please, Sign In to add comment