Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Draft of Dynamic Framework Target #2

Conversation

sgoldberg-sfdc
Copy link

Platforms affected

iOS / iOS Simulator

What does this PR do?

Add's a Dynamic Framework Target for building Cordova

What testing has been done on this change?

Tested dynamic framework in application

@sgoldberg-sfdc
Copy link
Author

@khawkins Just getting the ball rolling here. I probably need some sort of template for the header comments in the framework header.

@khawkins
Copy link
Owner

CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/contents.xcworkspacedata should not be checked in—those are local development files. CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/ should probably be added to .gitignore.

@sgoldberg-sfdc
Copy link
Author

Oops, I got used to having a .gitignore setup.

//! Project version string for Cordova.
FOUNDATION_EXPORT const unsigned char CordovaVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <Cordova/PublicHeader.h>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the public headers should be represented in the umbrella header, a la:

#import <Cordova/CDVViewController.h

And so on.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I swore that was automated by adding them to public. I guess not. Will do.

.gitignore Outdated
@@ -224,3 +224,4 @@ node_modules/color-support/
node_modules/fs.realpath/
node_modules/jasmine-core/
node_modules/jasmine/
CordovaLib/CordovaLib.xcodeproj/project.xcworkspace
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that CordovaLib has its own .gitignore, let's just add this in there—there aren't any other CordovaLib entries in this file.

OTHER_LDFLAGS = "-all_load";
PRODUCT_BUNDLE_IDENTIFIER = com.salesforce.Cordova;
PRODUCT_NAME = "$(TARGET_NAME)";
PUBLIC_HEADERS_FOLDER_PATH = Cordova.framework/PublicHeaders;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we go with the standard value for framework targets here? I.e. $(CONTENTS_FOLDER_PATH)/Headers.

OTHER_LDFLAGS = "-all_load";
PRODUCT_BUNDLE_IDENTIFIER = com.salesforce.Cordova;
PRODUCT_NAME = "$(TARGET_NAME)";
PUBLIC_HEADERS_FOLDER_PATH = Cordova.framework/PublicHeaders;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$(CONTENTS_FOLDER_PATH)/Headers here too.

GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = Cordova/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd roll this back to 8.0, as the current min versions of iOS support in CordovaLib are already less than that.

GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = Cordova/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roll back to 8.0.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. Roll back to 8.0.

MTL_ENABLE_DEBUG_INFO = NO;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "-all_load";
PRODUCT_BUNDLE_IDENTIFIER = com.salesforce.Cordova;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd make this com.apache.cordova.Cordova.

MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "-all_load";
PRODUCT_BUNDLE_IDENTIFIER = com.salesforce.Cordova;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd make this com.apache.cordova.Cordova.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 here as well.

@khawkins
Copy link
Owner

So the other body of work that we're going to need to do to make this reasonably production ready as a first class sibling to the CordovaLib library, is to integrate it into the testing environment. The tests run through the npm local package (npm install, npm test), and ultimately end up executing (among other things) tests from the tests/cordova-ios.xcworkspace workspace, which currently links a Cordova testing app and test suite to the CordovaLib static library.

My thought is to add a new app and test target that links the framework instead of the static lib, but shares the same test files as the test target for the static lib. Thoughts?

@sgoldberg-sfdc
Copy link
Author

sgoldberg-sfdc commented Jan 26, 2017 via email

@@ -0,0 +1,19 @@
//

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add the standard Apache license/copyright to every new file you're creating. That seems to be the Cordova way.

Here you go:

/*
 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.
 */

GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = Cordova/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.2;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. Roll back to 8.0.

MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "-all_load";
PRODUCT_BUNDLE_IDENTIFIER = com.salesforce.Cordova;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 here as well.

GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = Cordova/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.2;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8.0.

OTHER_LDFLAGS = "-all_load";
PRODUCT_BUNDLE_IDENTIFIER = com.salesforce.Cordova;
PRODUCT_NAME = "$(TARGET_NAME)";
PUBLIC_HEADERS_FOLDER_PATH = Cordova.framework/PublicHeaders;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like @khawkins said, can we go with the standard value for framework targets here? I.e. $(CONTENTS_FOLDER_PATH)/Headers

- Removed .gitignore changes
- Added standard header comment
- Rolled iOS target back to 8.0
- Used standard header path
- Added all public headers to Cordova.h
@sgoldberg-sfdc
Copy link
Author

@khawkins @bhariharan - Pushed requested changes


// In this header, you should import all the public headers of your framework using statements like #import <Cordova/PublicHeader.h>

#import "CDVAvailability.h"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be in the same format as expected direct access from a framework consumer. E.g. #import <Cordova/CDVAvailability.h>.

Copy link

@bhariharan bhariharan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to Kevin's comment. Looks good otherwise.

@sgoldberg-sfdc
Copy link
Author

Headers updated. @khawkins @bhariharan I think a sample app should be part of a different PR.

Copy link
Owner

@khawkins khawkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good over all. We can look at the test infrastructure in the next PR.

@khawkins khawkins merged commit 2e9a697 into khawkins:master-dynamic-framework Feb 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants