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, #remove_source_directory, #set, #source_directory, #to_s
Constructor Details
#initialize(*args) ⇒ Custom
Returns a new instance of Custom.
20 21 22 |
# File 'lib/build-tool/build-system/custom.rb', line 20 def initialize( *args ) super( *args ) end |
Instance Method Details
#configure ⇒ Object
45 46 47 48 |
# File 'lib/build-tool/build-system/custom.rb', line 45 def configure check_build_directory( true ) execute( "configure.sh" ) end |
#configured? ⇒ Boolean
Check if the module is configured
29 30 |
# File 'lib/build-tool/build-system/custom.rb', line 29 def configured? end |
#execute(script) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/build-tool/build-system/custom.rb', line 50 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
70 71 72 |
# File 'lib/build-tool/build-system/custom.rb', line 70 def install( fast ) execute( "install.sh" ) end |
#install_fast_supported? ⇒ Boolean
74 75 76 |
# File 'lib/build-tool/build-system/custom.rb', line 74 def install_fast_supported? false end |
#make(target = nil) ⇒ Object
78 79 80 |
# File 'lib/build-tool/build-system/custom.rb', line 78 def make( target = nil ) execute( "compile.sh" ) end |
#name ⇒ Object
32 33 34 |
# File 'lib/build-tool/build-system/custom.rb', line 32 def name "custom" end |
#option_string ⇒ Object
82 83 84 85 86 87 88 89 |
# File 'lib/build-tool/build-system/custom.rb', line 82 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
41 42 43 |
# File 'lib/build-tool/build-system/custom.rb', line 41 def reconfigure() raise NotImplementedError end |