Last change
on this file since 13430 was
13430,
checked in by Mark Evenson, 12 years ago
|
Refactor ASDF extensions from JSS into ABCL-ASDF.
The JAR-FILE, JAR-DIRECTORY, and CLASS-FILE-DIRECTORY ASDF extensions
are now part of the ABCL-ASDF contrib as we aim to centralize all such
things in one place. *ADDED-TO-CLASSPATH* is now part of the
ABCL-ASDF package as well.
There is currently a (mostly) recursive relationship between JSS and
ABCL-ASDF, as each (mostly) requires the other for operation.
JSS:ENSURE-COMPATIBILITY will ensure that JSS continues to understand
the refactored extensions.
|
File size:
1.4 KB
|
Line | |
---|
1 | (defpackage #:abcl-asdf |
---|
2 | (:use :cl) |
---|
3 | (:export |
---|
4 | #:satisfy |
---|
5 | #:as-classpath |
---|
6 | |
---|
7 | #:resolve-artifact |
---|
8 | #:resolve-dependencies |
---|
9 | |
---|
10 | #:add-directory-jars-to-class-path |
---|
11 | #:need-to-add-directory-jar? |
---|
12 | |
---|
13 | #:*added-to-classpath* |
---|
14 | #:*inhibit-add-to-classpath*)) |
---|
15 | |
---|
16 | (in-package :asdf) |
---|
17 | (defclass iri (static-class) |
---|
18 | (schema authority path query fragment)) |
---|
19 | |
---|
20 | (defclass mvn (iri) ()) |
---|
21 | |
---|
22 | ;;; We interpret compilation to ensure that load-op will succeed |
---|
23 | (defmethod perform ((op compile-op) (c mvn)) |
---|
24 | (let ((version (component-version c))) |
---|
25 | (abcl-asdf:satisfy (component-name c) |
---|
26 | :version (if version version :latest)))) |
---|
27 | |
---|
28 | (defmethod perform ((operation load-op) (c mvn)) |
---|
29 | (let ((version (component-version c))) |
---|
30 | (java:add-to-classpath |
---|
31 | (abcl-asdf:as-classpath |
---|
32 | (abcl-asdf:satisfy (component-name c) |
---|
33 | :version (if version version :latest)))))) |
---|
34 | |
---|
35 | (in-package #:abcl-asdf) |
---|
36 | |
---|
37 | (defun satisfy (name &key (version :latest)) |
---|
38 | (declare (ignore version)) |
---|
39 | (resolve-dependencies name)) |
---|
40 | |
---|
41 | (defun as-classpath (classpath) |
---|
42 | "For a given MVN entry, return a list of loadable archives |
---|
43 | suitable for addition to the classpath." |
---|
44 | (split-string classpath ":")) |
---|
45 | |
---|
46 | (defun split-string (string split-char) |
---|
47 | (loop :for i = 0 :then (1+ j) |
---|
48 | :as j = (position split-char string :test #'string-equal :start i) |
---|
49 | :collect (subseq string i j) |
---|
50 | :while j)) |
---|
Note: See
TracBrowser
for help on using the repository browser.