Skip to content

Commit

Permalink
Merge pull request #1 from cgay/deft
Browse files Browse the repository at this point in the history
I dub thee "Deft"
  • Loading branch information
cgay authored Apr 21, 2024
2 parents 292b7bf + 12f0297 commit 7755a43
Show file tree
Hide file tree
Showing 36 changed files with 238 additions and 259 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ jobs:
mkdir -p ${DYLAN}
make install
- name: Exercise installed dylan-tool
- name: Exercise deft
env:
DYLAN_CATALOG: ext/pacman-catalog
DYLAN: dylan-root
run: |
dylan_exe="$(realpath ${DYLAN}/bin/dylan-tool-app)"
exe="$(realpath ${DYLAN}/bin/deft-app)"
export DYLAN_CATALOG="$(realpath ${DYLAN_CATALOG})"
${dylan_exe} new library --force-package abc strings@1.1
${exe} new library --force-package abc strings@1.1
cd abc
${dylan_exe} update
${dylan_exe} status
${dylan_exe} list
${dylan_exe} build abc-test-suite
${exe} update
${exe} status
${exe} list
${exe} build abc-test-suite
_build/bin/abc-test-suite
45 changes: 15 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,72 +1,57 @@
# Low-tech Makefile to build and install dylan-tool.

# Building an executable for a library named "dylan" causes a conflict with the
# base dylan library. I want this tool to be named "dylan" on the command line,
# so it's necessary to use a makefile to build and then rename the executable
# during the installation process.

# Because there's currently no way to make a static executable this gets
# installed with the following directory structure:
#
# ${DYLAN}/install/dylan-tool/bin/dylan-tool # dylan-tool executable
# ${DYLAN}/install/dylan-tool/lib/* # dylan-tool used libraries
# ${DYLAN}/bin/dylan # symlink
# -> ../install/dylan-tool/bin/dylan-tool # to here
#
# So just make sure ${DYLAN}/bin (or ${HOME}/dylan/bin, the default) is on your path.
# Low-tech Makefile to build and install deft.

DYLAN ?= $${HOME}/dylan
install_dir = $(DYLAN)/install/dylan-tool
install_dir = $(DYLAN)/install/deft
install_bin = $(install_dir)/bin
install_lib = $(install_dir)/lib
link_target = $(install_bin)/dylan-tool-app
link_target = $(install_bin)/deft-app
link_source = $(DYLAN)/bin/dylan

git_version := "$(shell git describe --tags --always --match 'v*')"

.PHONY: build build-with-version clean install install-debug really-install remove-dylan-tool-artifacts test dist distclean
.PHONY: build build-with-version clean install install-debug really-install remove-deft-artifacts test dist distclean

build: remove-dylan-tool-artifacts
OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry dylan-compiler -build -unify dylan-tool-app
build: remove-deft-artifacts
OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry dylan-compiler -build -unify deft-app

# Hack to add the version to the binary with git tag info. Don't want this to
# be the normal build because it causes unnecessary rebuilds.
build-with-version: remove-dylan-tool-artifacts
build-with-version: remove-deft-artifacts
file="sources/commands/utils.dylan"; \
orig=$$(mktemp); \
temp=$$(mktemp); \
cp -p $${file} $${orig}; \
cat $${file} | sed "s,/.__./.*/.__./,/*__*/ \"${git_version}\" /*__*/,g" > $${temp}; \
mv $${temp} $${file}; \
OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry \
dylan-compiler -build -unify dylan-tool-app; \
dylan-compiler -build -unify deft-app; \
cp -p $${orig} $${file}

really-install:
mkdir -p $(DYLAN)/bin
cp _build/sbin/dylan-tool-app $(DYLAN)/bin/
cp _build/sbin/deft-app $(DYLAN)/bin/

install: build-with-version really-install

# Build and install without the version hacking above.
install-debug: build really-install

# dylan-tool needs to be buildable with submodules so that it can be built on
# Deft needs to be buildable with submodules so that it can be built on
# new platforms without having to manually install deps.
test: build
OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry \
dylan-compiler -build dylan-tool-test-suite \
&& DYLAN_CATALOG=ext/pacman-catalog _build/bin/dylan-tool-test-suite
dylan-compiler -build deft-test-suite \
&& DYLAN_CATALOG=ext/pacman-catalog _build/bin/deft-test-suite

dist: distclean install

# Sometimes I use dylan-tool to develop dylan-tool, so this makes sure to clean
# Sometimes I use deft to develop deft, so this makes sure to clean
# up its artifacts.
remove-dylan-tool-artifacts:
remove-deft-artifacts:
rm -rf _packages
find registry -not -path '*/generic/*' -type f -exec rm {} \;

clean: remove-dylan-tool-artifacts
clean: remove-deft-artifacts
rm -rf _build
rm -rf _test

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Dylan Tool
# Deft

[![tests](https://github.com/dylan-lang/dylan-tool/actions/workflows/test.yaml/badge.svg)](https://github.com/dylan-lang/dylan-tool/actions/workflows/test.yaml)
[![GitHub issues](https://img.shields.io/github/issues/dylan-lang/dylan-tool?color=blue)](https://github.com/dylan-lang/dylan-tool/issues)
[![tests](https://github.com/dylan-lang/deft/actions/workflows/test.yml/badge.svg)](https://github.com/dylan-lang/deft/actions/workflows/test.yml)
[![GitHub issues](https://img.shields.io/github/issues/dylan-lang/deft?color=blue)](https://github.com/dylan-lang/deft/issues)
[![Matrix](https://img.shields.io/matrix/dylan-lang-general:matrix.org?color=blue&label=Chat%20on%20Matrix&server_fqdn=matrix.org)](https://app.element.io/#/room/#dylan-language:matrix.org)

* Package management
Expand All @@ -10,13 +10,13 @@
* No more Git submodules
* Build/test from anywhere in your workspace

The `dylan` tool simplifies the management of Dylan workspaces and packages and
Deft simplifies the management of Dylan workspaces and packages and
provides a simplified interface to the Open Dylan compiler for building and
(soon) testing, and generating documentation. It eliminates the need to manage
library locations (registries) by hand and the need to use git submodules to
track dependencies.

$ dylan new application hello
$ deft new application hello
Downloaded pacman-catalog@master to /tmp/dylan/_packages/pacman-catalog/master/src/
Created library hello.
Created library hello-test-suite.
Expand All @@ -29,7 +29,7 @@ track dependencies.

$ cd hello

$ dylan build --all
$ deft build --all
Open Dylan 2023.1
Build of 'hello-test-suite' completed
Build of 'hello-app' completed
Expand All @@ -45,9 +45,9 @@ repository. For any package to be downloadable it must have an entry in the
catalog.

Full documentation is
[here](https://opendylan.org/package/dylan-tool).
[here](https://opendylan.org/package/deft).

## Bugs

If you have a feature request, think something should be designed differently, or find
bugs, [file a bug report](https://github.com/dylan-lang/dylan-tool/issues).
bugs, [file a bug report](https://github.com/dylan-lang/deft/issues).
4 changes: 2 additions & 2 deletions documentation/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('../../_packages/sphinx-extensions/current/src/sphinxcontrib'))
sys.path.insert(0, os.path.abspath('../../ext/sphinx-extensions/sphinxcontrib'))
import dylan.themes as dylan_themes


# -- Project information -----------------------------------------------------

project = 'dylan-tool'
project = 'deft'
copyright = '2021, Dylan Hackers'


Expand Down
Loading

0 comments on commit 7755a43

Please sign in to comment.