Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OSGI functionality to JSS, minor fixes to invoke, engage #1" reader #410

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
26 changes: 16 additions & 10 deletions contrib/abcl-asdf/abcl-asdf.asd
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,23 @@
:depends-on (jss abcl-build)
:components
((:module package
:pathname ""
:components ((:file "package")))
:pathname ""
:components ((:file "package")))
(:module base
:pathname ""
:components ((:file "abcl-asdf")
(:file "asdf-jar" :depends-on ("abcl-asdf")))
:depends-on (package maven))
:pathname ""
:components ((:file "abcl-asdf")
(:file "asdf-jar" :depends-on ("abcl-asdf")))
:depends-on (package maven))
(:module maven
:pathname ""
:components ((:file "maven")
(:file "mvn-module"))
:depends-on (package)))
:pathname ""
:components ((:file "maven")
(:file "mvn-module"))
:depends-on (package))
(:module osgi
:pathname ""
:components ((:file "osgi")
(:file "asdf-osgi-bundle"))
:depends-on (base maven)
:serial t))
:in-order-to ((test-op (test-op abcl-asdf-tests))))

22 changes: 4 additions & 18 deletions contrib/abcl-asdf/asdf-jar.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,9 @@
(unless abcl-asdf:*inhibit-add-to-classpath*
(abcl-asdf:add-directory-jars-to-class-path (truename (component-pathname c)) t)))

(defmethod operation-done-p ((operation load-op) (c jar-directory))
(or abcl-asdf:*inhibit-add-to-classpath*
(not (abcl-asdf:need-to-add-directory-jar? (component-pathname c) t))))

(defmethod operation-done-p ((operation compile-op) (c jar-directory))
t)



(defclass jar-file (static-file)
((type :initform "jar")))
Expand Down Expand Up @@ -83,21 +80,10 @@
(defmethod perform :before ((operation load-op) (c jar-file))
(normalize-jar-name c))

(defmethod operation-done-p :before ((operation load-op) (c jar-file))
(normalize-jar-name c))

(defmethod operation-done-p ((operation load-op) (c jar-file))
(or abcl-asdf:*inhibit-add-to-classpath*
(member (namestring (truename (component-pathname c)))
abcl-asdf:*added-to-classpath* :test 'equal)))

(defmethod operation-done-p ((operation compile-op) (c jar-file))
t)

(defclass class-file-directory (static-file) ())

(defmethod perform ((operation compile-op) (c class-file-directory))
(java:add-to-classpath (component-pathname c)))
(defmethod perform ((operation compile-op) (c class-file-directory)))
(defmethod perform ((operation prepare-op) (c class-file-directory)))

(defmethod perform ((operation load-op) (c class-file-directory))
(java:add-to-classpath (component-pathname c)))
Expand Down
31 changes: 31 additions & 0 deletions contrib/abcl-asdf/asdf-osgi-bundle.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
(in-package :asdf)

(defclass bundle (jar-file)
;; bootdelegation and system-packages correspond to the framework
;; config vars org.osgi.framework.bootdelegation and
;; org.osgi.framework.system.packages.extra implementation is to
;; restart OSGI with the values appended to the existing
;; configuration in *osgi-configuration* I thought I understood the
;; difference but I don't - only system-packages has worked for me.
;; These should be lists of strings . What these accomplish might
;; better be done with "extension bundles" but I haven't tried them
;; yet.
((bootdelegation :initarg :bootdelegation :initform nil)
(system-packages :initarg :system-packages :initform nil)))

(defmethod perform ((operation load-op) (c bundle))
(let ((extra-bootdelegation (slot-value c 'bootdelegation))
(extra-system-packages (slot-value c 'system-packages)))
(if (or extra-bootdelegation extra-system-packages)
(warn "not handling :bootdelegation and :system-packages args yet"))
(unless (find (component-name c) jss::*loaded-osgi-bundles* :test 'equalp :key 'car)
(jss:add-bundle (component-pathname c)))))

(defmethod perform ((operation compile-op) (c jar-file))
nil)






Loading