-
Notifications
You must be signed in to change notification settings - Fork 0
/
rsb-tools-send.asd
93 lines (72 loc) · 2.82 KB
/
rsb-tools-send.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
;;;; rsb-tools-send.asd --- RSB sending utility based on rsb.
;;;;
;;;; Copyright (C) 2012-2019 Jan Moringen
;;;;
;;;; Author: Jan Moringen <[email protected]>
(cl:defpackage #:rsb-tools-send-system
(:use
#:cl
#:asdf)
(:export
#:version/list
#:version/string))
(cl:in-package #:rsb-tools-send-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
(defsystem :rsb-tools-send
:author "Jan Moringen <[email protected]>"
:maintainer "Jan Moringen <[email protected]>"
:version #.(version/string)
:license "GPLv3" ; see COPYING file for details.
:description "A simple utility for sending remote methods exposed
via RSB."
:depends-on (:alexandria
:let-plus
:iterate
(:version :log4cl "1.1.1")
:cl-ppcre
:net.didierverna.clon
(:version :rsb #.(version/string :revision? nil))
(:version :rsb-tools-common #.(version/string))
(:version :rsb-tools-commands #.(version/string)))
:encoding :utf-8
:components ((:module "send"
:components ((:file "package")
(:file "main"
:depends-on ("package"))))))