Dependency on ANE file
My project has several ANE dependencies.
When I add a reference to ANE file using dependencies instruction it doesn't seem to work.
How should I do it?
Thank you,
Ido.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Yennick Trevels on 09 Aug, 2014 08:09 AM
You'll have to use the 'extensionDir' property, where it's value is either an absolute or relative (from the project directory) path to where the ane files are.
Support Staff 2 Posted by Yennick Trevels on 09 Aug, 2014 08:12 AM
Ignore my last answer, that's only when you're building an application, not a library.
With a library you should just be able to reference those swc-based ane libraries as dependencies
3 Posted by ido.ran on 09 Aug, 2014 08:35 AM
I understand and that's the right answer. Unfortunately some developers distribute only the ANE file without the accompany swc file and as it turns out it is possible to reference ANE file using external-library switch.
One possible workaround is simply to copy the ANE file and rename it to SWC.
But, maybe adding ane command along side merged, external, etc. can be more elegant solution.
Support Staff 4 Posted by Yennick Trevels on 09 Aug, 2014 08:53 AM
I think for now the merged, external etc. scopes are sufficient. But as you indicated in your bug report, GradleFx currently only accepts swc-based dependencies, while it might make sense to also accept the '.ane' based files since they're also accepted by the external-library switch of the compiler (which GradleFx uses in the background).
So I'll just have to fix that bug I guess :)
I'll think about adding the 'ane' scope, not quite sure whether I want that, although it sounds like it might have some benefits (in terms of usability)
5 Posted by Matyas on 29 Oct, 2014 01:37 AM
Are you sure that the extensionDir property is working?
I have this in my build.gradle:
(the anes directory has some .ANE files) But if I run gradle clean packageMobile the extensionDir property seems to be ignored, this is how mxmlc is invoked:
This fails because the compiler cannot find classes that are in the ANE. As you can see the path defined in the extensionDir property is not here.. Or is there something else needed?
Support Staff 6 Posted by Yennick Trevels on 31 Oct, 2014 11:51 PM
You're mixing up two things, the compilation of your project and the packaging of it into a platform specific bundle (in your case an ipa).
What you're seeing there are the options used during compilation (mxmlc is the application compiler). Since the extensionDir property only applies to the packaging of your application, it won't show up in this compilation options list. There might be another problem during compilation (try to run gradle with either --info or --stacktrace). You probably didn't declare the required ane's as dependencies.
7 Posted by Peter Nicolai on 05 Dec, 2014 08:20 PM
"it might make sense to also accept the '.ane' based files since they're also accepted by the external-library switch of the compiler (which GradleFx uses in the background)."
I agree - gradlefx should support this since the compiler (and IDEs do) - otherwise you end up having to modify your project just to make it compatible with gradlefx which is undesirable IMO.
It is possible to get a working SWC out of an ANE and use that, but it's unnecessary and creates more risk of version conflicts, an extra artifact to manage versioning of, etc.
Support Staff 8 Posted by Yennick Trevels on 06 Dec, 2014 01:00 AM
This will be in the next version of GradleFx: https://github.com/GradleFx/GradleFx/issues/140