Permalink
Browse files

Merge pull request #631 from tonyarnold/develop

Cleanup of MagicalRecord 2
  • Loading branch information...
2 parents 001fe09 + 2c72a35 commit f5a1edcf2cb664d0aae8e9e22a34f3b9de9561d1 @casademora casademora committed Jan 1, 2014
Showing with 607 additions and 268 deletions.
  1. +0 −1 .gitignore
  2. +5 −5 .gitmodules
  3. +2 −1 .travis.yml
  4. +176 −191 {Project Files → }/MagicalRecord.xcodeproj/project.pbxproj
  5. 0 {Project Files → }/MagicalRecord.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  6. +1 −1 {Project Files → }/MagicalRecord.xcodeproj/xcshareddata/xcschemes/MagicalRecordTests-OSX.xcscheme
  7. +1 −1 {Project Files → }/MagicalRecord.xcodeproj/xcshareddata/xcschemes/MagicalRecordTests-iOS.xcscheme
  8. +1 −1 {Project Files → }/MagicalRecord.xcodeproj/xcshareddata/xcschemes/libMagicalRecord-OSX.xcscheme
  9. +2 −2 {Project Files → }/MagicalRecord.xcodeproj/xcshareddata/xcschemes/libMagicalRecord-iOS.xcscheme
  10. +1 −0 MagicalRecord/Core/MagicalRecord.h
  11. +6 −1 MagicalRecord/Core/MagicalRecord.m
  12. +0 −3 MagicalRecord/CoreData+MagicalRecord.h
  13. +5 −0 MagicalRecord/MagicalRecordVersion.h
  14. BIN Project Files/Default-568h@2x.png
  15. +0 −60 Project Files/Rakefile
  16. +0 −1 Project Files/Tests/Support/Vendor/Expecta
  17. 0 {Project Files/Library → }/Support/MagicalRecord-OSX-Prefix.pch
  18. 0 {Project Files/Library → }/Support/MagicalRecord-iOS-Prefix.pch
  19. 0 {Project Files → Support/Scripts}/generateShorthandFile.rb
  20. +18 −0 Support/Scripts/objc-build-scripts/LICENSE.md
  21. +82 −0 Support/Scripts/objc-build-scripts/README.md
  22. +80 −0 Support/Scripts/objc-build-scripts/bootstrap
  23. +142 −0 Support/Scripts/objc-build-scripts/cibuild
  24. +12 −0 Support/Scripts/objc-build-scripts/schemes.awk
  25. +12 −0 Support/Scripts/objc-build-scripts/targets.awk
  26. +35 −0 Support/Scripts/objc-build-scripts/xcodebuild.awk
  27. +25 −0 Support/Scripts/objc-build-scripts/xctool.awk
  28. 0 {Project Files → }/Tests/Core/MagicalRecordStackTests.m
  29. 0 {Project Files → }/Tests/Core/MagicalRecordTestBase.h
  30. 0 {Project Files → }/Tests/Core/MagicalRecordTestBase.m
  31. 0 {Project Files → }/Tests/Core/NSManagedObjectContextHelperTests.m
  32. 0 {Project Files → }/Tests/Core/NSManagedObjectHelperTests.m
  33. 0 {Project Files → }/Tests/Core/NSPersisentStoreHelperTests.m
  34. 0 {Project Files → }/Tests/Core/NSPersistentStoreCoordinatorHelperTests.m
  35. 0 ...es → }/Tests/DataImport/ImportSingleEntityRelatedToManyMappedEntitiesUsingMappedPrimaryKeyTests.m
  36. 0 {Project Files → }/Tests/DataImport/ImportSingleEntityRelatedToMappedEntityUsingDefaultsTests.m
  37. 0 ...ct Files → }/Tests/DataImport/ImportSingleEntityRelatedToMappedEntityUsingMappedPrimaryKeyTests.m
  38. 0 ...les → }/Tests/DataImport/ImportSingleEntityRelatedToMappedEntityWithNestedMappedAttributesTests.m
  39. 0 ...ct Files → }/Tests/DataImport/ImportSingleEntityRelatedToMappedEntityWithSecondaryMappingsTests.m
  40. 0 {Project Files → }/Tests/DataImport/ImportSingleEntityWithNoRelationshipsTests.m
  41. 0 {Project Files → }/Tests/DataImport/ImportSingleRelatedEntityTests.m
  42. 0 {Project Files → }/Tests/DataImport/MagicalDataImportTestCase.h
  43. 0 {Project Files → }/Tests/DataImport/MagicalDataImportTestCase.m
  44. 0 {Project Files → }/Tests/Fixtures/FixtureHelpers.h
  45. 0 {Project Files → }/Tests/Fixtures/FixtureHelpers.m
  46. 0 ...les → }/Tests/Fixtures/ImportSingleEntityRelatedToManyMappedEntitiesUsingListOfPrimaryKeysTests.m
  47. 0 {Project Files → }/Tests/Fixtures/SampleJSONDataForImport.json
  48. 0 {Project Files → }/Tests/Fixtures/SingleEntityRelatedToManyMappedEntitiesUsingListOfPrimaryKeys.json
  49. 0 {Project Files → }/Tests/Fixtures/SingleEntityRelatedToManyMappedEntitiesUsingMappedPrimaryKey.json
  50. 0 {Project Files → }/Tests/Fixtures/SingleEntityRelatedToMappedEntityUsingDefaults.json
  51. 0 {Project Files → }/Tests/Fixtures/SingleEntityRelatedToMappedEntityUsingMappedPrimaryKey.json
  52. 0 {Project Files → }/Tests/Fixtures/SingleEntityRelatedToMappedEntityWithNestedMappedAttributes.json
  53. 0 {Project Files → }/Tests/Fixtures/SingleEntityRelatedToMappedEntityWithSecondaryMappings.json
  54. 0 {Project Files → }/Tests/Fixtures/SingleEntityWithNoRelationships.json
  55. 0 {Project Files → }/Tests/Fixtures/SingleEntityWithNoRelationships.plist
  56. 0 {Project Files → }/Tests/Fixtures/SingleRelatedEntity.json
  57. 0 {Project Files → }/Tests/Fixtures/TestModel.xcdatamodeld/TestModel.xcdatamodel/contents
  58. 0 {Project Files → }/Tests/Fixtures/TestModel/AbstractRelatedEntity.h
  59. 0 {Project Files → }/Tests/Fixtures/TestModel/AbstractRelatedEntity.m
  60. 0 {Project Files → }/Tests/Fixtures/TestModel/ConcreteRelatedEntity.h
  61. 0 {Project Files → }/Tests/Fixtures/TestModel/ConcreteRelatedEntity.m
  62. 0 {Project Files → }/Tests/Fixtures/TestModel/DifferentClassNameMapping.h
  63. 0 {Project Files → }/Tests/Fixtures/TestModel/DifferentClassNameMapping.m
  64. 0 {Project Files → }/Tests/Fixtures/TestModel/MappedEntity.h
  65. 0 {Project Files → }/Tests/Fixtures/TestModel/MappedEntity.m
  66. 0 ...Files → }/Tests/Fixtures/TestModel/SingleEntityRelatedToManyMappedEntitiesUsingMappedPrimaryKey.h
  67. 0 ...Files → }/Tests/Fixtures/TestModel/SingleEntityRelatedToManyMappedEntitiesUsingMappedPrimaryKey.m
  68. 0 {Project Files → }/Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityUsingDefaults.h
  69. 0 {Project Files → }/Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityUsingDefaults.m
  70. 0 {Project Files → }/Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityUsingMappedPrimaryKey.h
  71. 0 {Project Files → }/Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityUsingMappedPrimaryKey.m
  72. 0 ... Files → }/Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityWithNestedMappedAttributes.h
  73. 0 ... Files → }/Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityWithNestedMappedAttributes.m
  74. 0 {Project Files → }/Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityWithSecondaryMappings.h
  75. 0 {Project Files → }/Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityWithSecondaryMappings.m
  76. 0 {Project Files → }/Tests/Fixtures/TestModel/SingleEntityWithNoRelationships.h
  77. 0 {Project Files → }/Tests/Fixtures/TestModel/SingleEntityWithNoRelationships.m
  78. 0 {Project Files → }/Tests/Fixtures/TestModel/SingleRelatedEntity.h
  79. 0 {Project Files → }/Tests/Fixtures/TestModel/SingleRelatedEntity.m
  80. 0 {Project Files → }/Tests/Fixtures/TestModel/_AbstractRelatedEntity.h
  81. 0 {Project Files → }/Tests/Fixtures/TestModel/_AbstractRelatedEntity.m
  82. 0 {Project Files → }/Tests/Fixtures/TestModel/_ConcreteRelatedEntity.h
  83. 0 {Project Files → }/Tests/Fixtures/TestModel/_ConcreteRelatedEntity.m
  84. 0 {Project Files → }/Tests/Fixtures/TestModel/_DifferentClassNameMapping.h
  85. 0 {Project Files → }/Tests/Fixtures/TestModel/_DifferentClassNameMapping.m
  86. 0 {Project Files → }/Tests/Fixtures/TestModel/_MappedEntity.h
  87. 0 {Project Files → }/Tests/Fixtures/TestModel/_MappedEntity.m
  88. 0 ...iles → }/Tests/Fixtures/TestModel/_SingleEntityRelatedToManyMappedEntitiesUsingMappedPrimaryKey.h
  89. 0 ...iles → }/Tests/Fixtures/TestModel/_SingleEntityRelatedToManyMappedEntitiesUsingMappedPrimaryKey.m
  90. 0 {Project Files → }/Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityUsingDefaults.h
  91. 0 {Project Files → }/Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityUsingDefaults.m
  92. 0 ...ject Files → }/Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityUsingMappedPrimaryKey.h
  93. 0 ...ject Files → }/Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityUsingMappedPrimaryKey.m
  94. 0 ...Files → }/Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityWithNestedMappedAttributes.h
  95. 0 ...Files → }/Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityWithNestedMappedAttributes.m
  96. 0 ...ject Files → }/Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityWithSecondaryMappings.h
  97. 0 ...ject Files → }/Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityWithSecondaryMappings.m
  98. 0 {Project Files → }/Tests/Fixtures/TestModel/_SingleEntityWithNoRelationships.h
  99. 0 {Project Files → }/Tests/Fixtures/TestModel/_SingleEntityWithNoRelationships.m
  100. 0 {Project Files → }/Tests/Fixtures/TestModel/_SingleRelatedEntity.h
  101. 0 {Project Files → }/Tests/Fixtures/TestModel/_SingleRelatedEntity.m
  102. 0 {Project Files → }/Tests/MagicalRecord+ActionsSpec.m
  103. 0 {Project Files → }/Tests/NSManagedObjectContext+MagicalSavesSpec.m
  104. 0 {Project Files → }/Tests/Support/MagicalRecordTests-OSX-Info.plist
  105. 0 {Project Files → }/Tests/Support/MagicalRecordTests-OSX-Prefix.pch
  106. 0 {Project Files → }/Tests/Support/MagicalRecordTests-iOS-Info.plist
  107. 0 {Project Files → }/Tests/Support/MagicalRecordTests-iOS-Prefix.pch
  108. +1 −0 Tests/Vendor/Expecta
  109. 0 {Project Files/Tests/Support → Tests}/Vendor/Specta
View
@@ -18,4 +18,3 @@ profile
*.moved-aside
DerivedData
-BuildConfig.h
View
@@ -1,6 +1,6 @@
-[submodule "Project Files/Tests/Support/Vendor/Expecta"]
- path = Project Files/Tests/Support/Vendor/Expecta
-url=https://github.com/specta/expecta.git
-[submodule "Project Files/Tests/Support/Vendor/Specta"]
- path = Project Files/Tests/Support/Vendor/Specta
+[submodule "Tests/Vendor/Expecta"]
+ path = Tests/Vendor/Expecta
+url=https://github.com/tonyarnold/expecta.git
+[submodule "Tests/Vendor/Specta"]
+ path = Tests/Vendor/Specta
url = https://github.com/specta/specta.git
View
@@ -1 +1,2 @@
-language: objective-c
+language: objective-c
+script: Support/Scripts/objc-build-scripts/cibuild

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0510"
+ LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0510"
+ LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0510"
+ LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0510"
+ LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -15,7 +15,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C7CF97AA17498414008D9D13"
- BuildableName = "liblibMagicalRecord-iOS.a"
+ BuildableName = "libMagicalRecord-iOS.a"
BlueprintName = "libMagicalRecord-iOS"
ReferencedContainer = "container:MagicalRecord.xcodeproj">
</BuildableReference>
@@ -51,6 +51,7 @@ typedef void (^CoreDataBlock)(NSManagedObjectContext *context);
+ (NSInteger)version;
+ (NSString *)displayVersion;
++ (NSString *)build;
+ (NSString *) currentStack;
@@ -6,7 +6,7 @@
//
#import "CoreData+MagicalRecord.h"
-#import "BuildConfig.h"
+#import "MagicalRecordVersion.h"
NSString * const kMagicalRecordCleanedUpNotification = @"kMagicalRecordCleanedUpNotification";
@@ -36,6 +36,11 @@ + (NSString *)displayVersion
return MAGICAL_RECORD_DISPLAY_VERSION;
}
++ (NSString *)build
+{
+ return MAGICAL_RECORD_BUILD;
+}
+
+ (void) cleanUp
{
[self cleanUpErrorHanding];
@@ -4,9 +4,6 @@
#endif
#ifdef __OBJC__
-// #if !( __has_feature(objc_arc) && __has_feature(objc_arc_weak) )
-// #error MagicalRecord now requires ARC to be enabled
-// #endif
#import <CoreFoundation/CoreFoundation.h>
#import <CoreData/CoreData.h>
@@ -0,0 +1,5 @@
+// Do not edit
+#define MAGICAL_RECORD_DISPLAY_VERSION @"2.2develop"
+#define MAGICAL_RECORD_VERSION 595
+#define MAGICAL_RECORD_BUILD @"1a09221"
+// Updated on Wed Jan 1 12:39:31 EST 2014
Deleted file not rendered
View
@@ -1,60 +0,0 @@
-@ios_fixtures = "Unit Tests/Fixtures/iOS"
-
-
-@target = ""
-@project = ""
-@fixtures = ""
-
-namespace :setup do
- task :ios do
-
- end
-
- task :osx do
- @target = "Mac App Unit Tests"
- @project = "Magical Record.xcodeproj"
- @fixtures = "Unit Tests/Fixtures/Mac"
- end
-end
-
-namespace :clean do
- task :osx => ["setup:osx"] do
- rm_rf "#{@fixtures}/TestEntities"
- end
-end
-
-namespace :build do
-
- task :run do
- results = system("xcodebuild -project '#{@project}' -target '#{@target}'")
- puts results
- end
-
- namespace :db do
- task :create do
- Dir.chdir(@fixtures) do
- puts `/usr/local/bin/mogenerator -m TestModel.xcdatamodeld/TestModel.xcdatamodel -O TestEntities`
- end
- end
- end
-
- task :osx => ["setup:osx", "clean:osx", "build:db:create", "build:run"]
-
- task :ios => [] do
-
- end
-end
-
-namespace :test do
- task :osx => ["build:osx"] do
- puts "testing osx"
- end
-
- task :ios do
- puts "testing ios"
- end
-end
-
-task :test => ["test:osx", "test:ios"]
-
-task :default => :test
Submodule Expecta deleted from f02b26
@@ -0,0 +1,18 @@
+**Copyright (c) 2013 Justin Spahr-Summers**
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,82 @@
+# objc-build-scripts
+
+This project is a collection of scripts created with two goals:
+
+ 1. To standardize how Objective-C projects are bootstrapped after cloning
+ 1. To easily build Objective-C projects on continuous integration servers
+
+## Scripts
+
+Right now, there are two important scripts: [`bootstrap`](#bootstrap) and
+[`cibuild`](#cibuild). Both are Bash scripts, to maximize compatibility and
+eliminate pesky system configuration issues (like setting up a working Ruby
+environment).
+
+The structure of the scripts on disk is meant to follow that of a typical Ruby
+project:
+
+```
+script/
+ bootstrap
+ cibuild
+```
+
+### bootstrap
+
+This script is responsible for bootstrapping (initializing) your project after
+it's been checked out. Here, you should install or clone any dependencies that
+are required for a working build and development environment.
+
+By default, the script will verify that [xctool][] is installed, then initialize
+and update submodules recursively. If any submodules contain `script/bootstrap`,
+that will be run as well.
+
+To check that other tools are installed, you can set the `REQUIRED_TOOLS`
+environment variable before running `script/bootstrap`, or edit it within the
+script directly. Note that no installation is performed automatically, though
+this can always be added within your specific project.
+
+### cibuild
+
+This script is responsible for building the project, as you would want it built
+for continuous integration. This is preferable to putting the logic on the CI
+server itself, since it ensures that any changes are versioned along with the
+source.
+
+By default, the script will run [`bootstrap`](#bootstrap), look for any Xcode
+workspace or project in the working directory, then build all targets/schemes
+(as found by `xcodebuild -list`) using [xctool][].
+
+You can also specify the schemes to build by passing them into the script:
+
+```sh
+script/cibuild ReactiveCocoa-Mac ReactiveCocoa-iOS
+```
+
+As with the `bootstrap` script, there are several environment variables that can
+be used to customize behavior. They can be set on the command line before
+invoking the script, or the defaults changed within the script directly.
+
+## Getting Started
+
+To add the scripts to your project, read the contents of this repository into
+a `script` folder:
+
+```
+$ git remote add objc-build-scripts https://github.com/jspahrsummers/objc-build-scripts.git
+$ git fetch objc-build-scripts
+$ git read-tree --prefix=script/ -u objc-build-scripts/master
+```
+
+Then commit the changes, to incorporate the scripts into your own repository's
+history. You can also freely tweak the scripts for your specific project's
+needs.
+
+To merge in upstream changes later:
+
+```
+$ git fetch -p objc-build-scripts
+$ git merge --ff --squash -Xsubtree=script objc-build-scripts/master
+```
+
+[xctool]: https://github.com/facebook/xctool
@@ -0,0 +1,80 @@
+#!/bin/bash
+
+export SCRIPT_DIR=$(dirname "$0")
+
+##
+## Configuration Variables
+##
+
+config ()
+{
+ # A whitespace-separated list of executables that must be present and locatable.
+ : ${REQUIRED_TOOLS="xctool"}
+
+ export REQUIRED_TOOLS
+}
+
+##
+## Bootstrap Process
+##
+
+main ()
+{
+ config
+
+ if [ -n "$REQUIRED_TOOLS" ]
+ then
+ echo "*** Checking dependencies..."
+ check_deps
+ fi
+
+ local submodules=$(git submodule status)
+ local result=$?
+
+ if [ "$result" -ne "0" ]
+ then
+ exit $result
+ fi
+
+ if [ -n "$submodules" ]
+ then
+ echo "*** Updating submodules..."
+ update_submodules
+ fi
+}
+
+check_deps ()
+{
+ for tool in $REQUIRED_TOOLS
+ do
+ which -s "$tool"
+ if [ "$?" -ne "0" ]
+ then
+ echo "*** Error: $tool not found. Please install it and bootstrap again."
+ exit 1
+ fi
+ done
+}
+
+bootstrap_submodule ()
+{
+ local bootstrap="script/bootstrap"
+
+ if [ -e "$bootstrap" ]
+ then
+ echo "*** Bootstrapping $name..."
+ "$bootstrap" >/dev/null
+ else
+ update_submodules
+ fi
+}
+
+update_submodules ()
+{
+ git submodule sync --quiet && git submodule update --init && git submodule foreach --quiet bootstrap_submodule
+}
+
+export -f bootstrap_submodule
+export -f update_submodules
+
+main
Oops, something went wrong.

0 comments on commit f5a1edc

Please sign in to comment.