Skip to content

Commit

Permalink
doit static update
Browse files Browse the repository at this point in the history
  • Loading branch information
bozokopic committed Mar 28, 2024
1 parent b4c4d86 commit 839f9f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 30 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Documentation = "http://hat-syslog.hat-open.com"

[project.optional-dependencies]
dev = [
"hat-doit ~=0.15.11",
"hat-doit ~=0.15.12",
"sphinxcontrib-plantuml >=0.25",
"sphinxcontrib-programoutput >=0.17",
]

[build-system]
requires = ["hat-doit ~=0.15.11"]
requires = ["hat-doit ~=0.15.12"]
build-backend = "hat.doit.pep517"

[tool.pytest.ini_options]
Expand Down
2 changes: 1 addition & 1 deletion requirements.pip.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
appdirs ~=1.4.4
hat-aio ~=0.7.9
hat-doit ~=0.15.11
hat-doit ~=0.15.12
hat-json ~=0.5.26
hat-juggler ~=0.6.14
hat-util ~=0.6.13
Expand Down
38 changes: 11 additions & 27 deletions src_doit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from pathlib import Path
import subprocess

import doit

from hat.doit import common
from hat.doit.docs import (build_sphinx,
build_pdoc)
Expand Down Expand Up @@ -114,33 +112,19 @@ def build(args):
'task_dep': ['node_modules']}


@doit.create_after('node_modules')
def task_static():
"""Copy static files"""
src_dst_dirs = [(src_static_dir,
ui_dir),
(node_modules_dir / '@hat-open/juggler',
ui_dir / 'script/@hat-open/juggler'),
(node_modules_dir / '@hat-open/renderer',
ui_dir / 'script/@hat-open/renderer'),
(node_modules_dir / '@hat-open/util',
ui_dir / 'script/@hat-open/util'),
(node_modules_dir / 'snabbdom/build',
ui_dir / 'script/snabbdom')]

for src_dir, dst_dir in src_dst_dirs:
for src_path in src_dir.rglob('*'):
if not src_path.is_file():
continue

dst_path = dst_dir / src_path.relative_to(src_dir)

yield {'name': str(dst_path),
'actions': [(common.mkdir_p, [dst_path.parent]),
(common.cp_r, [src_path, dst_path])],
'file_dep': [src_path],
'targets': [dst_path],
'task_dep': ['node_modules']}
return common.get_task_copy([(src_static_dir,
ui_dir),
(node_modules_dir / '@hat-open/juggler',
ui_dir / 'script/@hat-open/juggler'),
(node_modules_dir / '@hat-open/renderer',
ui_dir / 'script/@hat-open/renderer'),
(node_modules_dir / '@hat-open/util',
ui_dir / 'script/@hat-open/util'),
(node_modules_dir / 'snabbdom/build',
ui_dir / 'script/snabbdom')],
task_dep=['node_modules'])


def task_pip_requirements():
Expand Down

0 comments on commit 839f9f1

Please sign in to comment.