platform/osx/build/osx.rake in rhodes-3.2.3 vs platform/osx/build/osx.rake in rhodes-3.3.0.beta.1

- old
+ new

@@ -35,18 +35,69 @@ $name_tool = "install_name_tool" $move = "mv" $remove = "rm" $qt_project_dir = File.join( $startdir, 'platform/shared/qt/' ) $build_dir = File.join( $startdir, 'platform/osx/bin/' ) + $devroot = '/Developer' if $devroot.nil? + $xcodebuild = $devroot + "/usr/bin/xcodebuild" + $sdkroot = "/" end end namespace "build" do namespace "osx" do + + task :extensions => "config:osx" do + ENV['RHO_PLATFORM'] = 'osx' + ENV["PLATFORM_DEVELOPER_BIN_DIR"] = "/usr/bin" + ENV["SDKROOT"] = $sdkroot + ENV['PWD'] = $startdir + ENV['RHO_ROOT'] = ENV['PWD'] + ENV['TARGET_TEMP_DIR'] = File.join(ENV['PWD'], "platform", "osx", "bin", "extensions") + ENV["BUILD_DIR"] = File.join(ENV['PWD'], "platform", "osx", "bin", "RhoSimulator", "tmp") + ENV["ARCHS"] = "x86_64 -g -gdwarf-2 -Xarch_x86_64 -mmacosx-version-min=10.5 -DRHODES_EMULATOR" + ENV["RHO_ROOT"] = $startdir + + ENV["XCODEBUILD"] = $xcodebuild + ENV["CONFIGURATION"] ||= $configuration + ENV["SDK_NAME"] ||= $sdk + + $app_config["extensions"].each do |ext| + $app_config["extpaths"].each do |p| + extpath = File.join(p, ext, 'ext') + next unless File.exists? File.join(extpath, "build") + ENV['TEMP_FILES_DIR'] = File.join(ENV['PWD'], "platform", "osx", "bin", "extensions", ext) + $extensions_lib << " -l#{ext}" + $pre_targetdeps << " ../../../osx/bin/extensions/lib#{ext}.a" + puts Jake.run('./build', [], extpath) + exit 1 unless $? == 0 + end + end + end + task :rhosimulator => ["config:set_osx_platform", "config:osx", "config:qt"] do + $rhosimulator_build = true + $config["platform"] = $current_platform + chdir $startdir + $extensions_lib = '' + $pre_targetdeps = '' + init_extensions(pwd, nil) + Rake::Task["build:osx:extensions"].invoke + + if $extensions_lib.length > 0 + File.open(File.join($startdir, 'platform/osx/bin/extensions/extensions.pri'), "wb") do |fextensions| + fextensions.write(%{SOURCES += ../../ruby/ext/rho/extensions.c +LIBS += -L../../../osx/bin/extensions#{$extensions_lib} +PRE_TARGETDEPS += #{$pre_targetdeps} +}) + end + else + Jake.run($remove,['-Rf', File.join($startdir, 'platform/osx/bin/extensions')]) + end + app_path = File.join( $build_dir, 'RhoSimulator/RhoSimulator.app' ) - puts Jake.run($remove,['-R', app_path ]) + puts Jake.run($remove,['-Rf', app_path ]) File.open(File.join($startdir, 'platform/shared/qt/rhodes/resources/Info.plist'), "wb") do |fversion| fversion.write( %{<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"> <plist version="0.9"> @@ -92,15 +143,15 @@ args = [ '-change', fw_path[0] + lib + fw_path[1] + '/' + lib, fw_path[0] + lib + fw_path[2] + '/' + lib, exe_path] puts Jake.run($name_tool,args) } # end of the depricated macdeployqt fix code - puts Jake.run($remove,['-R', File.join(frm_path, 'QtDeclarative.framework' )]) - puts Jake.run($remove,['-R', File.join(frm_path, 'QtOpenGL.framework' )]) - puts Jake.run($remove,['-R', File.join(frm_path, 'QtScript.framework' )]) - puts Jake.run($remove,['-R', File.join(frm_path, 'QtSql.framework' )]) - puts Jake.run($remove,['-R', File.join(frm_path, 'QtSvg.framework' )]) - puts Jake.run($remove,['-R', File.join(frm_path, 'QtXmlPatterns.framework' )]) + puts Jake.run($remove,['-Rf', File.join(frm_path, 'QtDeclarative.framework' )]) + puts Jake.run($remove,['-Rf', File.join(frm_path, 'QtOpenGL.framework' )]) + puts Jake.run($remove,['-Rf', File.join(frm_path, 'QtScript.framework' )]) + puts Jake.run($remove,['-Rf', File.join(frm_path, 'QtSql.framework' )]) + puts Jake.run($remove,['-Rf', File.join(frm_path, 'QtSvg.framework' )]) + puts Jake.run($remove,['-Rf', File.join(frm_path, 'QtXmlPatterns.framework' )]) chdir $qt_project_dir puts Jake.run($make, ['clean']) end end