Skip to content

Commit de4e496

Browse files
committed
deft new application: new directory organization
New organization for `deft new application orange` looks like this: ``` dylan-package.json Makefile .gitignore src src/app src/app/main.dylan src/app/orange-app.lid src/app/library.dylan src/tests src/tests/orange-test-suite.lid src/tests/library.dylan src/tests/orange-tests.dylan src/lib src/lib/orange.dylan src/lib/orange.lid src/lib/library.dylan ``` With the --simple option the output is unchanged.
1 parent 168e0a4 commit de4e496

3 files changed

Lines changed: 199 additions & 111 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ For Dylan, this specifically means:
1414
* Manage project dependencies
1515
* No more editing registry files
1616
* No more Git submodules
17-
* Build (and test [TODO]) from anywhere in your workspace
18-
* Create boilerplate for new projects
17+
* Build and test from anywhere in your workspace
18+
* Create application, library, and test suite boilerplate for new projects
1919
* Create reference docs for your project [TODO]
2020

2121
Deft simplifies the management of Dylan workspaces and packages and
22-
provides a simplified interface to the Open Dylan compiler for building and
23-
(soon) testing and generating documentation. It eliminates the need to manage
22+
provides a simplified interface to the Open Dylan compiler for building,
23+
testing, and generating documentation. It eliminates the need to manage
2424
library locations (registries) by hand and the need to use Git submodules to
2525
track dependencies.
2626

documentation/source/index.rst

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
deft - The Dylan CLI
55
********************
66

7-
The :program:`deft` command-line tool is intended to make Dylan development
7+
The :program:`deft` command-line tool makes Dylan development
88
easier by taking care of some of the drudgery for you, including:
99

1010
* managing Dylan workspaces and package dependencies
@@ -195,12 +195,13 @@ to this::
195195
and then run `deft update`_ again::
196196

197197
$ deft update
198-
Workspace directory is /home/you/dylan/workspaces/hello-world/.
199-
Updated 1 file in /home/you/dylan/workspaces/hello-world/registry/.
198+
Downloaded base64@0.3.0 to /home/you/hello-world/_packages/base64/0.3.0/src/
199+
Updated 2 of 20 registry files in /home/you/hello-world/registry/.
200+
200201

201202
Note that we didn't specify a version for "base64", so the latest version is downloaded.
202-
Usually it's a good idea to specify a particular version, like "base64\@0.1". Take a
203-
look at "registry/<your-platform>/base64" to see where the package was installed.
203+
For serious projects it's a good idea to specify a particular version, like "base64\@0.3"
204+
so that dependencies don't change unexpectedly when new versions are released.
204205

205206
We also haven't actually changed the hello-world code to use base64. That is
206207
left as an exercise. (Modify :file:`library.dylan` and run ``deft build -a`` again.)
@@ -210,11 +211,11 @@ Now that you've got a working project, try some other :program:`deft`
210211

211212
* `deft status`_ tells you the status of the active packages. It will find the
212213
``hello-world`` package but will complain that it's not a Git repository. Run
213-
``git init`` in it if you like.
214+
``git init`` if you like.
214215

215216
* `deft list`_ with ``--all`` lists all the packages in the catalog. (Note
216217
that many libraries are still included with Open Dylan. They'll be moved to
217-
packages eventually.)
218+
separate packages in the future.)
218219

219220

220221
.. index::
@@ -530,11 +531,33 @@ http version 1.0 and the latest version of logging. ::
530531
$ _build/bin/killer-test-suite
531532
$ _build/bin/killer-app
532533

533-
You must run ``deft update`` whenever dependencies are changed, to install the
534-
new dependencies and update the registry files.
534+
.. note:: The executable is named "killer-app" because it can't have the same name as the
535+
shared library, "killer". The compiler would complain that "killer" depends on
536+
itself. Instead, a :file:`Makefile` is generated for the purpose of renaming the
537+
executable file to "killer" during installation. Just run ``make install``.
538+
539+
You may of course rename the executable to "killer" and the shared library to
540+
"killer-lib" or whatever you like. Naming is hard.
541+
542+
You must run `deft update`_ whenever dependencies are changed, to install the new
543+
dependencies and update the registry files.
535544

536545
**See also:** `deft new library`_
537546

547+
**Options:**
548+
549+
``--force-package``, ``-p``
550+
Create :file:`dylan-package.json` even if already inside a package. This is
551+
intended for testing and continuous integration use.
552+
553+
``--git``
554+
Generate a ``.gitignore`` file. The default is false.
555+
556+
``--simple``
557+
Generate only an executable application, without a separate shared library or
558+
test suite. This also generates all files in the top-level directory. This option
559+
is intended to be useful for making "throw away" libraries for learning or testing
560+
purposes.
538561

539562
.. index::
540563
single: deft new library subcommand
@@ -548,7 +571,8 @@ Generate code for a new shared library.
548571
Synopsis: ``deft new library [options] <name> [<dependency> ...]``
549572

550573
This command is the same as `deft new application`_ except that it doesn't
551-
generate the corresponding ``<name>-app`` executable library.
574+
generate the corresponding ``<name>-app`` executable library or the associated
575+
:file:`Makefile`.
552576

553577
Specifying dependencies is optional. They should be in the same form as
554578
specified in the :file:`dylan-package.json` file. For example, "strings\@1.0".
@@ -560,8 +584,8 @@ This command generates the following code:
560584
* A :file:`dylan-package.json` file (unless this new library is being added to
561585
an existing package).
562586

563-
You must run ``deft update`` whenever dependencies are changed, to install
564-
the new dependencies and update the registry files.
587+
You must run `deft update`_ whenever dependencies are changed, to install the new
588+
dependencies and update the registry files.
565589

566590
**See also:** `deft new application`_
567591

@@ -571,6 +595,9 @@ the new dependencies and update the registry files.
571595
Create :file:`dylan-package.json` even if already inside a package. This is
572596
intended for testing and continuous integration use.
573597

598+
``--git``
599+
Generate a ``.gitignore`` file. The default is false.
600+
574601
Here's an example of creating a library named "http" which depends on "strings"
575602
version 1.0 and the latest version of "logging". ::
576603

@@ -602,8 +629,8 @@ Synopsis: ``deft new workspace [options] <name>``
602629

603630
**Options:**
604631

605-
``--directory``
606-
Create the workspace under this directory instead of in the current working
632+
``--directory=DIR``
633+
Create the workspace under ``DIR`` instead of in the current working
607634
directory.
608635

609636
`deft new workspace`_ creates a new workspace directory and initializes it

0 commit comments

Comments
 (0)