JavaFXPorts and robovm-cocoatouch import - ios

I’m trying to use JavaFXPorts and RoboVM-cocoatouch but I can’t use the native stuff from RoboVM like UIButton.
I have the following dependencies in my build.gradle file:
classpath 'org.javafxports:jfxmobile-plugin:1.0.0-b5'
classpath 'org.robovm:robovm-cocoatouch:1.0.0'
And I'm trying to import org.robovm.apple.uikit.* but eclipse can't find the Packages.
What I have to do that I can use JavaFXPorts and the native stuff from RoboVM?

The short answer:
you need to create a folder src/ios/java in which your iOS specific source files should be located. The source files within this folder automatically have the correct classpath set, so you can use the RoboVM classes there.
The long answer:
In addition to the default main source set, the jfxmobile plugin also adds a source set for every platform the plugin supports: android, ios and desktop. Each source set has a src/PLATFORM/java and src/PLATFORM/resources directory which contains the platform specific source files and resource files respectively.
Platform independent code must be written inside the folder src/main/java, while platform specific code must be written inside the matching platform sources folder. For instance, in your case, iOS code should be put inside the src/ios/java folder.
The plugin also makes sure that the dependencies are correctly configured for each source set. Also, when you are for instance generating your IPA, it will only contain the class files from the main and ios source sets.
For more information about the structure of a jfxmobile project, look at the Structure section on this webpage: http://javafxports.org/page/Setting_up
You can read more information about gradle source sets in the java plugin documentation: http://gradle.org/docs/current/userguide/java_plugin.html

Related

dart language: How to get all the classes available to import?

Programmatically I want to get all dart files available to import.
How can I achievement this? (programmatically)
In which environment do you want that?
If it's for a single Pub package, ensure that dart pub get has been run, then parse the .dart_tool/package_config.json file and find the roots of all the packages. Then search through those directories for all dart files that are not part files (does not start with part of ...;). The rest should be Dart library files which can be imported.
If you only want the packages that can be imported from inside lib/, you may want to parse the pubspec.yaml file too, so you can ignore the dev_dependencies.
Then you may also want to list the available dart:... platform libraries. Which are available depends on which platform you compile for. You need to figure that out somehow, then you should just keep a list for each platform.

iOS Cordova first plugin - plugin.xml to inject a feature

I'm creating my first Cordova plugin and I'm confused to the structure of building it. I have a fresh Cordova project and I've added the iOS platform. I was looking at this for guidance (specifically the Echo iOS plugin example part):
https://cordova.apache.org/docs/en/5.1.1/guide/platforms/ios/plugin.html
but I'm quite new to this and I'm a little bamboozled by what I'm actually supposed to be doing. It tells me to use plugin.xml to inject a feature specification to the local platform's config.xml file. Is the plugin.xml a file I need to create or is it the one in project> plugins> cordova-plugin-whitelist > plugin.xml? Either way how do I use it to inject this feature? I presume it's something it reads from when it builds the project but I'm still unsure how to do it.
Thanks.
As far as i know to create custom plugins, you gotta create a plugin folder as per the specifications and ensure that the plugin is referred in the fetch.json file under plugins folder. Then removing and re-adding the platform should take care of plugin installation in respective folder. You can refer any of the existing plugins to replicate the same folder structure.
The detailed info on custom plugin creation is available in cordova official documentation.Hope it helps

JUCE iOS build has no target

I have code for a VST plugin and need to port some of it to an iOS app.
I have tried building the OSX version and using the lib.a and it doesnt work. When I open the iOS version of it, Xcode shows that it is missing the tagret.
If I copy the code directly into Xcode with all the JUCE modules, and I set the header search paths, I get compilation errors on things like no such type for String
After this latest JUCE update, Xcode would give the same errors until I updated the JUCE file itself, so I think the JUCE build settings or configuration of the new version is doing something differently. How can I get this code into a different Xcode project, so that I can use it?
Can I compile it as a library and use the objects through the header?
JUCE is designed to be included in projects generated by the Introjucer / Projucer (the JUCE project management tool). Without this, the correct preprocessor definitions will not be set up.
If you really needed to include JUCE source code inside your program, you could manually set up these preprocessor definitions (take a look at the AppConfig.h header from a generated project to get an idea of how much work this will be), but you'd really be going against the normal "JUCE way".
Simply including the headers and linking against the library will not work without considerable effort, as the include structure is ... odd ... and there isn't any library to link against directly anyway (the generated projects contain all the JUCE source normally, so there's no need).
Adding the JUCE source files (i.e. .cpp and .mm) to be compiled in a project directly will result in compilation errors, as they need to be compiled in a very specific order which is mandated by the header file (the header files #include certain implementation files after setting up their dependencies).
In short, if you can at all I would advise generating the project with the Projucer and adding other source files in as you need them, rather than the other way around.

Dart project structure for apps (not libs)

I am trying to understand Dart's recommended project structure and not seeing the "forest through the trees".
So, if my project is intended to be a reusable library, say, a logging framework of some sort, then if I understand the above link correctly, I want all of my development to be under a lib and lib/src directory.
But what if I am building a web app? Where do my Dart source files go? Under packages? Specifically:
Where do I place Dart source files for a web app (not a lib)?
Are my web app's "packages" just directories that are logically organized similar to Java packages?
Does Dart recommend a 1-class-per-file convention for its source code?
1)
your_app_package/web
your_app_package/web/src/xxx
static content like jpg, css go to
* your_app_package/asset
2) the packages directory is maintained automatically. You configure in the file pubspec.yaml which 3rd party libraries you want to use and then call pub get or pub upgrade and the packages directory is updated automatically (the Darteditor does this automatically when you update pubspec.yaml).
3) not that I know of.
I had some problems putting additional classed in the code file of a Polymer element though. But I guess this is just a temporary limitation of Polymer.

Unity: resources.bundle isn't added to xcode

I used to copy/paste my IOS plugin files inside Plugins/IOS folder on my Unity project, but it doesn't work for bundles (as it has directory structure).
I can't beleave there is no way to generate xcode project from unity with .bundle inside?
Any help appreciated
Unity3D will not contains folders in the Plugins/iOS to Xcode project. In fact Unity3D will only auto merge source file and .a library for you, as described by Unity3D's doc:
Automated plugin integration Unity iOS supports automated plugin
integration in a limited way. All files with extensions
.a,.m,.mm,.c,.cpp located in the Assets/Plugins/iOS folder will be
merged into the generated Xcode project automatically. However,
merging is done by symlinking files from Assets/Plugins/iOS to the
final destination, which might affect some workflows. The .h files are
not included in the Xcode project tree, but they appear on the
destination file system, thus allowing compilation of .m/.mm/.c/.cpp
files.
Note: subfolders are currently not supported.
But you can use the PostprocessBuildPlayer attribute to implement this yourself. I made a tool for this purpose called XUPorter, which can make exporting and libraries setting easier from Unity3D to Xcode. You may want to see it on GitHub. There is a demo in the package and you may set your bundle under the 'folders' tag.

Resources