Permalink
Browse files

Added static library targets for Mac and iOS platforms. Added a build…

… Rakefile. Reorganized directory layout. Updated readme.
  • Loading branch information...
1 parent 4564fd8 commit b673e626ca4e41bb343fdbbf8a0d199ef821fe48 @petejkim petejkim committed Jun 23, 2011
Showing with 654 additions and 306 deletions.
  1. +582 −263 Expecta.xcodeproj/project.pbxproj
  2. +9 −2 README.md
  3. +42 −0 Rakefile
  4. +0 −28 boilerplate/Expecta-Info.plist
  5. +0 −3 boilerplate/Expecta-Prefix.pch
  6. +0 −4 boilerplate/ExpectaTests-Prefix.pch
  7. +0 −5 boilerplate/main.m
  8. +5 −0 products/.gitignore
  9. +3 −0 src/Expecta-Prefix.pch
  10. +6 −0 src/Expecta.h
  11. +3 −0 src/NSValue+Expecta.m
  12. 0 src/{Matchers → matchers}/EXMatcherHelpers.h
  13. 0 src/{Matchers → matchers}/EXMatcherHelpers.m
  14. 0 src/{Matchers → matchers}/EXMatchers+toBeFalsy.h
  15. 0 src/{Matchers → matchers}/EXMatchers+toBeFalsy.m
  16. 0 src/{Matchers → matchers}/EXMatchers+toBeInstanceOf.h
  17. 0 src/{Matchers → matchers}/EXMatchers+toBeInstanceOf.m
  18. 0 src/{Matchers → matchers}/EXMatchers+toBeKindOf.h
  19. 0 src/{Matchers → matchers}/EXMatchers+toBeKindOf.m
  20. 0 src/{Matchers → matchers}/EXMatchers+toBeNil.h
  21. 0 src/{Matchers → matchers}/EXMatchers+toBeNil.m
  22. 0 src/{Matchers → matchers}/EXMatchers+toBeSubclassOf.h
  23. 0 src/{Matchers → matchers}/EXMatchers+toBeSubclassOf.m
  24. 0 src/{Matchers → matchers}/EXMatchers+toBeTruthy.h
  25. 0 src/{Matchers → matchers}/EXMatchers+toBeTruthy.m
  26. 0 src/{Matchers → matchers}/EXMatchers+toEqual.h
  27. 0 src/{Matchers → matchers}/EXMatchers+toEqual.m
  28. 0 src/{Matchers → matchers}/EXMatchers.h
  29. 0 test/{Support → helpers}/EXExpect+Test.h
  30. 0 test/{Support → helpers}/EXExpect+Test.m
  31. 0 test/{Support → helpers}/FakeTestCase.h
  32. 0 test/{Support → helpers}/FakeTestCase.m
  33. 0 test/{Support → helpers}/Fixtures.h
  34. 0 test/{Support → helpers}/Fixtures.m
  35. 0 test/{Support → helpers}/TestHelper.h
  36. +1 −1 boilerplate/ExpectaTests-Info.plist → test/support/Test-Info.plist
  37. +3 −0 test/support/Test-Prefix.pch
Oops, something went wrong.
View
@@ -32,8 +32,15 @@ Still under heavy development, but usable.
## USAGE
-Clone from Github, add `expecta/src` folder to your Xcode project and then add `#import "Expecta.h"` to your test code.
-Works best with [Cedar BDD Framework](http://pivotal.github.com/cedar/).
+1. Clone from Github.
+2. Run `rake` in project root to build.
+3. Copy and add all header files in `products` folder to the Spec/Test target in your Xcode project.
+4. For OS X projects, copy and add `libExpecta-macosx.a` in `products` folder to the Spec/Test target in your Xcode project.
+ For iOS projects, copy and add `libExpecta-ios-universal.a` in `products` folder to the Spec/Test target in your Xcode project.
+5. Add `-ObjC` to the "Other Linker Flags" build setting for the Spec/Test target in your Xcode project.
+6. Add `#import "Expecta.h"` to your test code.
+
+Expecta works best with [Cedar BDD Framework](http://pivotal.github.com/cedar/).
## BUILT-IN MATCHERS
View
@@ -0,0 +1,42 @@
+require 'tmpdir'
+
+def execute(command, stdout=nil)
+ puts "Running #{command}..."
+ command += " > #{stdout}" if stdout
+ system(command) or raise "** BUILD FAILED **"
+end
+
+def xcodebuild(target, sdk, configuration='Release')
+ "xcodebuild -target #{target} -sdk #{sdk} -configuration #{configuration}"
+end
+
+desc 'clean'
+task :clean do |t|
+ puts '=== CLEAN ==='
+ execute "xcodebuild -alltargets clean"
+end
+
+desc 'build'
+task :build => :clean do |t|
+ puts "=== BUILD ==="
+ configuration = 'Release'
+ execute xcodebuild('Expecta', 'macosx', configuration)
+ execute xcodebuild('Expecta-iOS', 'iphonesimulator', configuration)
+ execute xcodebuild('Expecta-iOS', 'iphoneos', configuration)
+ macosx_binary = "build/#{configuration}/libExpecta.a"
+ iphoneos_binary = "build/#{configuration}-iphonesimulator/libExpecta-ios.a"
+ iphonesimulator_binary = "build/#{configuration}-iphoneos/libExpecta-ios.a"
+ universal_binary = "build/libExpecta-ios-universal.a"
+ puts "=== GENERATE UNIVERSAL iOS BINARY (Device/Simulator) ==="
+ execute "lipo -create '#{iphoneos_binary}' '#{iphonesimulator_binary}' -output '#{universal_binary}'"
+ puts "\n=== COPY PRODUCTS ==="
+ execute "yes | rm -f products/*.h products/*.a products/LICENSE products/README.md"
+ execute "cp #{macosx_binary} products/libExpecta-macosx.a"
+ execute "mv #{universal_binary} products/"
+ execute "cp build/#{configuration}/*.h products/"
+ execute "cp LICENSE products/"
+ execute "cp README.md products/"
+ puts "\n** BUILD SUCCEEDED **"
+end
+
+task :default => [:build]
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>en</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIdentifier</key>
- <string>petejkim.${PRODUCT_NAME:rfc1034identifier}</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>1.0</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1</string>
- <key>LSMinimumSystemVersion</key>
- <string>${MACOSX_DEPLOYMENT_TARGET}</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
-</dict>
-</plist>
@@ -1,3 +0,0 @@
-#ifdef __OBJC__
- #import <Foundation/Foundation.h>
-#endif
@@ -1,4 +0,0 @@
-#ifdef __OBJC__
- #import <Foundation/Foundation.h>
- #import <SenTestingKit/SenTestingKit.h>
-#endif
View
@@ -1,5 +0,0 @@
-#import <Cocoa/Cocoa.h>
-
-int main(int argc, char *argv[]) {
- return NSApplicationMain(argc, (const char **)argv);
-}
View
@@ -0,0 +1,5 @@
+*.h
+*.a
+LICENSE
+README.md
+
View
@@ -0,0 +1,3 @@
+#ifdef __OBJC__
+# import <Foundation/Foundation.h>
+#endif
View
@@ -1,5 +1,9 @@
#import <Foundation/Foundation.h>
+#define EXFixCategoriesBug(name) \
+@interface EXFixCategoriesBug##name; @end \
+@implementation EXFixCategoriesBug##name; @end
+
#import "EXExpect.h"
#define EXMatchers EXExpect
@@ -17,6 +21,8 @@ EXExpect *_EX_expect(id testCase, int lineNumber, char *fileName, id actual);
@end
#define EXMatcherImplementationBegin(matcherName, matcherArguments) \
+EXFixCategoriesBug(EXMatcher##matcherName##Matcher); \
+\
@implementation EXExpect (matcherName##Matcher) \
- (void(^) matcherArguments) matcherName { \
NSObject *actual = self.actual; \
View
@@ -1,5 +1,8 @@
#import "NSValue+Expecta.h"
#import <objc/runtime.h>
+#import "Expecta.h"
+
+EXFixCategoriesBug(NSValue_Expecta);
@implementation NSValue (Expecta)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
- <string>petejkim.${PRODUCT_NAME:rfc1034identifier}</string>
+ <string>___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
@@ -0,0 +1,3 @@
+#ifdef __OBJC__
+# import <Foundation/Foundation.h>
+#endif

0 comments on commit b673e62

Please sign in to comment.