Class: BuildTool::BuildSystem::Custom
- Includes:
- MJ::Tools::SubProcess
- Defined in:
- lib/build-tool/build-system/custom.rb
Overview
Custom Build system.
Uses scripts do to the actual work.
Defined Under Namespace
Classes: CustomError
Instance Attribute Summary
Attributes inherited from Base
#defaults, #feature, #module, #out_of_source
Instance Method Summary collapse
- #configure ⇒ Object
-
#configured? ⇒ Boolean
Check if the module is configured.
- #execute(script) ⇒ Object
-
#initialize(*args) ⇒ Custom
constructor
A new instance of Custom.
- #install(fast) ⇒ Object
- #install_fast_supported? ⇒ Boolean
- #make(target = nil) ⇒ Object
- #name ⇒ Object
- #option_string ⇒ Object
-
#reconfigure ⇒ Object
Configure the module.
Methods inherited from Base
#[], #[]=, #active?, #after_rebase, #append, #build_directory, #check_build_directory, #check_install_prefix, #dup, #env, #install_prefix, #option_hash, #option_names, #option_set?, #parent, #prepare_for_installation, #prepend, #progressbar, #recipe, #remove_build_directory, #set, #source_directory, #to_s
Constructor Details
#initialize(*args) ⇒ Custom
Returns a new instance of Custom.
18 19 20 |
# File 'lib/build-tool/build-system/custom.rb', line 18 def initialize( *args ) super( *args ) end |
Instance Method Details
#configure ⇒ Object
43 44 45 46 |
# File 'lib/build-tool/build-system/custom.rb', line 43 def configure check_build_directory( true ) execute( "configure.sh" ) end |
#configured? ⇒ Boolean
Check if the module is configured
27 28 |
# File 'lib/build-tool/build-system/custom.rb', line 27 def configured? end |
#execute(script) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/build-tool/build-system/custom.rb', line 48 def execute( script ) path = self.recipe.find_first_config_file( "custom/%s/%s" % [ self.module.name, script.to_s ] ) if path.nil? raise CustomError, "Script configure.sh for %s not found!" % self.module.name end if !path.executable? raise CustomError, "Script %s not executable!" % path.to_s end command = "%s %s" % [ path.to_s, source_directory ] rc = self.module.environment.execute( command, build_directory, { 'INSTALL_PREFIX' => install_prefix.to_s, }.merge(Hash[option_hash])) if rc != 0 raise CustomError, "#{command.to_s} failed with error code #{rc}"; end end |
#install(fast) ⇒ Object
68 69 70 |
# File 'lib/build-tool/build-system/custom.rb', line 68 def install( fast ) execute( "install.sh" ) end |
#install_fast_supported? ⇒ Boolean
72 73 74 |
# File 'lib/build-tool/build-system/custom.rb', line 72 def install_fast_supported? false end |
#make(target = nil) ⇒ Object
76 77 78 |
# File 'lib/build-tool/build-system/custom.rb', line 76 def make( target = nil ) execute( "compile.sh" ) end |
#name ⇒ Object
30 31 32 |
# File 'lib/build-tool/build-system/custom.rb', line 30 def name "custom" end |
#option_string ⇒ Object
80 81 82 83 84 85 86 87 |
# File 'lib/build-tool/build-system/custom.rb', line 80 def option_string arr = [] option_names.each do |var| val = self[var] arr << "-D#{var}='#{val}'" end arr.join(" ") end |
#reconfigure ⇒ Object
Configure the module
39 40 41 |
# File 'lib/build-tool/build-system/custom.rb', line 39 def reconfigure() raise NotImplementedError end |