-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathEldev
76 lines (62 loc) · 3.28 KB
/
Eldev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
; -*- mode: emacs-lisp; lexical-binding: t -*-
(eldev-require-version "1.2")
(eldev-use-package-archive 'melpa)
(setf eldev-files-to-package `(:or ,eldev-files-to-package "/*.extmap"))
;; You can run `eldev build -sdev' to compile the development tool.
(push '(dev . "/dev") eldev-filesets)
(eldev-defbuilder datetime-builder-java (source target)
:short-name "JAVAC"
:source-files "*.java"
:targets (".java" -> ".class")
:define-cleaner (eldev-cleaner-java-class
"Delete compiled Java `.class' files."
:aliases java
:default t)
:collect (":default" ":java")
(eldev-call-process (executable-find "javac") `(,source ,@(when eldev-build-suppress-warnings '("-nowarn")) ,@(when eldev-build-treat-warnings-as-errors '("-Werror")))
:forward-output t
(unless (= exit-code 0)
(signal 'eldev-error `("`javac' process exited with error code %d" ,exit-code)))))
(eldev-defbuilder datetime-builder-locale-data-extmap (source target)
:short-name "LOCALES"
:message target
:source-files "/dev/HarvestData.class"
:targets "locale-data.extmap"
:collect ":data"
(datetime--build-extmap target "--locales"))
(eldev-defbuilder datetime-builder-timezone-data-extmap (source target)
:short-name "TIMEZONES"
:message target
:source-files "/dev/HarvestData.class"
:targets "timezone-data.extmap"
:collect ":data"
(datetime--build-extmap target "--timezones"))
(eldev-defbuilder datetime-builder-timezone-name-data-extmap (source target)
:short-name "TZ-NAMES"
:message target
:source-files "/dev/HarvestData.class"
:targets "timezone-name-data.extmap"
:collect ":data"
(datetime--build-extmap target "--timezone-names" :share-values t :compress-values t))
(defun datetime--build-extmap (target command-line &rest extmap-flags)
(require 'extmap)
(eldev-trace "Collecting data using the Java helper...")
(eldev-call-process "java" `("-cp" "dev" "HarvestData" ,@(eldev-listify command-line))
:destination '(t nil)
:forward-output 'stderr
(unless (= exit-code 0)
(signal 'eldev-error `(:hint "stderr output, if any, is shown above"
"`HarvestData' tool exited with error code %d:\n%s" ,exit-code ,(if (eobp) "[no stdout output]" (buffer-string)))))
(eldev-trace "Building an extmap out of it...")
(apply #'extmap-from-alist target (eldev-read-wholly (buffer-string) "`HarvestData' output") :overwrite t extmap-flags)))
;; Before testing we need to compile `test/ProcessTimestamp.java'.
(add-hook 'eldev-test-hook (lambda ()
(eldev-verbose "Building the tool in `test' target set first...")
(let ((eldev-build-sets '(test))
(eldev-verbosity-level 'quiet))
(eldev-build))))
(setf eldev-formatted-project-name "datetime")
(setf eldev-release-post-release-commit-message "Post-release version bump."
eldev-release-post-release-commit (lambda (version)
(let ((eldev-release-min-version-size 3))
(eldev-release-next-snapshot-version-unless-already-snapshot version))))