mirror of
https://github.com/zhigang1992/synx.git
synced 2026-04-28 20:55:19 +08:00
Test that build settings are changed accordingly
This commit is contained in:
@@ -44,7 +44,7 @@ module Xcodeproj
|
||||
# Fixes things like pch, info.plist references being changed
|
||||
def change_build_settings_reference
|
||||
return unless basename =~ /\.(pch|plist)$/
|
||||
|
||||
|
||||
project.targets.each do |t|
|
||||
t.each_build_settings do |bs|
|
||||
["INFOPLIST_FILE", "GCC_PREFIX_HEADER"].each do |setting_key|
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
8C848C63190DB9B300E9727B /* dummyTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "dummyTests-Info.plist"; sourceTree = "<group>"; };
|
||||
8C848C65190DB9B300E9727B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
8C848C67190DB9B300E9727B /* dummyTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = dummyTests.m; sourceTree = "<group>"; };
|
||||
8CE2DA1D19220F7B00D06F5E /* dummyTests-prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "dummyTests-prefix.pch"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -204,6 +205,7 @@
|
||||
children = (
|
||||
8C848C63190DB9B300E9727B /* dummyTests-Info.plist */,
|
||||
8C848C64190DB9B300E9727B /* InfoPlist.strings */,
|
||||
8CE2DA1D19220F7B00D06F5E /* dummyTests-prefix.pch */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
@@ -430,7 +432,7 @@
|
||||
"$(DEVELOPER_FRAMEWORKS_DIR)",
|
||||
);
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "dummy/dummy-Prefix.pch";
|
||||
GCC_PREFIX_HEADER = "dummyTests/Supporting Files/dummyTests-Prefix.pch";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
@@ -450,7 +452,7 @@
|
||||
"$(DEVELOPER_FRAMEWORKS_DIR)",
|
||||
);
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "dummy/dummy-Prefix.pch";
|
||||
GCC_PREFIX_HEADER = "dummyTests/Supporting Files/dummyTests-Prefix.pch";
|
||||
INFOPLIST_FILE = "dummyTests/dummyTests-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = xctest;
|
||||
|
||||
15
spec/dummy/dummyTests/dummyTests-prefix.pch
Normal file
15
spec/dummy/dummyTests/dummyTests-prefix.pch
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// dummyTests-prefix.pch
|
||||
// dummy
|
||||
//
|
||||
// Created by Mark Larsen on 5/13/14.
|
||||
// Copyright (c) 2014 marklarr. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef dummy_dummyTests_prefix_pch
|
||||
#define dummy_dummyTests_prefix_pch
|
||||
|
||||
// Include any system framework and library headers here that should be included in all compilation units.
|
||||
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
|
||||
|
||||
#endif
|
||||
@@ -33,5 +33,6 @@ dummyTests:
|
||||
Supporting Files:
|
||||
en.lproj:
|
||||
InfoPlist.strings:
|
||||
dummyTests-Prefix.pch:
|
||||
dummyTests-Info.plist:
|
||||
dummyTests.m:
|
||||
|
||||
@@ -29,5 +29,6 @@ dummy:
|
||||
dummyTests:
|
||||
Supporting Files:
|
||||
InfoPlist.strings:
|
||||
dummyTests-Prefix.pch:
|
||||
dummyTests-Info.plist:
|
||||
dummyTests.m:
|
||||
|
||||
@@ -69,6 +69,17 @@ describe Synxronize::Project do
|
||||
end
|
||||
|
||||
it "should have updated the pch and info.plist build setting paths" do
|
||||
# dummy target
|
||||
DUMMY_SYNX_TEST_PROJECT.targets.first.each_build_settings do |bs|
|
||||
expect(bs["GCC_PREFIX_HEADER"]).to eq("dummy/Supporting Files/dummy-Prefix.pch")
|
||||
expect(bs["INFOPLIST_FILE"]).to be_nil
|
||||
end
|
||||
|
||||
# dummyTests target
|
||||
DUMMY_SYNX_TEST_PROJECT.targets.last.each_build_settings do |bs|
|
||||
expect(bs["GCC_PREFIX_HEADER"]).to eq("dummyTests/Supporting Files/dummyTests-Prefix.pch")
|
||||
expect(bs["INFOPLIST_FILE"]).to eq("dummyTests/Supporting Files/dummyTests-Info.plist")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user