baltix 0.1.1 → 0.2
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/Gemfile +4 -2
- data/README.md +136 -10
- data/Rakefile +8 -3
- data/baltix.gemspec +47 -29
- data/bin/console +4 -3
- data/data/alt-licenses/README.md +26 -0
- data/data/alt-licenses/licenses.json +2991 -0
- data/data/alt-rpm/README.md +21 -0
- data/data/alt-rpm/architectures.json +613 -0
- data/data/spdx/README.md +22 -0
- data/data/spdx/licenses.json +9287 -0
- data/docs/action-flow.md +42 -0
- data/docs/actor-integration.md +71 -0
- data/docs/alt-architectures.md +27 -0
- data/docs/cleanup-actors.md +14 -0
- data/docs/dependency-actions.md +22 -0
- data/docs/installation-actors.md +35 -0
- data/docs/pkglist.md +56 -0
- data/docs/plans/revision-003.md +328 -0
- data/docs/plans/revision-004.md +416 -0
- data/docs/plans/revision-005.md +431 -0
- data/docs/plans/revision-006.md +439 -0
- data/docs/plans/revision-007.md +441 -0
- data/docs/plans/revision-008.md +445 -0
- data/docs/plans/revision-009.md +450 -0
- data/docs/plans/revision-010.md +486 -0
- data/docs/plans/revision-011.md +500 -0
- data/docs/plans/revision-012.md +501 -0
- data/docs/plans/revision-013.md +501 -0
- data/docs/plans/revision-014.md +501 -0
- data/docs/plans/revision-015.md +502 -0
- data/docs/plans/revision-016.md +503 -0
- data/docs/plans/revision-017.md +504 -0
- data/docs/plans/revision-018.md +505 -0
- data/docs/plans/revision-019.md +510 -0
- data/docs/plans/revision-020.md +524 -0
- data/docs/plans/revision-021.md +542 -0
- data/docs/plans/revision-022.md +542 -0
- data/docs/plans/revision-023.md +545 -0
- data/docs/plans/revision-024.md +567 -0
- data/docs/plans/revision-025.md +583 -0
- data/docs/plans/revision-026.md +241 -0
- data/docs/plans/revision-027.md +305 -0
- data/docs/plans/revision-028.md +298 -0
- data/docs/plans/revision-029.md +288 -0
- data/docs/rpm-action-macros.md +52 -0
- data/docs/rpm-parts.md +53 -0
- data/docs/ruby-dependencies.md +217 -0
- data/docs/ruby-policy-2.1.md +28 -0
- data/docs/ruby-versioning.md +61 -0
- data/docs/space-format.md +58 -0
- data/exe/baltix +1 -0
- data/lib/baltix/action_flow/files.rb +49 -0
- data/lib/baltix/action_flow/inputs.rb +60 -0
- data/lib/baltix/action_flow/journal.rb +60 -0
- data/lib/baltix/action_flow/options.rb +60 -0
- data/lib/baltix/action_flow.rb +65 -0
- data/lib/baltix/actor/build/collect.rb +72 -0
- data/lib/baltix/actor/build/compile.rb +25 -0
- data/lib/baltix/actor/build/extconf.rb +14 -0
- data/lib/baltix/actor/build/make.rb +18 -0
- data/lib/baltix/actor/build/postprocess.rb +14 -0
- data/lib/baltix/actor/build/rake.rb +18 -0
- data/lib/baltix/actor/build/ronn.rb +55 -0
- data/lib/baltix/actor/build.rb +87 -0
- data/lib/baltix/actor/clean/remove.rb +45 -0
- data/lib/baltix/actor/clean.rb +37 -0
- data/lib/baltix/actor/config.rb +12 -0
- data/lib/baltix/actor/copy.rb +22 -7
- data/lib/baltix/actor/distclean.rb +20 -0
- data/lib/baltix/actor/doc/collect.rb +39 -0
- data/lib/baltix/actor/doc/generate.rb +47 -0
- data/lib/baltix/actor/doc/inputs.rb +25 -0
- data/lib/baltix/actor/doc.rb +70 -0
- data/lib/baltix/actor/gen.rb +19 -0
- data/lib/baltix/actor/install/data.rb +18 -0
- data/lib/baltix/actor/install/documentation.rb +48 -0
- data/lib/baltix/actor/install/executable.rb +27 -0
- data/lib/baltix/actor/install/extension.rb +44 -0
- data/lib/baltix/actor/install/headers.rb +10 -0
- data/lib/baltix/actor/install/library.rb +13 -0
- data/lib/baltix/actor/install/metadata.rb +21 -0
- data/lib/baltix/actor/install/paths.rb +73 -0
- data/lib/baltix/actor/install/plugin.rb +25 -0
- data/lib/baltix/actor/install/record.rb +48 -0
- data/lib/baltix/actor/install/shebang.rb +29 -0
- data/lib/baltix/actor/install/transfer.rb +64 -0
- data/lib/baltix/actor/install/trees.rb +34 -0
- data/lib/baltix/actor/install.rb +71 -0
- data/lib/baltix/actor/link.rb +15 -6
- data/lib/baltix/actor/make.rb +14 -0
- data/lib/baltix/actor/predeps/write.rb +51 -0
- data/lib/baltix/actor/predeps.rb +41 -0
- data/lib/baltix/actor/provides.rb +12 -0
- data/lib/baltix/actor/requires.rb +12 -0
- data/lib/baltix/actor/show.rb +26 -0
- data/lib/baltix/actor/spec.rb +6 -3
- data/lib/baltix/actor/test/record.rb +8 -0
- data/lib/baltix/actor/test/run.rb +30 -0
- data/lib/baltix/actor/test/select.rb +16 -0
- data/lib/baltix/actor/test.rb +41 -0
- data/lib/baltix/actor/touch.rb +14 -5
- data/lib/baltix/actor.rb +43 -26
- data/lib/baltix/cli/dependency_options.rb +63 -0
- data/lib/baltix/cli/options/action.rb +32 -0
- data/lib/baltix/cli/options.rb +280 -0
- data/lib/baltix/cli/output_options.rb +56 -0
- data/lib/baltix/cli/rake_tasks.rb +59 -0
- data/lib/baltix/cli/source_options.rb +52 -0
- data/lib/baltix/cli.rb +130 -116
- data/lib/baltix/concerns/command.rb +52 -0
- data/lib/baltix/concerns/configuration.rb +39 -0
- data/lib/baltix/concerns/dependency_output.rb +21 -0
- data/lib/baltix/concerns/extension_metadata.rb +44 -0
- data/lib/baltix/concerns/file_destination.rb +14 -0
- data/lib/baltix/concerns/inspection.rb +27 -0
- data/lib/baltix/concerns/parts.rb +16 -0
- data/lib/baltix/concerns/target_paths.rb +57 -0
- data/lib/baltix/concerns.rb +11 -0
- data/lib/baltix/core_extensions/gem_dependency.rb +24 -0
- data/lib/baltix/core_extensions/gem_requirement.rb +45 -0
- data/lib/baltix/core_extensions/open_struct_merge.rb +62 -0
- data/lib/baltix/deps/executables.rb +30 -0
- data/lib/baltix/deps/packages.rb +32 -0
- data/lib/baltix/deps.rb +103 -194
- data/lib/baltix/dsl/dependency_groups.rb +77 -0
- data/lib/baltix/dsl/dependency_sources.rb +100 -0
- data/lib/baltix/dsl/filtering.rb +26 -0
- data/lib/baltix/dsl/loading.rb +72 -0
- data/lib/baltix/dsl/merging.rb +74 -0
- data/lib/baltix/dsl/rendering.rb +54 -0
- data/lib/baltix/dsl/requirements.rb +77 -0
- data/lib/baltix/dsl/temporary_files.rb +36 -0
- data/lib/baltix/dsl.rb +66 -273
- data/lib/baltix/executable_dependencies/features.rb +53 -0
- data/lib/baltix/executable_dependencies/library.rb +21 -0
- data/lib/baltix/executable_dependencies/library_features.rb +34 -0
- data/lib/baltix/executable_dependencies/syntax.rb +102 -0
- data/lib/baltix/executable_dependencies.rb +102 -0
- data/lib/baltix/extensions/bones.rb +173 -0
- data/lib/baltix/extensions/echoe.rb +143 -0
- data/lib/baltix/extensions/hoe/metadata.rb +89 -0
- data/lib/baltix/extensions/hoe/options.rb +84 -0
- data/lib/baltix/extensions/hoe/readme.rb +29 -0
- data/lib/baltix/extensions/hoe.rb +146 -0
- data/lib/baltix/extensions/jeweler.rb +95 -0
- data/lib/baltix/extensions/levitate.rb +74 -0
- data/lib/baltix/extensions/olddoc.rb +42 -0
- data/lib/baltix/extensions.rb +340 -419
- data/lib/baltix/i18n.rb +22 -19
- data/lib/baltix/license/catalog/capture.rb +58 -0
- data/lib/baltix/license/catalog.rb +75 -0
- data/lib/baltix/license.rb +76 -0
- data/lib/baltix/loader/capture.rb +91 -0
- data/lib/baltix/loader/cmake.rb +6 -3
- data/lib/baltix/loader/evaluation.rb +49 -0
- data/lib/baltix/loader/extconf.rb +27 -0
- data/lib/baltix/loader/feature_loading.rb +54 -0
- data/lib/baltix/loader/git-version-gen.rb +36 -21
- data/lib/baltix/loader/mast/properties.rb +58 -0
- data/lib/baltix/loader/mast.rb +97 -109
- data/lib/baltix/loader/object_capture.rb +27 -0
- data/lib/baltix/loader/olddoc.gemspec.erb +31 -0
- data/lib/baltix/loader/pom.rb +36 -16
- data/lib/baltix/loader/rookbook.rb +19 -14
- data/lib/baltix/loader/yaml.rb +9 -5
- data/lib/baltix/loader.rb +85 -132
- data/lib/baltix/log.rb +26 -27
- data/lib/baltix/rake/metadata_adapter.rb +30 -0
- data/lib/baltix/rake/task_context.rb +59 -0
- data/lib/baltix/rake/task_libraries.rb +73 -0
- data/lib/baltix/rake.rb +62 -12
- data/lib/baltix/source/base/dependencies.rb +81 -0
- data/lib/baltix/source/base/file_queries.rb +67 -0
- data/lib/baltix/source/base/file_tree.rb +70 -0
- data/lib/baltix/source/base/metadata.rb +140 -0
- data/lib/baltix/source/base/options.rb +71 -0
- data/lib/baltix/source/base/roots.rb +53 -0
- data/lib/baltix/source/base.rb +95 -377
- data/lib/baltix/source/fake.rb +89 -5
- data/lib/baltix/source/gem/delegation.rb +32 -0
- data/lib/baltix/source/gem/dependencies.rb +69 -0
- data/lib/baltix/source/gem/discovery.rb +72 -0
- data/lib/baltix/source/gem/file_trees.rb +114 -0
- data/lib/baltix/source/gem/forwarding.rb +12 -0
- data/lib/baltix/source/gem/metadata.rb +104 -0
- data/lib/baltix/source/gem/specification.rb +65 -0
- data/lib/baltix/source/gem.rb +65 -312
- data/lib/baltix/source/gemfile.rb +55 -5
- data/lib/baltix/source/rakefile.rb +12 -5
- data/lib/baltix/source.rb +36 -24
- data/lib/baltix/space/configuration.rb +54 -0
- data/lib/baltix/space/data/collections.rb +33 -0
- data/lib/baltix/space/data/gem_metadata.rb +79 -0
- data/lib/baltix/space/data/models.rb +20 -0
- data/lib/baltix/space/data/values.rb +72 -0
- data/lib/baltix/space/data.rb +53 -0
- data/lib/baltix/space/dependencies.rb +53 -0
- data/lib/baltix/space/filters.rb +96 -0
- data/lib/baltix/space/initialization.rb +124 -0
- data/lib/baltix/space/metadata.rb +130 -0
- data/lib/baltix/space/source_order.rb +43 -0
- data/lib/baltix/space/source_selection.rb +136 -0
- data/lib/baltix/space/source_status.rb +114 -0
- data/lib/baltix/space/spec.rb +3 -0
- data/lib/baltix/space.rb +87 -367
- data/lib/baltix/spec/rpm/aliases.rb +79 -0
- data/lib/baltix/spec/rpm/arch.rb +119 -0
- data/lib/baltix/spec/rpm/available_overrides.rb +106 -0
- data/lib/baltix/spec/rpm/build_dependencies.rb +132 -0
- data/lib/baltix/spec/rpm/build_queries.rb +61 -0
- data/lib/baltix/spec/rpm/changelog.rb +115 -0
- data/lib/baltix/spec/rpm/dependency_overrides.rb +83 -0
- data/lib/baltix/spec/rpm/dependency_policy.rb +69 -0
- data/lib/baltix/spec/rpm/deps.rb +113 -0
- data/lib/baltix/spec/rpm/env/requirements.rb +20 -0
- data/lib/baltix/spec/rpm/env.rb +76 -0
- data/lib/baltix/spec/rpm/executable_packages.rb +49 -0
- data/lib/baltix/spec/rpm/file_manifest.rb +72 -0
- data/lib/baltix/spec/rpm/guard_compilation.rb +95 -0
- data/lib/baltix/spec/rpm/imported_secondaries.rb +26 -0
- data/lib/baltix/spec/rpm/layout.rb +14 -0
- data/lib/baltix/spec/rpm/manpages.rb +71 -0
- data/lib/baltix/spec/rpm/metadata.rb +78 -0
- data/lib/baltix/spec/rpm/name/equality.rb +68 -0
- data/lib/baltix/spec/rpm/name/formatting.rb +33 -0
- data/lib/baltix/spec/rpm/name/parsing.rb +58 -0
- data/lib/baltix/spec/rpm/name.rb +77 -108
- data/lib/baltix/spec/rpm/packaged_versions.rb +107 -0
- data/lib/baltix/spec/rpm/parser/comments.rb +35 -0
- data/lib/baltix/spec/rpm/parser/context.rb +50 -0
- data/lib/baltix/spec/rpm/parser/dependencies.rb +91 -0
- data/lib/baltix/spec/rpm/parser/file_sections.rb +68 -0
- data/lib/baltix/spec/rpm/parser/flow.rb +84 -0
- data/lib/baltix/spec/rpm/parser/header_dependencies.rb +36 -0
- data/lib/baltix/spec/rpm/parser/macros.rb +43 -0
- data/lib/baltix/spec/rpm/parser/metadata.rb +106 -0
- data/lib/baltix/spec/rpm/parser/sections.rb +88 -0
- data/lib/baltix/spec/rpm/parser/values.rb +85 -0
- data/lib/baltix/spec/rpm/parser.rb +124 -269
- data/lib/baltix/spec/rpm/part_files.rb +64 -0
- data/lib/baltix/spec/rpm/part_prelude.rb +43 -0
- data/lib/baltix/spec/rpm/part_scripts.rb +52 -0
- data/lib/baltix/spec/rpm/part_switches.rb +65 -0
- data/lib/baltix/spec/rpm/pkglist/header.rb +73 -0
- data/lib/baltix/spec/rpm/pkglist/provides.rb +57 -0
- data/lib/baltix/spec/rpm/pkglist.rb +116 -0
- data/lib/baltix/spec/rpm/preparation.rb +73 -0
- data/lib/baltix/spec/rpm/rendering.rb +66 -0
- data/lib/baltix/spec/rpm/repository_application.rb +33 -0
- data/lib/baltix/spec/rpm/revision.rb +58 -0
- data/lib/baltix/spec/rpm/root_source.rb +48 -0
- data/lib/baltix/spec/rpm/scripts.rb +85 -0
- data/lib/baltix/spec/rpm/secondaries.rb +82 -0
- data/lib/baltix/spec/rpm/secondary.rb +117 -64
- data/lib/baltix/spec/rpm/secondary_parts.rb +84 -0
- data/lib/baltix/spec/rpm/section_document.rb +84 -0
- data/lib/baltix/spec/rpm/section_guards.rb +116 -0
- data/lib/baltix/spec/rpm/source_selection.rb +82 -0
- data/lib/baltix/spec/rpm/spec_core/architecture.rb +28 -0
- data/lib/baltix/spec/rpm/spec_core/attributes.rb +89 -0
- data/lib/baltix/spec/rpm/spec_core/availability.rb +60 -0
- data/lib/baltix/spec/rpm/spec_core/dependency_rendering.rb +83 -0
- data/lib/baltix/spec/rpm/spec_core/descriptions.rb +77 -0
- data/lib/baltix/spec/rpm/spec_core/documentation.rb +48 -0
- data/lib/baltix/spec/rpm/spec_core/executable_names.rb +37 -0
- data/lib/baltix/spec/rpm/spec_core/host_names.rb +60 -0
- data/lib/baltix/spec/rpm/spec_core/interpreters.rb +103 -0
- data/lib/baltix/spec/rpm/spec_core/names.rb +80 -0
- data/lib/baltix/spec/rpm/spec_core/obsoletes.rb +38 -0
- data/lib/baltix/spec/rpm/spec_core/package_dependencies.rb +74 -0
- data/lib/baltix/spec/rpm/spec_core/plain_dependencies.rb +60 -0
- data/lib/baltix/spec/rpm/spec_core/pre_name.rb +23 -0
- data/lib/baltix/spec/rpm/spec_core/provides.rb +104 -0
- data/lib/baltix/spec/rpm/spec_core/readme.rb +78 -0
- data/lib/baltix/spec/rpm/spec_core/registration.rb +18 -0
- data/lib/baltix/spec/rpm/spec_core/runtime_dependencies.rb +81 -0
- data/lib/baltix/spec/rpm/spec_core/summaries.rb +64 -0
- data/lib/baltix/spec/rpm/spec_core/text_wrapping.rb +36 -0
- data/lib/baltix/spec/rpm/spec_core/versioning.rb +75 -0
- data/lib/baltix/spec/rpm/spec_core/versions.rb +94 -0
- data/lib/baltix/spec/rpm/spec_core.rb +75 -527
- data/lib/baltix/spec/{rpm.erb → rpm/template.erb} +131 -31
- data/lib/baltix/spec/rpm.rb +253 -644
- data/lib/baltix/spec.rb +16 -14
- data/lib/baltix/target/gem.rb +61 -0
- data/lib/baltix/target/site.rb +40 -0
- data/lib/baltix/target.rb +16 -0
- data/lib/baltix/version.rb +3 -1
- data/lib/baltix.rb +77 -5
- data/locale/en_US.UTF-8.yaml +4 -1
- data/locale/ru_RU.UTF-8.yaml +7 -1
- data/rpm/baltix.env +4 -0
- data/rpm/baltix.prov +8 -0
- data/rpm/baltix.prov.files +6 -0
- data/rpm/baltix.req +8 -0
- data/rpm/baltix.req.files +6 -0
- data/rpm/macros.baltix +24 -0
- data/utils/rubocop/compact_block_braces.rb +39 -0
- data/utils/rubocop/spacing.rb +96 -0
- data/utils/update_alt_architectures.rb +57 -0
- data/utils/update_alt_licenses.rb +19 -0
- data/utils/update_spdx_licenses.rb +21 -0
- metadata +526 -17
- data/.github/workflows/ci.yml +0 -44
- data/.gitignore +0 -10
- data/TODO +0 -84
data/lib/baltix/loader.rb
CHANGED
|
@@ -1,99 +1,73 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'rake'
|
|
4
|
+
require 'tempfile'
|
|
2
5
|
|
|
3
6
|
require 'baltix'
|
|
4
7
|
require 'baltix/log'
|
|
5
8
|
|
|
9
|
+
# Evaluates upstream metadata with captured objects and restored process state.
|
|
6
10
|
module Baltix::Loader
|
|
7
11
|
include Baltix::Log
|
|
8
12
|
|
|
13
|
+
# Captures metadata declarations in an isolated evaluation context.
|
|
9
14
|
module Certain
|
|
10
15
|
include Baltix::Log
|
|
11
16
|
include Rake::DSL
|
|
12
17
|
|
|
13
18
|
attr_reader :object_hash, :object_ids
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
alias require_orig require
|
|
16
21
|
|
|
17
|
-
def
|
|
18
|
-
|
|
19
|
-
rescue LoadError
|
|
20
|
-
true
|
|
21
|
-
end
|
|
22
|
+
def require_embedded path
|
|
23
|
+
return if File.absolute_path?(path)
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
[]
|
|
31
|
-
end
|
|
32
|
-
end.flatten
|
|
33
|
-
|
|
34
|
-
[klass, objects]
|
|
35
|
-
end.to_h
|
|
36
|
-
|
|
37
|
-
if @object_hash
|
|
38
|
-
@object_ids = object_hash.map do |(k, oh)|
|
|
39
|
-
[k, oh.map {|h| h.__id__ } - @object_hash[k].map {|h| h.__id__ }]
|
|
40
|
-
end.to_h
|
|
25
|
+
begin
|
|
26
|
+
# try loading extension
|
|
27
|
+
require_relative("extensions/#{path}")
|
|
28
|
+
rescue LoadError
|
|
29
|
+
nil # Use normal feature loading when no embedded adapter exists.
|
|
30
|
+
else
|
|
31
|
+
true
|
|
41
32
|
end
|
|
33
|
+
end
|
|
42
34
|
|
|
43
|
-
|
|
35
|
+
def method_missing name, *parms, **parmh
|
|
36
|
+
execs = instance_variables.include?(:@execs) ? instance_variable_get(:@execs) : []
|
|
37
|
+
|
|
38
|
+
execs << [name, parms, parmh]
|
|
39
|
+
|
|
40
|
+
instance_variable_set(:@execs, execs)
|
|
44
41
|
end
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
store_object_hash(type_hash)
|
|
51
|
-
value = nil
|
|
43
|
+
# alias_method :orig_gem, :gem
|
|
44
|
+
# define_method :gem do |*args|
|
|
45
|
+
def gem name, *args
|
|
46
|
+
gems = instance_variables.include?(:@gems) ? instance_variable_get(:@gems) : []
|
|
52
47
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
Dir.chdir(File.dirname(file)) do
|
|
56
|
-
_file = File.basename(file).untaint
|
|
57
|
-
code = File.read(file, mode: 'r:UTF-8:-')
|
|
58
|
-
code.untaint
|
|
59
|
-
|
|
60
|
-
value =
|
|
61
|
-
begin
|
|
62
|
-
# evaluation required not to lost loaded object,
|
|
63
|
-
# the instance_eval is used in favor of eval to avoid lost predefined vars
|
|
64
|
-
# like for chef-utils gem
|
|
65
|
-
instance_eval(code, _file)
|
|
66
|
-
rescue Exception
|
|
67
|
-
# thrown for setup gem
|
|
68
|
-
load(File.basename(file), true)
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
rescue Exception => e
|
|
72
|
-
raise e
|
|
73
|
-
ensure
|
|
74
|
-
debug("value: #{value.inspect}")
|
|
75
|
-
pop
|
|
76
|
-
store_object_hash(type_hash)
|
|
77
|
-
end
|
|
48
|
+
gems.push(name => args)
|
|
49
|
+
instance_variable_set(:@gems, gems)
|
|
78
50
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
debug("[#{e.class}]: #{e.message}\n\t#{e.backtrace.join("\n\t")}")
|
|
51
|
+
true
|
|
52
|
+
end
|
|
82
53
|
|
|
83
|
-
|
|
54
|
+
def respond_to_missing? _name, _include_private = false
|
|
55
|
+
true # The metadata recorder accepts arbitrary DSL declarations.
|
|
84
56
|
end
|
|
85
57
|
|
|
86
58
|
def push
|
|
87
|
-
@paths =
|
|
88
|
-
|
|
59
|
+
@paths = $LOAD_PATH.dup
|
|
60
|
+
|
|
61
|
+
debug("Stored paths are: #{@paths.join("\n\t")}")
|
|
89
62
|
end
|
|
90
63
|
|
|
91
64
|
def pop
|
|
92
|
-
debug("Subtract paths:
|
|
93
|
-
# NOTE this sequency of merging is required to correct loading libs leads
|
|
65
|
+
debug("Subtract paths: #{($LOAD_PATH - @paths).join("\n\t")}")
|
|
66
|
+
# NOTE: this sequency of merging is required to correct loading libs leads
|
|
94
67
|
# to show warning and break building rdoc documentation
|
|
95
|
-
|
|
96
|
-
|
|
68
|
+
$LOAD_PATH.replace(@paths | $LOAD_PATH)
|
|
69
|
+
|
|
70
|
+
debug("Replaced paths with: #{$LOAD_PATH.join("\n\t")}")
|
|
97
71
|
end
|
|
98
72
|
end
|
|
99
73
|
|
|
@@ -106,87 +80,66 @@ module Baltix::Loader
|
|
|
106
80
|
end
|
|
107
81
|
|
|
108
82
|
def type_hash
|
|
109
|
-
@type_hash ||=
|
|
110
|
-
|
|
111
|
-
type =
|
|
112
|
-
begin
|
|
113
|
-
kls.const_get('TYPE')
|
|
114
|
-
rescue
|
|
115
|
-
nil
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
[kls, type]
|
|
119
|
-
end.select {|(_, type)| type }.to_h
|
|
120
|
-
end
|
|
83
|
+
@type_hash ||= Baltix::Loader.extended_list.filter_map do |klass|
|
|
84
|
+
type = loader_object_type(klass)
|
|
121
85
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
Baltix::Loader.extended_list.map do |kls|
|
|
125
|
-
begin
|
|
126
|
-
kls.const_get('PRELOAD_MATCHER')&.map do |k, v|
|
|
127
|
-
[k, v.is_a?(Symbol) && kls.singleton_method(v) || v]
|
|
128
|
-
end.to_h || {}
|
|
129
|
-
rescue
|
|
130
|
-
{}
|
|
131
|
-
end
|
|
132
|
-
end.reduce {|res, hash| res.merge(hash) }
|
|
86
|
+
[klass, type] if type
|
|
87
|
+
end.to_h
|
|
133
88
|
end
|
|
134
89
|
|
|
135
|
-
def
|
|
136
|
-
|
|
90
|
+
def loader_object_type klass
|
|
91
|
+
klass.const_get('TYPE')
|
|
92
|
+
rescue StandardError
|
|
93
|
+
nil
|
|
137
94
|
end
|
|
138
95
|
|
|
139
|
-
def
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
$stdout = $stderr = Tempfile.new('loader')
|
|
96
|
+
def pre_loaders
|
|
97
|
+
@pre_loaders ||= Baltix::Loader.extended_list.map {|klass| loader_preload_map(klass) }
|
|
98
|
+
.reduce {|previous, current| previous.merge(current) }
|
|
99
|
+
end
|
|
144
100
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
101
|
+
def loader_preload_map klass
|
|
102
|
+
klass.const_get('PRELOAD_MATCHER')&.transform_values do |value|
|
|
103
|
+
value.is_a?(Symbol) && klass.singleton_method(value) || value
|
|
104
|
+
end || {}
|
|
105
|
+
rescue StandardError
|
|
106
|
+
{}
|
|
107
|
+
end
|
|
151
108
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
module #{module_name}
|
|
155
|
-
extend(::Baltix::Loader::Certain)
|
|
156
|
-
end
|
|
157
|
-
END
|
|
158
|
-
|
|
159
|
-
mod = module_eval(mod_code)
|
|
160
|
-
mod.load_file(file, type_hash)
|
|
161
|
-
$stdout.rewind
|
|
162
|
-
$stderr.rewind
|
|
163
|
-
log = $stdout.readlines
|
|
164
|
-
errlog = $stderr.readlines
|
|
165
|
-
|
|
166
|
-
OpenStruct.new(mod: mod, log: log, errlog: errlog, object_hash: mod.object_hash, diff_ids: mod.object_ids)
|
|
167
|
-
rescue Exception => e
|
|
168
|
-
warn(e.message)
|
|
169
|
-
|
|
170
|
-
OpenStruct.new(mod: mod, object_hash: {}, log: log, errlog: errlog, diff_ids: [])
|
|
171
|
-
ensure
|
|
172
|
-
$stderr = stderr
|
|
173
|
-
$stdout = stdout
|
|
109
|
+
def self.module_cache
|
|
110
|
+
@module_cache ||= {}
|
|
174
111
|
end
|
|
175
112
|
|
|
176
|
-
def
|
|
177
|
-
|
|
113
|
+
def mods
|
|
114
|
+
Baltix::Loader.module_cache
|
|
115
|
+
end
|
|
178
116
|
|
|
117
|
+
def app_file file, dir = Dir.pwd
|
|
118
|
+
mods[file] ||= load_file(file, dir)
|
|
179
119
|
mod = mods[file].dup
|
|
180
|
-
objects = mod
|
|
120
|
+
objects = imported_module_objects(mod, file)
|
|
181
121
|
|
|
182
|
-
|
|
183
|
-
debug("Objects for '#{file}' are: #{objects.inspect}")
|
|
122
|
+
objects = [yield(objects)].flatten.tap(&:compact!) if block_given?
|
|
184
123
|
|
|
185
|
-
if block_given?
|
|
186
|
-
objects = [yield(objects)].flatten.compact
|
|
187
|
-
end
|
|
188
124
|
mod.objects = objects || []
|
|
189
125
|
|
|
190
126
|
mod
|
|
191
127
|
end
|
|
128
|
+
|
|
129
|
+
def imported_module_objects mod, file
|
|
130
|
+
objects = mod.object_ids[self]&.map {|id| ObjectSpace._id2ref(id) }
|
|
131
|
+
|
|
132
|
+
debug("Object ids for '#{file}' are: #{mod.object_ids[self].inspect}")
|
|
133
|
+
debug("Objects for '#{file}' are: #{objects.inspect}")
|
|
134
|
+
|
|
135
|
+
objects
|
|
136
|
+
end
|
|
192
137
|
end
|
|
138
|
+
|
|
139
|
+
require 'baltix/loader/feature_loading'
|
|
140
|
+
|
|
141
|
+
require 'baltix/loader/object_capture'
|
|
142
|
+
|
|
143
|
+
require 'baltix/loader/evaluation'
|
|
144
|
+
|
|
145
|
+
require 'baltix/loader/capture'
|
data/lib/baltix/log.rb
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Routes packaging diagnostics to configured streams.
|
|
1
4
|
module Baltix::Log
|
|
2
5
|
DEFAULT_IO_NAMES = {
|
|
3
6
|
none: nil,
|
|
4
7
|
error: 'stderr',
|
|
5
8
|
warn: 'stderr',
|
|
6
9
|
info: 'stderr',
|
|
7
|
-
debug: 'stderr'
|
|
8
|
-
}
|
|
10
|
+
debug: 'stderr'
|
|
11
|
+
}.freeze
|
|
9
12
|
|
|
10
|
-
DEFAULT_IO_NAMES.
|
|
13
|
+
DEFAULT_IO_NAMES.each_key do |key|
|
|
11
14
|
define_method(key) {|message| log(key, message) if level_match(key) }
|
|
12
15
|
end
|
|
13
16
|
|
|
@@ -21,15 +24,15 @@ module Baltix::Log
|
|
|
21
24
|
|
|
22
25
|
class << self
|
|
23
26
|
def prefix_for kind, prefix
|
|
24
|
-
|
|
27
|
+
@prefix[kind] = prefix
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
def prefix
|
|
28
|
-
|
|
31
|
+
@prefix ||= default_prefix(ios)
|
|
29
32
|
end
|
|
30
33
|
|
|
31
34
|
def default_prefix ios
|
|
32
|
-
ios.keys.
|
|
35
|
+
ios.keys.to_h {|kind| [kind, "[baltix][#{kind.upcase}]> "] }
|
|
33
36
|
end
|
|
34
37
|
|
|
35
38
|
def setup_kind kind, io
|
|
@@ -37,37 +40,33 @@ module Baltix::Log
|
|
|
37
40
|
end
|
|
38
41
|
|
|
39
42
|
def ios
|
|
40
|
-
|
|
43
|
+
@ios ||= io_name_parse(DEFAULT_IO_NAMES)
|
|
41
44
|
end
|
|
42
45
|
|
|
43
46
|
def level
|
|
44
|
-
|
|
47
|
+
@level ||= :info
|
|
45
48
|
end
|
|
46
49
|
|
|
47
50
|
def setup level = :info, io_names = DEFAULT_IO_NAMES, prefix = nil
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
@ios = io_name_parse(io_names)
|
|
52
|
+
@level = level
|
|
53
|
+
@prefix = prefix || default_prefix(ios)
|
|
51
54
|
end
|
|
52
55
|
|
|
53
56
|
def io_name_parse io_names
|
|
54
|
-
io_names.
|
|
55
|
-
io =
|
|
56
|
-
case io_name
|
|
57
|
-
when '-', 'stdout'
|
|
58
|
-
$stdout
|
|
59
|
-
when '--', 'stderr'
|
|
60
|
-
$stderr
|
|
61
|
-
when '', nil
|
|
62
|
-
nil
|
|
63
|
-
else
|
|
64
|
-
File.open(io_name, 'a+')
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
[kind, io]
|
|
68
|
-
end.to_h
|
|
57
|
+
io_names.to_h.transform_values {|name| open_log_stream(name) }
|
|
69
58
|
end
|
|
70
59
|
|
|
71
|
-
|
|
60
|
+
def open_log_stream name
|
|
61
|
+
case [name].flatten.first
|
|
62
|
+
when '-', 'stdout' then $stdout
|
|
63
|
+
when '--', 'stderr' then $stderr
|
|
64
|
+
when '', nil then nil
|
|
65
|
+
else File.open(name, 'a+')
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
at_exit do
|
|
69
|
+
(@ios || {}).each_value {|v| v.close if v.is_a?(File) }
|
|
70
|
+
end
|
|
72
71
|
end
|
|
73
72
|
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Recognizes metadata adapters without forcing unloaded Ruby constants.
|
|
4
|
+
class Baltix::Rake
|
|
5
|
+
# Recognizes metadata adapters even after an autoload was restored elsewhere.
|
|
6
|
+
# @param name [Symbol] registered metadata library constant
|
|
7
|
+
# @param value [Object] already loaded constant; no autoload is triggered
|
|
8
|
+
# @param location [String, false, nil] Ruby's reported constant source filename
|
|
9
|
+
# @param root [String] absolute adapter directory prefix
|
|
10
|
+
# @return [Boolean] whether the constant belongs to a metadata adapter
|
|
11
|
+
# Ruby may retain the autoload declaration's location after loading its file.
|
|
12
|
+
# Method definitions still identify the actual adapter. C-defined constants
|
|
13
|
+
# have no Ruby filename and are treated as real libraries unless known otherwise.
|
|
14
|
+
def self.metadata_adapter? name, value, location, root
|
|
15
|
+
return true if (@metadata_libraries || {})[name].equal?(value)
|
|
16
|
+
return true if adapter_source?(location, root)
|
|
17
|
+
return false unless value.is_a?(Module)
|
|
18
|
+
|
|
19
|
+
local_definitions(value).any? {|definition| adapter_source?(definition.source_location&.first, root) }
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def self.local_definitions value
|
|
23
|
+
value.singleton_methods(false).map {|name| value.method(name) } |
|
|
24
|
+
value.instance_methods(false).map {|name| value.instance_method(name) }
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def self.adapter_source? location, root
|
|
28
|
+
location.is_a?(String) && location.start_with?(root)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Restores process and Rake state around explicit upstream task execution.
|
|
4
|
+
class Baltix::Rake
|
|
5
|
+
private
|
|
6
|
+
|
|
7
|
+
def normalized_task_names task_names
|
|
8
|
+
task_names.map {|name| name.to_s.delete_prefix('@') }.tap {|items| items.reject!(&:empty?) }.uniq
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def capture_task_context
|
|
12
|
+
clean = CLEAN_CONSTANTS.filter_map do |name|
|
|
13
|
+
[name, Object.const_get(name, false)] if Object.const_defined?(name, false)
|
|
14
|
+
end.to_h
|
|
15
|
+
|
|
16
|
+
{ application: ::Rake.application, directory: Dir.pwd, clean: clean,
|
|
17
|
+
clean_library: $LOADED_FEATURES.find {|file| file.end_with?('/rake/clean.rb') }}
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def load_task_application clean_library
|
|
21
|
+
Dir.chdir(File.dirname(rakefile))
|
|
22
|
+
|
|
23
|
+
@app = ::Rake::Application.new
|
|
24
|
+
@tasks = nil
|
|
25
|
+
::Rake.application = @app
|
|
26
|
+
|
|
27
|
+
@app.init('rake', ['--rakefile', rakefile])
|
|
28
|
+
clear_clean_constants
|
|
29
|
+
clean_library ? Kernel.load(clean_library) : require('rake/clean')
|
|
30
|
+
|
|
31
|
+
@app.load_rakefile
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def invoke_tasks names
|
|
35
|
+
names.each {|name| @app.invoke_task(name) }
|
|
36
|
+
ensure
|
|
37
|
+
@app.thread_pool.join
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def clear_clean_constants
|
|
41
|
+
CLEAN_CONSTANTS.each {|name| Object.send(:remove_const, name) if Object.const_defined?(name, false) }
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def restore_task_context previous
|
|
45
|
+
::Rake.application = previous[:application]
|
|
46
|
+
|
|
47
|
+
Dir.chdir(previous[:directory])
|
|
48
|
+
clear_clean_constants
|
|
49
|
+
previous[:clean].each {|name, value| Object.const_set(name, value) }
|
|
50
|
+
|
|
51
|
+
$LOADED_FEATURES.delete_if {|file| file.end_with?('/rake/clean.rb') } unless previous[:clean_library]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def invalidate_task_metadata
|
|
55
|
+
root = "#{File.dirname(rakefile)}/"
|
|
56
|
+
|
|
57
|
+
self.class.mods.delete_if {|file, _| File.expand_path(file).start_with?(root) }
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Temporarily exposes real task libraries and restores metadata adapters afterward.
|
|
4
|
+
class Baltix::Rake
|
|
5
|
+
# Temporarily exposes real task libraries in place of metadata adapters.
|
|
6
|
+
# @yield executes Rakefile loading and task invocation in the library scope
|
|
7
|
+
# @return [Object] the block's return value
|
|
8
|
+
# Takes no parameters. Adapter constants and autoloads are restored even
|
|
9
|
+
# when the block raises. Previously required real libraries are reused so
|
|
10
|
+
# Ruby's require cache does not leave an adapter active during later runs.
|
|
11
|
+
def self.with_task_libraries
|
|
12
|
+
previous = {}
|
|
13
|
+
libraries = @task_libraries ||= {}
|
|
14
|
+
|
|
15
|
+
Baltix::METADATA_LIBRARIES.each_key {|name| expose_task_library(name, previous, libraries) }
|
|
16
|
+
|
|
17
|
+
yield
|
|
18
|
+
ensure
|
|
19
|
+
restore_task_libraries(previous, libraries)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def self.expose_task_library name, previous, libraries
|
|
23
|
+
snapshot = constant_snapshot(name)
|
|
24
|
+
previous[name] = snapshot
|
|
25
|
+
|
|
26
|
+
return if snapshot.first == :constant && !remember_metadata_adapter?(name, snapshot.last)
|
|
27
|
+
|
|
28
|
+
remove_top_constant(name)
|
|
29
|
+
|
|
30
|
+
Object.const_set(name, libraries[name]) if libraries.key?(name)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def self.constant_snapshot name
|
|
34
|
+
autoload = Object.autoload?(name)
|
|
35
|
+
|
|
36
|
+
return [:autoload, autoload] if autoload
|
|
37
|
+
return [:constant, Object.const_get(name, false)] if Object.const_defined?(name, false)
|
|
38
|
+
|
|
39
|
+
[:absent, nil]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def self.remember_metadata_adapter? name, value
|
|
43
|
+
location = Object.const_source_location(name)&.first
|
|
44
|
+
|
|
45
|
+
return false unless metadata_adapter?(name, value, location, ADAPTER_ROOT)
|
|
46
|
+
|
|
47
|
+
(@metadata_libraries ||= {})[name] = value
|
|
48
|
+
|
|
49
|
+
true
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def self.remove_top_constant name
|
|
53
|
+
Object.send(:remove_const, name) if Object.const_defined?(name, false)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def self.restore_task_libraries previous, libraries
|
|
57
|
+
previous.each do |name, (kind, value)|
|
|
58
|
+
remember_task_library(name, libraries)
|
|
59
|
+
remove_top_constant(name)
|
|
60
|
+
Object.const_set(name, value) if kind == :constant
|
|
61
|
+
Object.autoload(name, value) if kind == :autoload
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def self.remember_task_library name, libraries
|
|
66
|
+
return unless Object.const_defined?(name, false) && !Object.autoload?(name)
|
|
67
|
+
|
|
68
|
+
value = Object.const_get(name, false)
|
|
69
|
+
location = Object.const_source_location(name)&.first
|
|
70
|
+
|
|
71
|
+
libraries[name] = value unless metadata_adapter?(name, value, location, ADAPTER_ROOT)
|
|
72
|
+
end
|
|
73
|
+
end
|
data/lib/baltix/rake.rb
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# used in digest-crc gem as an extension compiler
|
|
2
4
|
#
|
|
3
5
|
require 'baltix/loader'
|
|
4
6
|
|
|
7
|
+
# Runs requested upstream tasks while preserving the caller Rake context.
|
|
5
8
|
class Baltix::Rake
|
|
6
9
|
extend ::Baltix::Loader
|
|
7
10
|
|
|
8
11
|
class InvalidRakefileError < StandardError; end
|
|
9
12
|
|
|
13
|
+
CLEAN_CONSTANTS = %i[CLEAN CLOBBER].freeze
|
|
14
|
+
ADAPTER_ROOT = "#{File.join(__dir__, 'extensions')}/".freeze
|
|
15
|
+
|
|
10
16
|
TYPE = 'Rake::Application'
|
|
11
|
-
PRELOAD_MATCHER = {
|
|
17
|
+
PRELOAD_MATCHER = { %r{/rakefile(.rb)?$}i => :preload }.freeze
|
|
12
18
|
|
|
13
19
|
attr_reader :app, :rakefile, :options
|
|
14
20
|
|
|
@@ -24,29 +30,67 @@ class Baltix::Rake
|
|
|
24
30
|
@tasks ||= @app&.tasks || []
|
|
25
31
|
end
|
|
26
32
|
|
|
33
|
+
# Executes one task using its real build libraries in the current Ruby process.
|
|
34
|
+
# @param task_name [String] task name, optionally carrying the legacy @ marker
|
|
35
|
+
# @return [Array<String>] the executed task name without a legacy marker
|
|
27
36
|
def run_task task_name
|
|
28
|
-
|
|
29
|
-
|
|
37
|
+
run_tasks([task_name])
|
|
38
|
+
end
|
|
30
39
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
# Loads the complete Rakefile and invokes tasks in their requested order.
|
|
41
|
+
# @param task_names [Array<String>] task names, with optional legacy @ markers
|
|
42
|
+
# @param mode [Symbol, nil] :if_defined skips names absent from this Rakefile
|
|
43
|
+
# @return [Array<String>] executed task names, with duplicates removed
|
|
44
|
+
# Legacy markers are stripped without starting a separate Ruby interpreter.
|
|
45
|
+
# Real libraries supply plugin tasks; metadata adapters are restored afterward.
|
|
46
|
+
# Task failures propagate, and the previous Rake application and directory are
|
|
47
|
+
# restored after parallel workers finish, even when a task fails. Metadata imported
|
|
48
|
+
# from the project is invalidated so generated files are seen by later actors.
|
|
49
|
+
# Rake cleaning tasks are reloaded when cached, or required normally otherwise; the
|
|
50
|
+
# caller's CLEAN/CLOBBER lists and cleaning-library require state are restored.
|
|
51
|
+
def run_tasks task_names, mode = nil
|
|
52
|
+
previous = capture_task_context
|
|
53
|
+
names = normalized_task_names(task_names)
|
|
54
|
+
|
|
55
|
+
self.class.with_task_libraries do
|
|
56
|
+
load_task_application(previous[:clean_library])
|
|
57
|
+
names = names.select {|name| @app.lookup(name) } if mode == :if_defined
|
|
58
|
+
invoke_tasks(names)
|
|
34
59
|
end
|
|
35
|
-
|
|
36
|
-
|
|
60
|
+
|
|
61
|
+
names
|
|
62
|
+
ensure
|
|
63
|
+
restore_task_context(previous) if previous
|
|
64
|
+
invalidate_task_metadata
|
|
37
65
|
end
|
|
38
66
|
|
|
67
|
+
private
|
|
68
|
+
|
|
69
|
+
# Creates a Rakefile reader or a deferred task runner.
|
|
70
|
+
# @param rakefile [String] path to an existing Rakefile
|
|
71
|
+
# @param options [Hash] :runtime skips metadata import before task execution
|
|
72
|
+
# @return [Baltix::Rake] the initialized reader or runner
|
|
73
|
+
# Missing files raise InvalidRakefileError. Runtime runners load the actual
|
|
74
|
+
# build libraries when run_tasks is called; other readers retain metadata mode.
|
|
39
75
|
def initialize rakefile, options = {}
|
|
40
|
-
raise
|
|
76
|
+
raise(InvalidRakefileError) unless File.file?(rakefile)
|
|
41
77
|
|
|
42
|
-
@rakefile = rakefile
|
|
78
|
+
@rakefile = File.expand_path(rakefile)
|
|
43
79
|
@options = options
|
|
44
|
-
|
|
80
|
+
|
|
81
|
+
@app = self.class.load(@rakefile).objects.first unless options[:runtime]
|
|
45
82
|
end
|
|
46
83
|
|
|
47
84
|
class << self
|
|
48
|
-
#
|
|
85
|
+
# Clears cached build metadata before a Rakefile is imported.
|
|
86
|
+
# Takes no parameters.
|
|
87
|
+
# @return [nil] the cleared Rake application
|
|
88
|
+
# If the loaded Hoe implementation supports resetting, its project state
|
|
89
|
+
# is cleared too.
|
|
90
|
+
# An unused Hoe autoload is left untouched.
|
|
49
91
|
def preload
|
|
92
|
+
::Hoe.reset if Object.const_defined?(:Hoe) && !Object.autoload?(:Hoe) && ::Hoe.respond_to?(:reset)
|
|
93
|
+
|
|
50
94
|
Rake.instance_variable_set(:@application, nil)
|
|
51
95
|
end
|
|
52
96
|
|
|
@@ -55,3 +99,9 @@ class Baltix::Rake
|
|
|
55
99
|
end
|
|
56
100
|
end
|
|
57
101
|
end
|
|
102
|
+
|
|
103
|
+
require 'baltix/rake/task_context'
|
|
104
|
+
|
|
105
|
+
require 'baltix/rake/task_libraries'
|
|
106
|
+
|
|
107
|
+
require 'baltix/rake/metadata_adapter'
|