bake-toolkit 1.8.0.1 → 2.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/bin/bake +14 -53
  3. data/bin/bakery +50 -43
  4. data/bin/createVSProjects +3 -3
  5. data/doc/cmd/install.html +1 -5
  6. data/doc/cmd/usecmd.html +29 -5
  7. data/doc/dyk/lint.html +21 -4
  8. data/doc/dyk/tipps.html +0 -6
  9. data/doc/eclipse/import.html +3 -1
  10. data/doc/eclipse/import/Import.png +0 -0
  11. data/doc/eclipse/use.html +8 -5
  12. data/doc/further/change.html +134 -1
  13. data/doc/further/issues.html +1 -0
  14. data/doc/further/wish.html +24 -21
  15. data/doc/index.html +1 -1
  16. data/doc/syntax/subst.html +8 -1
  17. data/doc/syntax/syntax.html +42 -14
  18. data/lib/bake/cache.rb +51 -59
  19. data/lib/bake/config/loader.rb +289 -0
  20. data/lib/bake/libElement.rb +134 -0
  21. data/lib/bake/mergeConfig.rb +1 -1
  22. data/lib/bake/model/language.rb +1 -1
  23. data/lib/bake/model/loader.rb +88 -0
  24. data/lib/bake/model/metamodel.rb +24 -16
  25. data/lib/bake/model/metamodel_ext.rb +9 -4
  26. data/lib/bake/options/options.rb +222 -0
  27. data/lib/bake/options/showConfigNames.rb +44 -0
  28. data/lib/bake/options/showDoc.rb +19 -0
  29. data/lib/bake/options/showLicense.rb +9 -0
  30. data/lib/bake/options/showToolchains.rb +39 -0
  31. data/lib/bake/options/usage.rb +54 -0
  32. data/lib/bake/process_output.rb +10 -0
  33. data/lib/bake/subst.rb +105 -40
  34. data/lib/bake/toolchain/clang.rb +44 -0
  35. data/lib/bake/toolchain/colorizing_formatter.rb +125 -0
  36. data/lib/bake/toolchain/diab.rb +53 -0
  37. data/lib/bake/toolchain/errorparser/diab_compiler_error_parser.rb +40 -0
  38. data/lib/bake/toolchain/errorparser/diab_linker_error_parser.rb +41 -0
  39. data/lib/bake/toolchain/errorparser/error_parser.rb +71 -0
  40. data/lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb +35 -0
  41. data/lib/bake/toolchain/errorparser/gcc_linker_error_parser.rb +35 -0
  42. data/lib/bake/toolchain/errorparser/greenhills_compiler_error_parser.rb +32 -0
  43. data/lib/bake/toolchain/errorparser/greenhills_linker_error_parser.rb +44 -0
  44. data/lib/bake/toolchain/errorparser/keil_compiler_error_parser.rb +40 -0
  45. data/lib/bake/toolchain/errorparser/keil_linker_error_parser.rb +30 -0
  46. data/lib/bake/toolchain/errorparser/lint_error_parser.rb +34 -0
  47. data/lib/bake/toolchain/errorparser/process_output.rb +3 -0
  48. data/lib/bake/toolchain/errorparser/ti_compiler_error_parser.rb +30 -0
  49. data/lib/bake/toolchain/errorparser/ti_linker_error_parser.rb +30 -0
  50. data/lib/bake/toolchain/gcc.rb +49 -0
  51. data/lib/bake/toolchain/gcc_param.rb +7 -0
  52. data/lib/bake/toolchain/greenhills.rb +52 -0
  53. data/lib/bake/toolchain/keil.rb +55 -0
  54. data/lib/bake/toolchain/lint.rb +20 -0
  55. data/lib/bake/toolchain/provider.rb +136 -0
  56. data/lib/bake/toolchain/ti.rb +47 -0
  57. data/lib/bake/util.rb +27 -15
  58. data/lib/bakery/buildPattern.rb +1 -1
  59. data/lib/bakery/model/language.rb +1 -1
  60. data/lib/bakery/model/loader.rb +56 -0
  61. data/lib/bakery/model/metamodel.rb +1 -1
  62. data/lib/bakery/options/options.rb +87 -0
  63. data/lib/bakery/toBake.rb +10 -6
  64. data/lib/blocks/block.rb +225 -0
  65. data/lib/blocks/blockBase.rb +155 -0
  66. data/lib/blocks/commandLine.rb +25 -0
  67. data/lib/blocks/compile.rb +382 -0
  68. data/lib/blocks/docu.rb +28 -0
  69. data/lib/blocks/executable.rb +143 -0
  70. data/lib/blocks/has_execute_command.rb +31 -0
  71. data/lib/blocks/library.rb +78 -0
  72. data/lib/blocks/lint.rb +53 -0
  73. data/lib/blocks/makefile.rb +87 -0
  74. data/lib/blocks/showIncludes.rb +114 -0
  75. data/lib/common/abortException.rb +4 -0
  76. data/lib/common/cleanup.rb +9 -0
  77. data/lib/common/exit_helper.rb +28 -0
  78. data/lib/common/ext/file.rb +88 -0
  79. data/lib/common/ext/stdout.rb +45 -0
  80. data/lib/common/ide_interface.rb +194 -0
  81. data/lib/common/options/option.rb +13 -0
  82. data/lib/common/options/parser.rb +59 -0
  83. data/lib/common/process.rb +64 -0
  84. data/lib/common/utils.rb +52 -0
  85. data/lib/{bake → common}/version.rb +3 -10
  86. data/lib/multithread/job.rb +44 -0
  87. data/lib/tocxx.rb +201 -932
  88. data/lib/vs/options.rb +3 -2
  89. data/license.txt +47 -22
  90. metadata +90 -30
  91. data/bin/bake-doc +0 -12
  92. data/lib/alias/loader.rb +0 -56
  93. data/lib/alias/model/language.rb +0 -22
  94. data/lib/alias/model/metamodel.rb +0 -29
  95. data/lib/bake/loader.rb +0 -92
  96. data/lib/bake/options.rb +0 -421
  97. data/lib/bakery/loader.rb +0 -57
  98. data/lib/bakery/options.rb +0 -105
  99. data/lib/option/parser.rb +0 -73
@@ -11,7 +11,6 @@ Using bake in Eclipse is very similar compared to the CDT build mechanism.
11
11
  <p>
12
12
  One major difference is, that .cproject and .project files are just wrappers. Do not use the standard property pages, they will be simply ignored! <b>Edit only the Project.meta files.</b><br>
13
13
  <b>The .cproject and .project files shall not be committed to your source control.</b>
14
- However, you may commit .cproject and .project files with an empty dummy configuration <b>once</b> to avoid the following importing step for future checkouts.
15
14
 
16
15
  <h2>Import</h2>
17
16
 
@@ -23,6 +22,9 @@ The importer can be found unter File->Import or in the context menu of the Proje
23
22
  All (sub)directories with a Project.meta are listed here. Choose the projects to import and press Finish.<p>
24
23
  <img src="import/Select.png"/>
25
24
  <img src="import/Import.png"/><br>
25
+ <br>
26
+ Note, that .(c)project files will not be overwritten per default. If e.g. a project is not a c-project, some bake features will not available.
27
+ In this case, enable the recreate option. This is also a good idea, if you want to get rid of old configurations.
26
28
 
27
29
  </body>
28
30
 
Binary file
data/doc/eclipse/use.html CHANGED
@@ -19,12 +19,15 @@ The chosen config is marked with a filled circle before the config name.You can
19
19
  <p>
20
20
  This label decoration can be switched off and on via Window->Preferences->General->Appearance->Label Decorations.
21
21
 
22
- <h2>Adjust includes for CDT</h2>
22
+ <h2>Adjust includes and defines for CDT</h2>
23
23
 
24
- As you might have already seen, a new menu item for the main project is enabled now: Adjust includes for CDT.<br>
25
- All CDT features work out-of-the-box except those about the #include statements e.g. auto-completion of includes. To import the "bake includes" into the CDT .cproject files, simply click on this menu item.<br>
26
- <b>This is not a must, it's just convenience.</b><br>
27
- Note: importing can take between a few seconds and a minute depending on the size of the workspace and the number of project settings which have to be written.<br>
24
+ As you might have already seen, a new menu item for the main project is enabled now: Adjust includes and defines for CDT.<br>
25
+ All CDT features work out-of-the-box except those about the #include and #define statements e.g. auto-completion of includes.
26
+ To import the includes and defines into the CDT .cproject files, simply click on this menu item.<p>
27
+ Compiler internal includes and defines must be specified in InternalInclude and InternalDefine files. See "Syntax" help page how to set the name of these files. Note, that the
28
+ variables CPPPath, CPath, ASMPath, ArchiverPath and LinkerPath can be used in these files.<br>
29
+ <p>
30
+ Adjusting can take between a few seconds and a minute depending on the size of the workspace and the number of project settings which have to be written.<br>
28
31
 
29
32
  <h2>Build/Clean Projects/Files</h2>
30
33
 
@@ -7,6 +7,139 @@
7
7
  <body>
8
8
  <h1>Changelog</h1>
9
9
 
10
+ January 15, 2015 - bake-toolkit 2.0.10<br>
11
+ <ul>
12
+ <li><b>Bugfix: spaces in paths were not handled correctly in all cases</b>
13
+ <li><b>Bugfix: dependency files of Keil compiler not treated correctly</b>
14
+ <li><b>Added: showing why files are built in verbose mode <i>-v2</i></b>
15
+ <li><b>Added: whole workspace can be linted now (projects will be linted separately)</b>
16
+ <li><b>Changed: removed <i>bake-doc</i> command, use <i>bake --doc<i> instead</b>
17
+ <li><b>Changed: if no default project is specified, possible build configs are shown on command line again like in bake 1.x</b>
18
+ </ul>
19
+
20
+ January 7, 2015 - bake-toolkit 2.0.3<br>
21
+ <ul>
22
+ <li><b>Changed: default configuration is chosen if configuration name is omitted. This applies to command line as well as to <i>Dependency</i> definitions, e.g.:</b><br>
23
+ # Project.meta:<br>
24
+ Dependency canDriver # no <i>config</i> attribute<br>
25
+ # Command line:<br>
26
+ bake -m bla/myProj # no configuration name specified<br>
27
+ <b>To show the possible configs of a project, use the --show_configs command line option.</b>
28
+ <p>
29
+ <li><b>Changed: more than one config of a project can be used in one build.</b><br>
30
+ Example:<br>
31
+ Dependency canDriver, config: C1<br>
32
+ Dependency canDriver, config: C2<br>
33
+ <b>To reference a config of the current project, omit the project name, e.g.:</b><br>
34
+ Dependency config: C3<br>
35
+ <b>To build a single project, you can still use -p command line argument:</b><br>
36
+ bake Debug -p canDriver<br>
37
+ <b>However, if canDriver has more than one config in the workspace, all configs will be built. To build only a single config, use a comma separator like this:</b><br>
38
+ bake Debug -p canDriver,C1<br>
39
+ <p>
40
+ <li><b>Changed: the default output folder has been changed due to the new feature of having several configs of a project in one workspace.</b><br>
41
+ <table border="1">
42
+ <tr>
43
+ <th></th>
44
+ <th>Old</th>
45
+ <th>New</th>
46
+ </tr>
47
+ <tr>
48
+ <td><b>Main project</b></td>
49
+ <td>$(MainConfigName)</td>
50
+ <td>$(MainConfigName)</td>
51
+ </tr>
52
+ <tr>
53
+ <td><b>Sub project</b></td>
54
+ <td>$(MainConfigName)_$(MainProjectName)</td>
55
+ <td>$(SubConfigName)_$(MainProjectName)_$(MainConfigName)</td>
56
+ </tr>
57
+ </table>
58
+ <b>Be careful if you have something like this in Project.meta:</b><br>
59
+ ExternalLibrary "bspCoreZ6/$(MainConfigName)_$(MainProjectName)/src/coreZ6/startup/startupCode.o", search:false<br>
60
+ <b>This refers to the old output directory. Change it or if you want to support old and new bake versions,
61
+ write a <i>PreStep</i> which copies the file from the new location to the old one.</b>
62
+
63
+ <p>
64
+ <li><b>Changed: with -f a pattern can be specified, not only a single file. All files matching this string will be compiled.</b>
65
+ <li><b>Changed: variables in Dependency definitions are not allowed anymore to avoid inconsistencies.</b>
66
+ <li><b>Changed: no error will be reported anymore if makefile has no clean target.</b>
67
+ <li><b>Changed: source files will now be compiled and archived ordered by the <i>Files</i> definition in Project.meta, not by a Eclipse-backward-compatibility-ordering.</b>
68
+ <li><b>Changed: reworked some error messages, more error annotations are shown in IDEs</b>
69
+ <p>
70
+ <li><b>Added: "--include_filter" and "--exclude_filter" also work for main step of <i>CustomConfig</i></b>
71
+ <li><b>Added: possibility to add comments in roots.bake</b>
72
+ <li><b>Added: new variables CPPPath, CPath, ASMPath, ArchiverPath and LinkerPath. These variables can also be used in <i>InternalDefines</i> and <i>InternalInclude</i> files.</b>
73
+ <li><b>Added: lint is not restricted to GCC toolchain anymore.</b><br>
74
+ <li><b>Added: --docu option. Specify the docu command line in <i>Docu</i> tag of the <i>(Default)Toolchain</i>.</b><br>
75
+ <p>
76
+ <li><b>Removed: support for Ruby 1.8. Use Ruby 1.9 or higher.</b>
77
+ <li><b>Removed: dependencies to cxxproject and rake gems</b>
78
+ <li><b>Removed: "-j" as default flag when calling makefiles. This must be explicitly specified.</b>
79
+ <li><b>Removed: option to check for unnecessary includes</b>
80
+ <li><b>Removed: hardcoded TI compiler commands and flags</b>
81
+ <table border="1">
82
+ <tr>
83
+ <th></th>
84
+ <th>Old</th>
85
+ <th>New</th>
86
+ </tr>
87
+ <tr>
88
+ <td><b>Compiler command</b></td>
89
+ <td>$(ti_home)/ccsv5/tools/compiler/tms470/bin/cl470</td>
90
+ <td>ti_cl</td>
91
+ </tr>
92
+ <tr>
93
+ <td><b>Compiler flags</b></td>
94
+ <td>-mv7A8 -g --include_path="#{ti_home}/ccsv5/tools/compiler/tms470/include" --diag_warning=225 -me --abi=eabi --code_state=32 --preproc_with_compile</td>
95
+ <td></td>
96
+ </tr>
97
+ <tr>
98
+ <td><b>Archiver command</b></td>
99
+ <td>$(ti_home)/ccsv5/tools/compiler/tms470/bin/ar470</td>
100
+ <td>ti_ar</td>
101
+ </tr>
102
+ <tr>
103
+ <td><b>Linker command</b></td>
104
+ <td>$(ti_home)/ccsv5/tools/compiler/tms470/bin/cl470</td>
105
+ <td>ti_cl</td>
106
+ </tr>
107
+ <tr>
108
+ <td><b>Linker flags</b></td>
109
+ <td>-mv7A8 -g --diag_warning=225 -me --abi=eabi --code_state=32 -z --warn_sections -i"$(ti_home)/ccsv5/tools/compiler/tms470/lib" -i"$(ti_home)/ccsv5/tools/compiler/tms470/include"</td>
110
+ <td></td>
111
+ </tr>
112
+ <tr>
113
+ <td><b>Linker lib prefix flags</b></td>
114
+ <td>-lDebug/configPkg/linker.cmd</td>
115
+ <td></td>
116
+ </tr>
117
+ </table>
118
+ <p>
119
+ <li><b>Bugfix: variables in <i>add</i> and <i>remove</i> attributes of <i>Flags</i> now work as intended</b>
120
+ <li><b>Bugfix: output folder was not created if no sources are specified for <i>LibraryConfig</i> and <i>ExecutableConfig</i>.</b>
121
+ <li><b>Bugfix: "-p" was not forwarded in bakery.</b>
122
+ <p>
123
+ <li><b>Cosmetic: bakery now calls bake with relative pathnames, which results in nicer outputs.</b>
124
+
125
+
126
+
127
+ </ul>
128
+
129
+ December 19, 2014 - Eclipse plugin 1.2.0<br>
130
+ <ul>
131
+ <li><b>Bugfix: it is now ensured, that bake will be started from Eclipse working directory</b>
132
+ <li><b>Bugfix: projects created with the "new bake project wizard" are now placed in the correct folder.</b>
133
+ <li><b>Added: Eclipse working directory shown in bake preference dialog (important if -w option is used with relative paths)</b>
134
+ <li><b>Added: Options to recreate .(c)project files when importing bake projects</b>
135
+ <li><b>Changed: Eclipse configurations will be named "bake" and not "Do not use this config, use bake instead"</b>
136
+ </ul>
137
+
138
+ December 16, 2014 - Eclipse plugin 1.1.1<br>
139
+ <ul>
140
+ <li><b>Bugfix: Adjust include and defines broken feature used wrong command line option.</b>
141
+ </ul>
142
+
10
143
  November 7, 2014 - bake-toolkit 1.8.0, Eclipse plugin 1.1.0<br>
11
144
  <ul>
12
145
  <li><b>Added: InternalIncludes and InternalDefines in DefaultToolchain, which are forwarded to the IDE.</b>
@@ -55,7 +188,7 @@ July 18, 2014 - bake-toolkit 1.5.0<br>
55
188
  June 6, 2014 - bake-toolkit 1.4.0<br>
56
189
  <ul>
57
190
  <li><b>Bugfix: variables can be used in "Set" now</b>
58
- <li><b>Added: variable "MainProjectDir"
191
+ <li><b>Added: variable "MainProjectDir"</b>
59
192
  </ul>
60
193
 
61
194
  May 23, 2014 - bake-toolkit 1.3.0<br>
@@ -11,6 +11,7 @@
11
11
  <b>Workaround 1</b>: Clean the project.<br>
12
12
  <b>Workaround 2</b>: Delete the archive/executable manually.<br>
13
13
  <b>Workaround 3</b>: Touch, edit, create another source file.<br>
14
+ <li><b>Issue</b>: Lint output not shown during linting (has to be refactored)
14
15
  </ul>
15
16
 
16
17
 
@@ -6,32 +6,35 @@
6
6
  <body>
7
7
  <h1>Wishes and planned features</h1>
8
8
 
9
- Features listed on this page are open for discussion.
9
+ bake:
10
10
  <ul>
11
- <li>Project configurations are placed in Project.meta. If more than one meta file would be supported, different applications may edit different meta files.
12
- <ul>
13
- <li>Applications can change e.g. compiler flags without breaking another application.
14
- <li>However, if e.g. a new include path is needed, all meta-files have to be adapted.
15
- </ul>
11
+ <li>Add variables for output directories of sub projects, which can be used in main project
12
+ <li>Show lint output during linting. This is possible, but the error parser mechanism has to be refactored
13
+ <li>Support VS compiler
14
+ <li>Glob in Windows does not work if Project.meta is placed in root folder. Implement workaround
15
+ <li>Support read-only file systems (cache files cannot be written)
16
16
  <li>Another way to define IncludeDirs, etc. which avoids repeating the work IncludeDir for every include dir (rtext change?)
17
17
  <li>meta files: "{" not only at the end of a line, should be possible to place anywhere
18
- <li>New lines in problems view are shown as a square sign. These signs should be somehow removed without breaking the annotations in the source files.
19
- <li>Maybe a project property page can be introduced as Project.meta-Viewer/Editor - this could be a feature for a later version.
20
18
  <li>Global bake config (e.g. for -v or -a black)
21
- <li>Support toolchain settings for files with wildcards. Clarify how to proceed with ambiguous declarations.
22
- <li>Word wrap in colored console in Eclipse (seems a bit tricky)
23
- <li>Build order of files currently the same as in Eclipse makefiles. Should that be changed to reflect order of "Files" tags in Project.meta?
24
- <li>bakery shall call bake with relative pathnames, which results in nicer outputs in nightly builds
25
- <li>Introduce background ruby process for Eclipse to workaround the require bug in ruby 1.9.x for Windows.<br>
26
- Reason: require statements take round about two seconds before the build can be started. Two seconds is very much when building a single file.
27
- <li>Exporter: add some more logic for exclude build directories to reduce useless definitions in Project.meta files
28
- <li>Additional redirect from errors and warnings in a log file.
19
+ <li>Support toolchain settings for files with wildcards. Clarify how to proceed with ambiguous declarations
20
+ <li>Additional redirect from errors and warnings in a log file
29
21
  <li>Conditional variables like ifeq ($(VIDEO_MODE_12BIT_JPEG), 1)
30
- <li>Better annotations undefined symbol errors (if e.g. filename is given in error message)
31
- <li>Doxygen parameter to generate Doxygen, maybe with AutoOpen from Eclipse?
32
- <li>Even shorter command line options
33
- <li>Better error log in Eclipse if plugin does not work
34
- <li>Doxygen support or even better generic docu support
22
+ <li>Better annotations for undefined symbol errors (if e.g. filename is given in error message)
23
+ <li>Cache source file names which are used for creating an archive or executable (to detect that rebuild is necessary if sources are specified with wildcards in Project.meta and some files were deleted)
24
+ </ul>
25
+
26
+ IDEs:
27
+ <ul>
28
+ <li>VS: Debugging in VS
29
+ <li>Eclipse: newlines in problems view are shown as a square sign. These signs should be somehow removed without breaking the annotations in the source files
30
+ <li>Eclipse: Word wrap in colored console (seems to be a bit tricky)
31
+ <li>Eclipse: better error log if plugin does not work
32
+ <li>Common: Add docu how to debug in IDEs
33
+ </ul>
34
+
35
+ Internal:
36
+ <ul>
37
+ <li>Cleanup names of attributes in metamodel
35
38
  </ul>
36
39
 
37
40
  </body>
data/doc/index.html CHANGED
@@ -72,7 +72,7 @@ bake is used to build software <font color="#009900"><b>fast</b></font> and <fon
72
72
 
73
73
  <p>
74
74
  <hr>
75
- <table width="100%" border="0"><tr><td align="left">Described bake-toolkit version: 1.8.0</td><td align="right">November 7, 2014</td></tr></table>
75
+ <table width="100%" border="0"><tr><td align="left">Described bake-toolkit version: 2.0.10</td><td align="right">January 15, 2015</td></tr></table>
76
76
 
77
77
  </body>
78
78
 
@@ -41,6 +41,11 @@ bake includes also some standard variables:
41
41
  <tr><td>$(ArtifactNameBase)</td> <td>bootloader_1.0</td></tr>
42
42
  <tr><td>$(Time)</td> <td>2012-12-24 20:00:00 +0200</td></tr>
43
43
  <tr><td>$(Hostname)</td> <td>MY_COMPUTER</td></tr>
44
+ <tr><td>$(CPPPath)</td> <td>/usr/bin</td></tr>
45
+ <tr><td>$(CPath)</td> <td>/usr/bin</td></tr>
46
+ <tr><td>$(ASMPath)</td> <td>/usr/bin</td></tr>
47
+ <tr><td>$(ArchiverPath)</td> <td>/usr/bin</td></tr>
48
+ <tr><td>$(LinkerPath)</td> <td>/usr/bin</td></tr>
44
49
  </table>
45
50
  <br>
46
51
  <table border="1">
@@ -61,6 +66,8 @@ Otherwise:
61
66
  </table>
62
67
  <p>
63
68
  If the environment variable does not exist, it will be substituted by an empty string.
69
+ <p>
70
+ Note, that variables in <b>Dependency</b> definitions are not allowed.
64
71
 
65
72
  <h3>Equal variables</h3>
66
73
 
@@ -75,7 +82,7 @@ If the environment variable does not exist, it will be substituted by an empty s
75
82
  <h4>In subproject</h4>
76
83
  <table border="1">
77
84
  <tr><th bgcolor="#CCCCCC">Variable</th><th bgcolor="#CCCCCC">is equal to</th></tr>
78
- <tr><td>$(OutputDir)</td> <td>$(MainConfigName)_$(MainProjectName)</td></tr>
85
+ <tr><td>$(OutputDir)</td> <td>$(ConfigName)_$(MainProjectName)_$(MainConfigName)</td></tr>
79
86
  </table>
80
87
 
81
88
  <h3>Auto-adjustment of paths to existing projects</h3>
@@ -64,7 +64,7 @@ z-index: 100;
64
64
 
65
65
  <table border="1" style="font-family:monospace"; font-size:10><td>
66
66
 
67
- <span class="help" onMouseover="showProject()" onMouseout="notip()">Project</span> {<br>
67
+ <span class="help" onMouseover="showProject()" onMouseout="notip()">Project</span> <span class="help" onMouseover="showDefaultConfig()" onMouseout="notip()">default</span>: &#60;name&#62; {<br>
68
68
  &nbsp; <br>
69
69
 
70
70
  &nbsp; <span class="help" onMouseover="showDescription()" onMouseout="notip()">Description</span> &#60;text&#62;<br><br>
@@ -123,16 +123,10 @@ z-index: 100;
123
123
  &nbsp; &nbsp; &nbsp; }<br>
124
124
  &nbsp; &nbsp; &nbsp; <span class="help" onMouseover="showInternalIncludes()" onMouseout="notip()">InternalIncludes</span> &#60;file&#62;<br>
125
125
  &nbsp; &nbsp; &nbsp; <span class="help" onMouseover="showDefaultLintPolicy()" onMouseout="notip()">LintPolicy</span> &#60;policy&#62;<br>
126
- &nbsp; &nbsp; }<br></span><br></span>
127
-
128
- <span id="libExe_part"><span class="show" style="background-color:#EEEEEE;">
129
- &nbsp; &nbsp; <span class="mycomment"># Valid for ExecutableConfig and LibraryConfig</span><br><br>
130
- &nbsp; &nbsp; <span class="help" onMouseover="showFiles()" onMouseout="notip()">Files</span> &#60;pattern&#62; {<br>
131
- &nbsp; &nbsp; &nbsp; <span class="help" onMouseover="showFilesFlags()" onMouseout="notip()">Flags</span> &#60;flags&#62;, add: &#60;flags&#62;, remove: &#60;flags&#62;<br>
132
- &nbsp; &nbsp; &nbsp; <span class="help" onMouseover="showFilesDefine()" onMouseout="notip()">Define</span> &#60;define&#62;<br>
126
+ &nbsp; &nbsp; &nbsp; <span class="help" onMouseover="showDocu()" onMouseout="notip()">Docu</span> &#60;cmdLine&#62;<br>
133
127
  &nbsp; &nbsp; }<br>
134
- &nbsp; &nbsp; <span class="help" onMouseover="showExcludeFiles()" onMouseout="notip()">ExcludeFiles</span> &#60;pattern&#62;<br>
135
- &nbsp; &nbsp; <span class="help" onMouseover="showIncludeDir()" onMouseout="notip()">IncludeDir</span> &#60;dir&#62;<br>
128
+
129
+
136
130
  &nbsp; &nbsp; <span class="help" onMouseover="showToolchainProject()" onMouseout="notip()">Toolchain</span> <span class="help" onMouseover="showOutputDir()" onMouseout="notip()">outputDir</span>: &#60;dir&#62; {<br>
137
131
  &nbsp; &nbsp; &nbsp; <span class="help" onMouseover="showCompiler()" onMouseout="notip()">Compiler</span> ASM | CPP | C,
138
132
  <span class="help" onMouseover="showCommand()" onMouseout="notip()">command</span>: &#60;cmd&#62; {</i><br>
@@ -150,7 +144,20 @@ z-index: 100;
150
144
  &nbsp; &nbsp; &nbsp; &nbsp; <span class="help" onMouseover="showLibPostfixFlags()" onMouseout="notip()">LibPostfixFlags</span> &#60;flags&#62;, add: &#60;flags&#62;, remove: &#60;flags&#62<br>
151
145
  &nbsp; &nbsp; &nbsp; }<br>
152
146
  &nbsp; &nbsp; &nbsp; <span class="help" onMouseover="showLintPolicy()" onMouseout="notip()">LintPolicy</span> &#60;policy&#62;<br>
153
- &nbsp; &nbsp; }<br></span><br></span>
147
+ &nbsp; &nbsp; &nbsp; <span class="help" onMouseover="showDocu()" onMouseout="notip()">Docu</span> &#60;cmdLine&#62;<br>
148
+ &nbsp; &nbsp; }<br></span><br>
149
+ </span>
150
+
151
+ <span id="libExe_part"><span class="show" style="background-color:#EEEEEE;">
152
+ &nbsp; &nbsp; <span class="mycomment"># Valid for ExecutableConfig and LibraryConfig</span><br><br>
153
+ &nbsp; &nbsp; <span class="help" onMouseover="showFiles()" onMouseout="notip()">Files</span> &#60;pattern&#62; {<br>
154
+ &nbsp; &nbsp; &nbsp; <span class="help" onMouseover="showFilesFlags()" onMouseout="notip()">Flags</span> &#60;flags&#62;, add: &#60;flags&#62;, remove: &#60;flags&#62;<br>
155
+ &nbsp; &nbsp; &nbsp; <span class="help" onMouseover="showFilesDefine()" onMouseout="notip()">Define</span> &#60;define&#62;<br>
156
+ &nbsp; &nbsp; }<br>
157
+ &nbsp; &nbsp; <span class="help" onMouseover="showExcludeFiles()" onMouseout="notip()">ExcludeFiles</span> &#60;pattern&#62;<br>
158
+ &nbsp; &nbsp; <span class="help" onMouseover="showIncludeDir()" onMouseout="notip()">IncludeDir</span> &#60;dir&#62;<br>
159
+
160
+ </span><br></span>
154
161
 
155
162
  <span id="exe_part"><span class="show" style="background-color:#EEEEEE;">
156
163
  &nbsp; &nbsp; <span class="mycomment"># Valid for ExecutableConfig</span><br><br>
@@ -165,11 +172,16 @@ z-index: 100;
165
172
  <span style="background-color:#DDDDDD;" id="makefile_part" class="showInline"> &#60;name&#62;,
166
173
  <span class="help" onMouseover="showMakefileLib()" onMouseout="notip()">lib</span>: &#60;lib&#62;,
167
174
  <span class="help" onMouseover="showMakefileTarget()" onMouseout="notip()">target</span>: &#60;target&#62;,
168
- <span class="help" onMouseover="showMakefilePathTo()" onMouseout="notip()">pathTo</span>: &#60;paths&#62; {<br>
175
+ <span class="help" onMouseover="showMakefilePathTo()" onMouseout="notip()">pathTo</span>: &#60;paths&#62;,
176
+ <span class="help" onMouseover="showStepDefault()" onMouseout="notip()">default</span>: on|off,
177
+ <span class="help" onMouseover="showStepFilter()" onMouseout="notip()">filter</span>: &#60;name&#62; {<br>
169
178
  &nbsp; &nbsp; &nbsp; <span class="help" onMouseover="showMakefileFlags()" onMouseout="notip()">Flags</span> &#60;flags&#62;<br>
170
179
  &nbsp; &nbsp; }<br>
171
180
  </span>
172
- <span style="background-color:#DDDDDD;" id="commandline_part" class="hide">&#60;line&#62;</span>
181
+ <span style="background-color:#DDDDDD;" id="commandline_part" class="hide">&#60;line&#62;,
182
+ <span class="help" onMouseover="showStepDefault()" onMouseout="notip()">default</span>: on|off,
183
+ <span class="help" onMouseover="showStepFilter()" onMouseout="notip()">filter</span>: &#60;name&#62;
184
+ </span>
173
185
  &nbsp; &nbsp; <br></span><br></span>
174
186
  &nbsp; }<br>
175
187
  }<br>
@@ -191,6 +203,16 @@ function showProject() {
191
203
  ddrivetip("Project", "Yes", "1", "-",str)
192
204
  }
193
205
 
206
+ function showDefaultConfig() {
207
+ str = 'Default configuration which is used if not explicitly specified on command line or Dependency definition.<br><br>'+
208
+ 'Examples:<br>'+
209
+ '# Project.meta:<br>'+
210
+ 'Dependency canDriver # uses default config of canDriver project<br>'+
211
+ '# Command line:<br>'+
212
+ 'bake -m folder/dir/projABC # builds default config of project projABC'
213
+ ddrivetip("defaukt", "No", "-", "-",str)
214
+ }
215
+
194
216
  function showResponsible() {
195
217
  str = "Specify all responsible persons of the project."
196
218
  ddrivetip("Responsible", "No,", "0..1", "-",str)
@@ -411,7 +433,9 @@ function showSet() {
411
433
 
412
434
  function showDependency() {
413
435
  str = 'Specifies another project to be built before this project.<br>'+
414
- 'The archive, linker libs and search paths are imported from this project to the this project automatically.'
436
+ 'The archive, linker libs and search paths are imported from this project to the this project automatically.<br>'+
437
+ 'If you omit the project, the current project will be used.<br>'+
438
+ 'If you omit the config name, the default config will be used.'
415
439
  ddrivetip("Dependency", "No","0..n","-",str)
416
440
  }
417
441
 
@@ -519,6 +543,10 @@ function showLintPolicy() {
519
543
  ddrivetip("LintPolicy", "No","0..n","-","lnt-file - but it can be used for any other command line option for Lint.")
520
544
  }
521
545
 
546
+ function showDocu() {
547
+ ddrivetip("Docu", "No","0..1","-","Command to build the documentation. e.g.:<br>doxygen main.cfg")
548
+ }
549
+
522
550
  function showDefaultFlags() {
523
551
  ddrivetip("Flags", "No","0..n","-","Default flags.")
524
552
  }
data/lib/bake/cache.rb CHANGED
@@ -1,12 +1,12 @@
1
- require 'cxxproject/utils/exit_helper'
2
- require 'cxxproject/utils/printer'
3
- require 'bake/version'
4
- require 'bake/options'
1
+ require 'common/exit_helper'
2
+ require 'bake/toolchain/colorizing_formatter'
3
+ require 'common/options/parser'
4
+ require 'common/version'
5
5
 
6
- module Cxxproject
6
+ module Bake
7
7
 
8
8
  class Cache
9
- attr_accessor :project2config
9
+ attr_accessor :referencedConfigs
10
10
  attr_accessor :files # project_files
11
11
  attr_accessor :cache_file
12
12
  attr_accessor :version
@@ -16,6 +16,7 @@ module Cxxproject
16
16
  attr_accessor :defaultToolchain
17
17
  attr_accessor :defaultToolchainTime
18
18
  attr_accessor :no_autodir
19
+ attr_accessor :build_config
19
20
  end
20
21
 
21
22
  class CacheAccess
@@ -23,13 +24,14 @@ module Cxxproject
23
24
  attr_reader :defaultToolchainTime
24
25
  attr_reader :cacheFilename
25
26
 
26
- def initialize(pm_filename, config_name, options)
27
- @cacheFilename = File.dirname(pm_filename)+"/.bake/"+File.basename(pm_filename)+"."+sanitize_filename(config_name)+".cache"
27
+ def initialize()
28
+ if Bake.options.build_config == ""
29
+ @cacheFilename = Bake.options.main_dir+"/.bake/Default.Project.meta.cache"
30
+ else
31
+ @cacheFilename = Bake.options.main_dir+"/.bake/Project.meta." + sanitize_filename(Bake.options.build_config) + ".cache"
32
+ end
28
33
 
29
- CLOBBER.include(File.dirname(pm_filename)+"/.bake")
30
-
31
34
  FileUtils.mkdir_p(File.dirname(@cacheFilename))
32
- @options = options
33
35
  @defaultToolchain = nil
34
36
  @defaultToolchainTime = nil
35
37
  end
@@ -43,40 +45,40 @@ module Cxxproject
43
45
  contents = File.open(@cacheFilename, "rb") {|io| io.read }
44
46
  cache = Marshal.load(contents)
45
47
 
46
- if cache.version != Version.bake
47
- Printer.printInfo("Info: cache version ("+cache.version+") does not match to bake version ("+Version.bake+"), reloading meta information")
48
+ if cache.version != Version.number
49
+ Bake.formatter.printInfo("Info: cache version ("+cache.version+") does not match to bake version ("+Version.number+"), reloading meta information")
48
50
  cache = nil
49
- @options.set_nocache # complete re-read
50
51
  else
51
52
  @defaultToolchain = cache.defaultToolchain
52
53
  @defaultToolchainTime = cache.defaultToolchainTime
53
- end
54
+ end
54
55
 
55
56
  if cache != nil
56
57
  if cache.cache_file != @cacheFilename
57
- Printer.printInfo "Info: cache filename changed, reloading meta information"
58
+ Bake.formatter.printInfo("Info: cache filename changed, reloading meta information")
58
59
  cache = nil
59
- @options.set_nocache # abs dir may wrong
60
60
  end
61
61
  end
62
62
 
63
63
  if cache != nil
64
64
  cache.files.each do |c|
65
65
  if (not File.exists?(c))
66
- Printer.printInfo "Info: meta file(s) renamed or deleted, reloading meta information"
66
+ Bake.options.nocache = true
67
+ Bake.formatter.printInfo("Info: meta file(s) renamed or deleted, reloading meta information")
67
68
  cache = nil
68
- @options.set_nocache # abs dir may wrong
69
69
  break
70
70
  end
71
71
  end
72
72
  end
73
73
 
74
74
  if cache != nil
75
- cache.project2config.each do |pname,config|
76
- if not File.exists?(config.file_name)
77
- Printer.printInfo "Info: meta file(s) renamed or deleted, reloading meta information"
78
- cache = nil
79
- @options.set_nocache # abs dir may wrong
75
+ cache.referencedConfigs.each do |pname,configs|
76
+ configs.each do |config|
77
+ if not File.exists?(config.file_name)
78
+ Bake.options.nocache = true
79
+ Bake.formatter.printInfo("Info: meta file(s) renamed or deleted, reloading meta information")
80
+ cache = nil
81
+ end
80
82
  end
81
83
  end
82
84
  end
@@ -84,7 +86,7 @@ module Cxxproject
84
86
  if cache != nil
85
87
  cache.files.each do |c|
86
88
  if File.mtime(c) > cacheTime
87
- Printer.printInfo "Info: cache is out-of-date, reloading meta information"
89
+ Bake.formatter.printInfo("Info: cache is out-of-date, reloading meta information")
88
90
  cache = nil
89
91
  break
90
92
  end
@@ -92,9 +94,9 @@ module Cxxproject
92
94
  end
93
95
 
94
96
  if cache != nil
95
- if cache.workspace_roots.length == @options.roots.length
97
+ if cache.workspace_roots.length == Bake.options.roots.length
96
98
  cache.workspace_roots.each do |r|
97
- if not @options.roots.include?r
99
+ if not Bake.options.roots.include?r
98
100
  cache = nil
99
101
  break
100
102
  end
@@ -102,70 +104,60 @@ module Cxxproject
102
104
  else
103
105
  cache = nil
104
106
  end
105
- Printer.printInfo "Info: specified roots differ from cached roots, reloading meta information" if cache.nil?
107
+ Bake.formatter.printInfo("Info: specified roots differ from cached roots, reloading meta information") if cache.nil?
106
108
  end
107
109
 
108
110
  if cache != nil
109
- if (not @options.include_filter.eql?(cache.include_filter)) or (not @options.exclude_filter.eql?(cache.exclude_filter))
111
+ if (not Bake.options.include_filter.eql?(cache.include_filter)) or (not Bake.options.exclude_filter.eql?(cache.exclude_filter))
110
112
  cache = nil
111
- Printer.printInfo "Info: specified filters differ from cached filters, reloading meta information"
113
+ Bake.formatter.printInfo("Info: specified filters differ from cached filters, reloading meta information")
112
114
  end
113
115
  end
114
116
 
115
117
  if cache != nil
116
- if (not @options.no_autodir.eql?(cache.no_autodir))
118
+ if (not Bake.options.no_autodir.eql?(cache.no_autodir))
117
119
  cache = nil
118
- Printer.printInfo "Info: no_autodir option differs in cache, reloading meta information"
120
+ Bake.formatter.printInfo("Info: no_autodir option differs in cache, reloading meta information")
119
121
  end
120
- end
122
+ end
121
123
 
122
124
  else
123
- Printer.printInfo("Info: cache not found, reloading meta information")
125
+ Bake.formatter.printInfo("Info: cache not found, reloading meta information")
124
126
  end
125
-
126
- rescue ExitHelperException
127
- raise
128
- rescue
129
- Printer.printWarning "Warning: cache file corrupt, reloading meta information"
127
+ rescue Exception
128
+ Bake.formatter.printWarning("Warning: cache file corrupt, reloading meta information (cache might be written by an older bake version)")
130
129
  cache = nil
131
130
  end
132
131
 
133
132
  if cache != nil
134
- Printer.printInfo "Info: cache is up-to-date, loading cached meta information" if @options.verbose
135
-
136
- cache.files.each do |c|
137
- CLOBBER.include(File.dirname(c)+"/.bake")
138
- end
139
-
140
- return cache.project2config
133
+ Bake.formatter.printInfo("Info: cache is up-to-date, loading cached meta information") if Bake.options.verboseHigh
134
+ Bake.options.build_config = cache.build_config if Bake.options.build_config == ""
135
+ return cache.referencedConfigs
141
136
  end
137
+
142
138
  return nil
143
-
144
139
  end
145
140
 
146
- def write_cache(project_files, project2config, defaultToolchain, defaultToolchainTime)
141
+ def write_cache(project_files, referencedConfigs, defaultToolchain, defaultToolchainTime)
147
142
  cache = Cache.new
148
- cache.project2config = project2config
143
+ cache.referencedConfigs = referencedConfigs
149
144
  cache.files = project_files
150
145
  cache.cache_file = @cacheFilename
151
- cache.version = Version.bake
152
- cache.include_filter = @options.include_filter
153
- cache.no_autodir = @options.no_autodir
154
- cache.exclude_filter = @options.exclude_filter
155
- cache.workspace_roots = @options.roots
146
+ cache.version = Version.number
147
+ cache.include_filter = Bake.options.include_filter
148
+ cache.no_autodir = Bake.options.no_autodir
149
+ cache.exclude_filter = Bake.options.exclude_filter
150
+ cache.workspace_roots = Bake.options.roots
156
151
  cache.defaultToolchain = defaultToolchain
157
152
  cache.defaultToolchainTime = defaultToolchainTime
153
+ cache.build_config = Bake.options.build_config
158
154
  bbdump = Marshal.dump(cache)
159
155
  begin
160
156
  File.delete(@cacheFilename)
161
157
  rescue
162
158
  end
163
159
  File.open(@cacheFilename, 'wb') {|file| file.write(bbdump) }
164
-
165
- project_files.each do |f|
166
- CLOBBER.include(File.dirname(f)+"/.bake")
167
- end
168
-
160
+ Bake.options.nocache = false
169
161
  end
170
162
 
171
163
  end