Updated Branches: refs/heads/2.8.x 9f3431a36 -> a2f158653 Updated Tags: refs/tags/2.8.0 [created] a2f158653
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/61e23c1e/lib/cordova-ios/CordovaLibTests/ExifTests.m ---------------------------------------------------------------------- diff --git a/lib/cordova-ios/CordovaLibTests/ExifTests.m b/lib/cordova-ios/CordovaLibTests/ExifTests.m index 960ac95..dfd6da4 100644 --- a/lib/cordova-ios/CordovaLibTests/ExifTests.m +++ b/lib/cordova-ios/CordovaLibTests/ExifTests.m @@ -1,154 +1,171 @@ -// -// ExifTestTests.m -// ExifTestTests -// -// Created by Lorin Beer on 2013-03-18. -// -// +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ #import <SenTestingKit/SenTestingKit.h> #import "ExifTestTests.h" #import "../ExifTest/CDVJpegHeaderWriter.m" - @implementation ExifTestTests - (void)setUp { [super setUp]; testHeaderWriter = [[CDVJpegHeaderWriter alloc] init]; - testErrorThreshhold = [NSNumber numberWithDouble: 0.000001]; - NSLog(@"%x", ~10+1); - - + testErrorThreshhold = [NSNumber numberWithDouble:0.000001]; + NSLog(@"%x", ~10 + 1); } - (void)tearDown { // Tear-down code here. - + [super tearDown]; } -//================================================================================================== +// ================================================================================================== // rational approximation of decimal by continued fraction tests -//================================================================================================== +// ================================================================================================== // tests continued fraction with random int -- (void)testContinuedFractionWithUInt { +- (void)testContinuedFractionWithUInt +{ NSLog(@"Continued Fraction Test with random int value, numerator should be generated value, denominator should be 1"); - NSNumber * numerator = @0; - NSNumber * denominator = @0; - NSNumber * testValue = [NSNumber numberWithInt: abs(arc4random())]; - [testHeaderWriter decimalToUnsignedRational: testValue - withResultNumerator: &numerator - withResultDenominator: &denominator]; + NSNumber* numerator = @0; + NSNumber* denominator = @0; + NSNumber* testValue = [NSNumber numberWithInt:abs(arc4random())]; + [testHeaderWriter decimalToUnsignedRational:testValue + withResultNumerator:&numerator + withResultDenominator:&denominator]; STAssertEquals([numerator intValue], - [testValue intValue], - @"Numerator did not match"); + [testValue intValue], + @"Numerator did not match"); STAssertEquals([denominator intValue], - 1, - @"denominator was not one"); + 1, + @"denominator was not one"); } // tests continued fraction with random float -- (void)testContinuedFractionWithUFloat { +- (void)testContinuedFractionWithUFloat +{ NSLog(@"Continued Fraction Test with random double value, resulting fraction should be within acceptable error threshhold"); - NSNumber * threshhold = @0.1; - NSNumber * numerator = @0; - NSNumber * denominator = @0; - NSLog(@"%f",((double)arc4random() / ARC4RANDOM_MAX) * 100.0f); - NSNumber * testValue = [NSNumber numberWithDouble: - ((double)arc4random() / ARC4RANDOM_MAX) * 100.0f]; - - [testHeaderWriter decimalToUnsignedRational: testValue - withResultNumerator: &numerator - withResultDenominator: &denominator]; - NSLog(@"%lf, %lf",[testValue doubleValue], [numerator doubleValue]/[denominator doubleValue]); + NSNumber* threshhold = @0.1; + NSNumber* numerator = @0; + NSNumber* denominator = @0; + NSLog(@"%f", ((double)arc4random() / ARC4RANDOM_MAX) * 100.0f); + NSNumber* testValue = [NSNumber numberWithDouble: + ((double)arc4random() / ARC4RANDOM_MAX) * 100.0f]; + + [testHeaderWriter decimalToUnsignedRational:testValue + withResultNumerator:&numerator + withResultDenominator:&denominator]; + NSLog(@"%lf, %lf", [testValue doubleValue], [numerator doubleValue] / [denominator doubleValue]); STAssertEqualsWithAccuracy([testValue doubleValue], - [numerator doubleValue]/[denominator doubleValue], - [threshhold doubleValue], - @"rational approximation did not meet acceptable error threshhold"); - + [numerator doubleValue] / [denominator doubleValue], + [threshhold doubleValue], + @"rational approximation did not meet acceptable error threshhold"); } // tests continued fraction in sqrt(2) worst case -- (void)testContinuedFractionsWorstCase { +- (void)testContinuedFractionsWorstCase +{ NSLog(@"Continued Fraction Test with provable worst case ~sqrt(2), resulting fraction should be within acceptable error threshhold"); - NSNumber * threshhold = @0.1; - NSNumber * numerator = @0; - NSNumber * denominator = @0; - NSNumber * testValue = [NSNumber numberWithDouble: sqrt(2)]; - [testHeaderWriter decimalToUnsignedRational: testValue - withResultNumerator: &numerator - withResultDenominator: &denominator]; + NSNumber* threshhold = @0.1; + NSNumber* numerator = @0; + NSNumber* denominator = @0; + NSNumber* testValue = [NSNumber numberWithDouble:sqrt(2)]; + [testHeaderWriter decimalToUnsignedRational:testValue + withResultNumerator:&numerator + withResultDenominator:&denominator]; STAssertEqualsWithAccuracy([testValue doubleValue], - [numerator doubleValue]/[denominator doubleValue], - [threshhold doubleValue], - @"rational approximation did not meet acceptable error threshhold"); + [numerator doubleValue] / [denominator doubleValue], + [threshhold doubleValue], + @"rational approximation did not meet acceptable error threshhold"); } // tests format hex from a decimal -- (void) testFormatHexFromDecimal { - NSNumber * testValue = @1; - NSNumber * testPlaces = @8; - NSString * result = nil; - result = [testHeaderWriter formattedHexStringFromDecimalNumber: testValue - withPlaces: testPlaces]; +- (void)testFormatHexFromDecimal +{ + NSNumber* testValue = @1; + NSNumber* testPlaces = @8; + NSString* result = nil; + + result = [testHeaderWriter formattedHexStringFromDecimalNumber:testValue + withPlaces:testPlaces]; // assert not nil STAssertNotNil(result, @"nil renturned from formattedHexStringFromDecimalNumber"); // assert correct number of places STAssertEquals([result length], [testPlaces unsignedIntegerValue], - @"returned string to wrong number of places. Should be = %i Was = %i", - [testPlaces intValue], - [result length]); + @"returned string to wrong number of places. Should be = %i Was = %i", + [testPlaces intValue], + [result length]); // assert correct hex representation STAssertTrueNoThrow([result isEqualToString:@"00000001"], @"result should be equal to @00000001"); - } // tests format number string with leading zeroes -- (void) testFormatNumberWithLeadingZeroes { - NSString * result = nil; - NSNumber * testValue = @8769; // Exif SubIFD Offset Tag - NSNumber * testPlaces = @6; - result = [testHeaderWriter formatNumberWithLeadingZeroes: testValue - withPlaces: testPlaces]; +- (void)testFormatNumberWithLeadingZeroes +{ + NSString* result = nil; + NSNumber* testValue = @8769; // Exif SubIFD Offset Tag + NSNumber* testPlaces = @6; + + result = [testHeaderWriter formatNumberWithLeadingZeroes:testValue + withPlaces:testPlaces]; STAssertNotNil(result, @"nil renturned from formattedHexStringFromDecimalNumber"); STAssertEquals([result length], - [testPlaces unsignedIntegerValue], - @"returned string to wrong number of places. Should be = %i Was = %i", - [testPlaces intValue], - [result length]); + [testPlaces unsignedIntegerValue], + @"returned string to wrong number of places. Should be = %i Was = %i", + [testPlaces intValue], + [result length]); // assert correct hex representation STAssertTrueNoThrow([result isEqualToString:@"008769"], @"result was = %@ should be = @008769", result); } -- (void) testUnsignedRationalToString { - NSString * result = nil; - NSNumber * numerator = @1; - NSNumber * denominator = @10; - result = [testHeaderWriter formatRationalWithNumerator: numerator - withDenominator: denominator - asSigned: FALSE]; +- (void)testUnsignedRationalToString +{ + NSString* result = nil; + NSNumber* numerator = @1; + NSNumber* denominator = @10; + + result = [testHeaderWriter formatRationalWithNumerator:numerator + withDenominator:denominator + asSigned:FALSE]; NSLog(result); STAssertNotNil(result, @"nil returned from testUnsignedRationalToString"); - STAssertTrueNoThrow([result length]==16, @"returned string with wrong length. Exif rationals are 8 bytes, string has %ld bytes",[result length]/2); + STAssertTrueNoThrow([result length] == 16, @"returned string with wrong length. Exif rationals are 8 bytes, string has %ld bytes", [result length] / 2); STAssertTrueNoThrow([result isEqualToString:@"000000010000000a"], @"result was = %@ should be = @0000000100000010", result); } -- (void) testSignedRationalToString { - NSString * result = nil; - NSNumber * numerator = @-1; - NSNumber * denominator = @-10; - result = [testHeaderWriter formatRationalWithNumerator: numerator - withDenominator: denominator - asSigned: TRUE]; +- (void)testSignedRationalToString +{ + NSString* result = nil; + NSNumber* numerator = @ - 1; + NSNumber* denominator = @ - 10; + + result = [testHeaderWriter formatRationalWithNumerator:numerator + withDenominator:denominator + asSigned:TRUE]; NSLog(result); STAssertNotNil(result, @"nil returned from testSignedRationalToString"); - STAssertTrueNoThrow([result length]==16, @"returned string with wrong length. Exif rationals are 8 bytes, string has %ld bytes",[result length]/2); + STAssertTrueNoThrow([result length] == 16, @"returned string with wrong length. Exif rationals are 8 bytes, string has %ld bytes", [result length] / 2); STAssertTrueNoThrow([result isEqualToString:@"fffffffffffffff6"], @"result was = %@ should be = @000000FF000000F6", result); } http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/61e23c1e/lib/cordova-ios/RELEASENOTES.md ---------------------------------------------------------------------- diff --git a/lib/cordova-ios/RELEASENOTES.md b/lib/cordova-ios/RELEASENOTES.md index 3c2031a..9c50659 100644 --- a/lib/cordova-ios/RELEASENOTES.md +++ b/lib/cordova-ios/RELEASENOTES.md @@ -19,8 +19,44 @@ # --> ## Release Notes for Cordova (iOS) ## - - Cordova is a static library that enables developers to include the Cordova API in their iOS application projects easily, and also create new Cordova-based iOS application projects through the command-line. + +Update these notes using: git log --pretty=format:'* %s' --topo-order --no-merges origin/2.7.x...HEAD + +Cordova is a static library that enables developers to include the Cordova API in their iOS application projects easily, and also create new Cordova-based iOS application projects through the command-line. + +### 2.8.0 (201305XX) ### + +* [CB-2840] Nil checks to avoid crash when network disconnected +* [CB-3416] adding empty <plugins> element during deprecation window. +* [CB-3006] Customize InAppBrowser location bar +* [CB-3405] InAppBrowser option to hide bottom bar with Done/History buttons +* [CB-3394] Cordova iOS crashes when multiple access elements in config.xml +* [CB-3166] Add deprecation notice for use of <plugin> in config.xml in iOS +* [CB-2905] Exif geolocation meta data tag writing +* [CB-3307] Rename cordova-ios.js -> cordova.js +* [CB-1108] Convert <plugin> -> <feature> with <param> +* [CB-3321] Fix bogus "failed whitelist" log messages +* [CB-3311] add default textbox for notification prompt +* [CB-2846] SplashScreen crashes app when image not available +* [CB-2789] Remove CaptureOptions.mode support. +* [CB-3295] Send InAppBrowser loadstart events when redirects occur +* [CB-2896] added ImageIO and OpenAL system frameworks to support new exif functionality in CDVCamera +* [CB-2896] writing data to object through CGImageDestinationRef, enables multipart exif tag writing +* [CB-2958] simple fix, moved write to photealbum code and sourced from modified data. Photo data returned by cordova will match photo on cameraroll +* [CB-3339] add version to command line scripts +* [CB-3377] Remove cordova/release script +* [CB-2974] Add a ./cordova/lib/list-devices project-level helper script to iOS +* [CB-2951] Add a ./cordova/lib/list-emulator-images project-level helper script to iOS +* [CB-2974] Add a ./cordova/lib/list-devices project-level helper script to iOS +* [CB-2966] Add a ./cordova/lib/list-started-emulators as project-level helper script to iOS +* [CB-2990] Add a ./cordova/lib/install-device project-level helper script to iOS +* [CB-2982] Add a ./cordova/lib/install-emulator project-level helper script to iOS +* [CB-2998] Add a ./cordova/lib/start-emulator project-level helper script to iOS +* [CB-2916] Add a ./cordova/clean project-level script for iOS +* [CB-2053] Update UIImagePickerController label to reflect video media type in CDVCamera +* [CB-3530] PhoneGap app crashes on iOS with error "CDVWebViewDelegate: Navigation started when state=1" + +<br /> ### 2.7.0 (201304XX) ### http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/61e23c1e/lib/cordova-ios/bin/templates/project/__TESTING__/config.xml ---------------------------------------------------------------------- diff --git a/lib/cordova-ios/bin/templates/project/__TESTING__/config.xml b/lib/cordova-ios/bin/templates/project/__TESTING__/config.xml index ca292c8..db64661 100644 --- a/lib/cordova-ios/bin/templates/project/__TESTING__/config.xml +++ b/lib/cordova-ios/bin/templates/project/__TESTING__/config.xml @@ -1,4 +1,22 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> <widget xmlns = "http://www.w3.org/ns/widgets" id = "io.cordova.helloCordova" version = "2.0.0"> http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/61e23c1e/lib/cordova-ios/bin/uncrustify.cfg ---------------------------------------------------------------------- diff --git a/lib/cordova-ios/bin/uncrustify.cfg b/lib/cordova-ios/bin/uncrustify.cfg index d52ce33..1e3099b 100644 --- a/lib/cordova-ios/bin/uncrustify.cfg +++ b/lib/cordova-ios/bin/uncrustify.cfg @@ -1,4 +1,20 @@ -# Uncrustify 0.59 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + # Based off of https://gist.github.com/261662/ # http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/61e23c1e/lib/cordova-ios/guides/Cordova Plugin Upgrade Guide.md ---------------------------------------------------------------------- diff --git a/lib/cordova-ios/guides/Cordova Plugin Upgrade Guide.md b/lib/cordova-ios/guides/Cordova Plugin Upgrade Guide.md index 7a03bc4..8fc3776 100644 --- a/lib/cordova-ios/guides/Cordova Plugin Upgrade Guide.md +++ b/lib/cordova-ios/guides/Cordova Plugin Upgrade Guide.md @@ -22,6 +22,71 @@ This document is for developers who need to upgrade their Cordova plugins to a newer Cordova version. Starting with Cordova 1.5.0, some classes have been renamed, which will require the plugin to be upgraded. Make sure your project itself has been upgraded using the [Cordova iOS Upgrading Guide](http://cordova.apache.org/docs/en/edge/guide_upgrading_ios_index.md.html#Upgrading%20Cordova%20iOS) document. +## Upgrading older Cordova plugins to 2.8.0 ## + +1. **Install** Cordova 2.8.0 +2. Follow the **"Upgrading older Cordova plugins to 2.7.0"** section, if necessary +3. The <plugin> tag in **config.xml** has been deprecated and support will be removed in 3.0.0. To upgrade to the <feature> tag, see this example: + + <plugins> + <plugin name="LocalStorage" value="CDVLocalStorage" /> + <!-- other plugins --> + </plugins> + + <!-- change to: (note that a <feature> tag is on the same level as <plugins> --> + <feature name="LocalStorage"> + <param name="ios-package" value="CDVLocalStorage" /> + </feature> + + +## Upgrading older Cordova plugins to 2.7.0 ## + +1. **Install** Cordova 2.7.0 +2. Follow the **"Upgrading older Cordova plugins to 2.6.0"** section, if necessary +3. The old cordova.exec signature has been deprecated since 2.1, and removed in 2.7.0. See upgrade steps below. + +When you use a method signature in JavaScript like this: + + cordova.exec('MyService.myMethod', myArg1, myArg2, myArg3); + + +The console log will ask you to upgrade it like this: + + The old format of this exec call has been removed (deprecated since 2.1). + Change to: cordova.exec(null, null, "MyService", "myMethod", [ myArg1, myArg2, myArg3 ]); + + +But, if your corresponding Objective-C method uses the old signature like so: + + - (void) myMethod:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; + + +Update it to this new signature: + + - (void) myMethod:(CDVInvokedUrlCommand*)command; + +Also update any references to "arguments" in the method body with "command.arguments". + +So if your method looked like this: + + - (void) myMethod:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options + { + NSString* myArgs1 = [arguments objectAtIndex:0]; + NSString* myArgs2 = [arguments objectAtIndex:1]; + NSString* myArgs3 = [arguments objectAtIndex:2]; + } + +Change it to this: + + - (void) myMethod:(CDVInvokedUrlCommand*)command + { + NSString* myArgs1 = [command.arguments objectAtIndex:0]; + NSString* myArgs2 = [command.arguments objectAtIndex:1]; + NSString* myArgs3 = [command.arguments objectAtIndex:2]; + } + +This is the easiest upgrade path. If you want to further use the more powerful callback mechanisms provided, see the [Plugin Development Guide](http://docs.phonegap.com/en/2.7.0/guide_plugin-development_ios_index.md.html#Developing%20a%20Plugin%20on%20iOS) to upgrade your plugin. + ## Upgrading older Cordova plugins to 2.6.0 ## 1. **Install** Cordova 2.6.0
