reality-generators 1.7.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 986819e5e78b30b24221b6bf9339dce933b77437
4
- data.tar.gz: ee5aab0f511adca821bf40cf246ffe4fb46ba3cc
3
+ metadata.gz: eb271940ea03018e01b712e7b48e7c398f0b60b1
4
+ data.tar.gz: ef6ca7b54c3f3b6bc59998a9286db225170702d2
5
5
  SHA512:
6
- metadata.gz: 7fe93a2c0dd2543ae99ce2b219749637849d07e4871beaa4847bd39deb05e69960ac42eccbd51245ba27e088841651e987110eaa49b83d887371011c2c78f1b5
7
- data.tar.gz: cca3b4a84461e2604bcf0196922fc75002389b187b540853e5fb66da67659390e3d39862c327e5d229be44b5734d527415816dac0f60c39efad167957793fbc4
6
+ metadata.gz: a19d5020200dd18b3597ed8f0cd4c5fca8a6f5b898cafcdee27bee85eddfdca29174dec5a2c1e3839c48844ab6b23359f345acb4900d095ca9fe1257614e7336
7
+ data.tar.gz: 73deadfbfdbfdd6cba4d3b418d12d165e8993cb03ba3908960ff5b58c83079f12c90434ffb0851b1773e0f6145cd4eec3143dbd8bed443be964a2c9dcac871aa
@@ -16,6 +16,50 @@ module Reality #nodoc
16
16
  module Generators #nodoc
17
17
  module Rake #nodoc
18
18
 
19
+ # This class is typically mixed into Myproject::Build constants to add simplified mechanisms for defining build tasks
20
+ module BuildTasksMixin
21
+ def define_load_task(filename = nil, &block)
22
+ base_directory = File.dirname(::Buildr.application.buildfile.to_s)
23
+ candidate_file = File.expand_path("#{base_directory}/#{default_descriptor_filename}")
24
+ if filename.nil?
25
+ filename = candidate_file
26
+ elsif File.expand_path(filename) == candidate_file
27
+ self.log_container.warn("#{self.name}.define_load_task() passed parameter '#{filename}' which is the same value as the default parameter. This parameter can be removed.")
28
+ end
29
+ self.const_get(:LoadDescriptor).new(File.expand_path(filename), &block)
30
+ end
31
+
32
+ def define_generate_task(generator_keys, options = {}, &block)
33
+ element_key = options[:"#{root_element_type}_key"]
34
+ target_dir = options[:target_dir]
35
+ buildr_project = options[:buildr_project]
36
+
37
+ if buildr_project.nil? && ::Buildr.application.current_scope.size > 0
38
+ buildr_project = ::Buildr.project(::Buildr.application.current_scope.join(':')) rescue nil
39
+ end
40
+
41
+ build_key = options[:key] || (buildr_project.nil? ? :default : buildr_project.name.split(':').last)
42
+
43
+ if target_dir
44
+ base_directory = File.dirname(::Buildr.application.buildfile.to_s)
45
+ target_dir = File.expand_path(target_dir, base_directory)
46
+ end
47
+
48
+ if target_dir.nil? && !buildr_project.nil?
49
+ target_dir = buildr_project._(:target, :generated, self.generated_type_path_prefix, build_key)
50
+ elsif !target_dir.nil? && !buildr_project.nil?
51
+ self.log_container.warn("#{self.name}.define_generate_task specifies a target directory parameter but it can be be derived from the context. The parameter should be removed.")
52
+ end
53
+
54
+ if target_dir.nil?
55
+ self.log_container.error("#{self.name}.define_generate_task should specify a target directory as it can not be derived from the context.")
56
+ end
57
+
58
+ self.const_get(:GenerateTask).new(element_key, build_key, generator_keys, target_dir, buildr_project, &block)
59
+ end
60
+ end
61
+
62
+ # This is the base class used to define tasks that generate artifacts using templates
19
63
  class BaseGenerateTask
20
64
  attr_accessor :description
21
65
  attr_accessor :namespace_key
@@ -134,6 +178,8 @@ module Reality #nodoc
134
178
  end
135
179
  end
136
180
 
181
+ # Base class that defines tasks to load the resource descriptors into application
182
+ # This will load the file such as 'architecture.rb', 'noft.rb' or 'resgen.rb'
137
183
  class BaseLoadDescriptor
138
184
  attr_accessor :description
139
185
  attr_accessor :namespace_key
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{reality-generators}
5
- s.version = '1.7.0'
5
+ s.version = '1.8.0'
6
6
  s.platform = Gem::Platform::RUBY
7
7
 
8
8
  s.authors = ['Peter Donald']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reality-generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Donald