PageRenderTime 59ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/tool/geant/src/parser/geant_fileset.e

http://github.com/gobo-eiffel/gobo
Specman e | 678 lines | 503 code | 77 blank | 98 comment | 43 complexity | 5d50070a900bcaaf3f859e8a02afa9c4 MD5 | raw file
  1. note
  2. description:
  3. "Fileset"
  4. library: "Gobo Eiffel Ant"
  5. copyright: "Copyright (c) 2001-2018, Sven Ehrke and others"
  6. license: "MIT License"
  7. date: "$Date$"
  8. revision: "$Revision$"
  9. class GEANT_FILESET
  10. inherit
  11. ANY
  12. KL_SHARED_FILE_SYSTEM
  13. export {NONE} all end
  14. KL_IMPORTED_STRING_ROUTINES
  15. create
  16. make
  17. feature {NONE} -- Initialization
  18. make (a_project: GEANT_PROJECT)
  19. -- Create a new fileset.
  20. local
  21. a_tester: UC_STRING_EQUALITY_TESTER
  22. do
  23. project := a_project
  24. create {DS_HASH_SET [GEANT_FILESET_ENTRY]} filenames.make_equal (20)
  25. create {DS_HASH_SET [STRING]} single_includes.make (20)
  26. create a_tester
  27. single_includes.set_equality_tester (a_tester)
  28. create {DS_HASH_SET [STRING]} single_excludes.make (20)
  29. single_excludes.set_equality_tester (a_tester)
  30. set_filename_variable_name ("fs.filename")
  31. set_mapped_filename_variable_name ("fs.mapped_filename")
  32. force := True
  33. ensure
  34. filename_variable_name_set: filename_variable_name.is_equal ("fs.filename")
  35. mapped_filename_variable_name_set: mapped_filename_variable_name.is_equal ("fs.mapped_filename")
  36. force_is_true: force = True
  37. end
  38. feature -- Access
  39. project: GEANT_PROJECT
  40. -- Project to which Current belongs to
  41. dir_name: detachable STRING
  42. -- Current working directory for execution
  43. directory_name: detachable STRING
  44. -- Name of directory serving as root for recursive scanning
  45. include_wc_string: detachable STRING
  46. -- Wildcard against which filenames are matched for inclusion
  47. exclude_wc_string: detachable STRING
  48. -- Wildcard against which filenames are matched for exclusion
  49. convert_to_filesystem: BOOLEAN
  50. -- Are `item_filename' and `item_mapped_filename' in the format
  51. -- of the current filesystem?
  52. -- Note: Result = false implies that both features' Result is in unix format
  53. map: detachable GEANT_MAP
  54. -- Map for filenames
  55. has_map: BOOLEAN
  56. -- Does current fileset has a map?
  57. do
  58. Result := map /= Void
  59. ensure
  60. definition: Result = (map /= Void)
  61. end
  62. force: BOOLEAN
  63. -- Should all selected files be included in `filenames' regardless of their timestamp?
  64. -- True: all selected files are included in `filenames'.
  65. -- False: only those files are included in `filename' for which the timestamp is
  66. -- newer than the timestamp of their corresponding files specified by `map'.
  67. -- If `map' is Void the mapped filename and the source filename are the same
  68. -- which means no file is included.
  69. -- default value: False
  70. concat: BOOLEAN
  71. -- Should `directory_name' be prepended to matched filenames?
  72. filename_directory_name: detachable STRING
  73. -- Name of directory prepended to matched filenames
  74. mapped_filename_directory_name: detachable STRING
  75. -- Name of directory prepended to mapped filenames
  76. filename_variable_name: STRING
  77. -- Name of project variable to which `item_filename' is assigned to
  78. -- during iterations;
  79. -- default: 'fs.filename'
  80. mapped_filename_variable_name: STRING
  81. -- Name of project variable to which `item_mapped_filename' is assigned to
  82. -- during iterations;
  83. -- default: 'fs.mapped_filename'
  84. item_filename: STRING
  85. -- Filename at current cursor
  86. require
  87. not_off: not off
  88. do
  89. if not convert_to_filesystem then
  90. Result := filenames.item_for_iteration.filename
  91. else
  92. Result := filenames.item_for_iteration.filename_converted
  93. end
  94. ensure
  95. item_filename_not_void: Result /= Void
  96. end
  97. item_mapped_filename: STRING
  98. -- Mapped filename at current cursor
  99. require
  100. not_off: not off
  101. do
  102. if not convert_to_filesystem then
  103. Result := filenames.item_for_iteration.mapped_filename
  104. else
  105. Result := filenames.item_for_iteration.mapped_filename_converted
  106. end
  107. ensure
  108. item_mapped_filename_not_void: Result /= Void
  109. end
  110. feature -- Status report
  111. is_executable: BOOLEAN
  112. -- Can element be executed?
  113. do
  114. Result := is_in_gobo_31_format or else is_in_gobo_32_format
  115. if Result then
  116. if is_in_gobo_31_format then
  117. Result := (attached directory_name as l_directory_name and then l_directory_name.count > 0)
  118. if not Result then
  119. project.log (<<" [fileset] error: attribute 'directory' is mandatory">>)
  120. end
  121. end
  122. end
  123. if Result then
  124. Result := not attached include_wildcard as l_include_wildcard or else l_include_wildcard.is_compiled
  125. if not Result then
  126. project.log (<<" [fileset] error: attribute 'include' is not valid">>)
  127. end
  128. end
  129. if Result then
  130. Result := not attached exclude_wildcard as l_exclude_wildcard or else l_exclude_wildcard.is_compiled
  131. if not Result then
  132. project.log (<<" [fileset] error: attribute 'exclude' is not valid">>)
  133. end
  134. end
  135. if Result then
  136. Result := not attached map as l_map or else l_map.is_executable
  137. if not Result then
  138. project.log (<<" [fileset] error: element 'map' is not defined correctly">>)
  139. end
  140. end
  141. ensure
  142. directory_name_not_void_and_not_empty: (Result and is_in_gobo_31_format) implies attached directory_name as l_directory_name and then l_directory_name.count > 0
  143. include_wildcard_compiled: Result implies (not attached include_wildcard as l_include_wildcard or else l_include_wildcard.is_compiled)
  144. exclude_wildcard_compiled: Result implies (not attached exclude_wildcard as l_exclude_wildcard or else l_exclude_wildcard.is_compiled)
  145. map_executable: Result implies (not attached map as l_map or else l_map.is_executable)
  146. correct_format: Result implies is_in_gobo_31_format or else is_in_gobo_32_format
  147. end
  148. is_in_gobo_31_format: BOOLEAN
  149. -- Is fileset setup for obsolete GOBO 3.1 format?
  150. do
  151. Result := directory_name /= Void and then filename_directory_name = Void and then
  152. mapped_filename_directory_name = Void and then dir_name = Void
  153. ensure
  154. definition: Result implies directory_name /= Void and then
  155. filename_directory_name = Void and then mapped_filename_directory_name = Void and then
  156. dir_name = Void
  157. end
  158. is_in_gobo_32_format: BOOLEAN
  159. -- Is fileset setup for GOBO 3.2 format?
  160. do
  161. Result := directory_name = Void and then not concat
  162. ensure
  163. definition: Result implies directory_name = Void and then not concat
  164. end
  165. are_project_variables_up_to_date: BOOLEAN
  166. -- If not `off' is project variable named `filename_variable_name' set to `item_filename' and
  167. -- project variable named `mapped_filename_variable_name' set to `item_mapped_filename'?
  168. -- And if `off' are project variables named `filename_variable_name' and
  169. -- `mapped_filename_variable_name' not existing?
  170. do
  171. if not off then
  172. Result := project.variables.has (filename_variable_name) and then
  173. STRING_.same_string (project.variables.item (filename_variable_name), item_filename) and then
  174. project.variables.has (mapped_filename_variable_name) and then
  175. STRING_.same_string (project.variables.item (mapped_filename_variable_name), item_mapped_filename)
  176. else
  177. Result := not (project.variables.has (filename_variable_name) or
  178. project.variables.has (mapped_filename_variable_name))
  179. end
  180. ensure
  181. filename_variable_name_exists: not off implies
  182. (Result implies project.variables.has (filename_variable_name))
  183. filename_variable_name_set: not off implies (Result implies
  184. STRING_.same_string (project.variables.item (filename_variable_name), item_filename))
  185. mapped_filename_variable_name_exists: not off implies
  186. (Result implies project.variables.has (mapped_filename_variable_name))
  187. mapped_filename_variable_name_set: not off implies (Result implies
  188. STRING_.same_string (project.variables.item (mapped_filename_variable_name), item_mapped_filename))
  189. filename_variable_name_not_exists: off implies
  190. (Result implies not project.variables.has (filename_variable_name))
  191. mapped_filename_variable_name_not_exists: off implies
  192. (Result implies not project.variables.has (mapped_filename_variable_name))
  193. end
  194. is_empty: BOOLEAN
  195. -- Is fileset empty?
  196. do
  197. Result := filenames.is_empty
  198. end
  199. after: BOOLEAN
  200. -- Is there no valid position to right of cursor?
  201. do
  202. Result := filenames.after
  203. end
  204. off: BOOLEAN
  205. -- Is there no item at internal cursor position?
  206. do
  207. Result := filenames.off
  208. end
  209. feature -- Element change
  210. set_dir_name (a_dir_name: STRING)
  211. -- Set `dir_name' to `a_dir_name'.
  212. require
  213. dir_name_not_void: a_dir_name /= Void
  214. do
  215. dir_name := a_dir_name
  216. ensure
  217. dir_name_set: dir_name = a_dir_name
  218. end
  219. set_directory_name (a_directory_name: STRING)
  220. -- Set `directory_name' to `a_directory_name'.
  221. require
  222. directory_name_not_void: a_directory_name /= Void
  223. do
  224. directory_name := a_directory_name
  225. ensure
  226. directory_name_set: directory_name = a_directory_name
  227. end
  228. set_include_wc_string (a_include_wc_string: STRING)
  229. -- Set `include_wc_string' to `a_include_wc_string' and
  230. -- make a compiled version available in `include_wildcard'
  231. require
  232. a_include_wc_string_not_void : a_include_wc_string /= Void
  233. a_include_wc_string_not_empty: a_include_wc_string.count > 0
  234. local
  235. l_include_wildcard: like include_wildcard
  236. do
  237. include_wc_string := a_include_wc_string
  238. -- Setup wildcard for include patterns:
  239. create {LX_DFA_WILDCARD} l_include_wildcard.compile (a_include_wc_string, True)
  240. include_wildcard := l_include_wildcard
  241. if not l_include_wildcard.is_compiled then
  242. project.log (<<" [fileset] error: invalid include wildcard: '", a_include_wc_string, "%'">>)
  243. end
  244. ensure
  245. include_wc_string_set: include_wc_string = a_include_wc_string
  246. end
  247. set_exclude_wc_string (a_exclude_wc_string: STRING)
  248. -- Set `exclude_wc_string' to `a_exclude_wc_string' and
  249. -- make a compiled version available in `exclude_wildcard'
  250. require
  251. a_exclude_wc_string_not_void : a_exclude_wc_string /= Void
  252. a_exclude_wc_string_not_empty: a_exclude_wc_string.count > 0
  253. local
  254. l_exclude_wildcard: like exclude_wildcard
  255. do
  256. exclude_wc_string := a_exclude_wc_string
  257. -- Setup wildcard for exclude patterns:
  258. create {LX_DFA_WILDCARD} l_exclude_wildcard.compile (a_exclude_wc_string, True)
  259. exclude_wildcard := l_exclude_wildcard
  260. if not l_exclude_wildcard.is_compiled then
  261. project.log (<<" [fileset] error: invalid exclude wildcard: '", a_exclude_wc_string, "%'">>)
  262. end
  263. ensure
  264. exclude_wc_string_set: exclude_wc_string = a_exclude_wc_string
  265. end
  266. set_convert_to_filesystem (b: BOOLEAN)
  267. -- Set `convert_to_filesystem' to `b'.
  268. do
  269. convert_to_filesystem := b
  270. ensure
  271. convert_to_filesystem_set: convert_to_filesystem = b
  272. end
  273. set_map (a_map: like map)
  274. -- Set `map' to `a_map'.
  275. require
  276. a_map_not_void: a_map /= Void
  277. do
  278. map := a_map
  279. ensure
  280. map_set: map = a_map
  281. end
  282. set_force (b: BOOLEAN)
  283. -- Set `force' to `b'.
  284. do
  285. force := b
  286. ensure
  287. force_set: force = b
  288. end
  289. set_concat (b: BOOLEAN)
  290. -- Set `concat' to `b'.
  291. do
  292. concat := b
  293. ensure
  294. concat_set: concat = b
  295. end
  296. set_filename_directory_name (a_filename_directory_name: STRING)
  297. -- Set `filename_directory_name' to `a_filename_directory_name'.
  298. require
  299. filename_directory_name_not_void: a_filename_directory_name /= Void
  300. do
  301. filename_directory_name := a_filename_directory_name
  302. ensure
  303. filename_directory_name_set: filename_directory_name = a_filename_directory_name
  304. end
  305. set_mapped_filename_directory_name (a_mapped_filename_directory_name: STRING)
  306. -- Set `mapped_filename_directory_name' to `a_mapped_filename_directory_name'.
  307. require
  308. mapped_filename_directory_name_not_void: a_mapped_filename_directory_name /= Void
  309. do
  310. mapped_filename_directory_name := a_mapped_filename_directory_name
  311. ensure
  312. mapped_filename_directory_name_set: mapped_filename_directory_name = a_mapped_filename_directory_name
  313. end
  314. set_filename_variable_name (a_filename_variable_name: STRING)
  315. -- Set `filename_variable_name' to `a_filename_variable_name'.
  316. require
  317. a_filename_variable_name_not_void: a_filename_variable_name /= Void
  318. a_filename_variable_name_not_empty: a_filename_variable_name.count > 0
  319. do
  320. filename_variable_name := a_filename_variable_name
  321. ensure
  322. filename_variable_name_set: filename_variable_name = a_filename_variable_name
  323. end
  324. set_mapped_filename_variable_name (a_mapped_filename_variable_name: STRING)
  325. -- Set `mapped_filename_variable_name' to `a_mapped_filename_variable_name'.
  326. require
  327. a_mapped_filename_variable_name_not_void: a_mapped_filename_variable_name /= Void
  328. a_mapped_filename_variable_name_not_empty: a_mapped_filename_variable_name.count > 0
  329. do
  330. mapped_filename_variable_name := a_mapped_filename_variable_name
  331. ensure
  332. mapped_filename_variable_name_set: mapped_filename_variable_name = a_mapped_filename_variable_name
  333. end
  334. feature -- Element change
  335. add_fileset_entry_if_necessary (a_filename: STRING)
  336. -- Add new GEANT_FILESET_ENTRY created from `a_filename'
  337. -- to `filenames'.
  338. -- If force is set to 'false' do this only if the file named
  339. -- `map.mapped_filename (a_filename)' (if map /= Void)
  340. -- `a_filename' (if map = Void)
  341. -- is older than the file name `a_filename'.
  342. require
  343. a_filename_not_void: a_filename /= Void
  344. a_filename_not_empty: a_filename.count > 0
  345. local
  346. a_entry: GEANT_FILESET_ENTRY
  347. an_filename: STRING
  348. an_mapped_filename: STRING
  349. do
  350. project.trace_debug (<<" [*fileset] trying to add: '", a_filename, "%'">>)
  351. an_filename := a_filename
  352. if attached map as l_map then
  353. an_mapped_filename := l_map.mapped_filename (an_filename)
  354. else
  355. an_mapped_filename := an_filename
  356. end
  357. -- Remove support for 'gobo32_format' after obsolete period:
  358. if concat and attached directory_name as l_directory_name then
  359. an_mapped_filename := unix_file_system.pathname (l_directory_name, an_mapped_filename)
  360. end
  361. if attached filename_directory_name as l_filename_directory_name then
  362. an_filename := unix_file_system.pathname (l_filename_directory_name, an_filename)
  363. end
  364. if attached mapped_filename_directory_name as l_mapped_filename_directory_name then
  365. an_mapped_filename := unix_file_system.pathname (l_mapped_filename_directory_name,
  366. an_mapped_filename)
  367. end
  368. if force or else is_file_outofdate (an_filename, an_mapped_filename) then
  369. create a_entry.make (an_filename, an_mapped_filename)
  370. filenames.force_last (a_entry)
  371. end
  372. end
  373. remove_fileset_entry (a_filename: STRING)
  374. -- Remove entry with name equal to `a_filename' if existing.
  375. local
  376. a_entry: GEANT_FILESET_ENTRY
  377. do
  378. project.trace_debug (<<" [*fileset] removing: '", a_filename, "%'">>)
  379. create a_entry.make (a_filename, a_filename)
  380. filenames.remove (a_entry)
  381. end
  382. add_single_include (a_filename: STRING)
  383. -- Add `a_filename' to list of single filenames to include into fileset.
  384. require
  385. a_filename_not_void: a_filename /= Void
  386. do
  387. single_includes.force_last (a_filename)
  388. end
  389. add_single_exclude (a_filename: STRING)
  390. -- Add `a_filename' to list of single filenames to exclude from fileset.
  391. require
  392. a_filename_not_void: a_filename /= Void
  393. do
  394. single_excludes.force_last (a_filename)
  395. end
  396. feature -- Cursor movement
  397. start
  398. -- Move cursor to first position.
  399. do
  400. filenames.start
  401. if off then
  402. remove_project_variables
  403. else
  404. update_project_variables
  405. end
  406. ensure
  407. empty_behavior: is_empty implies after
  408. project_variables_up_to_date: are_project_variables_up_to_date
  409. end
  410. forth
  411. -- Move cursor to next position.
  412. require
  413. not_after: not after
  414. do
  415. filenames.forth
  416. if off then
  417. remove_project_variables
  418. else
  419. update_project_variables
  420. end
  421. ensure
  422. project_variables_up_to_date: are_project_variables_up_to_date
  423. end
  424. go_after
  425. -- Move cursor to `after' position.
  426. do
  427. remove_project_variables
  428. filenames.go_after
  429. ensure
  430. project_variables_up_to_date: are_project_variables_up_to_date
  431. end
  432. feature -- Execution
  433. execute
  434. -- Populate `filenames'.
  435. local
  436. al_directory_name: STRING
  437. cs: DS_SET_CURSOR [STRING]
  438. a_old_cwd: STRING
  439. do
  440. remove_project_variables
  441. a_old_cwd := file_system.current_working_directory
  442. -- Change to directory `dir_name' if specified:
  443. if attached dir_name as l_dir_name then
  444. project.trace_debug (<<" [*fileset] dir: '", l_dir_name, "%'">>)
  445. project.trace_debug (<<" [*fileset] changing to directory: '", l_dir_name, "%'">>)
  446. file_system.set_current_working_directory (l_dir_name)
  447. end
  448. if attached directory_name as l_directory_name then
  449. project.trace_debug (<<" [*fileset] directory_name: ", l_directory_name>>)
  450. end
  451. if attached include_wc_string as l_include_wc_string then
  452. project.trace_debug (<<" [*fileset] include_wc_string: ", l_include_wc_string>>)
  453. end
  454. if attached filename_directory_name as l_filename_directory_name then
  455. project.trace_debug (<<" [*fileset] filename_directory: ", l_filename_directory_name>>)
  456. end
  457. if attached mapped_filename_directory_name as l_mapped_filename_directory_name then
  458. project.trace_debug (<<" [*fileset] mapped_filename_directory: ", l_mapped_filename_directory_name>>)
  459. end
  460. if attached directory_name as l_directory_name then
  461. al_directory_name := unix_file_system.canonical_pathname (l_directory_name)
  462. else
  463. create al_directory_name.make_from_string (".")
  464. end
  465. -- Add entries from filesystem scan:
  466. scan_internal (al_directory_name, al_directory_name)
  467. -- Add single includes:
  468. cs := single_includes.new_cursor
  469. from cs.start until cs.after loop
  470. add_fileset_entry_if_necessary (cs.item)
  471. cs.forth
  472. end
  473. -- Remove single excludes:
  474. cs := single_excludes.new_cursor
  475. from cs.start until cs.after loop
  476. remove_fileset_entry (cs.item)
  477. cs.forth
  478. end
  479. if project.options.debug_mode then
  480. from start until after loop
  481. project.trace_debug (<<" [*fileset] entry: [", item_filename, ", ", item_mapped_filename, "]">>)
  482. forth
  483. end
  484. end
  485. -- Change back to previous directory:
  486. project.trace_debug (<<" [*fileset] changing to directory: '", a_old_cwd, "%'">>)
  487. file_system.set_current_working_directory (a_old_cwd)
  488. end
  489. include_wildcard: detachable LX_WILDCARD
  490. -- Expression defining filenames for inclusion
  491. exclude_wildcard: detachable LX_WILDCARD
  492. -- Expression defining filenames for exclusion
  493. feature {NONE} -- Implementation/Access
  494. filenames: DS_SET [GEANT_FILESET_ENTRY]
  495. -- Files underneath directory named `directory_name' (if `is_in_gobo_31_format')
  496. -- Files underneath current working directory (if `is_in_gobo_32_format')
  497. -- matching expressions in `include_wc_string' and not matching
  498. -- expressions in `exclude_wc_string' with their corresponding
  499. -- mapped filename if `has_map';
  500. -- available after execute has been performed.
  501. single_includes: DS_SET [STRING]
  502. -- Filenames to be included in `filenames'
  503. single_excludes: DS_SET [STRING]
  504. -- Filenames to be excluded from `filenames'
  505. feature {NONE} -- Implementation/Processing
  506. scan_internal (a_directory_name, a_root_directory_name: STRING)
  507. -- Scan directory named `a_directory_name' recursivley;
  508. -- put filenames found matching `include_wildcard' and not matching `exclude_wildcard'
  509. -- into `filenames';
  510. require
  511. a_directory_name_not_void: a_directory_name /= Void
  512. a_root_directory_name_not_void: a_root_directory_name /= Void
  513. local
  514. a_dir: KL_DIRECTORY
  515. a_name: STRING
  516. s: STRING
  517. smatch: STRING
  518. do
  519. create a_dir.make (a_directory_name)
  520. a_dir.open_read
  521. if a_dir.is_open_read then
  522. from a_dir.read_entry until a_dir.end_of_input loop
  523. a_name := a_dir.last_entry
  524. if
  525. not STRING_.same_string (a_name, file_system.relative_current_directory) and
  526. not STRING_.same_string (a_name, file_system.relative_parent_directory)
  527. then
  528. s := unix_file_system.pathname (a_directory_name, a_name)
  529. -- Recurse for directories:
  530. if file_system.is_directory_readable (s) then
  531. scan_internal (s, a_root_directory_name)
  532. else
  533. -- Handle files:
  534. --!! project.trace_debug (<<"filename: ", s, "%N">>)
  535. if is_in_gobo_31_format then
  536. smatch := s.substring (a_root_directory_name.count + 2, s.count) -- 2 because of '/'
  537. else
  538. smatch := s.substring (3, s.count) -- 3 because of './'
  539. end
  540. --!! project.trace_debug (<<" trying to match: ", smatch, "%N">>)
  541. if attached include_wildcard as l_include_wildcard and then l_include_wildcard.recognizes (smatch) then
  542. add_fileset_entry_if_necessary (smatch)
  543. end
  544. if attached exclude_wildcard as l_exclude_wildcard and then l_exclude_wildcard.recognizes (smatch) then
  545. remove_fileset_entry (smatch)
  546. end
  547. end
  548. end
  549. a_dir.read_entry
  550. end
  551. a_dir.close
  552. end
  553. end
  554. is_file_outofdate (a_first_filename, a_second_filename: STRING): BOOLEAN
  555. -- Is timestamp of file named `a_second_filename' older than
  556. -- timestamp of file named `a_first_filename' or doesn't exist at all?
  557. require
  558. a_first_filename_not_void: a_first_filename /= Void
  559. a_second_filename_not_void: a_second_filename /= Void
  560. -- first_file_exists: file_system.file_exists (first_filename)
  561. local
  562. a_first_time: INTEGER
  563. a_second_time: INTEGER
  564. do
  565. if not file_system.file_exists (a_second_filename) then
  566. Result := True
  567. else
  568. a_first_time := file_system.file_time_stamp (a_first_filename)
  569. a_second_time := file_system.file_time_stamp (a_second_filename)
  570. Result := a_second_time < a_first_time
  571. end
  572. end
  573. update_project_variables
  574. -- Set project variable with name `filename_variable_name' to `item_filename' and
  575. -- project variable with name `mapped_filename_variable_name' to `item_mapped_filename'.
  576. require
  577. not_off: not off
  578. do
  579. project.variables.set_variable_value (filename_variable_name, item_filename)
  580. project.variables.set_variable_value (mapped_filename_variable_name, item_mapped_filename)
  581. ensure
  582. project_variables_set: are_project_variables_up_to_date
  583. end
  584. remove_project_variables
  585. -- Remove project variable with name `filename_variable_name' and
  586. -- project variable with name `mapped_filename_variable_name'.
  587. do
  588. project.trace_debug (<<" [*fileset] removing project variables '",
  589. filename_variable_name, "' and '", mapped_filename_variable_name, "'">>)
  590. project.variables.remove (filename_variable_name)
  591. project.variables.remove (mapped_filename_variable_name)
  592. ensure
  593. project_variables_removed: not project.variables.has (filename_variable_name) and
  594. not project.variables.has (mapped_filename_variable_name)
  595. end
  596. invariant
  597. filename_variable_name_not_void: filename_variable_name /= Void
  598. filename_variable_name_not_empty: filename_variable_name.count > 0
  599. mapped_filename_variable_name_not_void: mapped_filename_variable_name /= Void
  600. mapped_filename_variable_name_not_empty: mapped_filename_variable_name.count > 0
  601. end