garden: run "doc" before "pages"
[git-cola.git] / garden.yaml
blob87a44730cf7eaf636f06b5603bdca65cb82d91ea
1 # Use "cargo install garden-tools" to install garden https://gitlab.com/garden-rs/garden
3 #   # Installation
4 #   garden install              # Install git-cola to the installation ${prefix}
5 #   garden doc                  # Generate documentation: html + manual pages
6 #   garden install docs         # Install documentation
8 #   # Variables can be overridden using "-D name=value", e.g.:
9 #   garden -D prefix=$PWD/dist install docs
10 #   garden -D DESTDIR=/tmp/stage -D prefix=/usr/local install
12 #   # Development
13 #   garden test                 # Run the test suite
14 #   garden fmt                  # Format code using "cercis"
15 #   garden html                 # Generate documentation: html only
16 #   garden man                  # Generate documentation: manual pages only
17 #   garden pot                  # Regenerate git-cola.pot with new translations
18 #   garden po                   # Update .po files with new translations from git-cola.pot
19 #   garden pages                # Install the pages/ website documentation.
21 #   # macOS
22 #   garden macos/app            # Build a git-cola.app bundle
24 #   # Related Projects
25 #   garden grow pages           # Clone the Git Cola homepage
26 #   garden grow fedora          # Clone the Fedora packaging
27 #   garden grow deb             # Clone the Debian packaging
28 trees:
29   git-cola:
30     description: The highly-caffeinated Git GUI
31     path: "${GARDEN_CONFIG_DIR}"
32     url: "git@gitlab.com:git-cola/git-cola.git"
33     commands:
34       doc: ${GARDEN} -vv cmd docs html man -- "$@"
35       dev: ${PYTHON} -m venv --system-site-packages ${env_dir}
36       dev>:
37         - dev/extras
38         - dev/development
39         - dev/build
40       dev/build: ${activate} ${PIP} install --editable '.[build]'
41       dev/development: ${activate} ${PIP} install --editable '.[docs,dev]'
42       dev/extras: ${activate} ${PIP} install --editable '.[extras]'
43       dev/pyqt6: ${activate} ${PIP} install --editable '.[pyqt6]'
44       dev/env: ${activate} "$@"
45       check>:
46         - test
47         - doc
48         - pylint
49       fmt: |
50         ${activate}
51         ${CERCIS} --version
52         ${GIT} ls-files -- '*.py' |
53         ${GREP} -v ^qtpy |
54         ${XARGS} ${CERCIS} "$@"
55       html: ${GARDEN} -vv html docs
56       install: |
57         if test -n "${DESTDIR}"
58         then
59             pip_root="--root=${DESTDIR}"
60             export DESTDIR="${DESTDIR}"
61         fi
62         ${PIP} install --disable-pip-version-check $pip_root --prefix=${prefix} "$@" .
63       i18n>:
64         - pot
65         - po
66       macos/app: |
67         ${MKDIR_P} ${cola_app}/Contents/MacOS
68         ${MKDIR_P} ${cola_app_resources}
69         ${PYTHON} -m venv ${cola_app_resources}
70         source ${cola_app_resources}/bin/activate
71         ${PIP} install '.[docs,extras,pyqt6]'
72         ${CP} contrib/darwin/Info.plist contrib/darwin/PkgInfo ${cola_app}/Contents
73         if test -n "${cola_full_version}"
74         then
75             ${SED} -i -e s/0.0.0.0/${cola_full_version}/ ${cola_app}/Contents/Info.plist
76         fi
77         ${SED} -i -e s/0.0.0/${cola_version}/ ${cola_app}/Contents/Info.plist
78         ${CP} contrib/darwin/git-cola ${cola_app}/Contents/MacOS
79         ${CP} contrib/darwin/git-cola.icns ${cola_app}/Contents/Resources
80         ${GARDEN} -vv -D prefix=${cola_app_resources} install
81         ${GARDEN} -vv doc
82         ${GARDEN} -vv -D prefix=${cola_app_resources} install docs
83       man: ${GARDEN} -vv man docs
84       po: |
85         for po in cola/i18n/*.po
86         do
87             ${MSGMERGE} \
88                 --no-wrap \
89                 --no-fuzzy-matching \
90                 --sort-output \
91                 --output-file $$po.new \
92                 $$po \
93                 cola/i18n/git-cola.pot
94             mv $$po.new $$po
95         done
96       pot: |
97         ${XGETTEXT} \
98             --language=Python \
99             --keyword=N_ \
100             --no-wrap \
101             --omit-header \
102             --sort-output \
103             --output-dir cola/i18n \
104             --output git-cola.pot \
105             cola/*.py \
106             cola/*/*.py
107       pages<: doc
108       pages: ${GARDEN} -vv -D prefix=${TREE_PATH}/pages install docs "$@"
109       pylint: |
110         ${PYLINT} --version
111         ${PYLINT} ${PYLINT_OPTIONS} --rcfile=.pylintrc "$@" cola test
112       run: ${activate} ./bin/git-cola "$@"
113       run/qt6: ${activate} QT_API=PyQt6 ./bin/git-cola "$@"
114       test: ${activate} ${PYTEST_CMD} cola test "$@"
115       tox: ${TOX} run "$@"
116       tox/check: ${TOX} run -e check "$@"
117     remotes:
118       BaumiCoder: "https://github.com/BaumiCoder/git-cola.git"
119       DasaniT: "https://github.com/DasaniT/git-cola.git"
120       Mailaender: "https://github.com/Mailaender/git-cola.git"
121       Mithil467: "https://github.com/Mithil467/git-cola.git"
122       NielBuys: "https://github.com/NielBuys/git-cola.git"
123       WNguyen14: "https://github.com/WNguyen14/git-cola.git"
124       abid1998: "https://github.com/abid1998/git-cola.git"
125       achernet: "https://github.com/achernet/git-cola.git"
126       axel-h: "https://github.com/axel-h/git-cola.git"
127       bearsh: "https://github.com/bearsh/git-cola.git"
128       bensmrs: "https://github.com/bensmrs/git-cola.git"
129       bobvanderlinden: "https://github.com/bobvanderlinden/git-cola.git"
130       brccabral: "https://github.com/brccabral/git-cola.git"
131       davvid: "git@github.com:davvid/git-cola.git"
132       dschwoerer: "https://github.com/dschwoerer/git-cola.git"
133       florisla: "https://github.com/florisla/git-cola.git"
134       fu7mu4: "https://github.com/fu7mu4/git-cola.git"
135       gdebure: "https://github.com/gdebure/git-cola.git"
136       github: "git@github.com:git-cola/git-cola.git"
137       guoyunhe: "https://github.com/guoyunhe/git-cola.git"
138       gyuris: "https://github.com/gyuris/git-cola.git"
139       haffmans: "https://github.com/haffmans/git-cola.git"
140       harmathy: "https://github.com/harmathy/git-cola.git"
141       hsoft: "https://github.com/hsoft/git-cola.git"
142       jamie-pate: "https://github.com/jamie-pate/git-cola.git"
143       kenyuy: "https://github.com/kenyuy/git-cola.git"
144       kisaragi-hiu: "https://github.com/kisaragi-hiu/git-cola.git"
145       kneirinck: "https://github.com/kneirinck/git-cola.git"
146       kurtmckee: "https://github.com/kurtmckee/git-cola.git"
147       laerreal: "https://github.com/laerreal/git-cola.git"
148       lah7: "https://github.com/lah7/git-cola.git"
149       living180: "https://github.com/living180/git-cola.git"
150       ljhcage: "https://github.com/ljhcage/git-cola.git"
151       malpas: "https://github.com/malpas/git-cola.git"
152       melkecelioglu: "https://github.com/melkecelioglu/git-cola.git"
153       milestone12: "https://github.com/milestone12/git-cola.git"
154       mmargoliono: "https://github.com/mmargoliono/git-cola"
155       mp-chet: "https://github.com/mp-chet/git-cola.git"
156       nakanoi: "https://github.com/nakanoi/git-cola.git"
157       nandalopes: "https://github.com/nandalopes/git-cola.git"
158       OriShalhon: "https://github.com/OriShalhon/git-cola.git"
159       pilarmolinalopez: "https://github.com/pilarmolinalopez/git-cola.git"
160       quintusfelix: "https://github.com/quintusfelix/git-cola.git"
161       rafaelreuber: "https://github.com/rafaelreuber/git-cola.git"
162       scop: "https://github.com/scop/git-cola.git"
163       sergei-dyshel: "https://github.com/sergei-dyshel/git-cola.git"
164       sthalik: "https://github.com/sthalik/git-cola.git"
165       skunkwerks: "https://github.com/skunkwerks/git-cola.git"
166       takluyver: "https://github.com/takluyver/git-cola.git"
167       thk123: "https://github.com/thk123/git-cola.git"
168       timgates42: "https://github.com/timgates42/git-cola.git"
169       vdragon: "https://github.com/Vdragon/git-cola.git"
170       victorhck: "https://github.com/victorhck/git-cola.git"
171       virtualstaticvoid: "https://github.com/virtualstaticvoid/git-cola.git"
172       wm4: "https://github.com/wm4/git-cola.git"
173       wojnilowicz: "https://github.com/wojnilowicz/git-cola.git"
174       yaellevy: "https://github.com/yaellevy/git-cola.git"
175   deb:
176     description: Debian packaging
177     url: "git@gitlab.com:git-cola/git-cola-debian.git"
178     remotes:
179       davvid: "git@github.com:davvid/git-cola-debian.git"
180   docs:
181     description: Sphinx documentation
182     variables:
183       env_dir: ../env3
184     commands:
185       clean: rm -fr _build
186       doctest: ${activate} ${SPHINX_CMD} -b doctest . _build/doctest "$@"
187       html: ${activate} ${SPHINX_CMD} -b html . _build/html "$@"
188       man: ${activate} ${SPHINX_CMD} -b man . _build/man "$@"
189       linkcheck: ${activate} ${SPHINX_CMD} -b linkcheck . _build/linkcheck "$@"
190       install: |
191         ${MKDIR_P} ${DESTDIR}${docdir}
192         ${INSTALL} -m 644 *.html ${DESTDIR}${docdir}
193         ${INSTALL} -m 644 *.rst ${DESTDIR}${docdir}
194         # HTML documentation
195         ${MKDIR_P} ${DESTDIR}${htmldir}
196         ${RSYNC_CMD} _build/html/ ${DESTDIR}${htmldir}/
197         # Manual pages
198         ${MKDIR_P} ${DESTDIR}${mandir}
199         ${INSTALL} -m 644 _build/man/git-cola.1 ${DESTDIR}${mandir}
200         ${INSTALL} -m 644 _build/man/git-dag.1 ${DESTDIR}${mandir}
201   fedora:
202     description: Fedora packaging
203     url: "https://src.fedoraproject.org/rpms/git-cola.git"
204     remotes:
205       git-cola: "git@gitlab.com:git-cola/git-cola-fedora.git"
206       davvid: "git@github.com:davvid/git-cola-fedora.git"
207   pages:
208     description: "Git Cola's homepage"
209     url: "git@gitlab.com:git-cola/git-cola.gitlab.io.git"
210     remotes:
211       github: "git@github.com:git-cola/git-cola.github.io.git"
212       ls-jad-elkik: "git://github.com/ls-jad-elkik/git-cola.github.io.git"
213       lz-coder: "https://github.com/lz-coder/git-cola.github.io.git"
214     links:
215       - "https://git-cola.gitlab.io"
216       - "https://git-cola.github.io"
218 # Variables can be overridden externally using "garden -D name=value ...".
219 variables:
220   # Traditional DESTDIR + prefix variables
221   DESTDIR: ""
222   prefix: ${GARDEN_CONFIG_DIR}/dist
223   docdir: ${prefix}/share/doc/git-cola
224   htmldir: ${docdir}/html
225   mandir: ${prefix}/share/man/man1
226   cola_app: ${TREE_PATH}/git-cola.app
227   cola_app_resources: ${cola_app}/Contents/Resources
228   cola_full_version: $ ./bin/git-cola version --brief
229   cola_version: $ ${SED} -e "s/VERSION = '\(.*\)'/\1/"  cola/_version.py
230   is_virtualenv: |
231     $ ${PYTHON} -c '
232     import os, sys
233     if sys.prefix != sys.base_prefix or os.environ.get("VIRTUAL_ENV"):
234         print("true")
235     '
236   env_dir: env3
237   activate: |
238     if test -z "${is_virtualenv}" && test -f "${env_dir}/bin/activate"
239     then
240         source "${env_dir}/bin/activate"
241     fi
242   # External commands and options
243   CERCIS: cercis
244   CP: cp
245   GARDEN: garden
246   GIT: git
247   GREP: grep
248   INSTALL: install
249   MKDIR_P: mkdir -p
250   MSGMERGE: msgmerge
251   PIP: pip
252   PYLINT: ${activate} ${PYTHON} -B -m pylint
253   PYLINT_OPTIONS: |
254     $ ${activate} ${PYLINT} --score=no --help >/dev/null 2>&1 && printf '%s' --score=no
255   PYTEST: ${activate} ${PYTHON} -B -m pytest
256   PYTEST_OPTIONS: $ test "$(uname -s)" != "Linux" && printf '%s' --ignore=cola/inotify.py
257   PYTEST_CMD: ${PYTEST} ${PYTEST_OPTIONS} -p no:cacheprovider
258   PYTHON: python3
259   RSYNC: rsync
260   RSYNC_CMD: ${RSYNC} -r --delete --exclude=.buildinfo
261   SED: sed
262   SPHINX: ${PYTHON} -m sphinx
263   SPHINX_CMD: ${SPHINX} -d _build/doctrees -a
264   TOX: tox
265   XARGS: xargs
266   XGETTEXT: xgettext