mtbuild 0.1.5 → 0.1.6

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: 187145809f7658bc92518be6863f4bdb610f9e62
4
- data.tar.gz: 748518274ed38a3d00de5c1912ee7e225a1e3255
3
+ metadata.gz: cb12941f60713ffa3d81bf968339deeada8081f9
4
+ data.tar.gz: ff02505a38643a0d0ed553bfa299ce1f75aa343f
5
5
  SHA512:
6
- metadata.gz: 5c3d17fad767c18324de6c7920774f960d4e8ce03a75514f7f56e9129168963b911cbb41ccc7d6c2ebd76313bfdacef9d9cc4c1ab17aa36b0050f375fca16ed3
7
- data.tar.gz: d8c2fda21efca90b2db2c35c85fdd8958e7c949ee1b6d6d47444d9dbe73639b2f4911c879dc321eaf9d618bdb2f25bf29ba3de0e93226831c47e2f0678dad22f
6
+ metadata.gz: 2167c9621af792ce4e1255a557f796a83741d97e3859c686a6c436f1fdd48d8c9620c2b56b2d5fc6ac54f2a92ed2559670c8f6f1a979ac0deb40ea8cb776ee78
7
+ data.tar.gz: dff942548e13fc59a9b524f58651a367002e2cd1bf0b281a1f5d55ed1d3b709b6b8fe0b87e9be86c1f161c4444c8630cae553402e7bd08cb539583cbc384a05d
data/CHANGES.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Release Notes #
2
2
 
3
3
 
4
+ ## MTBuild 0.1.6 ##
5
+
6
+ ### Changes ###
7
+
8
+ * Fixed issue where the project path was always prepended to paths, even
9
+ absolute paths. This prevented workspaces from specifying absolute paths
10
+ in default configurations.
11
+
12
+
4
13
  ## MTBuild 0.1.5 ##
5
14
 
6
15
  ### Changes ###
data/README.md CHANGED
@@ -343,9 +343,11 @@ workspace(workspace_name, workspace_folder, &configuration_block)
343
343
  For ```configuration_block```, you supply a block that takes one parameter. When MTBuild invokes the block, it will pass a Workspace object as this parameter. Inside the block, you can make Workspace calls on this object to add projects, set configuration defaults, etc.
344
344
 
345
345
  #### add_project ####
346
+
346
347
  Use ```add_project(project_location)``` inside of a workspace configuration block to add a project that lives inside a subfolder. The ```project_location``` parameter must be a subfolder of the workspace. If the project lives at the same level as the workspace, you should define it in the same mtbuildfile as the workspace. In this case, the project will be implicitly added and you do not need to use ```add_project``` inside the workspace. See the **Project Plus Workspace Example** above for an example of a workspace and project that live at the same folder level.
347
348
 
348
349
  #### add_workspace ####
350
+
349
351
  Use ```add_workspace(workspace_location, pull_default_tasks: false, pull_configurations: [], push_configurations: [])``` inside of a workspace configuration block to add a child workspace that lives inside a subfolder. The ```workspace_location``` parameter must be a subfolder of the workspace.
350
352
 
351
353
  The optional, named parameter, ```pull_default_tasks``` determines whether the parent workspace should pull in the child workspace's default tasks. If this is ```true```, then when ```mtbuild``` is run on the parent workspace with no specified build targets, the child workspace's default targets will be built. If this is ```false```, then only targets that are referenced from the child workspace will be built as needed.
@@ -355,15 +357,19 @@ The optional, named parameter ```pull_configurations``` specifies a list of conf
355
357
  The optional, named parameter ```push_configurations``` specifies a list of configurations to push down to the child workspace. Pushing down configurations allows you to add to a child workspace's configuration settings or, if the child has a default configuration set via ```set_default_configuration()```, you can auto-generate a new configuration.
356
358
 
357
359
  #### add_default_tasks ####
360
+
358
361
  Use ```add_default_tasks(default_tasks)``` inside of a workspace configuration block to add tasks that run when you invoke MTBuild with no arguments. The ```default_tasks``` parameter expects one or more (in an array) project task names. The project tasks should be qualified relative to the current workspace. For example, if a workspace includes a project called ```MyApp```, which has a configuration called ```Debug```, you can add this by referring to it as ```MyApp:Debug```. If no default tasks are specified, then invoking MTBuild with no arguments will effectively do nothing.
359
362
 
360
363
  #### add_default_rake_tasks ####
364
+
361
365
  Use ```add_default_rake_tasks(default_tasks)``` inside of a workspace configuration block to add tasks that run when you invoke MTBuild with no arguments. The ```default_tasks``` parameter expects one or more (in an array) Rake task names. Unlike ```add_default_tasks()```, this method expects "raw" Rake task names. This lets you specify that MTBuild should run any Rake task by default when building this workspace.
362
366
 
363
367
  #### MTBuild::Workspace.add_default_tasks ####
368
+
364
369
  Use the class method ```MTBuild::Workspace.add_default_tasks(default_tasks)``` to add a default task outside of a workspace configuration block. This is useful for letting projects register default tasks in the project's mtbuildfile.rb. Note that the tasks specified in the ```default_tasks``` list must be fully-qualified ```mtbuild``` names that take workspace nesting into account. You should use the project method ```task_for_configuration``` to get the correct task names.
365
370
 
366
371
  #### set_configuration_defaults ####
372
+
367
373
  Use ```set_configuration_defaults(configuration_name, defaults_hash)``` inside of a workspace configuration block to add default settings for a configuration. This is how you would select, for instance, a default toolchain for all projects with a specific configuration.
368
374
 
369
375
  The following example selects the "gcc" toolchain and sets the C standard to C99 for any projects with a configuration named "Debug":
@@ -403,6 +409,7 @@ end
403
409
  ```
404
410
 
405
411
  #### set_output_folder ####
412
+
406
413
  Use ```set_output_folder(output_folder)``` inside of a workspace configuration block to change the build output folder. By default, this folder is set to "build" underneath the workspace folder. The ```output_folder``` parameter expects the name of a folder relative to the workspace. If the folder does not exist, MTBuild will create it.
407
414
 
408
415
  ### MTBuild::Project ###
@@ -410,9 +417,11 @@ Use ```set_output_folder(output_folder)``` inside of a workspace configuration b
410
417
  This is a base class for projects. You won't typically use it directly, but it provides some useful methods for all project types.
411
418
 
412
419
  #### task_for_configuration ####
420
+
413
421
  Use ```task_for_configuration(config_name)``` to get the fully qualified task name for the project configuration called ```config_name```. This is useful for getting fully qualified task names to register as default tasks using ```MTBuild::Workspace.add_default_tasks```
414
422
 
415
423
  #### tasks_for_all_configurations ####
424
+
416
425
  Use ```tasks_for_all_configurations``` to get a list of the fully qualified task names for all of the project's configurations. This is useful for getting fully qualified task names to register as default tasks using ```MTBuild::Workspace.add_default_tasks```
417
426
 
418
427
 
@@ -430,15 +439,18 @@ application_project(application_name, project_folder, &configuration_block)
430
439
 
431
440
  For ```configuration_block```, you supply a block that takes one parameter. When MTBuild invokes the block, it will pass an ApplicationProject object as this parameter. Inside the block, you can make ApplicationProject calls on this object to add configurations.
432
441
 
433
- #### set_default_configuration ####
442
+ #### set_default_configuration ####
443
+
434
444
  Use ```set_default_configuration(configuration)``` inside of an application project configuration block to add a default build configuration for the application. The ```configuration``` parameter expects a hash that contains settings for the configuration. Default project configurations allow you to specify a base set of toolchain settings, source files, dependencies, etc. for a project. Any project configurations that are explicitly added with ```add_configuration()``` will be merged with the project default.
435
445
 
436
446
  You can also use ```set_default_configuration()``` in a project along with ```set_configuration_defaults()``` in the parent workspace to auto-generate project configurations without needing to explicitly add each configuration to a project with ```add_configuration()```. If a project contains a default configuration, then any configurations added with ```set_configuration_defaults()``` in a parent workspace will be auto-generated for the project by merging the workspace configuration with the default configuration. Note that you can use all three mechanisms together: ```set_default_configuration()```, ```set_configuration_defaults()```, and ```add_configuration()```. When you do so, the configuration results from the merging of all three tiers of settings.
437
447
 
438
448
  #### add_configuration ####
449
+
439
450
  Use ```add_configuration(configuration_name, configuration)``` inside of an application project configuration block to add a build configuration for the application. The ```configuration_name``` parameter expects a symbol that serves as a human-readable name for the configuration. Rake tasks related to this configuration will be namespaced with this symbol. For example, the top-level Rake task for building the "Debug" configuration of "MyApplication" would be "MyApplication:Debug". The ```configuration``` parameter expects a hash that contains settings for the configuration.
440
451
 
441
452
  ##### Application Project configuration settings #####
453
+
442
454
  Application Project configurations require the following settings:
443
455
 
444
456
  * ```:toolchain``` - A toolchain hash constructed with the ```toolchain``` DSL method (detailed in a later section).
@@ -482,15 +494,19 @@ static_library_project(library_name, project_folder, &configuration_block)
482
494
  For ```configuration_block```, you supply a block that takes one parameter. When MTBuild invokes the block, it will pass a StaticLibraryProject object as this parameter. Inside the block, you can make StaticLibraryProject calls on this object to add configurations.
483
495
 
484
496
  #### add_configuration ####
497
+
485
498
  Use ```add_configuration(configuration_name, configuration)``` inside of a static library project configuration block to add a build configuration for the library. The ```configuration_name``` parameter expects a symbol that serves as a human-readable name for the configuration. Rake tasks related to this configuration will be namespaced with this symbol. For example, the top-level Rake task for building the "Debug" configuration of "MyLibrary" would be "MyLibrary:Debug". The ```configuration``` parameter expects a hash that contains settings for the configuration.
486
499
 
487
500
  #### add_api_headers ####
501
+
488
502
  Use ```add_api_headers(api_headers)``` inside of a static library project configuration block--before adding configurations--to set the location(s) of the library'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.
489
503
 
490
504
  #### build_framework_package ####
505
+
491
506
  Use ```build_framework_package(configuration_names)``` inside of a static library project configuration block to specify that the library should provide a framework package target. Use ```configuration_names``` to provide a list of configuration names to include in the package. For example, ```'Configuration1'``` or ```['Configuration1', 'Configuration2']```.
492
507
 
493
508
  ##### Static Library Project configuration settings #####
509
+
494
510
  Static Library Project configurations use the same settings as Application Project configurations.
495
511
 
496
512
  Additionally, Static Library Project configurations offer the following optional settings:
@@ -498,6 +514,7 @@ Additionally, Static Library Project configurations offer the following optional
498
514
  * ```:configuration_headers``` - One or more configuration header paths. For example, ```'config/Debug'``` or ```['config/Debug', 'config/common']```.
499
515
 
500
516
  ### MTBuild::TestApplicationProject ###
517
+
501
518
  Define a Test Application Project with the following DSL method:
502
519
 
503
520
  ```Ruby
@@ -511,9 +528,11 @@ test_application_project(application_name, project_folder, &configuration_block)
511
528
  For ```configuration_block```, you supply a block that takes one parameter. When MTBuild invokes the block, it will pass a TestApplicationProject object as this parameter. Inside the block, you can make TestApplicationProject calls on this object to add configurations.
512
529
 
513
530
  #### add_configuration ####
531
+
514
532
  Use ```add_configuration(configuration_name, configuration)``` inside of a test application project configuration block to add a build configuration for the application. The ```configuration_name``` parameter expects a symbol that serves as a human-readable name for the configuration. Rake tasks related to this configuration will be namespaced with this symbol. For example, the top-level Rake task for building the "Debug" configuration of "MyTestApplication" would be "MyTestApplication:Debug". The ```configuration``` parameter expects a hash that contains settings for the configuration.
515
533
 
516
534
  ##### Test Application Project configuration settings #####
535
+
517
536
  Test Application Project configurations use the same settings as Application Library Project configurations.
518
537
 
519
538
  ### MTBuild::FrameworkProject ###
@@ -531,12 +550,15 @@ framework_project(framework_name, project_folder, &configuration_block)
531
550
  For ```configuration_block```, you supply a block that takes one parameter. When MTBuild invokes the block, it will pass an FrameworkProject object as this parameter. Inside the block, you can make FrameworkProject calls on this object to add configurations.
532
551
 
533
552
  #### add_configuration ####
553
+
534
554
  Use ```add_configuration(configuration_name, configuration)``` inside of a framework project configuration block to add a configuration for the framework. The ```configuration_name``` parameter expects a symbol that serves as a human-readable name for the configuration. Rake tasks related to this configuration will be namespaced with this symbol. For example, the top-level Rake task for building the "Debug" configuration of "MyLibrary" would be "MyLibrary:Debug". The ```configuration``` parameter expects a hash that contains settings for the configuration.
535
555
 
536
556
  #### add_api_headers ####
557
+
537
558
  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.
538
559
 
539
560
  ##### Framework Project configuration settings #####
561
+
540
562
  Framework Project configurations require the following settings:
541
563
 
542
564
  * ```:objects``` - One or more framework object files. For example, ```'MyLibrary.a'```
@@ -546,6 +568,7 @@ Framework Project configurations offer the following optional settings:
546
568
  * ```:configuration_headers``` - One or more configuration header paths. For example, ```'config/Debug'``` or ```['config/Debug', 'config/common']```.
547
569
 
548
570
  ### MTBuild::Toolchain ###
571
+
549
572
  Define a Toolchain with the following DSL method:
550
573
 
551
574
  ```Ruby
@@ -557,6 +580,7 @@ def toolchain(toolchain_name, toolchain_configuration={})
557
580
  ```toolchain_configuration``` expects a hash that contains settings for the toolchain.
558
581
 
559
582
  ##### Toolchain settings #####
583
+
560
584
  All toolchains offer the following optional settings:
561
585
 
562
586
  * ```:include_paths``` - One or more include folders to use while compiling. For example, ```'include'``` or ```['include', 'include/plugins']```. Note that the paths should be relative to the project folder.
@@ -567,9 +591,11 @@ All toolchains offer the following optional settings:
567
591
 
568
592
 
569
593
  ### MTBuild::ToolchainGcc ###
594
+
570
595
  Define a gcc toolchain by passing ```:gcc``` as the ```toolchain_name``` when invoking the ```toolchain()``` method.
571
596
 
572
597
  ##### ToolchainGcc settings #####
598
+
573
599
  On top of the base Toolchain settings, the ToolchainGcc toolchain offers the following optional settings:
574
600
 
575
601
  * ```:cppflags``` - A string or array of strings representing C Preprocessor flags to be used in all compilation and link steps
@@ -586,7 +612,9 @@ On top of the base Toolchain settings, the ToolchainGcc toolchain offers the fol
586
612
 
587
613
 
588
614
  ### MTBuild::ToolchainArmNoneEabiGcc ###
615
+
589
616
  Define an arm-none-eabi-gcc toolchain by passing ```:arm_none_eabi_gcc``` as the ```toolchain_name``` when invoking the ```toolchain()``` method.
590
617
 
591
618
  ##### ToolchainArmNoneEabiGcc settings #####
619
+
592
620
  The ToolchainArmNoneEabiGcc toolchain uses the same settings as the ToolchainGcc toolchain.
@@ -1,6 +1,6 @@
1
1
  module MTBuild
2
2
  # The current MTBuild version.
3
- VERSION = '0.1.5'
3
+ VERSION = '0.1.6'
4
4
  end
5
5
 
6
6
  require 'rake'
@@ -17,17 +17,17 @@ module MTBuild
17
17
  def self.expand_file_list(included_files, excluded_files, base_folder=nil)
18
18
  file_list = FileList.new()
19
19
 
20
- included_files = Utils.ensure_array(included_files).flatten.collect{|s| base_folder ? File.join(base_folder, s) : s}
20
+ included_files = Utils.ensure_array(included_files).flatten.collect{|s| (base_folder and (Pathname.new s).relative?) ? File.join(base_folder, s) : s}
21
21
  file_list.include(included_files)
22
22
 
23
- excluded_files = Utils.ensure_array(excluded_files).flatten.collect{|e| base_folder ? File.join(base_folder, e) : e}
23
+ excluded_files = Utils.ensure_array(excluded_files).flatten.collect{|e| (base_folder and (Pathname.new e).relative?) ? File.join(base_folder, e) : e}
24
24
  file_list.exclude(*excluded_files)
25
25
 
26
26
  return file_list.to_ary.collect{|f| File.expand_path(f)}
27
27
  end
28
28
 
29
29
  def self.expand_folder_list(included_folders, base_folder=nil)
30
- included_folders = Utils.ensure_array(included_folders).flatten.collect{|f| base_folder ? File.join(base_folder, f) : f}
30
+ included_folders = Utils.ensure_array(included_folders).flatten.collect{|f| (base_folder and (Pathname.new f).relative?) ? File.join(base_folder, f) : f}
31
31
  return Dir.glob(included_folders).to_ary.reject{|f| !File.directory?f}.collect{|f| File.expand_path(f)}
32
32
  end
33
33
 
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.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jerry Ryle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-04 00:00:00.000000000 Z
11
+ date: 2015-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake