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
7bd6d1ec
Commit
7bd6d1ec
authored
May 24, 2017
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Module package
parent
f1c42597
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
35 deletions
+36
-35
content.py
hdlmake/module/content.py
+36
-0
core.py
hdlmake/module/core.py
+0
-35
No files found.
hdlmake/module/content.py
View file @
7bd6d1ec
...
...
@@ -7,6 +7,7 @@ from hdlmake import fetch
from
hdlmake.util
import
path
as
path_mod
from
.core
import
ModuleCore
import
six
import
os
class
ModuleArgs
(
object
):
...
...
@@ -147,3 +148,38 @@ class ModuleContent(ModuleCore):
included_makefiles_aux
=
self
.
manifest_dict
[
"incl_makefiles"
][:]
makefiles_paths
=
self
.
_make_list_of_paths
(
included_makefiles_aux
)
self
.
incl_makefiles
.
extend
(
makefiles_paths
)
def
_create_file_list_from_paths
(
self
,
paths
):
"""
Build a Source File Set containing the files indicated by the
provided list of paths
"""
from
hdlmake.srcfile
import
create_source_file
,
SourceFileSet
srcs
=
SourceFileSet
()
# Check if this is the top module and grab the include_dirs
if
self
.
parent
is
None
:
if
'include_dirs'
in
self
.
manifest_dict
:
include_dirs
=
self
.
manifest_dict
[
'include_dirs'
]
else
:
include_dirs
=
[]
else
:
if
'include_dirs'
in
self
.
manifest_dict
:
include_dirs
=
self
.
top_module
.
manifest_dict
[
'include_dirs'
]
else
:
include_dirs
=
[]
for
path_aux
in
paths
:
if
os
.
path
.
isdir
(
path_aux
):
dir_
=
os
.
listdir
(
path_aux
)
for
f_dir
in
dir_
:
f_dir
=
os
.
path
.
join
(
self
.
path
,
path_aux
,
f_dir
)
if
not
os
.
path
.
isdir
(
f_dir
):
srcs
.
add
(
create_source_file
(
path
=
f_dir
,
module
=
self
,
library
=
self
.
library
,
include_dirs
=
include_dirs
))
else
:
srcs
.
add
(
create_source_file
(
path
=
path_aux
,
module
=
self
,
library
=
self
.
library
,
include_dirs
=
include_dirs
))
return
srcs
hdlmake/module/core.py
View file @
7bd6d1ec
...
...
@@ -140,38 +140,3 @@ class ModuleCore(ModuleConfig):
self
.
library
=
self
.
manifest_dict
[
"library"
]
if
"action"
in
self
.
manifest_dict
:
self
.
action
=
self
.
manifest_dict
[
"action"
]
.
lower
()
def
_create_file_list_from_paths
(
self
,
paths
):
"""
Build a Source File Set containing the files indicated by the
provided list of paths
"""
from
hdlmake.srcfile
import
create_source_file
,
SourceFileSet
srcs
=
SourceFileSet
()
# Check if this is the top module and grab the include_dirs
if
self
.
parent
is
None
:
if
'include_dirs'
in
self
.
manifest_dict
:
include_dirs
=
self
.
manifest_dict
[
'include_dirs'
]
else
:
include_dirs
=
[]
else
:
if
'include_dirs'
in
self
.
manifest_dict
:
include_dirs
=
self
.
top_module
.
manifest_dict
[
'include_dirs'
]
else
:
include_dirs
=
[]
for
path_aux
in
paths
:
if
os
.
path
.
isdir
(
path_aux
):
dir_
=
os
.
listdir
(
path_aux
)
for
f_dir
in
dir_
:
f_dir
=
os
.
path
.
join
(
self
.
path
,
path_aux
,
f_dir
)
if
not
os
.
path
.
isdir
(
f_dir
):
srcs
.
add
(
create_source_file
(
path
=
f_dir
,
module
=
self
,
library
=
self
.
library
,
include_dirs
=
include_dirs
))
else
:
srcs
.
add
(
create_source_file
(
path
=
path_aux
,
module
=
self
,
library
=
self
.
library
,
include_dirs
=
include_dirs
))
return
srcs
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