Changeset 15020


Ignore:
Timestamp:
05/25/17 06:57:16 (3 months ago)
Author:
mevenson
Message:

asdf-mvn-module: fix test invocation

Remove duplicate defintion of RESOLVE-MULTIPLE-MAVEN-DEPENDENCIES

Location:
trunk/abcl/contrib/abcl-asdf
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/contrib/abcl-asdf/maven.lisp

    r15018 r15020  
    626626
    627627
    628 (defun resolve-multiple-maven-dependencies (dependencies &optional managed-dependencies exclusions (first-is-root nil))
    629   "Return a list of jar file paths that satisfy dependencies
    630 
    631  dependencies: a list of maven artifacts. color or slash separated
    632    components groupid:artifactid:versionid
    633 
    634  managed-dependencies: a list of maven artifacts. If an dependency
    635    with same groupid and artifactid are encountered, the version
    636    specified here overrides.
    637 
    638  exclusions: a list of partial maven artifacts
    639    groupid:artifactid. Dependencies with same groupid and artifactid are
    640    exluded
    641 
    642  first-is-root: If the first dependency should include optional
    643    dependencies, set this to t. Usually not.
    644  "
    645   (let (aether)
    646     (with-aether (aether)
    647       (let ((collect-request (java:jnew (jss:find-java-class "CollectRequest")))
    648             (exclusions-collection (jss:new 'hashset) )
    649             (compile-scope (java:jfield (jss:find-java-class "JavaScopes") "COMPILE")))
    650         (loop for e  in exclusions
    651            for (groupid artifactid) = (abcl-build:split-string e #\:)
    652            ;; If i have scope be compile-scope it doesn't get excluded!!
    653            for exclusion = (jss:new 'aether.graph.Exclusion groupid artifactid "" "jar")
    654            do (#"add" exclusions-collection exclusion))
    655         (loop for a in dependencies
    656            for artifact = (make-artifact (#"replaceAll" a "/" ":"))
    657            for dependency = (jss:new 'aether.graph.Dependency artifact compile-scope)
    658            do 
    659            ;; setExclusions returns a new dependency. We have to use that. That passed dependency i not modified!
    660            ;; 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
    661            ;; Nice of them to clearly document that :-/
    662        (setq dependency (#"setExclusions" dependency exclusions-collection))
    663        (if first-is-root
    664      (#"setRoot" collect-request dependency)
    665      (#"addDependency" collect-request dependency))
    666        (setq first-is-root nil))
    667         (loop for a in managed-dependencies
    668            for artifact = (make-artifact (#"replaceAll" a "/" ":"))
    669            for dependency = (jss:new 'aether.graph.Dependency artifact compile-scope)
    670            do (setq dependency (#"setExclusions" dependency exclusions-collection))
    671        (#"addManagedDependency" collect-request dependency))
    672         (let ((dependencies (#"collectDependencies" (ensure-repository-system) (ensure-session) collect-request))
    673               (nodelist-generator (jss:new 'PreorderNodeListGenerator))
    674               (dependency-request (jss:new 'DependencyRequest)))
    675           (#"setRoot" dependency-request (#"getRoot" dependencies))
    676           (#"resolveDependencies" (ensure-repository-system) (ensure-session) dependency-request)
    677           (#"accept" (#"getRoot" dependencies) nodelist-generator)
    678           (abcl-build:split-string (#"getClassPath" nodelist-generator) #\:))))))
    679 
    680628;;; Currently the last file listed in ASDF
    681629(provide 'abcl-asdf)
  • trunk/abcl/contrib/abcl-asdf/t/mvn-module.lisp

    r15018 r15020  
    55  (asdf:initialize-source-registry
    66   `(:source-registry
    7      (:directory ,(asdf:system-relative-pathname :mvn-module "t/eg/"))
     7     (:directory ,(asdf:system-relative-pathname :asdf-mvn-module "t/eg/"))
    88     :inherit-configuration)))
    99
Note: See TracChangeset for help on using the changeset viewer.