27
27
28
28
from tools .targets import TARGET_MAP
29
29
from tools .utils import mkdir
30
- from tools .resources import FileType
30
+ from tools .resources import FileType , FileRef
31
31
32
32
"""Just a template for subclassing"""
33
33
@@ -95,9 +95,17 @@ def __init__(self, target, export_dir, project_name, toolchain,
95
95
resources .win_to_unix ()
96
96
self .resources = resources
97
97
self .generated_files = []
98
+ getting_started_name = "GettingStarted.html"
99
+ dot_mbed_name = ".mbed"
98
100
self .static_files = (
99
- join (self .TEMPLATE_DIR , "GettingStarted.html" ),
100
- join (self .TEMPLATE_DIR , ".mbed" ),
101
+ FileRef (
102
+ getting_started_name ,
103
+ join (self .TEMPLATE_DIR , getting_started_name )
104
+ ),
105
+ FileRef (
106
+ dot_mbed_name ,
107
+ join (self .TEMPLATE_DIR , dot_mbed_name )
108
+ ),
101
109
)
102
110
self .builder_files_dict = {}
103
111
self .add_config ()
@@ -204,7 +212,7 @@ def gen_file(self, template_file, data, target_file, **kwargs):
204
212
mkdir (dirname (target_path ))
205
213
logging .debug ("Generating: %s" , target_path )
206
214
open (target_path , "w" ).write (target_text )
207
- self .generated_files += [target_path ]
215
+ self .generated_files += [FileRef ( target_file , target_path ) ]
208
216
209
217
def gen_file_nonoverwrite (self , template_file , data , target_file , ** kwargs ):
210
218
"""Generates or selectively appends a project file from a template"""
@@ -221,7 +229,7 @@ def gen_file_nonoverwrite(self, template_file, data, target_file, **kwargs):
221
229
else :
222
230
logging .debug ("Generating: %s" , target_path )
223
231
open (target_path , "w" ).write (target_text )
224
- self .generated_files += [target_path ]
232
+ self .generated_files += [FileRef ( template_file , target_path ) ]
225
233
226
234
def _gen_file_inner (self , template_file , data , target_file , ** kwargs ):
227
235
"""Generates a project file from a template using jinja"""
@@ -237,7 +245,7 @@ def _gen_file_inner(self, template_file, data, target_file, **kwargs):
237
245
target_path = join (self .export_dir , target_file )
238
246
logging .debug ("Generating: %s" , target_path )
239
247
open (target_path , "w" ).write (target_text )
240
- self .generated_files += [target_path ]
248
+ self .generated_files += [FileRef ( target_file , target_path ) ]
241
249
242
250
def make_key (self , src ):
243
251
"""From a source file, extract group name
0 commit comments