Importing frameworks in Oxygene for Cocoa

Hi,

Is there a date for the release of the capability to import custom frameworks?

Regards,
Alvaro Dalloz

Right now, we just support static libraries. We’re looking into third-party framework supports, but there are several issues with it, not the least that copying a .framework to Windows will destroy the symbolic links it contains, which is an issue for the finished .app bundle.

We will solve this, but i cannot give you a promised date. might be in the June release, might not. In the mean time, i would suggest recompiling the framework to a static library.

I have tried to import a framework for iOS.
I’ve found a Static/…/A/ folder in that framework.
Under the /A folder is a binary file without .a Extension (name is equal to the component name) and an “Headers” Folder.
I think the binary is the static lib, right?

Into the Headers folder are a lot of header files and a “master header” named “SensibleTableView.h”

When I run FxGen with the following parameters, the I get an error message, because UIViewController is undefined.
(Parsing (root) file: SensibleTableView.h
An error occurred: SCGlobals.h (218:42 pp: 7674) Declaration expected; current token: Identifier UIViewController)

iOSSdkVersion=“6.1”;
processiOSLibrary({
library: “libSensibleTableView”,
headers: [“SensibleTableView.h”],
includePaths: ["/Users/jens/Downloads/STV 3.2.1 Lite/Static Frameworks/SensibleTableView.framework/Versions/A/Headers"],
includeFX: [“UIKit”],
copyLibs: ["/Users/jens/Downloads/STV 3.2.1 Lite/Static Frameworks/SensibleTableView.framework/Versions/A/SensibleTableView"],
architectures: [“armv7s”,“armv7”],
explicitHeaders: false,
dummy: null
});

I have included the UIKit (.fx).

Am I doing something fundamentally wrong, something is missing or is the content of that “Static/…/A/” Folder incompatible with FxGen?

Thank You.
Jens

Right now, FXGen supports static libraries only. iOS does not support third party frameworks at all, only static libraries, so framework import will only ever be relevant/supported for OS X.

Hi Marc,
right. The iOS restrictions allow only static libs.

I can use the SensibleTableView “static Framework” with Xcode an deploy it’s demos to my iPhone. Therefore (I think), the file “STV 3.2.1 Lite/static Frameworks/SensibleTableView.framework/Versions/A/SensibleTableView” must be clearly a static library, whose header files are in “STV 3.2.1 Lite/static Frameworks/SensibleTableView.framework/Versions/A/Headers”.

I believe fails the FxGen with me, because I’ve specified the UIKit (fx) probably incorrectly.
FxGen reads the .h files and stops because the UIViewController is not declared.

Any news on importing third party frameworks? I’m interested on using Parse with Oxygene, but not having the source it’s not posible to recompile it as static library.

iOS or Mac?

Parse uses a Framework on both iOS and OS X. I expect to hit the lack of Framework support in the not too distant future.

Right. i’m asking because we do support (not really-)framework imports, for iOS, now.

I know. It’s the (real) Mac ones that would be really handy to support. You could argue that using a framework is the “right way” to package an SDK on the Mac platform so not supporting it is a bit of an omission.

I note that Xamarin don’t support Mac Frameworks either so if RemObjects did it would be a(nother) selling point.

it’s something i want us to support, yes. Right now the trickiest part is doing sop from Windows, as .frameworks are folders chock-full of symbolic links. From Mac (ie Fie or xbuild command line builds), they should be fairly straight forward (and probably can be done with some tweaking now, just import the .h files inside the framework as if they were a static lib, and then pass the proper -f and -F flags ioth framework name and path via the “Linker Options” command line.

(wrapping that up into an import that FXGen can handle would be trivial).

the tricky part will be using that framework from Windows/VS in an intuitive way. We can’t just copy the .framework bundle next to the fx file like we do for static libs, and send it across the network to link —because when you copy the framework to Windows, it’ll be f**cked. Some thinking here will be necessary on how to solve this “properly”.

The symlinks would also need to exist in the finished app in /bin so maybe it’s not tractable on windows?

Exactly, that’s the problem.

The current thinking is to zop the .framework up as part of the import. place that next to the .fx, so we can build and link. but the finished .app would be broken as soon as it gets back to Windows. Unless we cna somehow safely “flatten” the framework (ie drop the symlinks). But i’m not sure yet if that will be straight-forward, since there could be anything inside that framework folder, really, and we cant officially depend on its structure.

Apparently iOS8 adds official framework support - http://asciiwwdc.com/2014/sessions/416

1 Like

Yes, we’re putting prio on getting frameworks supported, for building AND for importing, for when Xcode 6 ships.

1 Like

I was wondering about the status of this ?

I want to explore this https://github.com/realm/realm-cocoa

They provide framework files. There is source but I’m never really sure what I’m doing when it comes to creating static libraries.