The asd-generator Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The asd-generator Reference Manual

This is the asd-generator Reference Manual, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 10:46:24 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

asd-generator

Automatic generator for ASDF's .asd files.

This is still in alpha, but I use it to build my own projects, if it means anything. :P

This autoregenerates an .asd file with a customizable :COMPONENTS field, based on the file structure you provide.

The project must have a valid .asd file containing a single asdf:defsystem expression.

The project must have a asd-generator-data.asd file with the structure outlined below.

Installation

Currently, not available from quicklisp.

With Roswell, you can:

$ ros install phoe/asd-generator

Lisp API

write-asd

Syntax: (write-asd system-designator &key im-sure)

This writes the ASD file for a provided ASDF-loadable system.

You need to press Enter before anything happens, unless the im-sure key is set to non-nil.

regen

Syntax: (regen &key im-sure)

This calls write-asd on the current package, as stated in the *package* variable.

You need to press Enter before anything happens, unless the im-sure key is set to non-nil.

Command line API

update-asdf [-y] [-C pathname] [-f data] [[-s SYSTEM]*]

Mostly corresponds to calling regen and write-asd.

Known bugs/TODO

Save all of your files in Emacs before running this, as it will pull files like .#file.lisp into the :COMPONENTS tree along with all others.

Example of usage:

Original asdf file:

(defsystem #:asd-generator-test
 :description "system for testing asd-generator"
 :author "Masataro Asai"
 :depends-on (#:cl-fad
              #:iterate
              #:alexandria)
 :serial t
 :components ())

asd-generator-data.asd

(("package")        ;single element list (<PATH>) is an abbreviation of (:file <PATH>)
 (:file "constants")
 (:file "constants2" :depends-on ("constants")) ; you have to specify :file when you use other features
 (:cffi-grovel-file "grovel") ; works well with asdf extensions
 ;;
 (:dir :src                             ; abbreviation of :module + :components.
       ("a")
       ("b")
       (:dir "sub" ("a"))
       
       (:rest)
       ;; Traverse the current directory recursively and expands to the list of
       ;; files that are not included by any other directives.
       ;; 
       ;; This means that the expansion is affected by the components not just
       ;; before, but also after (:rest).  Thus the files "a", "b", "sub/a", "c",
       ;; "rest", all files below "more-grovels", all files below "non-recursive",
       ;; all files below "sub2" are excluded.
       ;; 
       ;; This could be somewhat similar to the behavior of
       ;; (call-next-method).
       
       ;; (:rest :as :file)    ; You can specify the component type (:file by default).

       ("c")
       
       ;; A file rest.lisp should be included by (:file "rest")
       (:file "rest")
       
       (:dir "more-grovels"
             (:rest :as :cffi-grovel-file)) ; Specifying the component type.
    
       (:dir "non-recursive"
             ;; You can disable the recursive traversal.  Note that while the
             ;; expansion includes only the files immediately below
             ;; "non-recursive" and does not include the files in the
             ;; subdirectory "non-recursive/sub", the files below
             ;; "non-recursive/sub" are also excluded from the above (:rest)
             ;; directive. In other words, all files below "non-recursive" are
             ;; treated as if they are already included.
             (:rest :recursive nil))
         
       (:dir "sub2")                  ; directory without subcomponents imply (:rest).
       ;; (:dir "sub2" (:rest))       ; eqivalent definition
       ))

Result asdf file:

(defsystem #:asd-generator-test
 :description "system for testing asd-generator"
 :author "Masataro Asai"
 :depends-on (#:cl-fad
              #:iterate
              #:alexandria)
 :serial t
 :components ((:file "package")
              (:file "constants")
              (:file "constants2"
               :depends-on ("constants"))
              (:cffi-grovel-file "grovel")
              (:module "src"
               :components ((:file "a")
                            (:file "b")
                            (:module "sub"
                             :components ((:file "a")))
                            (:file "not-specified-anywhere/a")
                            (:file "not-specified-anywhere/b")
                            (:file "not-specified-anywhere/c")
                            (:file "c")
                            (:file "rest")
                            (:module "more-grovels"
                             :components ((:cffi-grovel-file "a")
                                          (:cffi-grovel-file "b")
                                          (:cffi-grovel-file "c")))
                            (:module "non-recursive"
                             :components ((:file "a")
                                          (:file "b")
                                          (:file "c")))
                            (:module "sub2"
                             :components ((:file "a")
                                          (:file "b")
                                          (:file "c")))))))

Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 asd-generator

Author

MichaƂ "phoe" Herda <phoe@openmailbox.org>

License

GPLv3

Description

Automatic directory scanner/generator for .asd project files.

Dependencies
Source

asd-generator.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 asd-generator.asd

Location

asd-generator.asd

Systems

asd-generator (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 asd-generator/package.lisp

Parent

asd-generator (system)

Location

package.lisp

Packages

asd-generator


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 asd-generator/asd-generator.lisp

Dependency

package.lisp (file)

Parent

asd-generator (system)

Location

asd-generator.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 asd-generator

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: regen &key IM-SURE
Package

asd-generator

Source

asd-generator.lisp (file)

Function: write-asd SYSTEM &key IM-SURE DATA
Package

asd-generator

Source

asd-generator.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Macros

Macro: ensure-system PLACE

Ensure the PLACE is a system

Package

asd-generator

Source

asd-generator.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: all-pathnames DIRECTORY
Package

asd-generator

Source

asd-generator.lisp (file)

Function: backup-pathname PATHNAME
Package

asd-generator

Source

asd-generator.lisp (file)

Function: expand DATA DIR
Package

asd-generator

Source

asd-generator.lisp (file)

Function: generate-asd SYSTEM &optional DATA
Package

asd-generator

Source

asd-generator.lisp (file)

Function: generate-components SYSTEM DATA

Generate a form for the :COMPONENT section of the ASDF definition of SYSTEM, from the given DATA

Package

asd-generator

Source

asd-generator.lisp (file)

Function: get-unix-time ()
Package

asd-generator

Source

asd-generator.lisp (file)

Function: pprint-asd ASDF-DEFINITION &optional *STANDARD-OUTPUT*
Package

asd-generator

Source

asd-generator.lisp (file)

Function: process-rest-form DIR PATHS &key AS RECURSIVE TYPE
Package

asd-generator

Source

asd-generator.lisp (file)

Function: read-asd ASD-PATHNAME

Read a definition file and find the asdf definition. Handle older ASDF files which contain multiple forms. The recent ASDF assumes one system per file.

Package

asd-generator

Source

asd-generator.lisp (file)

Function: to-string SYMBOL
Package

asd-generator

Source

asd-generator.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   A   F   L  
Index Entry  Section

A
asd-generator.asd: The asd-generator<dot>asd file
asd-generator/asd-generator.lisp: The asd-generator/asd-generator<dot>lisp file
asd-generator/package.lisp: The asd-generator/package<dot>lisp file

F
File, Lisp, asd-generator.asd: The asd-generator<dot>asd file
File, Lisp, asd-generator/asd-generator.lisp: The asd-generator/asd-generator<dot>lisp file
File, Lisp, asd-generator/package.lisp: The asd-generator/package<dot>lisp file

L
Lisp File, asd-generator.asd: The asd-generator<dot>asd file
Lisp File, asd-generator/asd-generator.lisp: The asd-generator/asd-generator<dot>lisp file
Lisp File, asd-generator/package.lisp: The asd-generator/package<dot>lisp file

Jump to:   A   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   A   B   E   F   G   M   P   R   T   W  
Index Entry  Section

A
all-pathnames: Internal functions

B
backup-pathname: Internal functions

E
ensure-system: Internal macros
expand: Internal functions

F
Function, all-pathnames: Internal functions
Function, backup-pathname: Internal functions
Function, expand: Internal functions
Function, generate-asd: Internal functions
Function, generate-components: Internal functions
Function, get-unix-time: Internal functions
Function, pprint-asd: Internal functions
Function, process-rest-form: Internal functions
Function, read-asd: Internal functions
Function, regen: Exported functions
Function, to-string: Internal functions
Function, write-asd: Exported functions

G
generate-asd: Internal functions
generate-components: Internal functions
get-unix-time: Internal functions

M
Macro, ensure-system: Internal macros

P
pprint-asd: Internal functions
process-rest-form: Internal functions

R
read-asd: Internal functions
regen: Exported functions

T
to-string: Internal functions

W
write-asd: Exported functions

Jump to:   A   B   E   F   G   M   P   R   T   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables


Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   A   P   S  
Index Entry  Section

A
asd-generator: The asd-generator system
asd-generator: The asd-generator package

P
Package, asd-generator: The asd-generator package

S
System, asd-generator: The asd-generator system

Jump to:   A   P   S