]> git.eshelyaron.com Git - emacs.git/commitdiff
Summarization happening and some ELPA support
authorPhillip Lord <phillip.lord@russet.org.uk>
Wed, 14 Sep 2016 22:20:23 +0000 (23:20 +0100)
committerPhillip Lord <phillip.lord@russet.org.uk>
Wed, 14 Sep 2016 22:20:23 +0000 (23:20 +0100)
packages/GNUmakefile
packages/admin/assess-discover.el
packages/admin/package-build.el
packages/admin/package-makefile.el
packages/temp.el

index e1bc6f85f9678b9393d72436a24a4f25b3f22d31..a19d3613f1b5700f90eee12e22f61859dbac5bc6 100644 (file)
@@ -11,7 +11,7 @@ DIRS=$(filter-out .,$(subst ./,,$(shell find . -maxdepth 1 -type d)))
 ## dependent on makefile
 all: pkg-all $(EMACS)
 
-check: cleanlog check-packages
+check: cleanlog check-packages ert-summarize
 
 check-maybe: check-packages
 
index cbbbfb31fb7a9e7f4750f725cd9b76587f23ddf5..3f07575371ef0b0fba2eb10d852a734bceb431a6 100644 (file)
@@ -58,6 +58,5 @@ tests directory."
 
 (defun assess-discover-run-and-exit-batch-dir (directory &optional selector)
   (assess-discover--load-all-tests
-   (concat default-directory
-           directory))
+   (expand-file-name directory))
   (ert-run-tests-batch-and-exit selector))
index 71897a2b0dd58ace8d353e6424245debc3a7c7d6..48468e1b516a0658071d049dc55c0e1dad2f39d5 100644 (file)
@@ -6,8 +6,8 @@
 ;; So this one does the business during build
 (defun package-build-prepare (dir)
   (let ((descr
-           (package-desc-create :name (make-symbol dir)))
-          (location (package-build-dir dir)))
+         (package-desc-create :name (make-symbol dir)))
+          (location (expand-file-name dir)))
       (archive-refresh-pkg-file location)
       (setq descr (package-load-descriptor location))
       (package-generate-autoloads (package-desc-name descr) location)
index 0e42918a0d822a4407b8220c7263d6edfc57f235..2f0086ba50e2ed932b0f8c1df7c2808a0abfcfa0 100644 (file)
@@ -1,65 +1,66 @@
 (require 'seq)
 
+(defvar package-makefile--elpa nil)
+(defvar package-makefile--log-targets nil)
+(defvar package-makefile--pkg-targets nil)
+
 (defun package-makefile--package-dirs (directory)
   (directory-files directory nil "[^.].*"))
 
 (defun package-makefile--target-pkg-el (top-dir base-dir)
-  (format
-   "%s-pkg: %s/%s/%s-pkg.el
+  (let ((pkgfile (concat top-dir "/" base-dir "/" base-dir "-pkg.el")))
+    (add-to-list
+     'package-makefile--pkg-targets pkgfile)
+    (format
+     "%s-pkg: %s
 
-%s/%s/%s-pkg.el: %s
+%s: %s
 \t$(EMACS) --batch --directory=admin \\
 \t\t--load admin/package-build.el \\
 \t\t--eval '(package-build-prepare \"%s/%s\")'
 "
 
-   base-dir top-dir base-dir base-dir
-   top-dir base-dir base-dir
-   (mapconcat
-    (lambda (n)
-      (concat top-dir "/" base-dir "/" n))
-    (seq-remove
-     (lambda (n)
-       (or
-        (string-match-p
-         ".*-autoloads.el" n)
-        (string-match-p
-         ".*-pkg.el" n)))
-     (directory-files
-      (concat top-dir "/" base-dir)
-      nil
-      ".*el$"))
-    " ")
-   top-dir base-dir))
+     base-dir pkgfile
+     pkgfile
+     (mapconcat
+      (lambda (n)
+        (concat top-dir "/" base-dir "/" n))
+      (seq-remove
+       (lambda (n)
+         (or
+          (string-match-p
+           ".*-autoloads.el" n)
+          (string-match-p
+           ".*-pkg.el" n)))
+       (directory-files
+        (concat top-dir "/" base-dir)
+        nil
+        ".*el$"))
+      " ")
+     top-dir base-dir)))
 
 (defun package-makefile--pkg-targets (top-dir all-dirs)
-  (concat
-   "pkg-all: "
-   (mapconcat
-    'identity
-    all-dirs
-    "-pkg ")
-   "-pkg"
-   "\n\n"
-   (mapconcat
-    (lambda (base-dir)
-      (package-makefile--target-pkg-el top-dir base-dir))
-    all-dirs
-    "\n")))
+  (mapconcat
+   (lambda (base-dir)
+     (package-makefile--target-pkg-el top-dir base-dir))
+   all-dirs
+   "\n"))
 
 (defun package-makefile--log-target (top-dir base-dir)
   (let* ((fulldir (concat top-dir "/" base-dir))
          (filestem (concat top-dir "/" base-dir "/" base-dir))
          (logfile (concat filestem ".log"))
          (pkgfile (concat filestem "-pkg.el")))
+    (add-to-list
+     'package-makefile--log-targets logfile)
     (format
      "%s: %s
-       @$(EMACS) --batch --load admin/assess-discover.el \\
+       $(EMACS) --batch --load admin/assess-discover.el \\
                --eval '(assess-discover-run-and-exit-batch-dir \"%s\")' \\
                $(WRITE_LOG)
 
 %s:
-       test ! -f ./%s || mv ./%s ./%s~
+       test ! -f %s || mv %s %s~
        $(MAKE) %s WRITE_LOG=
 
 %s: %s
     (lambda (base-dir)
       (package-makefile--log-target top-dir base-dir))
     all-dirs
-    "\n")
-
-   "
-check-packages: "
+    "\n")))
 
+(defun package-makefile--check-packages-target (targets)
+  (concat
+    "check-packages: ")
    (mapconcat
     (lambda (base-dir)
       (concat top-dir "/" base-dir "/" base-dir ".log"))
     all-dirs
-    " ")))
+    " "))
 
 (defun package-makefile--core-packages ()
   (package-makefile--package-dirs "core"))
 
-(defun package-makefile--1 ()
-  (concat
-   (package-makefile--pkg-targets
-    "core"
-    (package-makefile--core-packages))
-   "\n"
-
-   (package-makefile--test-targets
-    "core"
-    (package-makefile--core-packages))
-   "\n"))
 
+(defun package-makefile--elpa-dirs (elpa-package-dir)
+  (seq-remove
+   (lambda (n)
+     (string= "elpa.rss" n))
+   (package-makefile--package-dirs elpa-package-dir)))
+
+
+(defun package-makefile--1 ()
+  (let ((package-makefile--log-targets nil)
+        (package-makefile--pkg-targets nil))
+    (concat
+     (package-makefile--pkg-targets
+      "core"
+      (package-makefile--core-packages))
+     "\n"
+
+     (package-makefile--test-targets
+      "core"
+      (package-makefile--core-packages))
+     "\n"
+
+     (when package-makefile--elpa
+       (package-makefile--pkg-targets
+        package-makefile--elpa
+        (package-makefile--elpa-dirs
+         package-makefile-0elpa))
+       "\n"
+
+       (package-makefile--test-targets
+        package-makefile--elpa
+        (package-makefile--elpa-dirs
+         package-makefile--elpa)))
+
+     "ert-summarize: " (mapconcat 'identity package-makefile--log-targets " ")
+     "\n\t$(EMACS) -l ert -f ert-summarize-tests-batch-and-exit $^\n\n"
+
+     "pkg-all: " (mapconcat 'identity package-makefile--pkg-targets " ")
+     "\n\n"
+     "check-packages: " (mapconcat 'identity package-makefile--log-targets " "))))
 
 (defun package-makefile ()
   (with-temp-buffer
index 47635363c37d0f25342800a62b8eeb4437feff45..553b1ef59c68c4bf9608b814438f1de128c6b5ef 100644 (file)
@@ -7,8 +7,3 @@
 (package-makefile--makefile)
 
 (package-build-prepare "core/example")
-
-(package-makefile--pkg-targets
- "/home/phillord/src/git/elpa-git/master/packages"
- (package-makefile--package-dirs
-  "/home/phillord/src/git/elpa-git/master/packages"))