mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-01 17:39:54 +08:00
[test] Get source to build on OS X 10.7 32-bit.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
$:.unshift("../../lib")
|
||||
|
||||
platform = ENV['PLATFORM'] || 'ios'
|
||||
require "motion/project/template/#{platform}"
|
||||
require "motion/project/template/#{ENV['PLATFORM'] || 'ios'}"
|
||||
|
||||
ENV['output'] ||= 'pretty_spec_dox'
|
||||
|
||||
@@ -15,6 +14,21 @@ Motion::Project::App.setup do |app|
|
||||
app.deployment_target = ENV['deployment_target'] if ENV['deployment_target']
|
||||
|
||||
app.archs[app.local_platform] = [ENV['ARCH']] if ENV['ARCH']
|
||||
|
||||
# 10.8 and 10.9 are 64-bit only.
|
||||
if ENV['PLATFORM'] == 'osx' && ENV['ARCH'] == 'i386'
|
||||
app.deployment_target = '10.7'
|
||||
end
|
||||
end
|
||||
|
||||
task :clean do
|
||||
if ENV['ARCH']
|
||||
dir = "./vendor/code/build-#{ENV['ARCH']}"
|
||||
if File.exist?(dir)
|
||||
App.info 'Delete', dir
|
||||
FileUtils.rm_rf dir
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
namespace :spec do
|
||||
|
||||
7
test/test/vendor/code/subscripting.h
vendored
7
test/test/vendor/code/subscripting.h
vendored
@@ -1,6 +1,9 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface TestSubscripting : NSObject
|
||||
@interface TestSubscripting : NSObject {
|
||||
NSMutableArray *_array;
|
||||
NSMutableDictionary *_dictionary;
|
||||
}
|
||||
|
||||
- (id)objectAtIndexedSubscript:(NSUInteger)index;
|
||||
- (void)setObject:(id)object atIndexedSubscript:(NSUInteger)index;
|
||||
@@ -8,4 +11,4 @@
|
||||
- (id)objectForKeyedSubscript:(id)key;
|
||||
- (void)setObject:(id)object forKeyedSubscript:(id<NSCopying>)key;
|
||||
|
||||
@end
|
||||
@end
|
||||
|
||||
13
test/test/vendor/code/subscripting.m
vendored
13
test/test/vendor/code/subscripting.m
vendored
@@ -7,6 +7,9 @@
|
||||
|
||||
@implementation TestSubscripting
|
||||
|
||||
@synthesize array = _array;
|
||||
@synthesize dictionary = _dictionary;
|
||||
|
||||
- (instancetype)init;
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
@@ -18,22 +21,22 @@
|
||||
|
||||
- (id)objectAtIndexedSubscript:(NSUInteger)index;
|
||||
{
|
||||
return self.array[index];
|
||||
return [self.array objectAtIndex:index];
|
||||
}
|
||||
|
||||
- (void)setObject:(id)object atIndexedSubscript:(NSUInteger)index;
|
||||
{
|
||||
self.array[index] = object;
|
||||
[self.array replaceObjectAtIndex:index withObject:object];
|
||||
}
|
||||
|
||||
- (id)objectForKeyedSubscript:(id)key;
|
||||
{
|
||||
return self.dictionary[key];
|
||||
return [self.dictionary objectForKey:key];
|
||||
}
|
||||
|
||||
- (void)setObject:(id)object forKeyedSubscript:(id<NSCopying>)key;
|
||||
{
|
||||
self.dictionary[key] = object;
|
||||
[self.dictionary setObject:object forKey:key];
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user