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']