This commit is contained in:
2019-09-17 14:10:01 -04:00
parent b23372cb29
commit a33259ed52
7 changed files with 80 additions and 60 deletions
+21 -11
View File
@@ -206,12 +206,26 @@ class TaskScript(BaseAction):
actions = [t for t in gen_actions()]
if recursive:
graph = {}
actions = []
_last_action = None
for _, action in list(networkx.dfs_edges(self.bashfile.graph, self)):
if _last_action != action:
actions.append(action)
_last_action = action
edge_view = networkx.edge_dfs(
self.bashfile.graph, self, orientation="original"
)
for parent, child, _ in edge_view:
if parent not in graph:
graph[parent] = [child]
else:
graph[parent].append(child)
for task in graph:
for action in graph[task]:
for dep_action in graph.get(action, []):
if dep_action not in actions:
actions.append(dep_action)
if action not in actions:
actions.append(action)
return actions
@@ -357,13 +371,9 @@ class Bakefile:
g = networkx.OrderedDiGraph()
for task in self.tasks.values():
if task not in g:
g.add_node(task)
g.add_node(task)
for dep in task.depends_on():
if dep not in g:
g.add_node(dep)
g.add_node(dep)
g.add_edge(task, dep)
self._graph = g
+6 -5
View File
@@ -269,11 +269,12 @@ def entrypoint(
depends_on = ()
if depends_on:
deps = []
for dep in depends_on:
if dep.is_filter:
dep = click.style(str(dep), fg="yellow")
deps.append(str(dep))
# deps = []
# for dep in depends_on:
# if dep.is_filter:
# dep = click.style(str(dep), fg="yellow")
# deps.append(str(dep))
deps = [str(a) for a in depends_on]
deps = f"\n {click.style('+', fg='yellow', bold=True)} {eng_join(deps, conj='&')}."
else:
deps = ""
-1
View File
@@ -12,4 +12,3 @@ ms/package: install/system
install/system:
npm install -g yo generator-code vsce
vnfpzyctwdml75il7y5prfe3637lbvr4wpkje3mtecgbqbm3fhmq
+5
View File
@@ -33,6 +33,11 @@ This project seeks to bridge all of these worlds into a single entrypoint — i
- Tasks can be run safely and reliably. Rest assured that scripts are executed from the project root (e.g. location of the `Bakefile`).
- See [advanced example](https://github.com/kennethreitz/bake#advanced-usage-sample) for further, juicy, details.
### Community / Contrib
- [Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=kennethreitz.bake) — highlights `Bakefile`.
------------------
## Installing `$ bake`
Binary file not shown.
+47 -42
View File
@@ -1,43 +1,48 @@
{
"name": "bake",
"displayName": "bake",
"description": "Hilighting for Bake: a strangely familiar task runner.",
"version": "0.0.1",
"publisher": "kennethreitz",
"repository": "https://github.com/kennethreitz/bake.git",
"engines": {
"vscode": "^1.38.0"
},
"categories": [
"Programming Languages"
],
"contributes": {
"languages": [
{
"id": "bakefile",
"aliases": [
"Bakefile",
"bakefile"
],
"extensions": [
"Bakefile"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "bakefile",
"scopeName": "source.bakefile",
"path": "./syntaxes/Bakefile.syntax.json",
"embeddedLanguages": {
"task": "source.shell"
}
}
]
},
"dependencies": {
"generator-code": "^1.2.6",
"vsce": "^1.66.0"
}
}
"name": "bake",
"displayName": "bake",
"description": "Hilighting for Bake: a strangely familiar task runner.",
"version": "0.0.1",
"publisher": "kennethreitz",
"repository": "https://github.com/kennethreitz/bake.git",
"engines": {
"vscode": "^1.38.0"
},
"categories": [
"Programming Languages"
],
"contributes": {
"languages": [
{
"id": "bakefile",
"aliases": [
"Bakefile",
"bakefile"
],
"extensions": [
"Bakefile"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "bakefile",
"scopeName": "source.bakefile",
"path": "./syntaxes/Bakefile.syntax.json",
"embeddedLanguages": {
"task": "source.shell"
}
}
]
},
"dependencies": {
"generator-code": "^1.2.6",
"vsce": "^1.66.0"
},
"__metadata": {
"id": "9c773cc4-328c-4e24-84c9-3cc5ba85b3d0",
"publisherDisplayName": "kennethreitz",
"publisherId": "7bf106b0-2ddb-49af-9b16-bbd0067cf5a9"
}
}
+1 -1
View File
@@ -18,7 +18,7 @@ URL = "https://github.com/kennethreitz/bake"
EMAIL = "me@kennethreitz.org"
AUTHOR = "Kenneth Reitz"
REQUIRES_PYTHON = ">=3.6.0"
VERSION = "0.4.1"
VERSION = "0.5.0"
# What packages are required for this module to be executed?
REQUIRED = ["click", "delegator.py", "pygments", "networkx"]