bake-toolkit 2.28.0 → 2.28.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/documentation/_build/html/_sources/changelog.txt +3 -0
  3. data/documentation/_build/html/_sources/index.txt +1 -1
  4. data/documentation/_build/html/_static/logo_tiny_48.png +0 -0
  5. data/documentation/_build/html/changelog.html +1154 -1149
  6. data/documentation/_build/html/commandline/commandline.html +285 -285
  7. data/documentation/_build/html/concepts/build_hierarchy.html +204 -204
  8. data/documentation/_build/html/concepts/concepts.html +196 -196
  9. data/documentation/_build/html/concepts/inject.html +216 -216
  10. data/documentation/_build/html/concepts/link_order.html +245 -245
  11. data/documentation/_build/html/concepts/prebuild.html +205 -205
  12. data/documentation/_build/html/concepts/the_main_project.html +260 -260
  13. data/documentation/_build/html/concepts/the_project_meta_file.html +288 -288
  14. data/documentation/_build/html/genindex.html +152 -152
  15. data/documentation/_build/html/ide/eclipse/eclipse.html +186 -186
  16. data/documentation/_build/html/ide/eclipse/how_to_convert_existing_cdt_workspace.html +208 -208
  17. data/documentation/_build/html/ide/eclipse/how_to_create_a_new_project_in_eclipse.html +191 -191
  18. data/documentation/_build/html/ide/eclipse/how_to_create_a_workspace_in_eclipse.html +198 -198
  19. data/documentation/_build/html/ide/eclipse/how_to_debug_in_eclipse.html +198 -198
  20. data/documentation/_build/html/ide/eclipse/how_to_install_eclipse_plugin.html +196 -196
  21. data/documentation/_build/html/ide/eclipse/how_to_use_bake_in_eclipse.html +256 -256
  22. data/documentation/_build/html/ide/ide_integrations.html +185 -185
  23. data/documentation/_build/html/ide/vs/how_to_create_vs_projects.html +171 -171
  24. data/documentation/_build/html/ide/vs/how_to_debug_in_vs.html +185 -185
  25. data/documentation/_build/html/ide/vs/how_to_used_bake_in_vs.html +190 -190
  26. data/documentation/_build/html/ide/vs/vs.html +170 -170
  27. data/documentation/_build/html/ide/vs/vs_install.html +202 -202
  28. data/documentation/_build/html/index.html +246 -246
  29. data/documentation/_build/html/install/install_bake.html +279 -279
  30. data/documentation/_build/html/internal.html +217 -217
  31. data/documentation/_build/html/known_issues.html +173 -173
  32. data/documentation/_build/html/license.html +236 -236
  33. data/documentation/_build/html/performance/performance.html +373 -373
  34. data/documentation/_build/html/quickstart/quickstart.html +236 -236
  35. data/documentation/_build/html/search.html +174 -174
  36. data/documentation/_build/html/searchindex.js +1 -1
  37. data/documentation/_build/html/syntax/adapt_configs.html +370 -370
  38. data/documentation/_build/html/syntax/auto_adjustment.html +189 -189
  39. data/documentation/_build/html/syntax/derive_configs.html +247 -247
  40. data/documentation/_build/html/syntax/project_meta_syntax.html +923 -923
  41. data/documentation/_build/html/syntax/syntax.html +196 -196
  42. data/documentation/_build/html/syntax/variable_substitutions.html +365 -365
  43. data/documentation/_build/html/tips_and_tricks/bakeclean.html +169 -169
  44. data/documentation/_build/html/tips_and_tricks/dot.html +186 -186
  45. data/documentation/_build/html/tips_and_tricks/how_to_use_bake_with_cygwin.html +214 -214
  46. data/documentation/_build/html/tips_and_tricks/qac.html +297 -297
  47. data/documentation/_build/html/tips_and_tricks/the_bakery.html +405 -405
  48. data/documentation/_build/html/tips_and_tricks/the_clang.html +201 -201
  49. data/documentation/_build/html/tips_and_tricks/tips_and_tricks.html +198 -198
  50. data/documentation/_build/html/why_bake/why_bake.html +241 -241
  51. data/lib/bake/config/checks.rb +76 -68
  52. data/lib/bake/model/metamodel.rb +6 -0
  53. data/lib/common/version.rb +1 -1
  54. metadata +3 -5
  55. data/documentation/_build/html/_sources/tips_and_tricks/static_code_analysis.txt +0 -122
  56. data/documentation/_build/html/_static/logo_conformant_48.png +0 -0
  57. data/documentation/_build/html/tips_and_tricks/static_code_analysis.html +0 -285
@@ -1,69 +1,77 @@
1
- module Bake
2
- module Configs
3
-
4
- class Checks
5
-
6
- def self.symlinkCheck(filename)
7
- dirOfProjMeta = File.dirname(filename)
8
- Dir.chdir(dirOfProjMeta) do
9
- if Dir.pwd != dirOfProjMeta and File.dirname(Dir.pwd) != File.dirname(dirOfProjMeta)
10
- isSym = false
11
- begin
12
- isSym = File.symlink?(dirOfProjMeta)
13
- rescue
14
- end
15
- if isSym
16
- Bake.formatter.printError("Symlinks only allowed with the same parent dir as the target: #{dirOfProjMeta} --> #{Dir.pwd}", filename)
17
- ExitHelper.exit(1)
18
- end
19
- end
20
- end
21
- end
22
-
23
- def self.commonMetamodelCheck(configs, filename, isAdapt = false)
24
-
25
- if configs.length == 0 && !isAdapt
26
- Bake.formatter.printError("No config found", filename)
27
- ExitHelper.exit(1)
28
- end
29
-
30
- configs.each do |config|
31
- if config.respond_to?("toolchain") and config.toolchain
32
- config.toolchain.compiler.each do |c|
33
- if not c.internalDefines.nil? and c.internalDefines != ""
34
- Bake.formatter.printError("InternalDefines only allowed in DefaultToolchain", c.internalDefines)
35
- ExitHelper.exit(1)
36
- end
37
- end
38
- end
39
-
40
- config.includeDir.each do |inc|
41
- if not ["front", "back", ""].include?inc.inject
42
- Bake.formatter.printError("inject of IncludeDir must be 'front' or 'back'", inc)
43
- ExitHelper.exit(1)
44
- end
45
- if not ["front", "back", ""].include?inc.infix
46
- Bake.formatter.printError("infix of IncludeDir must be 'front' or 'back'", inc)
47
- ExitHelper.exit(1)
48
- end
49
- if (inc.infix != "" and inc.inject != "")
50
- Bake.formatter.printError("IncludeDir must have inject OR infix (deprecated)", inc)
51
- ExitHelper.exit(1)
52
- end
53
- end if config.respond_to?("includeDir")
54
-
55
- config.dependency.each do |d|
56
- if not ["front", "back", ""].include?d.inject
57
- Bake.formatter.printError("inject of Dependency must be 'front' or 'back'", d)
58
- ExitHelper.exit(1)
59
- end
60
- end
61
-
62
- end
63
-
64
- end
65
-
66
- end
67
-
68
- end
1
+ module Bake
2
+ module Configs
3
+
4
+ class Checks
5
+
6
+ def self.symlinkCheck(filename)
7
+ dirOfProjMeta = File.dirname(filename)
8
+ Dir.chdir(dirOfProjMeta) do
9
+ if Dir.pwd != dirOfProjMeta and File.dirname(Dir.pwd) != File.dirname(dirOfProjMeta)
10
+ isSym = false
11
+ begin
12
+ isSym = File.symlink?(dirOfProjMeta)
13
+ rescue
14
+ end
15
+ if isSym
16
+ Bake.formatter.printError("Symlinks only allowed with the same parent dir as the target: #{dirOfProjMeta} --> #{Dir.pwd}", filename)
17
+ ExitHelper.exit(1)
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+ def self.commonMetamodelCheck(configs, filename, isAdapt = false)
24
+
25
+ if configs.length == 0 && !isAdapt
26
+ Bake.formatter.printError("No config found", filename)
27
+ ExitHelper.exit(1)
28
+ end
29
+
30
+ configs.each do |config|
31
+ if config.respond_to?("toolchain") and config.toolchain
32
+ config.toolchain.compiler.each do |c|
33
+ if not c.internalDefines.nil? and c.internalDefines != ""
34
+ Bake.formatter.printError("InternalDefines only allowed in DefaultToolchain", c.internalDefines)
35
+ ExitHelper.exit(1)
36
+ end
37
+ end
38
+ config.toolchain.lintPolicy.each do |l|
39
+ Bake.formatter.printWarning("Lint support was removed. Please delete LintPolicy from Project.meta.", l)
40
+ end
41
+ end
42
+ if config.respond_to?("defaultToolchain") and config.defaultToolchain
43
+ config.defaultToolchain.lintPolicy.each do |l|
44
+ Bake.formatter.printWarning("Lint support was removed. Please delete LintPolicy from Project.meta.", l)
45
+ end
46
+ end
47
+
48
+ config.includeDir.each do |inc|
49
+ if not ["front", "back", ""].include?inc.inject
50
+ Bake.formatter.printError("inject of IncludeDir must be 'front' or 'back'", inc)
51
+ ExitHelper.exit(1)
52
+ end
53
+ if not ["front", "back", ""].include?inc.infix
54
+ Bake.formatter.printError("infix of IncludeDir must be 'front' or 'back'", inc)
55
+ ExitHelper.exit(1)
56
+ end
57
+ if (inc.infix != "" and inc.inject != "")
58
+ Bake.formatter.printError("IncludeDir must have inject OR infix (deprecated)", inc)
59
+ ExitHelper.exit(1)
60
+ end
61
+ end if config.respond_to?("includeDir")
62
+
63
+ config.dependency.each do |d|
64
+ if not ["front", "back", ""].include?d.inject
65
+ Bake.formatter.printError("inject of Dependency must be 'front' or 'back'", d)
66
+ ExitHelper.exit(1)
67
+ end
68
+ end
69
+
70
+ end
71
+
72
+ end
73
+
74
+ end
75
+
76
+ end
69
77
  end
@@ -75,6 +75,10 @@ module Bake
75
75
  contains_one 'internalDefines', InternalDefines, 'parent'
76
76
  end
77
77
 
78
+ class LintPolicy < ModelElement
79
+ has_attr 'name', String, :defaultValueLiteral => ""
80
+ end
81
+
78
82
  class Docu < ModelElement
79
83
  has_attr 'name', String, :defaultValueLiteral => ""
80
84
  end
@@ -86,6 +90,7 @@ module Bake
86
90
  contains_many 'compiler', Compiler, 'parent'
87
91
  contains_one 'archiver', Archiver, 'parent'
88
92
  contains_one 'linker', Linker, 'parent'
93
+ contains_many 'lintPolicy', LintPolicy, 'parent'
89
94
  contains_one 'internalIncludes', InternalIncludes, 'parent'
90
95
  contains_one 'docu', Docu, 'parent'
91
96
  end
@@ -95,6 +100,7 @@ module Bake
95
100
  contains_many 'compiler', Compiler, 'parent'
96
101
  contains_one 'archiver', Archiver, 'parent'
97
102
  contains_one 'linker', Linker, 'parent'
103
+ contains_many 'lintPolicy', LintPolicy, 'parent'
98
104
  contains_one 'docu', Docu, 'parent'
99
105
  end
100
106
 
@@ -1,7 +1,7 @@
1
1
  module Bake
2
2
  class Version
3
3
  def self.number
4
- "2.28.0"
4
+ "2.28.1"
5
5
  end
6
6
 
7
7
  def self.printBakeVersion(ry = "")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bake-toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.28.0
4
+ version: 2.28.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Schaal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-03 00:00:00.000000000 Z
11
+ date: 2017-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rtext
@@ -220,7 +220,6 @@ files:
220
220
  - documentation/_build/html/_sources/tips_and_tricks/dot.txt
221
221
  - documentation/_build/html/_sources/tips_and_tricks/how_to_use_bake_with_cygwin.txt
222
222
  - documentation/_build/html/_sources/tips_and_tricks/qac.txt
223
- - documentation/_build/html/_sources/tips_and_tricks/static_code_analysis.txt
224
223
  - documentation/_build/html/_sources/tips_and_tricks/the_bakery.txt
225
224
  - documentation/_build/html/_sources/tips_and_tricks/the_clang.txt
226
225
  - documentation/_build/html/_sources/tips_and_tricks/tips_and_tricks.txt
@@ -340,8 +339,8 @@ files:
340
339
  - documentation/_build/html/_static/js/jquery-1.11.0.min.js
341
340
  - documentation/_build/html/_static/js/jquery-fix.js
342
341
  - documentation/_build/html/_static/keys.png
343
- - documentation/_build/html/_static/logo_conformant_48.png
344
342
  - documentation/_build/html/_static/logo_tiny_32.ico
343
+ - documentation/_build/html/_static/logo_tiny_48.png
345
344
  - documentation/_build/html/_static/minus.png
346
345
  - documentation/_build/html/_static/misra.png
347
346
  - documentation/_build/html/_static/notepad.png
@@ -413,7 +412,6 @@ files:
413
412
  - documentation/_build/html/tips_and_tricks/dot.html
414
413
  - documentation/_build/html/tips_and_tricks/how_to_use_bake_with_cygwin.html
415
414
  - documentation/_build/html/tips_and_tricks/qac.html
416
- - documentation/_build/html/tips_and_tricks/static_code_analysis.html
417
415
  - documentation/_build/html/tips_and_tricks/the_bakery.html
418
416
  - documentation/_build/html/tips_and_tricks/the_clang.html
419
417
  - documentation/_build/html/tips_and_tricks/tips_and_tricks.html
@@ -1,122 +0,0 @@
1
- Static Code Analysis
2
- ====================
3
-
4
- Static code analysis often is part or a pre step of the build, even though bake provides presteps which can be used to
5
- add customized steps, we choose to add explicit support for static code analysis due to the fact that the analysis often
6
- depends on information well known by the build system (include pahts, compiler flags, etc.). Currently bake has built in
7
- support for *Pc-Lint*.
8
-
9
- Lint
10
- ****
11
-
12
- With bake you can lint LibraryConfigs, ExecutableConfigs, single files and the complete workspace (in this case the projects are linted separately).
13
- The CPP Toolchain settings of the project are used regardless of the file type and file specific options.
14
- It is possible to specify lnt-files with LintPolicy, but you can add every other lint command line option as well.
15
-
16
- Basic Setup
17
- -----------
18
-
19
- #. Install `lint <http://www.gimpel.com/html/products.htm>`_.
20
- #. Make sure the The lint executable 'lint-nt.exe' is in the path.
21
-
22
- .. attention::
23
-
24
- even though there is a unix version of pc-lint the asscoated binary name must be lint-nt.exe otherwise
25
- it won't be recorgnized by the bake build system.
26
-
27
- After doing this steps you are able to lint your build configurations (LibraryConfigs and ExecutableConfigs) using the *--lint* flag on the command line.
28
-
29
- Example
30
- +++++++
31
- .. code-block:: console
32
-
33
- User@Host:~$ bake Debug -p MyLibraryProject --lint
34
-
35
-
36
- Configuring Lint
37
- ----------------
38
-
39
- In order to configure lint in the Project.meta file, just use the *LintPolicy* command, which forwards the supplied
40
- the parameters to lint.
41
-
42
- .. code-block:: text
43
-
44
- DefaultToolchain GCC {
45
- ...
46
- LintPolicy "$(ProjectDir)/lint/misra.lnt"
47
- LintPolicy "$(ProjectDir)/lint/suppressions.lnt"
48
- }
49
-
50
- Example
51
- +++++++
52
-
53
- This example shows how to redirect the output to single xml files placed into the main project folder.
54
-
55
- .. code-block:: text
56
-
57
- DefaultToolchain GCC {
58
- LintPolicy "-os($(MainProjectDir)/$(ProjectName)_$(ConfigName)_lintout.xml)"
59
- LintPolicy "-v"
60
- LintPolicy "+xml(doc)"
61
- LintPolicy "-format=%f %l %t %n %m"
62
- LintPolicy "-format_specific= "
63
- LintPolicy "-pragma(message)"
64
- ...
65
- }
66
-
67
-
68
- Known Issues
69
- ------------
70
- bake only searches for lint-nt.exe
71
- +++++++++++++++++++++++++++++++++++
72
- **Issue:**
73
- bake currently does not search for all possible names of the lint application, it only searches for a file called *lint-nt.exe*.
74
-
75
- **Solution:**
76
- If you have another lint command (e.g. because you are using flexe lint on unix)
77
- just create an symlink/alias which is called *lint-nt.exe*.
78
-
79
- Lint fails due to missing compiler includes and defines
80
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++
81
- **Issue:**
82
- Lint will fail if compiler internal includes and defines are missing.
83
-
84
- **Solution:**
85
-
86
- Lint comes with some helper files, handle this issue. In order to get a list of all needed
87
- helper files e.g. for GCC, use the following command.
88
-
89
- .. code-block:: console
90
-
91
- User@Host:~$ make -f .../PcLint/../lnt/co-gcc.mak
92
-
93
- You will get a output like this:
94
-
95
- .. code-block:: text
96
-
97
- gcc-include-path.lnt, lint_cmac.h, lint_cppmac.h and size-options.lnt.
98
-
99
- You can now add the needed includes and LintPolicies (.lnt files) to your bake
100
- configuration.
101
-
102
- Lint error due to too many includes
103
- +++++++++++++++++++++++++++++++++++
104
-
105
- **Issue:**
106
- In rare cases lint has problems if it has to open too many (include) files.
107
-
108
- **Solution:**
109
- You can use the *--lint-max* and the *--lint-min* options to get around this issue.
110
-
111
- Example:
112
-
113
- .. code-block:: console
114
-
115
- User@Host:~$ bake Debug -p MyLibraryProject --lint --lint-max 50 #(lints the first 51 files)
116
- User@Host:~$ bake Debug -p MyLibraryProject --lint --lint-min 51 --lint-max 100 #(lints the next 50 files)
117
- User@Host:~$ bake Debug -p MyLibraryProject --lint --lint-min 101 #(lints the rest of the files)
118
-
119
-
120
- .. Clang Analyze
121
- .. *************
122
-
@@ -1,285 +0,0 @@
1
- <!DOCTYPE html>
2
-
3
-
4
- <html xmlns="http://www.w3.org/1999/xhtml">
5
- <head>
6
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
-
8
- <title>Static Code Analysis &mdash; bake documentation</title>
9
-
10
- <link rel="stylesheet" href="../_static/basic.css" type="text/css" />
11
- <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
12
- <link rel="stylesheet" href="../_static/bootswatch-3.3.4/sandstone/bootstrap.min.css" type="text/css" />
13
- <link rel="stylesheet" href="../_static/bootstrap-sphinx.css" type="text/css" />
14
-
15
- <script type="text/javascript">
16
- var DOCUMENTATION_OPTIONS = {
17
- URL_ROOT: '../',
18
- VERSION: '',
19
- COLLAPSE_INDEX: false,
20
- FILE_SUFFIX: '.html',
21
- HAS_SOURCE: true
22
- };
23
- </script>
24
- <script type="text/javascript" src="../_static/jquery.js"></script>
25
- <script type="text/javascript" src="../_static/underscore.js"></script>
26
- <script type="text/javascript" src="../_static/doctools.js"></script>
27
- <script type="text/javascript" src="../_static/js/jquery-1.11.0.min.js"></script>
28
- <script type="text/javascript" src="../_static/js/jquery-fix.js"></script>
29
- <script type="text/javascript" src="../_static/bootstrap-3.3.4/js/bootstrap.min.js"></script>
30
- <script type="text/javascript" src="../_static/bootstrap-sphinx.js"></script>
31
- <link rel="shortcut icon" href="../_static/logo_tiny_32.ico"/>
32
- <link rel="top" title="bake documentation" href="../index.html" />
33
- <link rel="up" title="Tips and Tricks" href="tips_and_tricks.html" />
34
- <link rel="next" title="How to use bake with cygwin" href="how_to_use_bake_with_cygwin.html" />
35
- <link rel="prev" title="The Bakery" href="the_bakery.html" />
36
- <meta charset='utf-8'>
37
- <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
38
- <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
39
- <meta name="apple-mobile-web-app-capable" content="yes">
40
-
41
- </head>
42
- <body role="document">
43
-
44
- <div id="navbar" class="navbar navbar-default navbar-fixed-top">
45
- <div class="container">
46
- <div class="navbar-header">
47
- <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
48
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
49
- <span class="icon-bar"></span>
50
- <span class="icon-bar"></span>
51
- <span class="icon-bar"></span>
52
- </button>
53
- <a class="navbar-brand" href="../index.html"><img src="../_static/logo_conformant_48.png">
54
- </a>
55
- <span class="navbar-text navbar-version pull-left"><b></b></span>
56
- </div>
57
-
58
- <div class="collapse navbar-collapse nav-collapse">
59
- <ul class="nav navbar-nav">
60
-
61
-
62
- <li class="dropdown globaltoc-container">
63
- <a role="button"
64
- id="dLabelGlobalToc"
65
- data-toggle="dropdown"
66
- data-target="#"
67
- href="../index.html">Section <b class="caret"></b></a>
68
- <ul class="dropdown-menu globaltoc"
69
- role="menu"
70
- aria-labelledby="dLabelGlobalToc"><ul class="current">
71
- <li class="toctree-l1"><a class="reference internal" href="../why_bake/why_bake.html">Why you should use bake</a></li>
72
- <li class="toctree-l1"><a class="reference internal" href="../install/install_bake.html">Install bake</a></li>
73
- <li class="toctree-l1"><a class="reference internal" href="../quickstart/quickstart.html">Quickstart</a></li>
74
- <li class="toctree-l1"><a class="reference internal" href="../concepts/concepts.html">Concepts</a></li>
75
- <li class="toctree-l1"><a class="reference internal" href="../syntax/syntax.html">Syntax</a></li>
76
- <li class="toctree-l1"><a class="reference internal" href="../commandline/commandline.html">Commandline</a></li>
77
- <li class="toctree-l1"><a class="reference internal" href="../ide/ide_integrations.html">IDE Support</a></li>
78
- <li class="toctree-l1 current"><a class="reference internal" href="tips_and_tricks.html">Tips and Tricks</a></li>
79
- <li class="toctree-l1"><a class="reference internal" href="../performance/performance.html">Performance</a></li>
80
- <li class="toctree-l1"><a class="reference internal" href="../known_issues.html">Known Issues</a></li>
81
- <li class="toctree-l1"><a class="reference internal" href="../changelog.html">Changelog</a></li>
82
- <li class="toctree-l1"><a class="reference internal" href="../license.html">License</a></li>
83
- </ul>
84
- <ul>
85
- <li class="toctree-l1"><a class="reference internal" href="../internal.html">Internal developing notes</a></li>
86
- </ul>
87
- </ul>
88
- </li>
89
-
90
- <li class="dropdown">
91
- <a role="button"
92
- id="dLabelLocalToc"
93
- data-toggle="dropdown"
94
- data-target="#"
95
- href="#">SubSections <b class="caret"></b></a>
96
- <ul class="dropdown-menu localtoc"
97
- role="menu"
98
- aria-labelledby="dLabelLocalToc"><ul>
99
- <li><a class="reference internal" href="#">Static Code Analysis</a><ul>
100
- <li><a class="reference internal" href="#lint">Lint</a><ul>
101
- <li><a class="reference internal" href="#basic-setup">Basic Setup</a><ul>
102
- <li><a class="reference internal" href="#example">Example</a></li>
103
- </ul>
104
- </li>
105
- <li><a class="reference internal" href="#configuring-lint">Configuring Lint</a><ul>
106
- <li><a class="reference internal" href="#id2">Example</a></li>
107
- </ul>
108
- </li>
109
- <li><a class="reference internal" href="#known-issues">Known Issues</a><ul>
110
- <li><a class="reference internal" href="#bake-only-searches-for-lint-nt-exe">bake only searches for lint-nt.exe</a></li>
111
- <li><a class="reference internal" href="#lint-fails-due-to-missing-compiler-includes-and-defines">Lint fails due to missing compiler includes and defines</a></li>
112
- <li><a class="reference internal" href="#lint-error-due-to-too-many-includes">Lint error due to too many includes</a></li>
113
- </ul>
114
- </li>
115
- </ul>
116
- </li>
117
- </ul>
118
- </li>
119
- </ul>
120
- </ul>
121
- </li>
122
-
123
-
124
-
125
-
126
-
127
- <li>
128
- <a href="the_bakery.html" title="Previous Chapter: The Bakery"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; The Bakery</span>
129
- </a>
130
- </li>
131
- <li>
132
- <a href="how_to_use_bake_with_cygwin.html" title="Next Chapter: How to use bake with cygwin"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">How to use ba... &raquo;</span>
133
- </a>
134
- </li>
135
-
136
-
137
-
138
-
139
-
140
- </ul>
141
-
142
-
143
-
144
- <form class="navbar-form navbar-right" action="../search.html" method="get">
145
- <div class="form-group">
146
- <input type="text" name="q" class="form-control" placeholder="Search" />
147
- </div>
148
- <input type="hidden" name="check_keywords" value="yes" />
149
- <input type="hidden" name="area" value="default" />
150
- </form>
151
-
152
- </div>
153
- </div>
154
- </div>
155
-
156
- <div class="container">
157
- <div class="row">
158
- <div class="col-md-12">
159
-
160
- <div class="section" id="static-code-analysis">
161
- <h1>Static Code Analysis<a class="headerlink" href="#static-code-analysis" title="Permalink to this headline">¶</a></h1>
162
- <p>Static code analysis often is part or a pre step of the build, even though bake provides presteps which can be used to
163
- add customized steps, we choose to add explicit support for static code analysis due to the fact that the analysis often
164
- depends on information well known by the build system (include pahts, compiler flags, etc.). Currently bake has built in
165
- support for <em>Pc-Lint</em>.</p>
166
- <div class="section" id="lint">
167
- <h2>Lint<a class="headerlink" href="#lint" title="Permalink to this headline">¶</a></h2>
168
- <p>With bake you can lint LibraryConfigs, ExecutableConfigs, single files and the complete workspace (in this case the projects are linted separately).
169
- The CPP Toolchain settings of the project are used regardless of the file type and file specific options.
170
- It is possible to specify lnt-files with LintPolicy, but you can add every other lint command line option as well.</p>
171
- <div class="section" id="basic-setup">
172
- <h3>Basic Setup<a class="headerlink" href="#basic-setup" title="Permalink to this headline">¶</a></h3>
173
- <ol class="arabic simple">
174
- <li>Install <a class="reference external" href="http://www.gimpel.com/html/products.htm">lint</a>.</li>
175
- <li>Make sure the The lint executable &#8216;lint-nt.exe&#8217; is in the path.</li>
176
- </ol>
177
- <div class="admonition attention">
178
- <p class="first admonition-title">Attention</p>
179
- <p class="last">even though there is a unix version of pc-lint the asscoated binary name must be lint-nt.exe otherwise
180
- it won&#8217;t be recorgnized by the bake build system.</p>
181
- </div>
182
- <p>After doing this steps you are able to lint your build configurations (LibraryConfigs and ExecutableConfigs) using the <em>&#8211;lint</em> flag on the command line.</p>
183
- <div class="section" id="example">
184
- <h4>Example<a class="headerlink" href="#example" title="Permalink to this headline">¶</a></h4>
185
- <div class="highlight-console"><div class="highlight"><pre><span class="gp">User@Host:~$</span> bake Debug -p MyLibraryProject --lint
186
- </pre></div>
187
- </div>
188
- </div>
189
- </div>
190
- <div class="section" id="configuring-lint">
191
- <h3>Configuring Lint<a class="headerlink" href="#configuring-lint" title="Permalink to this headline">¶</a></h3>
192
- <p>In order to configure lint in the Project.meta file, just use the <em>LintPolicy</em> command, which forwards the supplied
193
- the parameters to lint.</p>
194
- <div class="highlight-text"><div class="highlight"><pre>DefaultToolchain GCC {
195
- ...
196
- LintPolicy &quot;$(ProjectDir)/lint/misra.lnt&quot;
197
- LintPolicy &quot;$(ProjectDir)/lint/suppressions.lnt&quot;
198
- }
199
- </pre></div>
200
- </div>
201
- <div class="section" id="id2">
202
- <h4>Example<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h4>
203
- <p>This example shows how to redirect the output to single xml files placed into the main project folder.</p>
204
- <div class="highlight-text"><div class="highlight"><pre>DefaultToolchain GCC {
205
- LintPolicy &quot;-os($(MainProjectDir)/$(ProjectName)_$(ConfigName)_lintout.xml)&quot;
206
- LintPolicy &quot;-v&quot;
207
- LintPolicy &quot;+xml(doc)&quot;
208
- LintPolicy &quot;-format=%f %l %t %n %m&quot;
209
- LintPolicy &quot;-format_specific= &quot;
210
- LintPolicy &quot;-pragma(message)&quot;
211
- ...
212
- }
213
- </pre></div>
214
- </div>
215
- </div>
216
- </div>
217
- <div class="section" id="known-issues">
218
- <h3>Known Issues<a class="headerlink" href="#known-issues" title="Permalink to this headline">¶</a></h3>
219
- <div class="section" id="bake-only-searches-for-lint-nt-exe">
220
- <h4>bake only searches for lint-nt.exe<a class="headerlink" href="#bake-only-searches-for-lint-nt-exe" title="Permalink to this headline">¶</a></h4>
221
- <blockquote>
222
- <div><p><strong>Issue:</strong>
223
- bake currently does not search for all possible names of the lint application, it only searches for a file called <em>lint-nt.exe</em>.</p>
224
- <p><strong>Solution:</strong>
225
- If you have another lint command (e.g. because you are using flexe lint on unix)
226
- just create an symlink/alias which is called <em>lint-nt.exe</em>.</p>
227
- </div></blockquote>
228
- </div>
229
- <div class="section" id="lint-fails-due-to-missing-compiler-includes-and-defines">
230
- <h4>Lint fails due to missing compiler includes and defines<a class="headerlink" href="#lint-fails-due-to-missing-compiler-includes-and-defines" title="Permalink to this headline">¶</a></h4>
231
- <blockquote>
232
- <div><p><strong>Issue:</strong>
233
- Lint will fail if compiler internal includes and defines are missing.</p>
234
- <p><strong>Solution:</strong></p>
235
- <p>Lint comes with some helper files, handle this issue. In order to get a list of all needed
236
- helper files e.g. for GCC, use the following command.</p>
237
- <div class="highlight-console"><div class="highlight"><pre><span class="gp">User@Host:~$</span> make -f .../PcLint/../lnt/co-gcc.mak
238
- </pre></div>
239
- </div>
240
- <p>You will get a output like this:</p>
241
- <div class="highlight-text"><div class="highlight"><pre>gcc-include-path.lnt, lint_cmac.h, lint_cppmac.h and size-options.lnt.
242
- </pre></div>
243
- </div>
244
- <p>You can now add the needed includes and LintPolicies (.lnt files) to your bake
245
- configuration.</p>
246
- </div></blockquote>
247
- </div>
248
- <div class="section" id="lint-error-due-to-too-many-includes">
249
- <h4>Lint error due to too many includes<a class="headerlink" href="#lint-error-due-to-too-many-includes" title="Permalink to this headline">¶</a></h4>
250
- <blockquote>
251
- <div><p><strong>Issue:</strong>
252
- In rare cases lint has problems if it has to open too many (include) files.</p>
253
- <p><strong>Solution:</strong>
254
- You can use the <em>&#8211;lint-max</em> and the <em>&#8211;lint-min</em> options to get around this issue.</p>
255
- <p>Example:</p>
256
- <div class="highlight-console"><div class="highlight"><pre><span class="gp">User@Host:~$</span> bake Debug -p MyLibraryProject --lint --lint-max <span class="m">50</span> <span class="c">#(lints the first 51 files)</span>
257
- <span class="gp">User@Host:~$</span> bake Debug -p MyLibraryProject --lint --lint-min <span class="m">51</span> --lint-max <span class="m">100</span> <span class="c">#(lints the next 50 files)</span>
258
- <span class="gp">User@Host:~$</span> bake Debug -p MyLibraryProject --lint --lint-min <span class="m">101</span> <span class="c">#(lints the rest of the files)</span>
259
- </pre></div>
260
- </div>
261
- </div></blockquote>
262
- </div>
263
- </div>
264
- </div>
265
- </div>
266
-
267
-
268
- </div>
269
-
270
- </div>
271
- </div>
272
- <footer class="footer">
273
- <div class="container">
274
- <p class="pull-right">
275
- <a href="#">Back to top</a>
276
-
277
- </p>
278
- <p>
279
- &copy; Copyright 2016, E.S.R.Labs AG.<br/>
280
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.<br/>
281
- </p>
282
- </div>
283
- </footer>
284
- </body>
285
- </html>