Skip to content
This repository was archived by the owner on Apr 21, 2024. It is now read-only.

Commit 51cca93

Browse files
authored
Merge pull request #20 from cgay/combine
Merge pacman and workspaces into dylan-tool repo
2 parents ec0cbe7 + 2dd86ee commit 51cca93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3538
-486
lines changed

.github/workflows/build-and-test.yml

+19-57
Original file line numberDiff line numberDiff line change
@@ -14,73 +14,35 @@ on:
1414
jobs:
1515
build-and-test:
1616
runs-on: ubuntu-latest
17-
env:
18-
# Install packages and `dylan` binary in a known location.
19-
DYLAN: ./dylan-root
2017

2118
steps:
22-
- uses: dylan-lang/install-dylan-tool@v1
23-
24-
- name: Create workspace
25-
run: ./dylan new workspace dt
26-
27-
# The Makefile assumes dylan-compiler is in the path.
28-
- name: Create symlinks
29-
run: |
30-
cd dt
31-
ln -s ../dylan-compiler
32-
3319
- uses: actions/checkout@v2
3420
with:
35-
path: dt/dylan-tool
21+
submodules: recursive
3622

37-
- uses: actions/checkout@v2
38-
with:
39-
repository: dylan-lang/workspaces
40-
ref: master
41-
path: dt/workspaces
42-
43-
- uses: actions/checkout@v2
44-
with:
45-
repository: dylan-lang/pacman
46-
ref: master
47-
path: dt/pacman
48-
49-
- uses: actions/checkout@v2
50-
with:
51-
repository: dylan-lang/pacman-catalog
52-
ref: master
53-
path: dt/pacman-catalog
54-
55-
- name: Update workspace
56-
run: |
57-
cd dt
58-
DYLAN_CATALOG=./pacman-catalog ../dylan update
59-
# debug
60-
find registry -type f -exec cat {} \; | sort
61-
62-
# The setting of PATH is a little bit tricky below. It is to make sure
63-
# dylan-compiler is on the path. dylan-compiler is in the job's top-level
64-
# directory.
65-
66-
- name: make test
67-
run: |
68-
cd dt/dylan-tool
69-
DYLAN_CATALOG=./pacman-catalog PATH=..:$PATH make pkg-test
23+
- uses: dylan-lang/install-opendylan@v2
7024

71-
- name: make install
25+
- name: test and install
26+
env:
27+
DYLAN_CATALOG: ext/pacman-catalog
28+
DYLAN: dylan-root
7229
run: |
73-
cd dt/dylan-tool
74-
# Installs to ${DYLAN}/bin/dylan
75-
PATH=..:$PATH make install
30+
mkdir -p ${DYLAN}
31+
PATH=.:${PATH} make test
32+
PATH=.:${PATH} make install
7633
7734
- name: Exercise dylan-tool
35+
env:
36+
DYLAN_CATALOG: ext/pacman-catalog
37+
DYLAN: dylan-root
7838
run: |
79-
${DYLAN}/bin/dylan new workspace test-workspace
39+
dylan_exe=$(realpath ${DYLAN}/bin/dylan)
40+
export DYLAN_CATALOG=$(realpath ${DYLAN_CATALOG})
41+
${dylan_exe} new workspace test-workspace
8042
cd test-workspace
81-
${DYLAN}/bin/dylan new library abc strings@1.1
82-
DYLAN_CATALOG=./pacman-catalog ${DYLAN}/bin/dylan update
83-
${DYLAN}/bin/dylan status
84-
${DYLAN}/bin/dylan list
43+
${dylan_exe} new library abc strings@1.1
44+
${dylan_exe} update
45+
${dylan_exe} status
46+
${dylan_exe} list
8547
../dylan-compiler -build abc-test-suite
8648
_build/bin/abc-test-suite

.gitmodules

+12-18
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,24 @@
1-
[submodule "ext/pacman"]
2-
path = ext/pacman
3-
url = https://github.com/dylan-lang/pacman
1+
[submodule "ext/sphinx-extensions"]
2+
path = ext/sphinx-extensions
3+
url = https://github.com/dylan-lang/sphinx-extensions.git
4+
[submodule "ext/command-line-parser"]
5+
path = ext/command-line-parser
6+
url = https://github.com/dylan-lang/command-line-parser
47
[submodule "ext/json"]
58
path = ext/json
69
url = https://github.com/dylan-lang/json
10+
[submodule "ext/logging"]
11+
path = ext/logging
12+
url = https://github.com/dylan-lang/logging
713
[submodule "ext/regular-expressions"]
814
path = ext/regular-expressions
915
url = https://github.com/dylan-lang/regular-expressions
1016
[submodule "ext/uncommon-dylan"]
1117
path = ext/uncommon-dylan
1218
url = https://github.com/dylan-lang/uncommon-dylan
13-
[submodule "ext/workspaces"]
14-
path = ext/workspaces
15-
url = https://github.com/dylan-lang/workspaces
16-
[submodule "ext/command-line-parser"]
17-
path = ext/command-line-parser
18-
url = https://github.com/dylan-lang/command-line-parser
19-
[submodule "ext/logging"]
20-
path = ext/logging
21-
url = https://github.com/dylan-lang/logging.git
22-
[submodule "ext/sphinx-extensions"]
23-
path = ext/sphinx-extensions
24-
url = https://github.com/dylan-lang/sphinx-extensions.git
25-
[submodule "ext/pacman-catalog"]
26-
path = ext/pacman-catalog
27-
url = https://github.com/dylan-lang/pacman-catalog
2819
[submodule "ext/testworks"]
2920
path = ext/testworks
3021
url = https://github.com/dylan-lang/testworks
22+
[submodule "ext/pacman-catalog"]
23+
path = ext/pacman-catalog
24+
url = https://github.com/dylan-lang/pacman-catalog

Makefile

+4-26
Original file line numberDiff line numberDiff line change
@@ -34,40 +34,18 @@ install: build
3434
cp -r _build/lib/lib* $(install_lib)/
3535
mkdir -p $(DYLAN)/bin
3636
@if [ ! -L "$(link_source)" ]; then \
37-
ln -s $(link_target) $(link_source); \
37+
ln -s $$(realpath $(link_target)) $$(realpath $(link_source)); \
3838
fi;
3939

4040
# dylan-tool needs to be buildable with submodules so that it can be built on
41-
# new platforms without having to manually install deps. It's easy to forget to
42-
# test it both ways, hence this target. (We should be able to ditch submodules
43-
# after there's a stable 1.0 version available for bootstrapping.)
41+
# new platforms without having to manually install deps.
4442
test: build
45-
dylan-compiler -build pacman-test-suite && _build/bin/pacman-test-suite
46-
dylan-compiler -build pacman-catalog-test-suite \
47-
&& DYLAN_CATALOG=ext/pacman-catalog _build/bin/pacman-catalog-test-suite
48-
dylan-compiler -build workspaces-test-suite && _build/bin/workspaces-test-suite
43+
dylan-compiler -build dylan-tool-test-suite \
44+
&& DYLAN_CATALOG=ext/pacman-catalog _build/bin/dylan-tool-test-suite
4945

5046
clean:
5147
rm -rf _build
5248

5349
distclean: clean
5450
rm -rf $(install_dir)
5551
rm -f $(link_source)
56-
57-
pkg-build:
58-
cd .. && dylan-compiler -build dylan-tool
59-
60-
# Note that whereas the test target tests the submoduled catalog this tests the
61-
# installed catalog since we don't know if pacman-catalog is an active package
62-
# or not.
63-
pkg-test: pkg-build
64-
../_build/bin/dylan-tool update
65-
cd .. && dylan-compiler -build pacman-test-suite \
66-
&& DYLAN_CATALOG=./pacman-catalog _build/bin/pacman-test-suite
67-
cd .. && dylan-compiler -build pacman-catalog-test-suite \
68-
&& DYLAN_CATALOG=./pacman-catalog _build/bin/pacman-catalog-test-suite
69-
cd .. && dylan-compiler -build workspaces-test-suite \
70-
&& _build/bin/workspaces-test-suite
71-
72-
pkg-clean:
73-
rm -rf ../_build

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Dylan Tool
22

3-
[![Gitter](https://badges.gitter.im/dylan-lang/general.svg)](https://gitter.im/dylan-lang/general?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
3+
[![Gitter](https://badges.gitter.im/dylan-lang/general.svg)](https://gitter.im/dylan-lang/general?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![tests](https://github.com/cgay/dylan-tool/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/cgay/dylan-tool/actions/workflows/build-and-test.yml)
44

55
**Note:** Because an executable named `dylan` conflicts with the base Dylan
66
library during the build process, this library is named `dylan-tool` and then

commands/command-line.dylan

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Module: dylan-tool-commands
2+
Synopsis: Definition of the command-line as a whole
3+
4+
5+
// Parent of "new library" and "new workspace".
6+
define class <new-subcommand> (<subcommand>)
7+
keyword name = "new";
8+
keyword help = "";
9+
end;
10+
11+
define function dylan-tool-command-line
12+
() => (p :: <command-line-parser>)
13+
make(<command-line-parser>,
14+
help: "Tool to maintain Dylan dev workspaces and installed packages.",
15+
options: list(make(<flag-option>,
16+
name: "verbose",
17+
help: "Generate more verbose output."),
18+
make(<flag-option>,
19+
name: "debug",
20+
help: "Enter the debugger (or print a backtrace) on error.")),
21+
subcommands:
22+
list($install-subcommand,
23+
$list-subcommand,
24+
make(<new-subcommand>,
25+
subcommands: list($new-library-subcommand,
26+
$new-workspace-subcommand)),
27+
$update-subcommand,
28+
$status-subcommand))
29+
end function;

commands/dylan-tool-commands.lid

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Library: dylan-tool-commands
2+
Files: library.dylan
3+
../pacman/utils.dylan
4+
../pacman/versions.dylan
5+
../pacman/packages.dylan
6+
../pacman/catalog.dylan
7+
../pacman/deps.dylan
8+
../pacman/install.dylan
9+
../workspaces/registry.dylan
10+
../workspaces/workspaces.dylan
11+
utils.dylan
12+
simple-commands.dylan
13+
new-library.dylan
14+
command-line.dylan

0 commit comments

Comments
 (0)