flgen 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/flgen/context.rb +16 -2
- data/lib/flgen/file_list.rb +4 -3
- data/lib/flgen/predefined_macros.yaml +12 -0
- data/lib/flgen/version.rb +1 -1
- data/lib/flgen.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17c6dc413fbc743f3014c128fc304fee0459fbe5ecc3fc9e7f9d12f0d26427d0
|
4
|
+
data.tar.gz: 262aec83a71a59ca34904e8be6f81787c5075ba5b9ac1726fb9668b3aa4832db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5515a610870d4d9ff29db0cf01f09db1aa19beaa354c85894153e21732894d7f82a5d68ca959060aee97bf4791f6457a0ee61e06aaf4e69ed3a61fdf6051787
|
7
|
+
data.tar.gz: 5be5528a8aaa6d2ce79fa5fcf91adf9ed95977c5fedbb5a4c70a97164a2647862aa6231d0888dab7c5166495275c2f161bbfbad473b07ea00ad97f29b099e13d
|
data/lib/flgen/context.rb
CHANGED
@@ -4,6 +4,7 @@ module FLGen
|
|
4
4
|
class Context
|
5
5
|
def initialize(options)
|
6
6
|
@options = options
|
7
|
+
define_predefined_macros
|
7
8
|
end
|
8
9
|
|
9
10
|
attr_reader :options
|
@@ -35,7 +36,7 @@ module FLGen
|
|
35
36
|
else
|
36
37
|
[macro, value]
|
37
38
|
end
|
38
|
-
add_macro_definition(k
|
39
|
+
add_macro_definition(k, v, false)
|
39
40
|
end
|
40
41
|
|
41
42
|
def macros
|
@@ -95,8 +96,21 @@ module FLGen
|
|
95
96
|
arguments.none? { |arg| arg.type == :library_file && arg.path == file }
|
96
97
|
end
|
97
98
|
|
98
|
-
def
|
99
|
+
def define_predefined_macros
|
100
|
+
return unless options[:tool]
|
101
|
+
|
102
|
+
list_name = File.join(__dir__, 'predefined_macros.yaml')
|
103
|
+
list = YAML.safe_load_file(list_name, filename: list_name, symbolize_names: true)
|
104
|
+
list[options[:tool]]&.each { |macro| add_macro_definition(macro, nil, true) }
|
105
|
+
end
|
106
|
+
|
107
|
+
def add_macro_definition(macro, value, predefined)
|
108
|
+
name = macro.to_sym
|
99
109
|
macros << name unless macros.include?(name)
|
110
|
+
add_macro_argument(name, value) unless predefined
|
111
|
+
end
|
112
|
+
|
113
|
+
def add_macro_argument(name, value)
|
100
114
|
arguments
|
101
115
|
.delete_if { |argument| argument.type == :define && argument.name == name }
|
102
116
|
add_compile_argument(Arguments::Define.new(name, value))
|
data/lib/flgen/file_list.rb
CHANGED
@@ -31,11 +31,12 @@ module FLGen
|
|
31
31
|
|
32
32
|
def find_files(patterns, from: nil, &block)
|
33
33
|
glob_files(patterns, from, __callee__, caller_location)
|
34
|
-
.then { |e|
|
34
|
+
.then { |e| block_given? && (return e.each(&block)) || e.to_a }
|
35
35
|
end
|
36
36
|
|
37
37
|
def find_file(patterns, from: nil)
|
38
|
-
glob_files(patterns, from, __callee__, caller_location)
|
38
|
+
glob_files(patterns, from, __callee__, caller_location)
|
39
|
+
.first&.then { |f| block_given? && (return yield f) || f }
|
39
40
|
end
|
40
41
|
|
41
42
|
def file?(path, from: :current)
|
@@ -117,7 +118,7 @@ module FLGen
|
|
117
118
|
return
|
118
119
|
end
|
119
120
|
|
120
|
-
@context.__send__("add_#{method_name}"
|
121
|
+
@context.__send__("add_#{method_name}", extracted_path)
|
121
122
|
end
|
122
123
|
|
123
124
|
def raise_no_entry_error(path, location, raise_error)
|
data/lib/flgen/version.rb
CHANGED
data/lib/flgen.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flgen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taichi Ishitani
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Filelist generator
|
14
14
|
email:
|
@@ -30,6 +30,7 @@ files:
|
|
30
30
|
- lib/flgen/file_list_formatter.rb
|
31
31
|
- lib/flgen/file_list_xsim_formatter.rb
|
32
32
|
- lib/flgen/formatter.rb
|
33
|
+
- lib/flgen/predefined_macros.yaml
|
33
34
|
- lib/flgen/source_file.rb
|
34
35
|
- lib/flgen/version.rb
|
35
36
|
- lib/flgen/vivado_tcl_formatter.rb
|
@@ -64,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
65
|
- !ruby/object:Gem::Version
|
65
66
|
version: '0'
|
66
67
|
requirements: []
|
67
|
-
rubygems_version: 3.
|
68
|
+
rubygems_version: 3.5.3
|
68
69
|
signing_key:
|
69
70
|
specification_version: 4
|
70
71
|
summary: Filelist generator
|