-
Notifications
You must be signed in to change notification settings - Fork 0
/
cl-rsbag-tools-merge.asd
95 lines (73 loc) · 3.07 KB
/
cl-rsbag-tools-merge.asd
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
;;;; rsbag-tools-merge.asd --- System definition for merge program.
;;;;
;;;; Copyright (C) 2011-2019 Jan Moringen
;;;;
;;;; Author: Jan Moringen <[email protected]>
(cl:defpackage #:cl-rsbag-tools-merge-system
(:use
#:cl
#:asdf)
(:export
#:version/list
#:version/string))
(cl:in-package #:cl-rsbag-tools-merge-system)
;;; Version stuff
(defparameter +version-major+ 0
"Major component of version number.")
(defparameter +version-minor+ 19
"Minor component of version number.")
(let* ((version-file (merge-pathnames "version.sexp" *load-truename*))
stream)
(when (probe-file version-file)
(setf stream (open version-file)))
(defparameter +version-revision+ (if stream (read stream) 0)
"Revision component of version number.")
(defparameter +version-commit+ (when stream (read stream))
"Commit component of version number.")
(when stream (close stream)))
(defun version/list (&key
(revision? t)
commit?)
"Return a version of the form (MAJOR MINOR [REVISION [COMMIT]])
where REVISION and COMMIT are optional.
REVISION? controls whether REVISION should be included. Default
behavior is to include REVISION.
COMMIT? controls whether COMMIT should be included. Default behavior
is to not include COMMIT."
(append (list +version-major+ +version-minor+)
(when revision? (list +version-revision+))
(when (and commit? +version-commit+)
(list +version-commit+))))
(defun version/string (&rest args
&key
revision?
commit?)
"Return a version string of the form
\"MAJOR.MINOR[.REVISION[-.COMMIT]]\" where REVISION and COMMIT are
optional.
See `version/list' for details on keyword parameters."
(declare (ignore revision? commit?))
(format nil "~{~A.~A~^.~A~^-~A~}" (apply #'version/list args)))
;;; System definition
(asdf:defsystem "cl-rsbag-tools-merge"
:description "A tool that merges multiple log files into one."
:long-description "A tool that merges one or more rsbag log files
into a new rsbag log file, potentially
transforming channels and/or entries in the
process."
:license "GPLv3" ; see COPYING file for details
:author "Jan Moringen <[email protected]>"
:maintainer "Jan Moringen <[email protected]>"
:version #.(version/string)
:depends-on ("alexandria"
"let-plus"
"cl-ppcre"
(:version "cl-rsbag" #.(version/string :revision? nil))
(:version "rsb-tools-common" #.(version/string :revision? nil))
(:version "rsb-formatting" #.(version/string :revision? nil))
(:version "rsbag-tools-common" #.(version/string))
(:version "rsbag-tools-commands" #.(version/string)))
:components ((:module "bag-merge"
:serial t
:components ((:file "package")
(:file "main")))))