80 columns formatting fixes.
[clon.git] / com.dvlsoft.clon.asd
blobc478c4f77a61eee41319b31453b0e091aa227364
1 ;;; com.dvlsoft.clon.asd --- ASDF system definition
3 ;; Copyright (C) 2010 Didier Verna
5 ;; Author:        Didier Verna <didier@lrde.epita.fr>
6 ;; Maintainer:    Didier Verna <didier@lrde.epita.fr>
7 ;; Created:       Wed Jun 18 08:40:38 2008
8 ;; Last Revision: Sat Jun 12 17:53:54 2010
10 ;; This file is part of clon.
12 ;; Clon is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License version 3,
14 ;; as published by the Free Software Foundation.
16 ;; Clon is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with this program; if not, write to the Free Software
23 ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 ;;; Commentary:
28 ;; Contents management by FCM version 0.1.
31 ;;; Code:
33 (in-package :cl-user)
35 (eval-when (:load-toplevel :execute)
36   #+sbcl  (require :sb-grovel)
37   #+clisp (handler-case (asdf:operate 'asdf:load-op :cffi-grovel)
38             (asdf:missing-component ()
39               (format *error-output* "~
40 *********************************************************************
41 * WARNING: ASDF component CFFI-GROVEL not found.                    *
42 * Clon will be loaded without support for terminal autodetection.   *
43 * See section A.1 of the user manual for more information.          *
44 *********************************************************************"))))
46 (defpackage :com.dvlsoft.clon.asdf
47   (:documentation "The Command-Line Options Nuker package for ASDF.")
48   (:use :cl)
49   (:export :define-constant
50            :+release-major-level+
51            :+release-minor-level+
52            :+release-status+ :+release-status-level+
53            :+release-name+
54            :version))
57 (in-package :com.dvlsoft.clon.asdf)
59 (defmacro define-constant (name value &optional doc)
60   `(defconstant ,name (if (boundp ',name) (symbol-value ',name) ,value)
61     ,@(when doc (list doc))))
63 (defconstant +release-major-level+ 1
64   "The major level of this release.")
66 (defconstant +release-minor-level+ 0
67   "The minor level of this release.")
69 (defconstant +release-status+ :beta
70   "The status of this release.")
72 (defconstant +release-status-level+ 18
73   "The status level of this release.")
75 (define-constant +release-name+ "Michael Brecker"
76   "The name of this release.")
78 ;; #### TODO: I'm sure the format strings can be improved
79 (defun %version (type major minor status level name)
80   (ecase type
81     (:number
82      (apply #'+
83        (* major 10000)
84        (* minor 100)
85        (when (eq status :patchlevel)
86          (list level))))
87     (:short
88      (format nil "~S.~S~
89                  ~[~
90                    a~*~S~;~
91                    b~*~S~;~
92                    rc~*~S~;~
93                    ~:[.~S~;~*~]~
94                  ~]"
95        major
96        minor
97        (ecase status
98          (:alpha 0)
99          (:beta 1)
100          (:rc 2)
101          (:patchlevel 3))
102        (zerop level)
103        level))
104     (:long
105      (format nil "~S.~S ~
106                  ~[~
107                    alpha ~*~S ~;~
108                    beta ~*~S ~;~
109                    release candidate ~*~S ~;~
110                    ~:[patchlevel ~S ~;~*~]~
111                  ~]~
112                  ~S"
113        major
114        minor
115        (ecase status
116          (:alpha 0)
117          (:beta 1)
118          (:rc 2)
119          (:patchlevel 3))
120        (zerop level)
121        level
122        name))))
124 (defun version (&optional (type :number))
125   "Return the current version of Clon.
126 TYPE can be one of :number, :short or :long.
128 A version number is computed as major*10000 + minor*100 + patchlevel, leaving
129 two digits for each level. Alpha, beta and rc status are ignored in version
130 numbers.
132 A short version is something like 1.3{a,b,rc}4, or 1.3.4 for patchlevel.
133 Alpha, beta or rc levels start at 1. Patchlevels start at 0 but are ignored
134 in the output, so that 1.3.0 appears as just 1.3.
136 A long version is something like
137 1.3 {alpha,beta,release candidate,patchlevel} 4 \"Michael Brecker\". As for
138 the short version, a patchlevel of 0 is ignored in the output."
139   (%version type +release-major-level+ +release-minor-level+
140             +release-status+ +release-status-level+
141             +release-name+))
143 (asdf:defsystem :com.dvlsoft.clon
144   :description "The Command-Line Options Nuker."
145   :long-description "Clon is a library for command-line option management.
146 It is intended to ease the creation of standalone Common Lisp applications by
147 providing a powerful and uniform command-line option interface.
148 The most important features of Clon are:
149 - [from the programmer's point of view] Centralized command-line options
150   specification and management, including automatic generation of help
151   strings, conversion from command-line / environment strings to
152   application-level option values, global or on-demand option retrieval, and
153   extensibility (the programmer can define his own option types).
154 - [from the end-user's point of view] Uniform command-line option syntax
155   across Clonified applications, including customization of the help strings
156   layout (with optional ISO6429 coloring on terminals that support it),
157   possibly abbreviated option calls and short/long syntax."
158   :author "Didier Verna <didier@lrde.epita.fr>"
159   :maintainer "Didier Verna <didier@lrde.epita.fr>"
160   :license "GNU GPL"
161   :version #.(version :long)
162   :depends-on (#+sbcl             :sb-posix
163                #+(and clisp cffi) :cffi)
164   :components ((:file "package")
165                #+sbcl
166                (:module "sbcl"
167                  :depends-on ("package")
168                  :serial t
169                  :components ((sb-grovel:grovel-constants-file
170                                "constants" :package :com.dvlsoft.clon)
171                               (:file "util")))
173                #+(and clisp cffi)
174                (:module "clisp"
175                  :depends-on ("package")
176                  :serial t
177                  :components ((cffi-grovel:grovel-file "constants")
178                               (:file "util")))
179                (module "src"
180                  :depends-on (#+sbcl "sbcl"
181                               #+(and clisp cffi) "clisp"
182                               "package")
183                  :components ((:file "util")
184                               (:file "item" :depends-on ("util"))
185                               (:file "text" :depends-on ("item"))
186                               (:module "options"
187                                 :depends-on ("text")
188                                 :components ((:file "option")
189                                              (:file "flag"
190                                                     :depends-on ("option"))
191                                              (:file "valued"
192                                                     :depends-on ("option"))
193                                              (:file "negatable"
194                                                     :depends-on ("valued"))
195                                              (:file "switch-base"
196                                                     :depends-on ("negatable"))
197                                              (:file "switch"
198                                                     :depends-on
199                                                     ("switch-base"))
200                                              (:file "stropt"
201                                                     :depends-on ("valued"))
202                                              (:file "lispobj"
203                                                     :depends-on ("valued"))
204                                              (:file "path"
205                                                     :depends-on ("valued"))
206                                              (:file "enum-base")
207                                              (:file "enum"
208                                                     :depends-on
209                                                     ("valued" "enum-base"))
210                                              (:file
211                                               "xswitch"
212                                               :depends-on ("valued"
213                                                            "switch-base"
214                                                            "enum-base"))))
215                               (:file "container" :depends-on ("options"))
216                               (:file "group" :depends-on ("container"))
217                               (:module "retrieval"
218                                 :depends-on ("options")
219                                 :components ((:file "cmdline")
220                                              (:file "environ")))
221                               (:file "synopsis" :depends-on ("group"))
222                               (:module "output"
223                                 :depends-on ("synopsis" "retrieval")
224                                 :components ((:file "face")
225                                              (:file "sheet"
226                                                     :depends-on ("face"))))
227                               (:file "context" :depends-on ("output"))))))
230 ;;; com.dvlsoft.clon.asd ends here