[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/javaimp 177572a 08/32: packages/javaimp/javaimp.el: par
From: |
Stefan Monnier |
Subject: |
[elpa] externals/javaimp 177572a 08/32: packages/javaimp/javaimp.el: parent pom check fix |
Date: |
Tue, 1 Dec 2020 10:08:27 -0500 (EST) |
branch: externals/javaimp
commit 177572a96de85bdc24038b66d798c804fb66cd67
Author: Filipp Gunbin <fgunbin@fastmail.fm>
Commit: Filipp Gunbin <fgunbin@fastmail.fm>
packages/javaimp/javaimp.el: parent pom check fix
---
javaimp.el | 46 +++++++++++++++++++++++++++++++---------------
1 file changed, 31 insertions(+), 15 deletions(-)
diff --git a/javaimp.el b/javaimp.el
index 18a07b0..cd00476 100644
--- a/javaimp.el
+++ b/javaimp.el
@@ -149,12 +149,12 @@ class name. The order of classes which were not matched
is defined by
;; A module is represented as a list of the form `(ARTIFACT POM-FILE
-;; SOURCE-DIR TEST-SOURCE-DIR POM-FILE-MOD-TS PARENT)'.
+;; SOURCE-DIR TEST-SOURCE-DIR POM-FILE-MOD-TS PARENT PARENT-TS)'.
(defsubst javaimp-make-mod (artifact pom-file source-dir test-source-dir
- pom-file-mod-ts jars-list parent)
+ pom-file-mod-ts jars-list parent parent-ts)
(list artifact pom-file source-dir test-source-dir
- pom-file-mod-ts jars-list parent))
+ pom-file-mod-ts jars-list parent parent-ts))
(defsubst javaimp-get-mod-artifact (module)
(nth 0 module))
@@ -183,6 +183,11 @@ class name. The order of classes which were not matched
is defined by
(defsubst javaimp-set-mod-parent (module value)
(setcar (nthcdr 6 module) value))
+(defsubst javaimp-get-mod-parent-ts (module)
+ (nth 7 module))
+(defsubst javaimp-set-mod-parent-ts (module value)
+ (setcar (nthcdr 7 module) value))
+
;; An artifact is represented as a list: (GROUP-ID ARTIFACT-ID VERSION).
@@ -325,7 +330,7 @@ with POM"
(car (process-lines javaimp-cygpath-program "-u"
test-source-dir))
test-source-dir))
- nil nil parent)
+ nil nil parent nil)
result)))))
(defun javaimp-build-artifact-pomfile-alist (pom-file-list)
@@ -413,28 +418,39 @@ the temporary buffer and returns its result"
(defun javaimp-get-file-ts (file)
(nth 5 (file-attributes file)))
-(defun javaimp-any-pom-updated (modules)
- (if (null modules)
+(defun javaimp-any-file-ts-updated (files)
+ (if (null files)
nil
- (let ((curr-ts (javaimp-get-file-ts
- (javaimp-get-mod-pom-file (car modules))))
- (last-ts (javaimp-get-mod-pom-mod-ts (car modules))))
+ (let ((curr-ts (javaimp-get-file-ts (car (car files))))
+ (last-ts (cdr (car files))))
(or (null last-ts) ; reading for the first time?
(not (equal (float-time curr-ts) (float-time last-ts)))
- (javaimp-any-pom-updated (cdr modules))))))
-
+ (javaimp-any-file-ts-updated (cdr files))))))
+
(defun javaimp-get-dep-jars-cached (module parent)
"Returns a list of dependency jar file paths for a MODULE.
Both MODULE and PARENT poms are checked for updates because
PARENT pom may have some versions which are inherited by the
MODULE."
- (when (javaimp-any-pom-updated (remq nil (list module parent)))
- ;; (re-)fetch dependencies and update ts
+ (when (javaimp-any-file-ts-updated
+ (remq nil (list (cons (javaimp-get-mod-pom-file module)
+ (javaimp-get-mod-pom-mod-ts module))
+ (when parent
+ (cons
+ (javaimp-get-mod-pom-file parent)
+ ;; here we check the saved parent ts because it
+ ;; matters what version we had when we were
+ ;; reloading this pom the last time
+ (javaimp-get-mod-parent-ts module))))))
+ ;; (re-)fetch dependencies
(javaimp-set-mod-pom-deps
module (javaimp-maven-fetch-module-deps module))
+ ;; update timestamps
(javaimp-set-mod-pom-mod-ts
- module (javaimp-get-file-ts (javaimp-get-mod-pom-file module))))
- (javaimp-get-mod-pom-deps module)))
+ module (javaimp-get-file-ts (javaimp-get-mod-pom-file module)))
+ (javaimp-set-mod-parent-ts
+ module (javaimp-get-file-ts (javaimp-get-mod-pom-file parent))))
+ (javaimp-get-mod-pom-deps module))
(defun javaimp-get-jdk-jars ()
"Returns list of jars from the jre/lib subdirectory of the JDK
- [elpa] branch externals/javaimp created (now 3c95c22), Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp c2bb0bc 01/32: * javaimp: New package., Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp 60a7312 02/32: javaimp: converted to lexical binding, doc fixes, minor code fixes, Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp c38cd53 03/32: javaimp: fixed lexical-binding var placement, Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp 170e1cd 05/32: javaimp: version 0.5, Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp 07e5c0f 04/32: javaimp: fix for cases when maven doesn't add xml declaration, Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp f8681a5 07/32: packages/javaimp/javaimp.el: added check for changes in parent pom, Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp 177572a 08/32: packages/javaimp/javaimp.el: parent pom check fix,
Stefan Monnier <=
- [elpa] externals/javaimp 59f2e14 11/32: packages/javaimp/javaimp.el: use line-beginning-position instead of forward-line, Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp d65f827 09/32: minor fixes, Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp 4be004d 10/32: packages/javaimp/javaimp.el: replace kill-line with delete-region, Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp 4fa5d2a 12/32: * packages/javaimp/javaimp.el: Fix some compiler warnings, Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp 32304ae 14/32: javaimp.el: Fix Maven output start regexp., Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp b5158b9 15/32: * packages/javaimp/javaimp.el: Update javaimp to v. 0.6., Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp 069aa0c 06/32: javaimp: doc fixes, Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp d1507ca 13/32: packages/javaimp/javaimp.el: Support additional source directories., Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp c59e1f7 22/32: packages/javaimp: Fix comparison of module load ts with parent files., Stefan Monnier, 2020/12/01
- [elpa] externals/javaimp eb08936 23/32: Fix some quoting problems in doc strings, Stefan Monnier, 2020/12/01