-
-
Notifications
You must be signed in to change notification settings - Fork 687
Creating Packages
Stefan Schwarzer edited this page Oct 17, 2022
·
9 revisions
- 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.
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.rktcontains the launcher definition. -
This
info.rktonly defines a collectiontodoreport -
This
info.rktis similar to 2, but also contains a definition for the documentation underscribblings. -
This
info.rktcontains 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.
Continuous integration (CI) example for Sourcehut
Here'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-racketinstalls Racket as the preparation for all other tasks. -
buildcreates a stand-alone binary for the native platform, which here is Ubuntu LTS (see the beginning of the.build.ymlfile). -
testruns the available automated tests. -
runtries to run the previously built program with different command line arguments and checks some results. -
build-alluses the raco-exe-multitarget package (which itself relies on theraco-cross-libpackage) to build standalone-binaries for different operating systems and saves these binaries as build artifacts.
