mtbuild 0.0.2 → 0.0.3
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 +4 -4
- data/CHANGES.md +23 -0
- data/README.md +20 -7
- data/lib/mtbuild/compiled_configuration.rb +1 -0
- data/lib/mtbuild/framework_configuration.rb +3 -1
- data/lib/mtbuild/framework_task.rb +6 -2
- data/lib/mtbuild/organized_package_task.rb +3 -2
- data/lib/mtbuild/staticlibrary_configuration.rb +3 -1
- data/lib/mtbuild/staticlibrary_project.rb +3 -1
- data/lib/mtbuild/staticlibrary_task.rb +6 -2
- data/lib/mtbuild/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 77ba725a664618bcc037519e8c8181b2560427f6
|
|
4
|
+
data.tar.gz: b6414488ebf9691a4a0a523b2d116571049a1039
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 347ca6affd9f88b736f20e190d9d59a191f5251fe5b431ab0ffb1b062bf6c9bf26a21abfc4643e6f07378aafce2dbc6acd8c53408a77f3efcddfca031c26f8e2
|
|
7
|
+
data.tar.gz: 9abc4e0a9a2b7dd6f6d8af1029d79a37cd730b604b74fc228e85054979922ac315e0550582dd549931fafadb0af9e515765a03ea84aab4428bc53260125f8b91
|
data/CHANGES.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Release Notes #
|
|
2
|
+
|
|
3
|
+
## MTBuild 0.0.3 ##
|
|
4
|
+
|
|
5
|
+
### Changes ###
|
|
6
|
+
|
|
7
|
+
* MTBuild now supports configuration headers in static library and framework projects.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## MTBuild 0.0.2 ##
|
|
11
|
+
|
|
12
|
+
### Changes ###
|
|
13
|
+
|
|
14
|
+
* MTBuild now supports Frameworks.
|
|
15
|
+
|
|
16
|
+
* MTBuild can now create applications packages and can build framework packages from static library projects.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## MTBuild 0.0.1 ##
|
|
20
|
+
|
|
21
|
+
### Changes ###
|
|
22
|
+
|
|
23
|
+
None. This is the first release.
|
data/README.md
CHANGED
|
@@ -241,10 +241,16 @@ Configurations can list dependencies that will be built before the configuration
|
|
|
241
241
|
|
|
242
242
|
#### Automatic Library Dependencies ####
|
|
243
243
|
|
|
244
|
-
MTBuild
|
|
244
|
+
MTBuild allows you to specify API header locations for framework and static library project configurations. If you list a framework or a static library project as a dependency of an application project, MTbuild will automatically include the framework or library's API header paths when compiling the application. Additionally, it will automatically link the application with the framework or library. This is intended to facilitate the scenario where you're building both a library and an application from a Workspace. To use the library from the application, you simply need to list the library as a dependency and MTBuild will make sure the application can use it.
|
|
245
245
|
|
|
246
246
|
Note that this does not work with non-MTBuild libraries. If you list a non-MTBuild Rake library task as a dependency of a MTBuild project, you will need to manually add the library's headers and library file to the project. If you have a precompiled 3rd-party library, you might consider wrapping it in a framework project so that you can use the Automatic Library Dependencies mechanism.
|
|
247
247
|
|
|
248
|
+
###### Configuration Headers #####
|
|
249
|
+
|
|
250
|
+
In addition to the per-project API header location, MTBuild allows you to specify per-configuration header locations. These are intended for headers that "configure" a library--typically via ```#define```. Note that this is a terrible pattern. If you're creating your own library, try very hard not to do this. For example, instead of using a ```#define``` to configure a library resource such as a buffer size, consider structuring the library such that the caller passes in buffer storage.
|
|
251
|
+
|
|
252
|
+
Using configuration headers to configure libraries is such a bad idea that MTBuild almost didn't support them. Unfortunately, the pattern is so common that we felt we needed to support them in order to work properly with many 3rd-party libraries. Again, if you're writing a library, avoid using them.
|
|
253
|
+
|
|
248
254
|
###### Automatic Library Dependencies Example #####
|
|
249
255
|
|
|
250
256
|
Top-level Rakefile.rb:
|
|
@@ -260,14 +266,15 @@ end
|
|
|
260
266
|
|
|
261
267
|
MyLibrary/Rakefile.rb
|
|
262
268
|
|
|
263
|
-
This defines a library with one configuration called "Debug". The library's API headers are in a folder called "include".
|
|
269
|
+
This defines a library with one configuration called "Debug". The library's API headers are in a folder called "include". This library is foul and therefore has configuration headers for the Debug configuration in a folder called "config/Debug".
|
|
264
270
|
|
|
265
271
|
```Ruby
|
|
266
272
|
static_library_project :MyLibrary, File.dirname(__FILE__) do |lib|
|
|
267
273
|
lib.add_api_headers 'include'
|
|
268
274
|
lib.add_configuration :Debug,
|
|
269
275
|
sources: ['src/**/*.c'],
|
|
270
|
-
toolchain: toolchain(:gcc)
|
|
276
|
+
toolchain: toolchain(:gcc),
|
|
277
|
+
configuration_headers: ['config/Debug']
|
|
271
278
|
end
|
|
272
279
|
```
|
|
273
280
|
|
|
@@ -390,7 +397,7 @@ Application Project configurations require the following settings:
|
|
|
390
397
|
|
|
391
398
|
Application Project configurations offer the following optional settings:
|
|
392
399
|
|
|
393
|
-
* ```:dependencies``` - The Rake task names of one or more dependencies. For example,
|
|
400
|
+
* ```:dependencies``` - The Rake task names of one or more dependencies. For example, ```'MyLibrary:Debug'``` or ```['MyLibrary1:Debug', 'MyLibrary2:Debug']```
|
|
394
401
|
|
|
395
402
|
* ```:sources``` - One or more source file names or source file glob patterns. For example, ```'main.c'``` or ```['main.c', 'startup.c']``` or ```['src/main.c', 'src/*.cpp']```. Note that the source file paths should be relative to the project folder.
|
|
396
403
|
|
|
@@ -434,6 +441,10 @@ Use ```build_framework_package(configuration_names)``` inside of a static librar
|
|
|
434
441
|
##### Static Library Project configuration settings #####
|
|
435
442
|
Static Library Project configurations use the same settings as Application Project configurations.
|
|
436
443
|
|
|
444
|
+
Additionally, Static Library Project configurations offer the following optional settings:
|
|
445
|
+
|
|
446
|
+
* ```:configuration_headers``` - One or more configuration header paths. For example, ```'config/Debug'``` or ```['config/Debug', 'config/common']```.
|
|
447
|
+
|
|
437
448
|
### MTBuild::TestApplicationProject ###
|
|
438
449
|
Define a Test Application Project with the following DSL method:
|
|
439
450
|
|
|
@@ -474,12 +485,14 @@ Use ```add_configuration(configuration_name, configuration)``` inside of a frame
|
|
|
474
485
|
Use ```add_api_headers(api_headers)``` inside of a framework project configuration block--before adding configurations--to set the location(s) of the framework's API headers. The ```api_headers``` parameter should be one or more API header paths. For example, ```'include'``` or ```['include', 'plugins']```. Note that the API header paths should be relative to the project folder. API header paths should NOT contain one another. For example, do not do this: ```['include', 'include/things']```. You can have subfolders inside of an API header location, but you should only add the topmost folder.
|
|
475
486
|
|
|
476
487
|
##### Framework Project configuration settings #####
|
|
477
|
-
Framework Project configurations
|
|
478
|
-
|
|
479
|
-
Additionally, Framework Project configurations require the following settings:
|
|
488
|
+
Framework Project configurations require the following settings:
|
|
480
489
|
|
|
481
490
|
* ```:objects``` - One or more framework object files. For example, ```'MyLibrary.a'```
|
|
482
491
|
|
|
492
|
+
Framework Project configurations offer the following optional settings:
|
|
493
|
+
|
|
494
|
+
* ```:configuration_headers``` - One or more configuration header paths. For example, ```'config/Debug'``` or ```['config/Debug', 'config/common']```.
|
|
495
|
+
|
|
483
496
|
### MTBuild::Toolchain ###
|
|
484
497
|
Define a Toolchain with the following DSL method:
|
|
485
498
|
|
|
@@ -62,6 +62,7 @@ module MTBuild
|
|
|
62
62
|
task_dependency = Rake.application.lookup(dependency)
|
|
63
63
|
fail "Unable to locate task for dependency: #{dependency}" if task_dependency.nil?
|
|
64
64
|
toolchain.add_include_paths(task_dependency.api_headers) if task_dependency.respond_to? :api_headers
|
|
65
|
+
toolchain.add_include_paths(task_dependency.configuration_headers) if task_dependency.respond_to? :configuration_headers
|
|
65
66
|
toolchain.add_include_objects(task_dependency.library_files) if task_dependency.respond_to? :library_files
|
|
66
67
|
end
|
|
67
68
|
end
|
|
@@ -9,8 +9,9 @@ module MTBuild
|
|
|
9
9
|
def initialize(project_name, project_folder, output_folder, configuration_name, configuration, api_headers)
|
|
10
10
|
super project_name, project_folder, output_folder, configuration_name, configuration
|
|
11
11
|
check_configuration(configuration)
|
|
12
|
-
@object_files = Utils.expand_file_list(configuration[:objects], [], @project_folder)
|
|
13
12
|
@api_headers = api_headers
|
|
13
|
+
@configuration_headers = Utils.expand_folder_list(configuration.fetch(:configuration_headers, []), @project_folder)
|
|
14
|
+
@object_files = Utils.expand_file_list(configuration[:objects], [], @project_folder)
|
|
14
15
|
end
|
|
15
16
|
|
|
16
17
|
# Create the actual Rake tasks that will perform the configuration's work
|
|
@@ -21,6 +22,7 @@ module MTBuild
|
|
|
21
22
|
puts "found framework #{t.name}."
|
|
22
23
|
end
|
|
23
24
|
new_task.api_headers = @api_headers
|
|
25
|
+
new_task.configuration_headers = @configuration_headers
|
|
24
26
|
new_task.library_files = @object_files
|
|
25
27
|
end
|
|
26
28
|
|
|
@@ -8,13 +8,17 @@ module Rake
|
|
|
8
8
|
# API header location for the framework
|
|
9
9
|
attr_accessor :api_headers
|
|
10
10
|
|
|
11
|
+
# Configuration header location for the framework
|
|
12
|
+
attr_accessor :configuration_headers
|
|
13
|
+
|
|
11
14
|
# The framework objects
|
|
12
15
|
attr_accessor :library_files
|
|
13
16
|
|
|
14
17
|
def initialize(task_name, app)
|
|
15
18
|
super
|
|
16
|
-
@api_headers =
|
|
17
|
-
@
|
|
19
|
+
@api_headers = []
|
|
20
|
+
@configuration_headers = []
|
|
21
|
+
@library_files = []
|
|
18
22
|
end
|
|
19
23
|
|
|
20
24
|
end
|
|
@@ -52,9 +52,10 @@ module MTBuild
|
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
# Add folder to a folder in the package
|
|
55
|
-
def add_folders_to_folder(package_folder, folders, excluded_files=[])
|
|
55
|
+
def add_folders_to_folder(package_folder, folders, included_files=['*'], excluded_files=[])
|
|
56
56
|
folders.each do |folder|
|
|
57
|
-
|
|
57
|
+
included_files = Utils.ensure_array(included_files).collect{|f| File.join('**',f)}
|
|
58
|
+
file_list = Utils.expand_file_list(included_files, excluded_files, folder)
|
|
58
59
|
package_file_list = file_list.collect{ |f| File.join(package_dir_path, package_folder, get_relative_path(folder,f)) }
|
|
59
60
|
@origin_files += file_list
|
|
60
61
|
@destination_files += package_file_list
|
|
@@ -9,6 +9,7 @@ module MTBuild
|
|
|
9
9
|
def initialize(project_name, project_folder, output_folder, configuration_name, configuration, api_headers)
|
|
10
10
|
@api_headers = api_headers
|
|
11
11
|
super project_name, project_folder, output_folder, configuration_name, configuration
|
|
12
|
+
@configuration_headers = Utils.expand_folder_list(configuration.fetch(:configuration_headers, []), @project_folder)
|
|
12
13
|
end
|
|
13
14
|
|
|
14
15
|
# Create the actual Rake tasks that will perform the configuration's work
|
|
@@ -17,7 +18,7 @@ module MTBuild
|
|
|
17
18
|
all_object_files = []
|
|
18
19
|
all_object_folders = []
|
|
19
20
|
@toolchains.each do |toolchain, sources|
|
|
20
|
-
toolchain.add_include_paths(@api_headers)
|
|
21
|
+
toolchain.add_include_paths(@api_headers+@configuration_headers)
|
|
21
22
|
object_files, object_folders = toolchain.create_compile_tasks(sources)
|
|
22
23
|
all_object_files |= object_files
|
|
23
24
|
all_object_folders |= object_folders
|
|
@@ -38,6 +39,7 @@ module MTBuild
|
|
|
38
39
|
end
|
|
39
40
|
end
|
|
40
41
|
new_task.api_headers = @api_headers
|
|
42
|
+
new_task.configuration_headers = @configuration_headers
|
|
41
43
|
new_task.library_files = library_files
|
|
42
44
|
end
|
|
43
45
|
|
|
@@ -47,9 +47,10 @@ module MTBuild
|
|
|
47
47
|
configuration_name = "#{@project_name}:#{framework_configuration}"
|
|
48
48
|
configuration_task = Rake.application.lookup(configuration_name)
|
|
49
49
|
fail "Unable to locate configuration: #{configuration_name}" if configuration_task.nil?
|
|
50
|
-
fail "Configuration is not a library configuration: #{configuration_name}" unless configuration_task.respond_to? :library_files
|
|
50
|
+
fail "Configuration is not a library configuration: #{configuration_name}" unless configuration_task.respond_to? :library_files and configuration_task.respond_to? :configuration_headers
|
|
51
51
|
|
|
52
52
|
t.add_files_to_folder("Libraries/#{framework_configuration}", configuration_task.library_files)
|
|
53
|
+
t.add_folders_to_folder("Config/#{framework_configuration}", configuration_task.configuration_headers) unless configuration_task.configuration_headers.empty?
|
|
53
54
|
end
|
|
54
55
|
end
|
|
55
56
|
|
|
@@ -65,6 +66,7 @@ module MTBuild
|
|
|
65
66
|
configuration_name = "#{@project_name}:#{framework_configuration}"
|
|
66
67
|
configuration_task = Rake.application.lookup(configuration_name)
|
|
67
68
|
f.puts(" lib.add_configuration :#{framework_configuration},")
|
|
69
|
+
f.puts(" configuration_headers: ['Config/#{framework_configuration}'],") unless configuration_task.configuration_headers.empty?
|
|
68
70
|
f.puts(" objects: ['Libraries/#{framework_configuration}/*']")
|
|
69
71
|
end
|
|
70
72
|
f.puts("end")
|
|
@@ -8,13 +8,17 @@ module Rake
|
|
|
8
8
|
# API header location for the static library
|
|
9
9
|
attr_accessor :api_headers
|
|
10
10
|
|
|
11
|
+
# Configuration header location for the static library
|
|
12
|
+
attr_accessor :configuration_headers
|
|
13
|
+
|
|
11
14
|
# The static library output file(s)
|
|
12
15
|
attr_accessor :library_files
|
|
13
16
|
|
|
14
17
|
def initialize(task_name, app)
|
|
15
18
|
super
|
|
16
|
-
@api_headers =
|
|
17
|
-
@
|
|
19
|
+
@api_headers = []
|
|
20
|
+
@configuration_headers = []
|
|
21
|
+
@library_files = []
|
|
18
22
|
end
|
|
19
23
|
|
|
20
24
|
end
|
data/lib/mtbuild/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mtbuild
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jerry Ryle
|
|
@@ -128,6 +128,7 @@ files:
|
|
|
128
128
|
- lib/mtbuild/versioners/mt_std_version.rb
|
|
129
129
|
- lib/mtbuild/workspace.rb
|
|
130
130
|
- lib/mtbuild.rb
|
|
131
|
+
- CHANGES.md
|
|
131
132
|
- LICENSE.md
|
|
132
133
|
- README.md
|
|
133
134
|
homepage: https://github.com/MindTribe/MTBuild
|