mtbuild 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77ba725a664618bcc037519e8c8181b2560427f6
4
- data.tar.gz: b6414488ebf9691a4a0a523b2d116571049a1039
3
+ metadata.gz: 254cf6e1b63b3a9f9fa1742bd41e2e8eabfe9672
4
+ data.tar.gz: adb98071b8a09e4f8ffab7fac9d34a177651856a
5
5
  SHA512:
6
- metadata.gz: 347ca6affd9f88b736f20e190d9d59a191f5251fe5b431ab0ffb1b062bf6c9bf26a21abfc4643e6f07378aafce2dbc6acd8c53408a77f3efcddfca031c26f8e2
7
- data.tar.gz: 9abc4e0a9a2b7dd6f6d8af1029d79a37cd730b604b74fc228e85054979922ac315e0550582dd549931fafadb0af9e515765a03ea84aab4428bc53260125f8b91
6
+ metadata.gz: 179b5bbb78fa6592ce4d43c301b7ccd28a4cd1e7b3e0bfee7928bbca226471f6012b1bf6edd5cad4d6f9e831aa86b377890245edf9f81e5a06c4008638d94cbf
7
+ data.tar.gz: 0ad9a45837a25af9fe73fb460c2b30c22ac8db64e5c3bfacd6d754d561ee9d762e374c9a1fedc011d8c8d5583486496d1a0ab5796105f2ad1d5a93d3c344cd74
data/CHANGES.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Release Notes #
2
2
 
3
+ ## MTBuild 0.0.5 ##
4
+
5
+ ### Changes ###
6
+
7
+ * MTBuild now supports spaces in project paths
8
+ * Cleaned up mtbuild sources and coverted stray tabs to spaces.
9
+
10
+
11
+ ## MTBuild 0.0.4 ##
12
+
13
+ ### Changes ###
14
+
15
+ * This was a bad gem push. Don't use.
16
+
17
+
3
18
  ## MTBuild 0.0.3 ##
4
19
 
5
20
  ### Changes ###
data/README.md CHANGED
@@ -112,7 +112,7 @@ Workspace Folder
112
112
  └ *.h/*.c/*.cpp
113
113
  ```
114
114
 
115
- In this case, we have a top-level workspace folder that contains projects in sub-folders. The project folders have public headers and source files neatly separated. Unit Test files are either located in their own folders, or separated by language--for example, if our project is written in C, but our unit tests are C++, we might put the unit test files alongside the project sources for convenience.
115
+ We have a top-level workspace folder that contains projects in sub-folders. The project folders have public headers and source files neatly separated. Unit Test files are either located in their own folders, or separated by language--for example, if our project is written in C, but our unit tests are C++, we might put the unit test files alongside the project sources for convenience.
116
116
 
117
117
  Here is an example of a simpler application that is self-contained:
118
118
 
@@ -125,7 +125,7 @@ Application Project Folder
125
125
  └ *.h/*.c/*.cpp
126
126
  ```
127
127
 
128
- In this case, the project and (optional) workspace are defined in a single Rakefile. There are no public headers, so everything goes into the "src" folder, but tests might still be separated into a "test" folder.
128
+ The project and (optional) workspace are defined in a single Rakefile. There are no public headers, so everything goes into the "src" folder, but tests might still be separated into a "test" folder.
129
129
 
130
130
  #### Rakefiles ####
131
131
 
@@ -171,7 +171,7 @@ A framework project wraps up a static library and its headers for use by applica
171
171
 
172
172
  #### Configurations ####
173
173
 
174
- A configuration containa build settings for a project. This includes source files, toolchain, dependencies, etc. By defining multiple configurations, a project can be built for different processors (ARM, x86, etc.), different platforms, or simply different settings (debug vs. release). Configurations generate the actual Rake tasks that begin doing work. They are named with a fixed convention that allows you to refer to them in other Rake tasks. The naming scheme is "Project:Configuration". For example, if you declare a project called "MyLibrary" with configuration "Debug", you could list "MyLibrary:Debug" as a dependency in any Rake task and "MyLibrary:Debug" would be built before that task.
174
+ A configuration contains build settings for a project. This includes source files, toolchain, dependencies, etc. By defining multiple configurations, a project can be built for different processors (ARM, x86, etc.), different platforms, or simply different settings (debug vs. release). Configurations generate the actual Rake tasks that begin doing work. They are named with a fixed convention that allows you to refer to them in other Rake tasks. The naming scheme is "Project:Configuration". For example, if you declare a project called "MyLibrary" with configuration "Debug", you could list "MyLibrary:Debug" as a dependency in any Rake task and "MyLibrary:Debug" would be built before that task.
175
175
 
176
176
  #### Workspaces ####
177
177
 
@@ -5,7 +5,7 @@ module MTBuild
5
5
  # Use this class to create application configurations. You won't typically
6
6
  # instantiate this directly. Instead, the ApplicationProject.add_configuration
7
7
  # method will create this for you.
8
- class ApplicationConfiguration < CompiledConfiguration
8
+ class ApplicationConfiguration < CompiledConfiguration
9
9
 
10
10
  # Create the actual Rake tasks that will perform the configuration's work
11
11
  def configure_tasks
@@ -43,6 +43,6 @@ module MTBuild
43
43
 
44
44
  end
45
45
 
46
- end
46
+ end
47
47
 
48
48
  end
@@ -4,7 +4,7 @@ module MTBuild
4
4
 
5
5
  # This class is used to build applications. An application has compilation
6
6
  # and link phases that produce a binary executable.
7
- class ApplicationProject < Project
7
+ class ApplicationProject < Project
8
8
 
9
9
  # Adds a named ApplicationConfiguration to the project.
10
10
  def add_configuration(configuration_name, configuration)
@@ -16,6 +16,6 @@ module MTBuild
16
16
  return cfg
17
17
  end
18
18
 
19
- end
19
+ end
20
20
 
21
21
  end
@@ -4,7 +4,7 @@ module MTBuild
4
4
 
5
5
  # This is the base class for configurations representing compiled objects
6
6
  # (libraries, applications, etc.)
7
- class CompiledConfiguration < Configuration
7
+ class CompiledConfiguration < Configuration
8
8
 
9
9
  # A list of Rake tasks that this configuration depends upon
10
10
  attr_reader :dependencies
@@ -15,7 +15,7 @@ module MTBuild
15
15
  # A list of Rake test tasks that will execute after this configuration builds
16
16
  attr_reader :tests
17
17
 
18
- def initialize(project_name, project_folder, output_folder, configuration_name, configuration)
18
+ def initialize(project_name, project_folder, output_folder, configuration_name, configuration)
19
19
  super
20
20
  check_configuration(configuration)
21
21
 
@@ -27,7 +27,7 @@ module MTBuild
27
27
  @toolchains = {@default_toolchain => source_files}
28
28
 
29
29
  @tests = Utils.ensure_array(configuration.fetch(:tests, []))
30
- end
30
+ end
31
31
 
32
32
  # This method adds source files with their own toolchains. Use this method
33
33
  # to add any source files that need special toolchain settings.
@@ -69,6 +69,6 @@ module MTBuild
69
69
  end
70
70
 
71
71
  include Rake::DSL
72
- end
72
+ end
73
73
 
74
74
  end
@@ -3,7 +3,7 @@ module MTBuild
3
3
  require 'mtbuild/versioner'
4
4
 
5
5
  # This is the base class for all configuration types.
6
- class Configuration
6
+ class Configuration
7
7
 
8
8
  # The configuration's name
9
9
  attr_reader :configuration_name
@@ -18,7 +18,7 @@ module MTBuild
18
18
  # The project's output folder. Project output goes here.
19
19
  attr_reader :output_folder
20
20
 
21
- def initialize(project_name, project_folder, output_folder, configuration_name, configuration)
21
+ def initialize(project_name, project_folder, output_folder, configuration_name, configuration)
22
22
  check_configuration(configuration)
23
23
  @project_name = project_name
24
24
  @project_folder = File.expand_path(project_folder)
@@ -28,7 +28,7 @@ module MTBuild
28
28
  @versioner = nil
29
29
  @versioner_config = configuration.fetch(:versioner, nil)
30
30
  @versioner = Versioner.create_versioner(@project_name, @project_folder, @output_folder, @configuration_name, @versioner_config) unless @versioner_config.nil?
31
- end
31
+ end
32
32
 
33
33
  # Create the actual Rake tasks that will perform the configuration's work
34
34
  def configure_tasks
@@ -41,6 +41,6 @@ module MTBuild
41
41
  end
42
42
 
43
43
  include Rake::DSL
44
- end
44
+ end
45
45
 
46
46
  end
@@ -1,7 +1,7 @@
1
1
  module MTBuild
2
2
 
3
3
  # This is the base class for all project types.
4
- class Project
4
+ class Project
5
5
 
6
6
  # The project's name
7
7
  attr_reader :project_name
@@ -15,13 +15,13 @@ module MTBuild
15
15
 
16
16
  # If supplied, the configuration_block will be passed the
17
17
  # newly-constructed Project object.
18
- def initialize(project_name, project_folder, &configuration_block)
18
+ def initialize(project_name, project_folder, &configuration_block)
19
19
  @configurations = []
20
20
  @default_tasks = []
21
21
  @project_name = project_name
22
22
  @project_folder = File.expand_path(project_folder)
23
23
  @output_folder = File.expand_path(File.join(@project_folder, MTBuild.default_output_folder))
24
- configuration_block.call(self) if configuration_block
24
+ configuration_block.call(self) if configuration_block
25
25
 
26
26
  namespace @project_name do
27
27
  @configurations.each do |configuration|
@@ -31,7 +31,7 @@ module MTBuild
31
31
 
32
32
  # If there is no active workspace, set up any registered default project tasks
33
33
  task :default => @default_tasks unless Workspace.have_workspace?
34
- end
34
+ end
35
35
 
36
36
  # Add tasks to be built by default if MTBuild is invoked with no arguments
37
37
  def add_default_tasks(default_tasks)
@@ -62,6 +62,6 @@ module MTBuild
62
62
  end
63
63
 
64
64
  include Rake::DSL
65
- end
65
+ end
66
66
 
67
67
  end
@@ -4,7 +4,7 @@ module MTBuild
4
4
  # Use this class to create static library configurations. You won't typically
5
5
  # instantiate this directly. Instead, the StaticLibraryProject.add_configuration
6
6
  # method will create this for you.
7
- class StaticLibraryConfiguration < CompiledConfiguration
7
+ class StaticLibraryConfiguration < CompiledConfiguration
8
8
 
9
9
  def initialize(project_name, project_folder, output_folder, configuration_name, configuration, api_headers)
10
10
  @api_headers = api_headers
@@ -43,6 +43,6 @@ module MTBuild
43
43
  new_task.library_files = library_files
44
44
  end
45
45
 
46
- end
46
+ end
47
47
 
48
48
  end
@@ -5,7 +5,7 @@ module MTBuild
5
5
 
6
6
  # This class is used to build static libraries. A static library has
7
7
  # compilation and archival phases that produce a binary library package.
8
- class StaticLibraryProject < Project
8
+ class StaticLibraryProject < Project
9
9
 
10
10
  def initialize(project_name, project_folder, &configuration_block)
11
11
  @framework_configurations = []
@@ -81,6 +81,6 @@ module MTBuild
81
81
  end
82
82
  end
83
83
 
84
- end
84
+ end
85
85
 
86
86
  end
@@ -4,7 +4,7 @@ module MTBuild
4
4
  # Use this class to create test application configurations. You won't typically
5
5
  # instantiate this directly. Instead, the TestApplicationProject.add_configuration
6
6
  # method will create this for you.
7
- class TestApplicationConfiguration < CompiledConfiguration
7
+ class TestApplicationConfiguration < CompiledConfiguration
8
8
 
9
9
  # Create the actual Rake tasks that will perform the configuration's work
10
10
  def configure_tasks
@@ -28,6 +28,6 @@ module MTBuild
28
28
  end
29
29
  end
30
30
 
31
- end
31
+ end
32
32
 
33
33
  end
@@ -5,7 +5,7 @@ module MTBuild
5
5
  # This class is used to build test applications. A test application has
6
6
  # compilation and link phases that produce a binary test executable. The test
7
7
  # executable is invoked after building successfully.
8
- class TestApplicationProject < Project
8
+ class TestApplicationProject < Project
9
9
 
10
10
  # Adds a named test application configuration to the project.
11
11
  def add_configuration(configuration_name, configuration)
@@ -17,6 +17,6 @@ module MTBuild
17
17
  return cfg
18
18
  end
19
19
 
20
- end
20
+ end
21
21
 
22
22
  end
@@ -1,7 +1,7 @@
1
1
  module MTBuild
2
2
 
3
3
  # This is the base class for all toolchain types.
4
- class Toolchain
4
+ class Toolchain
5
5
 
6
6
  # The toolchain's output folder
7
7
  attr_accessor :output_folder
@@ -13,7 +13,7 @@ module MTBuild
13
13
  # Text to append to the name of output files
14
14
  attr_accessor :output_decorator
15
15
 
16
- def initialize(configuration)
16
+ def initialize(configuration)
17
17
  @output_folder = ''
18
18
  @project_folder = ''
19
19
  @output_decorator = ''
@@ -24,7 +24,7 @@ module MTBuild
24
24
  add_include_paths(expand_project_relative_paths(configuration.fetch(:include_paths, [])))
25
25
  add_include_objects(expand_project_relative_paths(configuration.fetch(:include_objects, [])))
26
26
  add_library_paths(expand_project_relative_paths(configuration.fetch(:library_paths, [])))
27
- end
27
+ end
28
28
 
29
29
  # Retrieve a list of additional objects to link with
30
30
  def get_include_objects
@@ -104,6 +104,6 @@ module MTBuild
104
104
  end
105
105
 
106
106
  include Rake::DSL
107
- end
107
+ end
108
108
 
109
109
  end
@@ -4,11 +4,11 @@ module MTBuild
4
4
  Toolchain.register_toolchain(:arm_none_eabi_gcc, 'MTBuild::ToolchainArmNoneEabiGcc')
5
5
 
6
6
  # This ToolchainGcc subclass can build using arm-non-eabi-gcc
7
- class ToolchainArmNoneEabiGcc < ToolchainGcc
7
+ class ToolchainArmNoneEabiGcc < ToolchainGcc
8
8
 
9
- def initialize(configuration)
9
+ def initialize(configuration)
10
10
  super
11
- end
11
+ end
12
12
 
13
13
  # Create Rake tasks for linking
14
14
  def create_application_tasks(objects, executable_name)
@@ -45,7 +45,7 @@ module MTBuild
45
45
  private
46
46
 
47
47
  def construct_objcopy_command(input_name, output_name, objcopyflags)
48
- return "#{objcopy}#{objcopyflags} #{input_name} #{output_name}"
48
+ return "\"#{objcopy}\"#{objcopyflags} \"#{input_name}\" \"#{output_name}\""
49
49
  end
50
50
 
51
51
  def compiler
@@ -64,6 +64,6 @@ module MTBuild
64
64
  return 'arm-none-eabi-objcopy'
65
65
  end
66
66
 
67
- end
67
+ end
68
68
 
69
69
  end
@@ -7,11 +7,11 @@ module MTBuild
7
7
  Toolchain.register_toolchain(:gcc, 'MTBuild::ToolchainGcc')
8
8
 
9
9
  # This Toolchain subclass can build using GCC
10
- class ToolchainGcc < Toolchain
10
+ class ToolchainGcc < Toolchain
11
11
 
12
12
  attr_accessor :cppflags, :cflags, :cxxflags, :asflags, :ldflags, :linker_script
13
13
 
14
- def initialize(configuration)
14
+ def initialize(configuration)
15
15
  super
16
16
 
17
17
  begin
@@ -29,7 +29,7 @@ module MTBuild
29
29
  @asflags = configuration.fetch(:asflags, '')
30
30
  @ldflags = configuration.fetch(:ldflags, '')
31
31
  @linker_script = configuration.fetch(:linker_script, '')
32
- end
32
+ end
33
33
 
34
34
  # Create Rake tasks for compilation
35
35
  def create_compile_tasks(source_files)
@@ -111,36 +111,36 @@ module MTBuild
111
111
  end
112
112
 
113
113
  def construct_compile_command(file_type, prerequisites, include_paths, output_name)
114
- prerequisites_s = prerequisites.empty? ? '' : " #{prerequisites.join(' ')}"
115
- include_paths_s = include_paths.empty? ? '' : " -I#{include_paths.join(' -I')}"
114
+ prerequisites_s = prerequisites.empty? ? '' : " \"#{prerequisites.join('" "')}\""
115
+ include_paths_s = include_paths.empty? ? '' : " -I\"#{include_paths.join('" -I"')}\""
116
116
  cppflags_s = @cppflags.empty? ? '' : " #{@cppflags}"
117
117
  cflags_s = @cflags.empty? ? '' : " #{@cflags}"
118
118
  cxxflags_s = @cxxflags.empty? ? '' : " #{@cxxflags}"
119
119
  asflags_s = @asflags.empty? ? '' : " #{@asflags}"
120
- return "#{compiler}#{cppflags_s}#{cflags_s}#{prerequisites_s}#{include_paths_s} -MMD -c -o #{output_name}" if file_type == :c
121
- return "#{compiler}#{cppflags_s}#{cxxflags_s}#{prerequisites_s}#{include_paths_s} -MMD -c -o #{output_name}" if file_type == :cplusplus
122
- return "#{compiler}#{cppflags_s}#{asflags_s}#{prerequisites_s}#{include_paths_s} -MMD -c -o #{output_name}" if file_type == :asm
120
+ return "\"#{compiler}\"#{cppflags_s}#{cflags_s}#{prerequisites_s}#{include_paths_s} -MMD -c -o \"#{output_name}\"" if file_type == :c
121
+ return "\"#{compiler}\"#{cppflags_s}#{cxxflags_s}#{prerequisites_s}#{include_paths_s} -MMD -c -o \"#{output_name}\"" if file_type == :cplusplus
122
+ return "\"#{compiler}\"#{cppflags_s}#{asflags_s}#{prerequisites_s}#{include_paths_s} -MMD -c -o \"#{output_name}\"" if file_type == :asm
123
123
  end
124
124
 
125
125
  def construct_archive_command(prerequisites, output_name)
126
- prerequisites_s = prerequisites.empty? ? '' : " #{prerequisites.join(' ')}"
127
- return "#{archiver} rcs #{output_name} #{prerequisites_s}"
126
+ prerequisites_s = prerequisites.empty? ? '' : " \"#{prerequisites.join('" "')}\""
127
+ return "\"#{archiver}\" rcs \"#{output_name}\" #{prerequisites_s}"
128
128
  end
129
129
 
130
130
  def construct_link_command(prerequisites, output_name, include_paths, library_paths, map_name)
131
- prerequisites_s = prerequisites.empty? ? '' : " #{prerequisites.join(' ')}"
132
- include_paths_s = include_paths.empty? ? '' : " -I#{include_paths.join(' -I')}"
133
- library_paths_s = library_paths.empty? ? '' : " -L#{library_paths.join(' -L')}"
131
+ prerequisites_s = prerequisites.empty? ? '' : " \"#{prerequisites.join('" "')}\""
132
+ include_paths_s = include_paths.empty? ? '' : " -I\"#{include_paths.join('" -I"')}\""
133
+ library_paths_s = library_paths.empty? ? '' : " -L\"#{library_paths.join('" -L"')}\""
134
134
  cppflags_s = @cppflags.empty? ? '' : " #{@cppflags}"
135
135
  cflags_s = @cflags.empty? ? '' : " #{@cflags}"
136
136
  ldflags_s = @ldflags.empty? ? '' : " #{@ldflags}"
137
- linker_script_s = @linker_script.empty? ? '' : " -Wl,-T#{File.join(@project_folder,@linker_script)}"
138
- return "#{compiler}#{cppflags_s}#{cflags_s}#{ldflags_s}#{linker_script_s}#{prerequisites_s}#{include_paths_s} #{map_flag(map_name)} -o #{output_name}"
137
+ linker_script_s = @linker_script.empty? ? '' : " -Wl,-T\"#{File.join(@project_folder,@linker_script)}\""
138
+ return "\"#{compiler}\"#{cppflags_s}#{cflags_s}#{ldflags_s}#{linker_script_s}#{prerequisites_s}#{include_paths_s} #{map_flag(map_name)} -o \"#{output_name}\""
139
139
  end
140
140
 
141
141
  def map_flag(map_file)
142
- return "-Wl,-map,#{map_file}" if @compiler_is_LLVM_gcc
143
- return "-Wl,-Map=#{map_file},--cref"
142
+ return "-Wl,-map,\"#{map_file}\"" if @compiler_is_LLVM_gcc
143
+ return "-Wl,-Map=\"#{map_file}\",--cref"
144
144
  end
145
145
 
146
146
  def compiler
@@ -155,6 +155,6 @@ module MTBuild
155
155
  return 'gcc'
156
156
  end
157
157
 
158
- end
158
+ end
159
159
 
160
160
  end
@@ -1,4 +1,4 @@
1
1
  module MTBuild
2
2
  # The current MTBuild version.
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.5"
4
4
  end
@@ -1,7 +1,7 @@
1
1
  module MTBuild
2
2
 
3
3
  # Use this class to create a workspace
4
- class Workspace
4
+ class Workspace
5
5
  require 'mtbuild/utils'
6
6
  require 'rake/clean'
7
7
 
@@ -15,7 +15,7 @@ module MTBuild
15
15
  # The workspace's output folder
16
16
  attr_reader :output_folder
17
17
 
18
- def initialize(workspace_name, workspace_folder, &configuration_block)
18
+ def initialize(workspace_name, workspace_folder, &configuration_block)
19
19
  @workspace_name = workspace_name
20
20
  @workspace_folder = File.expand_path(workspace_folder)
21
21
  @output_folder = File.expand_path(File.join(@workspace_folder, MTBuild.default_output_folder))
@@ -41,7 +41,7 @@ module MTBuild
41
41
 
42
42
  task :default => @default_tasks+[:workspace]
43
43
  end
44
- end
44
+ end
45
45
 
46
46
  # Adds a project subfolder
47
47
  def add_project(project_location)
@@ -107,6 +107,6 @@ module MTBuild
107
107
 
108
108
  include Rake::DSL
109
109
 
110
- end
110
+ end
111
111
 
112
112
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mtbuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jerry Ryle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-24 00:00:00.000000000 Z
11
+ date: 2014-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake