Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
rhodes-core: common app_bootstrap.rake to omit execution of app-speci…
…fic Rakefile
- Loading branch information
1 parent
5b3197d
commit e0f5ebd
Showing
4 changed files
with
87 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require 'fileutils' | ||
include FileUtils | ||
|
||
#mv File.dirname(__FILE__) +"/../rakefile.rb", File.dirname(__FILE__) +"/../Rakefile" | ||
|
||
cp File.dirname(__FILE__) +"/../rhobuild.yml.example", File.dirname(__FILE__) +"/../rhobuild.yml" unless File.exists? File.dirname(__FILE__) +"/../rhobuild.yml" | ||
|
||
#hack upon hack. Since build files are modified, all the files need to be writable. | ||
#Only because iphone sim doesn work if you run it with sudo | ||
chmod_R 0777, File.dirname(__FILE__) + "/.." | ||
|
||
=begin | ||
File.chmod 0755, File.dirname(__FILE__) + "/../bin/get-rhodes-info" | ||
File.chmod 0755, File.dirname(__FILE__) + "/../bin/migrate-rhodes-app" | ||
File.chmod 0755, File.dirname(__FILE__) + "/../bin/rhodes" | ||
File.chmod 0755, File.dirname(__FILE__) + "/../bin/rhodes-setup" | ||
File.chmod 0755, File.dirname(__FILE__) + "/../bin/rhogen" | ||
File.chmod 0755, File.dirname(__FILE__) + "/../bin/set-rhodes-sdk" | ||
File.chmod 0755, File.dirname(__FILE__) + "/../bin/upgrade-rhodes-app" | ||
=end | ||
|
||
#This is the hack, we make all the things to make it look like an extension has compiled | ||
|
||
File.open('Makefile', 'w') { |f| f.write "all:\n\ninstall:\n\n" } | ||
File.open('make', 'w') do |f| | ||
f.write '#!/bin/sh' | ||
f.chmod f.stat.mode | 0111 | ||
end | ||
File.open('rhodes_postinstallhack' + '.so', 'w') { |f| f.chmod 0777} | ||
File.open('rhodes_postinstallhack' + '.dll', 'w') { |f| f.chmod 0777} | ||
File.open('nmake.bat', 'w') { |f| f.write "ECHO \"Done\"" | ||
f.chmod 0777} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
require 'yaml' | ||
|
||
unless File.exists? "build.yml" | ||
puts "Cannot find build.yml" | ||
exit 1 | ||
end | ||
|
||
$app_config = YAML::load_file("build.yml") | ||
$app_path = Dir.getwd | ||
|
||
if ENV["RHO_HOME"].nil? | ||
if $app_config["sdk"] | ||
rakefilepath = File.join(File.expand_path($app_config['sdk']), 'Rakefile') | ||
else | ||
begin | ||
rakefilepath = File.expand_path( File.join(File.dirname(__FILE__), '..', '..', 'Rakefile' ) ) | ||
rescue | ||
rakefilepath = "" | ||
end | ||
end | ||
else | ||
rakefilepath = "#{ENV["RHO_HOME"]}/Rakefile" | ||
end | ||
|
||
unless File.exists? rakefilepath | ||
puts "\nCannot find your Rhodes gem or source path: #{rakefilepath}" | ||
puts "\nIf you have the sdk on your path or have installed the gem this" | ||
puts "can be resolved by running 'set-rhodes-sdk'" | ||
puts "\nYou can also set this manually by modifying your build.yml or" | ||
puts "setting the environment variable RHO_HOME" | ||
exit 1 | ||
end | ||
|
||
load rakefilepath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters