Permalink
Browse files

Various changes to clean out cruft and get rid of annoying behaviour:

* GHUnit is no longer included as a git submodule. Instead, build scripts are used to fetch a pre-compiled GHUnit framework if one does not exist in External/GHUnit.
* iPhone sample has moved to using the framework rather than the static library for GHUnit
* Fiddle with conditional compilation for NSXMLParserDelegate
* Tweak the build phases to move running the scripts earlier
* Fix a clang warning that crept in as part of the recent changes to behaviour for fetching PAC files
* Remove legacy clang.sh script
* Move build scripts into their own folder
  • Loading branch information...
1 parent 0309737 commit bf03acff85fd215cb8ebe84cbb544f91f6012cb2 @pokeb pokeb committed Feb 5, 2011
View
@@ -9,3 +9,4 @@ build
profile
*.pbxuser
*.mode1v3
+External/GHUnit/*
View
@@ -1,3 +0,0 @@
-[submodule "External/GHUnit"]
- path = External/GHUnit
- url = git://github.com/gabriel/gh-unit.git
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+
+# This script fetches a pre-compiled copy of the iOS GHUnit.framework, if one isn't already in the External/GHUnit folder
+# This replaces the old system, where GHUnit was included as a git submodule, because:
+# a) git submodules confuse people (including me)
+# b) GHUnit seems to be tricky to build without warnings
+# The pre-compiled frameworks on allseeing-i.com were taken directly from those on the GHUnit downloads page on GitHub
+# If you'd rather build GHUnit yourself, simply grab a copy from http://github.com/gabriel/gh-unit and drop your built framework into External/GHUnit
+
+require 'net/http'
+if (!File.exists?('External/GHUnit/GHUnitIOS.framework'))
+ `curl -s http://allseeing-i.com/ASIHTTPRequest/GHUnit/GHUnit-IOS.zip > External/GHUnit/GHUnit-IOS.zip`
+ `unzip External/GHUnit/GHUnit-IOS.zip -d External/GHUnit/ & rm External/GHUnit/GHUnit-IOS.zip`
+end
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+
+# This script fetches a pre-compiled copy of the Mac GHUnit.framework, if one isn't already in the External/GHUnit folder
+# This replaces the old system, where GHUnit was included as a git submodule, because:
+# a) git submodules confuse people (including me)
+# b) GHUnit seems to be tricky to build without warnings
+# The pre-compiled frameworks on allseeing-i.com were taken directly from those on the GHUnit downloads page on GitHub
+# If you'd rather build GHUnit yourself, simply grab a copy from http://github.com/gabriel/gh-unit and drop your built framework into External/GHUnit
+
+require 'net/http'
+if (!File.exists?('External/GHUnit/GHUnit.framework'))
+ `curl -s http://allseeing-i.com/ASIHTTPRequest/GHUnit/GHUnit-Mac.zip > External/GHUnit/GHUnit-Mac.zip`
+ `unzip External/GHUnit/GHUnit-Mac.zip -d External/GHUnit/ & rm External/GHUnit/GHUnit-Mac.zip`
+end
File renamed without changes.
View
@@ -24,7 +24,7 @@
#import "ASIDataCompressor.h"
// Automatically set on build
-NSString *ASIHTTPRequestVersion = @"v1.8-49 2011-02-05";
+NSString *ASIHTTPRequestVersion = @"v1.8-50 2011-02-05";
NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain";
@@ -3684,7 +3684,7 @@ - (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode
}
// If your PAC file is larger than 16KB, you're just being cruel.
uint8_t buf[16384];
- unsigned int len = [(NSInputStream *)stream read:buf maxLength:16384];
+ NSInteger len = [(NSInputStream *)stream read:buf maxLength:16384];
if (len) {
[[self PACFileData] appendBytes:(const void *)buf length:len];
}
@@ -8,7 +8,7 @@
//
-#if !TARGET_OS_IPHONE || (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED <= __IPHONE_4_0)
+#if (!TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MAX_ALLOWED < __MAC_10_6) || (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED <= __IPHONE_4_0)
@protocol NSXMLParserDelegate
@optional
@@ -9,7 +9,7 @@
#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
-#import "GHUnit.h"
+#import <GHUnitIOS/GHUnit.h>
#else
#import <GHUnit/GHUnit.h>
#endif
Submodule GHUnit deleted from ffb517
@@ -10,7 +10,6 @@
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
B502441B1025D36B002B13E1 /* ProxyTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B502441A1025D36B002B13E1 /* ProxyTests.m */; };
B50C17DB121C254D0055FCAB /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B50C17DA121C254D0055FCAB /* Security.framework */; };
- B50FDEAA115A325E00BBC736 /* GHUnit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B5DB497C115624BF0062DB57 /* GHUnit.framework */; };
B51A1A9511DDF84700ED75CF /* ASIDownloadCacheTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B51A1A9411DDF84700ED75CF /* ASIDownloadCacheTests.m */; };
B522D71F103074AC009A2D22 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B522D71E103074AC009A2D22 /* ASIInputStream.m */; };
B522D720103074AC009A2D22 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B522D71E103074AC009A2D22 /* ASIInputStream.m */; };
@@ -61,42 +60,17 @@
B5873FA410FF2890001E145F /* ASICloudFilesRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F9D10FF2890001E145F /* ASICloudFilesRequest.m */; };
B587400810FF2913001E145F /* ASICloudFilesRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B587400610FF2913001E145F /* ASICloudFilesRequestTests.m */; };
B5B513860FBEE515002C74D0 /* GHUnitTestMain.m in Sources */ = {isa = PBXBuildFile; fileRef = B5B513850FBEE515002C74D0 /* GHUnitTestMain.m */; };
+ B5BF64E612FDE9CA00CBC324 /* GHUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5BF64E512FDE9C900CBC324 /* GHUnit.framework */; };
B5C664BC100A6220004F3C96 /* ASIS3RequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B5C664BB100A6220004F3C96 /* ASIS3RequestTests.m */; };
- B5DB49CA115627300062DB57 /* GHUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5DB497C115624BF0062DB57 /* GHUnit.framework */; };
/* End PBXBuildFile section */
-/* Begin PBXContainerItemProxy section */
- B5DB497B115624BF0062DB57 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = B5DB4976115624BF0062DB57 /* GHUnit.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = 8DC2EF5B0486A6940098B216;
- remoteInfo = GHUnit;
- };
- B5DB497D115624BF0062DB57 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = B5DB4976115624BF0062DB57 /* GHUnit.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = 002E73B60F2C213700427636;
- remoteInfo = Tests;
- };
- B5DB4981115624C60062DB57 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = B5DB4976115624BF0062DB57 /* GHUnit.xcodeproj */;
- proxyType = 1;
- remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
- remoteInfo = GHUnit;
- };
-/* End PBXContainerItemProxy section */
-
/* Begin PBXCopyFilesBuildPhase section */
B5B513820FBEE477002C74D0 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
- B50FDEAA115A325E00BBC736 /* GHUnit.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -195,9 +169,9 @@
B587400710FF2913001E145F /* ASICloudFilesRequestTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASICloudFilesRequestTests.h; sourceTree = "<group>"; };
B5B513850FBEE515002C74D0 /* GHUnitTestMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GHUnitTestMain.m; sourceTree = "<group>"; };
B5BD2BE611CA5EBC00D7C426 /* ASINSXMLParserCompat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASINSXMLParserCompat.h; path = Classes/S3/ASINSXMLParserCompat.h; sourceTree = SOURCE_ROOT; };
+ B5BF64E512FDE9C900CBC324 /* GHUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GHUnit.framework; path = External/GHUnit/GHUnit.framework; sourceTree = "<group>"; };
B5C664BA100A6220004F3C96 /* ASIS3RequestTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIS3RequestTests.h; sourceTree = "<group>"; };
B5C664BB100A6220004F3C96 /* ASIS3RequestTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIS3RequestTests.m; sourceTree = "<group>"; };
- B5DB4976115624BF0062DB57 /* GHUnit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GHUnit.xcodeproj; path = External/GHUnit/Project/GHUnit.xcodeproj; sourceTree = "<group>"; };
B5E3858B0F76606B00FD7857 /* Tests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "Tests-Info.plist"; path = "Mac Sample/Tests-Info.plist"; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -218,11 +192,11 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- B5DB49CA115627300062DB57 /* GHUnit.framework in Frameworks */,
B55B60140F7659A30064029C /* libz.1.2.3.dylib in Frameworks */,
B522DE601031BB03009A2D22 /* SystemConfiguration.framework in Frameworks */,
B50C17DB121C254D0055FCAB /* Security.framework in Frameworks */,
B53E62DC1255F6FC00C1E79A /* libxml2.dylib in Frameworks */,
+ B5BF64E612FDE9CA00CBC324 /* GHUnit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -232,8 +206,8 @@
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
- B5DB4976115624BF0062DB57 /* GHUnit.xcodeproj */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
+ B5BF64E512FDE9C900CBC324 /* GHUnit.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
@@ -420,26 +394,17 @@
path = CloudFiles;
sourceTree = "<group>";
};
- B5DB4977115624BF0062DB57 /* Products */ = {
- isa = PBXGroup;
- children = (
- B5DB497C115624BF0062DB57 /* GHUnit.framework */,
- B5DB497E115624BF0062DB57 /* Tests.app */,
- );
- name = Products;
- sourceTree = "<group>";
- };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8D1107260486CEB800E47090 /* Mac */ = {
isa = PBXNativeTarget;
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Mac" */;
buildPhases = (
+ B52D48FA10DA3FF4008E8365 /* ShellScript */,
8D1107290486CEB800E47090 /* Resources */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
- B52D48FA10DA3FF4008E8365 /* ShellScript */,
);
buildRules = (
);
@@ -455,16 +420,15 @@
isa = PBXNativeTarget;
buildConfigurationList = B55B5EE40F7658C80064029C /* Build configuration list for PBXNativeTarget "Unit Tests (GHUnit)" */;
buildPhases = (
+ B52D490910DA4009008E8365 /* ShellScript */,
B55B5EDB0F7658C70064029C /* Resources */,
B55B5EDC0F7658C70064029C /* Sources */,
B55B5EDD0F7658C70064029C /* Frameworks */,
B5B513820FBEE477002C74D0 /* CopyFiles */,
- B52D490910DA4009008E8365 /* ShellScript */,
);
buildRules = (
);
dependencies = (
- B5DB4982115624C60062DB57 /* PBXTargetDependency */,
);
name = "Unit Tests (GHUnit)";
productName = "Unit Tests (GHUnit)";
@@ -488,12 +452,6 @@
);
mainGroup = 29B97314FDCFA39411CA2CEA /* Mac */;
projectDirPath = "";
- projectReferences = (
- {
- ProductGroup = B5DB4977115624BF0062DB57 /* Products */;
- ProjectRef = B5DB4976115624BF0062DB57 /* GHUnit.xcodeproj */;
- },
- );
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* Mac */,
@@ -502,23 +460,6 @@
};
/* End PBXProject section */
-/* Begin PBXReferenceProxy section */
- B5DB497C115624BF0062DB57 /* GHUnit.framework */ = {
- isa = PBXReferenceProxy;
- fileType = wrapper.framework;
- path = GHUnit.framework;
- remoteRef = B5DB497B115624BF0062DB57 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- B5DB497E115624BF0062DB57 /* Tests.app */ = {
- isa = PBXReferenceProxy;
- fileType = wrapper.application;
- path = Tests.app;
- remoteRef = B5DB497D115624BF0062DB57 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
-/* End PBXReferenceProxy section */
-
/* Begin PBXResourcesBuildPhase section */
8D1107290486CEB800E47090 /* Resources */ = {
isa = PBXResourcesBuildPhase;
@@ -549,7 +490,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = ./set_version_number.rb;
+ shellScript = "./Build\\ Scripts/set_version_number.rb";
};
B52D490910DA4009008E8365 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@@ -562,7 +503,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = ./set_version_number.rb;
+ shellScript = "./Build\\ Scripts/set_version_number.rb\n./Build\\ Scripts/fetch_mac_ghunit.rb";
};
/* End PBXShellScriptBuildPhase section */
@@ -627,14 +568,6 @@
};
/* End PBXSourcesBuildPhase section */
-/* Begin PBXTargetDependency section */
- B5DB4982115624C60062DB57 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- name = GHUnit;
- targetProxy = B5DB4981115624C60062DB57 /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
/* Begin PBXVariantGroup section */
B55B5E730F7656DA0064029C /* MainMenu.xib */ = {
isa = PBXVariantGroup;
@@ -662,7 +595,10 @@
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COPY_PHASE_STRIP = NO;
- FRAMEWORK_SEARCH_PATHS = "External/GHUnit/**";
+ FRAMEWORK_SEARCH_PATHS = (
+ "External/GHUnit/**",
+ "\"$(SRCROOT)/External/GHUnit\"",
+ );
GCC_C_LANGUAGE_STANDARD = "compiler-default";
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
@@ -685,7 +621,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = "Unit Tests (GHUnit)";
- SDKROOT = macosx10.5;
+ SDKROOT = macosx;
};
name = Debug;
};
@@ -697,7 +633,10 @@
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- FRAMEWORK_SEARCH_PATHS = "External/GHUnit/**";
+ FRAMEWORK_SEARCH_PATHS = (
+ "External/GHUnit/**",
+ "\"$(SRCROOT)/External/GHUnit\"",
+ );
GCC_C_LANGUAGE_STANDARD = "compiler-default";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_MODEL_TUNING = G5;
@@ -716,7 +655,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = "Unit Tests (GHUnit)";
- SDKROOT = macosx10.5;
+ SDKROOT = macosx;
ZERO_LINK = NO;
};
name = Release;
@@ -742,7 +681,7 @@
INSTALL_PATH = "$(HOME)/Applications";
MACOSX_DEPLOYMENT_TARGET = 10.5;
PRODUCT_NAME = Mac;
- SDKROOT = macosx10.5;
+ SDKROOT = macosx;
};
name = Debug;
};
@@ -763,7 +702,7 @@
INSTALL_PATH = "$(HOME)/Applications";
MACOSX_DEPLOYMENT_TARGET = 10.5;
PRODUCT_NAME = Mac;
- SDKROOT = macosx10.5;
+ SDKROOT = macosx;
};
name = Release;
};
View
@@ -1,3 +0,0 @@
-#!/bin/sh
-scan-build xcodebuild -target iPhone -configuration Debug -project iPhone.xcodeproj -sdk iphonesimulator2.2.1
-scan-build xcodebuild -target Mac -configuration Debug -project Mac.xcodeproj
Oops, something went wrong.

0 comments on commit bf03acf

Please sign in to comment.