reality-generators 1.16.0 → 1.17.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
  SHA256:
3
- metadata.gz: acd8a4936db77dd749853e4acafb77c085a1dcc850fc2f05765f81a3b5062c47
4
- data.tar.gz: 0c4eec47b3067dfc911819a8f0d73b883ea6dfa28882c3abecdba01f577bb095
3
+ metadata.gz: 0bee2228de7a874d5c2608878982967909c8377131b466f86b1d7710c7d00611
4
+ data.tar.gz: 149169940b0dd2e931e361e57d31f58cbafffb0c872915647badb6fe542063bf
5
5
  SHA512:
6
- metadata.gz: fd269c773287b32e7420552b595134d5405c0d7954377fc23e76bada75b61308de2f801369f12a70197add6a40346c41ec0f50ce5fcc37a4336d4334028423a5
7
- data.tar.gz: 77e1e1c98b11647d59647369576b9c72713bf39ce03cbb21c28bccb1cf3e62217f3af7722e79c75c1c0431ee80a011461b2b67504c46ff829a33b7953d5bf342
6
+ metadata.gz: c4f83176ca1f14970c4feb732c61278053c9fc8dc02695d1e40f5bbd3131cb1c8fb6af4247729d5764c4be232443de359c6e7e717f72715be657aaeb8a6b6c7f
7
+ data.tar.gz: 9cb3b310ed7780790a702cb3549ca467456fe420325747f040990a69905c7a41d131fd80185aa60816763459419eca59a2d282787be0378f86ee5473c38a94ce
@@ -33,6 +33,7 @@ module Reality #nodoc
33
33
  element_key = options[:"#{root_element_type}_key"]
34
34
  target_dir = options[:target_dir]
35
35
  buildr_project = options[:buildr_project]
36
+ clean_generated_files = options[:clean_generated_files].nil? ? true : !!options[:clean_generated_files]
36
37
 
37
38
  if buildr_project.nil? && ::Buildr.application.current_scope.size > 0
38
39
  buildr_project = ::Buildr.project(::Buildr.application.current_scope.join(':')) rescue nil
@@ -46,7 +47,11 @@ module Reality #nodoc
46
47
  end
47
48
 
48
49
  if target_dir.nil? && !buildr_project.nil?
49
- target_dir = buildr_project._(:target, :generated, self.generated_type_path_prefix, build_key)
50
+ if clean_generated_files
51
+ target_dir = buildr_project._(:target, :generated, self.generated_type_path_prefix, build_key)
52
+ else
53
+ target_dir = buildr_project._(:srcgen, self.generated_type_path_prefix, build_key)
54
+ end
50
55
  elsif !target_dir.nil? && !buildr_project.nil?
51
56
  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
57
  end
@@ -55,6 +60,10 @@ module Reality #nodoc
55
60
  self.log_container.error("#{self.name}.define_generate_task should specify a target directory as it can not be derived from the context.")
56
61
  end
57
62
 
63
+ if clean_generated_files && buildr_project
64
+ buildr_project.clean { rm_rf target_dir }
65
+ end
66
+
58
67
  self.const_get(:GenerateTask).new(element_key, build_key, generator_keys, target_dir, buildr_project, &block)
59
68
  end
60
69
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{reality-generators}
5
- s.version = '1.16.0'
5
+ s.version = '1.17.0'
6
6
  s.platform = Gem::Platform::RUBY
7
7
 
8
8
  s.authors = ['Peter Donald']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reality-generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.0
4
+ version: 1.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Donald
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-19 00:00:00.000000000 Z
11
+ date: 2023-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reality-core