Skip to content

Commit 10af766

Browse files
committed
Make gen-project a visible command
1 parent 2271dc4 commit 10af766

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

template/justfile

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ _default: _status
5454
setup: _check-config _git-init install _git-add && _setup_part2
5555
git commit -m "Initialise git with minimal project" -a
5656

57-
_setup_part2: _gen-project _gendoc
57+
_setup_part2: gen-project _gendoc
5858
git add .
5959
git commit -m "Add generated docs and project artefacts" -a
6060

@@ -63,9 +63,19 @@ _setup_part2: _gen-project _gendoc
6363
install:
6464
poetry install
6565

66+
# Updates project template and LinkML package
67+
[group('project management')]
68+
update: _update-template _update-linkml
69+
70+
# Clean all generated files
71+
[group('project management')]
72+
clean: _clean_project
73+
rm -rf tmp
74+
rm -rf {{docdir}}/*
75+
6676
# (Re-)Generate project and documentation locally
6777
[group('model development')]
68-
site: _gen-project _gendoc
78+
site: gen-project _gendoc
6979

7080
# Deploy documentation site to Github Pages
7181
[group('deployment')]
@@ -85,15 +95,22 @@ lint:
8595
[group('model development')]
8696
testdoc: _gendoc _serve
8797

88-
# Updates project template and LinkML package
89-
[group('project management')]
90-
update: _update-template _update-linkml
91-
92-
# Clean all generated files
93-
[group('project management')]
94-
clean: _clean_project
95-
rm -rf tmp
96-
rm -rf {{docdir}}/*
98+
# Generate project files including Python data model
99+
[group('model development')]
100+
gen-project: _compile_sheets
101+
poetry run gen-project {{config_yaml}} -d {{dest}} {{source_schema_path}}
102+
mv {{dest}}/*.py {{pymodel}}
103+
poetry run gen-pydantic {{gen_pydantic_args}} {{source_schema_path}} > {{pymodel}}/{{schema_name}}_pydantic.py
104+
@if [ ! ${{gen_java_args}} ]; then \
105+
poetry run gen-java {{gen_java_args}} --output-directory {{dest}}/java/ {{source_schema_path}} || true ; \
106+
fi
107+
@if [ ! ${{gen_owl_args}} ]; then \
108+
mkdir -p {{dest}}/owl && \
109+
poetry run gen-owl {{gen_owl_args}} {{source_schema_path}} > {{dest}}/owl/{{schema_name}}.owl.ttl || true ; \
110+
fi
111+
@if [ ! ${{gen_ts_args}} ]; then \
112+
poetry run gen-typescript {{gen_ts_args}} {{source_schema_path}} > {{dest}}/typescript/{{schema_name}}.ts || true ; \
113+
fi
97114

98115
# ============== Migrations recipes for Copier ==============
99116

@@ -138,22 +155,6 @@ _compile_sheets:
138155
mv {{sheet_module_path}}.tmp {{sheet_module_path}}; \
139156
fi
140157

141-
# Generate project files
142-
_gen-project: _compile_sheets
143-
poetry run gen-project {{config_yaml}} -d {{dest}} {{source_schema_path}}
144-
mv {{dest}}/*.py {{pymodel}}
145-
poetry run gen-pydantic {{gen_pydantic_args}} {{source_schema_path}} > {{pymodel}}/{{schema_name}}_pydantic.py
146-
@if [ ! ${{gen_java_args}} ]; then \
147-
poetry run gen-java {{gen_java_args}} --output-directory {{dest}}/java/ {{source_schema_path}} || true ; \
148-
fi
149-
@if [ ! ${{gen_owl_args}} ]; then \
150-
mkdir -p {{dest}}/owl && \
151-
poetry run gen-owl {{gen_owl_args}} {{source_schema_path}} > {{dest}}/owl/{{schema_name}}.owl.ttl || true ; \
152-
fi
153-
@if [ ! ${{gen_ts_args}} ]; then \
154-
poetry run gen-typescript {{gen_ts_args}} {{source_schema_path}} > {{dest}}/typescript/{{schema_name}}.ts || true ; \
155-
fi
156-
157158
# Test schema generation
158159
_test-schema:
159160
poetry run gen-project {{config_yaml}} -d tmp {{source_schema_path}}

0 commit comments

Comments
 (0)