Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Hdlmake
Commits
82d2f907
Commit
82d2f907
authored
Mar 04, 2020
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimization: do not reparse modules already loaded.
parent
b20754ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
action.py
hdlmake/action/action.py
+9
-11
module.py
hdlmake/module/module.py
+5
-2
No files found.
hdlmake/action/action.py
View file @
82d2f907
...
...
@@ -48,26 +48,23 @@ class Action(object):
self
.
_deps_solved
=
False
self
.
options
=
options
def
__contains
(
self
,
module
):
"""Check if the pool contains the given module by checking the URL"""
for
mod
in
self
.
manifests
:
if
mod
.
url
==
module
.
url
:
return
True
return
False
def
new_module
(
self
,
parent
,
url
,
source
,
fetchto
):
"""Add new module to the pool.
This is the only way to add new modules to the pool
Thanks to it the pool can easily control its content
"""
# If the module is already present, do not create it.
for
mod
in
self
.
manifests
:
if
mod
.
url
==
url
:
return
None
# A new module will be added, dependencies have to be computed.
self
.
_deps_solved
=
False
args
=
ModuleArgs
()
args
.
set_args
(
parent
,
url
,
source
,
fetchto
)
new_module
=
Module
(
args
,
self
)
if
not
self
.
__contains
(
new_module
):
self
.
manifests
.
append
(
new_module
)
return
new_module
res
=
Module
(
args
,
self
)
self
.
manifests
.
append
(
res
)
return
res
def
load_all_manifests
(
self
):
# Load the top level module (which is in the current directory).
...
...
@@ -153,6 +150,7 @@ class Action(object):
self
.
tool
.
get_standard_libs
())
self
.
_deps_solved
=
True
if
self
.
options
.
all_files
:
# If option -all is used, no need to compute dependencies.
return
solved_files
=
SourceFileSet
()
solved_files
.
add
(
dep_solver
.
make_dependency_set
(
...
...
hdlmake/module/module.py
View file @
82d2f907
...
...
@@ -262,8 +262,11 @@ class Module(object):
raise
Exception
(
"Found an absolute path ("
+
path
+
") in a manifest("
+
self
.
path
+
")"
)
path
=
path_mod
.
rel2abs
(
path
,
self
.
path
)
mods
.
append
(
self
.
action
.
new_module
(
parent
=
self
,
url
=
path
,
source
=
m
,
fetchto
=
fetchto
))
# Create a module if not already loaded.
mod
=
self
.
action
.
new_module
(
parent
=
self
,
url
=
path
,
source
=
m
,
fetchto
=
fetchto
)
if
mod
is
not
None
:
mods
.
append
(
mod
)
self
.
modules
[
m
]
=
mods
def
_process_manifest_makefiles
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment