asdf-mvn-module: fix test invocation

Remove duplicate defintion of RESOLVE-MULTIPLE-MAVEN-DEPENDENCIES
parent 295de83e
...@@ -625,58 +625,6 @@ artifact and all of its transitive dependencies." ...@@ -625,58 +625,6 @@ artifact and all of its transitive dependencies."
`(:repository ,repository)))))))))) `(:repository ,repository))))))))))
(defun resolve-multiple-maven-dependencies (dependencies &optional managed-dependencies exclusions (first-is-root nil))
"Return a list of jar file paths that satisfy dependencies
dependencies: a list of maven artifacts. color or slash separated
components groupid:artifactid:versionid
managed-dependencies: a list of maven artifacts. If an dependency
with same groupid and artifactid are encountered, the version
specified here overrides.
exclusions: a list of partial maven artifacts
groupid:artifactid. Dependencies with same groupid and artifactid are
exluded
first-is-root: If the first dependency should include optional
dependencies, set this to t. Usually not.
"
(let (aether)
(with-aether (aether)
(let ((collect-request (java:jnew (jss:find-java-class "CollectRequest")))
(exclusions-collection (jss:new 'hashset) )
(compile-scope (java:jfield (jss:find-java-class "JavaScopes") "COMPILE")))
(loop for e in exclusions
for (groupid artifactid) = (abcl-build:split-string e #\:)
;; If i have scope be compile-scope it doesn't get excluded!!
for exclusion = (jss:new 'aether.graph.Exclusion groupid artifactid "" "jar")
do (#"add" exclusions-collection exclusion))
(loop for a in dependencies
for artifact = (make-artifact (#"replaceAll" a "/" ":"))
for dependency = (jss:new 'aether.graph.Dependency artifact compile-scope)
do
;; setExclusions returns a new dependency. We have to use that. That passed dependency i not modified!
;; http://grepcode.com/file/repo1.maven.org/maven2/org.eclipse.aether/aether-api/1.0.2.v0150114/org/eclipse/aether/graph/Dependency.java#Dependency.getOptional%28%29
;; Nice of them to clearly document that :-/
(setq dependency (#"setExclusions" dependency exclusions-collection))
(if first-is-root
(#"setRoot" collect-request dependency)
(#"addDependency" collect-request dependency))
(setq first-is-root nil))
(loop for a in managed-dependencies
for artifact = (make-artifact (#"replaceAll" a "/" ":"))
for dependency = (jss:new 'aether.graph.Dependency artifact compile-scope)
do (setq dependency (#"setExclusions" dependency exclusions-collection))
(#"addManagedDependency" collect-request dependency))
(let ((dependencies (#"collectDependencies" (ensure-repository-system) (ensure-session) collect-request))
(nodelist-generator (jss:new 'PreorderNodeListGenerator))
(dependency-request (jss:new 'DependencyRequest)))
(#"setRoot" dependency-request (#"getRoot" dependencies))
(#"resolveDependencies" (ensure-repository-system) (ensure-session) dependency-request)
(#"accept" (#"getRoot" dependencies) nodelist-generator)
(abcl-build:split-string (#"getClassPath" nodelist-generator) #\:))))))
;;; Currently the last file listed in ASDF ;;; Currently the last file listed in ASDF
(provide 'abcl-asdf) (provide 'abcl-asdf)
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
(defun asdf-add-test-mvn-module () (defun asdf-add-test-mvn-module ()
(asdf:initialize-source-registry (asdf:initialize-source-registry
`(:source-registry `(:source-registry
(:directory ,(asdf:system-relative-pathname :mvn-module "t/eg/")) (:directory ,(asdf:system-relative-pathname :asdf-mvn-module "t/eg/"))
:inherit-configuration))) :inherit-configuration)))
(unless (ignore-errors (asdf:find-system :test-mvn-module)) (unless (ignore-errors (asdf:find-system :test-mvn-module))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment