From 4f809213e2b09281edb0fae2bac903ffd4433e31 Mon Sep 17 00:00:00 2001 From: Watson Date: Tue, 18 Nov 2014 09:49:58 +0900 Subject: [PATCH] [RM-651] allow to run rake task other than `build' in Extension/Framework project http://hipbyte.myjetbrains.com/youtrack/issue/RM-651 --- NEWS | 2 ++ lib/motion/project/template/ios-extension-builder.rb | 4 ++++ lib/motion/project/template/ios-extension.rb | 4 ---- lib/motion/project/template/ios-framework.rb | 4 ---- lib/motion/project/template/ios-framework/builder.rb | 4 ++++ 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 2bbf0b58..9a99715f 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,8 @@ will fail with crash. * [iOS] Fixed a bug where #tap and #rotate_device cause a crash when it run `rake spec' with x86_64. + * [iOS] Fixed a bug where all rake task could not be ran in root directory of + Extension/Framework. So, CocoaPods libraries cannot be installed. * Fixed a bug where wrong Boxed object will be returned from Objective-C method. * Fixed the `motion support' command invocation to print both the stable and pre-release versions of RubyMotion. diff --git a/lib/motion/project/template/ios-extension-builder.rb b/lib/motion/project/template/ios-extension-builder.rb index fe31f0f6..2416275a 100644 --- a/lib/motion/project/template/ios-extension-builder.rb +++ b/lib/motion/project/template/ios-extension-builder.rb @@ -75,6 +75,10 @@ PLIST end def build(config, platform, opts) + unless ENV['RM_TARGET_BUILD'] + App.fail "Extension targets must be built from an application project" + end + @host_app_dir = ENV['RM_TARGET_HOST_APP_PATH'] config.sdk_version = ENV['RM_TARGET_SDK_VERSION'] if ENV['RM_TARGET_SDK_VERSION'] config.deployment_target = ENV['RM_TARGET_DEPLOYMENT_TARGET'] if ENV['RM_TARGET_DEPLOYMENT_TARGET'] diff --git a/lib/motion/project/template/ios-extension.rb b/lib/motion/project/template/ios-extension.rb index f1e725cb..1c463687 100644 --- a/lib/motion/project/template/ios-extension.rb +++ b/lib/motion/project/template/ios-extension.rb @@ -29,10 +29,6 @@ require 'motion/util/version' App = Motion::Project::App App.template = :'ios-extension' -unless ENV['RM_TARGET_BUILD'] - App.fail "Extension targets must be built from an application project" -end - require 'motion/project' require 'motion/project/template/ios-extension-config' require 'motion/project/template/ios-extension-builder' diff --git a/lib/motion/project/template/ios-framework.rb b/lib/motion/project/template/ios-framework.rb index 816348d7..b6b6f37c 100644 --- a/lib/motion/project/template/ios-framework.rb +++ b/lib/motion/project/template/ios-framework.rb @@ -29,10 +29,6 @@ require 'motion/util/version' App = Motion::Project::App App.template = :'ios-framework' -unless ENV['RM_TARGET_BUILD'] - App.fail "Framework targets must be built from an application project" -end - require 'motion/project' require 'motion/project/template/ios-framework/config' require 'motion/project/template/ios-framework/builder' diff --git a/lib/motion/project/template/ios-framework/builder.rb b/lib/motion/project/template/ios-framework/builder.rb index b788eed0..2dcbba22 100644 --- a/lib/motion/project/template/ios-framework/builder.rb +++ b/lib/motion/project/template/ios-framework/builder.rb @@ -28,6 +28,10 @@ require 'motion/project/builder' module Motion; module Project class Builder def build(config, platform, opts) + unless ENV['RM_TARGET_BUILD'] + App.fail "Framework targets must be built from an application project" + end + @host_app_dir = ENV['RM_TARGET_HOST_APP_PATH'] config.sdk_version = ENV['RM_TARGET_SDK_VERSION'] if ENV['RM_TARGET_SDK_VERSION'] config.deployment_target = ENV['RM_TARGET_DEPLOYMENT_TARGET'] if ENV['RM_TARGET_DEPLOYMENT_TARGET']