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
[CLI] Allow to use android libraries during build #4935
Conversation
… which is the whole point. I put actionbarsherlock as a commented example
You can actually do this today using CLI hooks. Try:
As for the scanning of Java files in the |
waiting for your commit, then i ll use your hook then |
Referencing this Jira issue: https://jira.appcelerator.org/browse/TIMOB-11360
|
@farfromrefug FYI, the |
Done it Chris!
|
Doh, forgot that data.args[1] is the params. :) Glad you got it working. |
Hello, I had successfully used the approach described here on my project, with version 3.2.0 This is, adding a plugin, with a hook folder and inside that hook: /**
* This code is needed to copy the resources of the GUJ EMS library project when compiling the Android apk.
*
* It's due to a Titanium bug on the building process explained here: https://jira.appcelerator.org/browse/TIMOB-11360
*
*/
exports.cliVersion = '>=3.X';
exports.init = function (logger, config, cli, appc) {
cli.on('build.android.aapt', {
pre: function(data, next) {
var args = data.args[1];
args.push('--auto-add-overlay');
var externalLibraries = [
{
javaClass:'CLASS NAME',
resPath:'RESOURCES FOLDER'
}
];
externalLibraries.forEach(function(lib) {
args.push('--extra-packages', lib.javaClass, '-S', lib.resPath);
});
next(data);
}
});
}; I got it working perfectly, I was able to use my module which was using an Android library with resources, etc. Now I have upgraded to 3.2.1 and I can't compile for Android anymore: [INFO] : Generating /Users/Jose/Documents/Titanium_Studio_Workspace/HomestylrTest/build/android/res/values/theme.xml If I remove the plugin, it compiles normally again, but of course the module fails because the resources are not present. Do you have any idea why it doesn't work anymore? Is that solution no valid anymore in 3.2.1 ? Can I revert the CLI, IDE, etc. easily to get it working again? Thanks in advance!! |
Yes that error is due to the very latest CLI. To me ti's the call to next with "data" that was the source of the error. |
If I recall correctly, |
Oh that s the null then! Though it works without arguments because what you modify in the hook is a reference object ;) |
Thanks a million!! It works like a champ now ;-) |
Those libs can have res, which is the whole point.
I put actionbarsherlock as a commented example