Creating Packages - racket/racket GitHub Wiki
Create new libraries/Creating Packages
- How to Organize Your Racket Library
- Migrating Your Racket Project from Travis to GitHub Actions (also covers setup if you didn't previously have TravisCI setup)
- Tutorial: Creating a Package by Stephen Chang
- Getting Started with packages
Don't forget to post your creations in the Racket package catalog.
Structure of a multi-collection package with a launcher
The todo-txt
repository is an example of a multi-collection package. The package also defines a launcher (command line program).
The structure of the repository is
$ tree
├── file
│ ├── info.rkt [1]
│ ├── todoreport
│ │ ├── info.rkt [2]
│ │ └── private
│ │ └── cli.rkt
│ ├── todoreport.rkt
│ ├── todo-txt
│ │ ├── doc
│ │ │ ├── ...
│ │ │ └── todo-txt
│ │ │ └── ...
│ │ ├── info.rkt [3]
│ │ ├── private
│ │ │ ├── task-group.rkt
│ │ │ └── task.rkt
│ │ └── scribblings
│ │ └── todo-txt.scrbl
│ └── todo-txt.rkt
├── info.rkt [4]
├── LICENSE
└── ...
There are four info.rkt files:
- This
info.rkt
contains the launcher definition. - This
info.rkt
only defines a collectiontodoreport
- This
info.rkt
is similar to 2, but also contains a definition for the documentation underscribblings
. - This
info.rkt
contains most of the package definition, in particular the line(define collection 'multi)
, the dependencies, the build dependencies, a package description and the package version. This file is adapted from the file that is generated byraco pkg new
.
Sourcehut
Continuous integration (CI) example forHere's an example for a .build.yml
file. It defines four tasks. A good part of the action happens in a Makefile.
These are the .build.yml
tasks:
install-racket
installs Racket as the preparation for all other tasks.build
creates a stand-alone binary for the native platform, which here is Ubuntu LTS (see the beginning of the.build.yml
file).test
runs the available automated tests.run
tries to run the previously built program with different command line arguments and checks some results.build-all
uses the raco-exe-multitarget package (which itself relies on theraco-cross-lib
package) to build standalone-binaries for different operating systems and saves these binaries as build artifacts.