Foros de discusión

gradlew generate doesn't clean previously generated files

thumbnail
Denis Signoretto, modificado hace 8 años.

gradlew generate doesn't clean previously generated files

Expert Mensajes: 375 Fecha de incorporación: 21/04/09 Mensajes recientes
Hi,

I'm experincing an error related to refactored/previously generated files by SDK Builder.
To gei it working I need to manually clean the module/module-name/android/gen directory.

I've tryed a "gradlew clean jar" task but I doesn't solve.
Is there a way to clean generated files before start a new generation ?

Thanks,
Denis.
thumbnail
Bruno Farache, modificado hace 8 años.

RE: gradlew generate doesn't clean previously generated files

Liferay Master Mensajes: 603 Fecha de incorporación: 14/05/07 Mensajes recientes
No, but you could easily add a gradle tasks that delete the gen folder and make it a dependency of the generate task.
thumbnail
Denis Signoretto, modificado hace 8 años.

RE: gradlew generate doesn't clean previously generated files

Expert Mensajes: 375 Fecha de incorporación: 21/04/09 Mensajes recientes
Hi Bruno,

IMHO it should be an improvement to add to Mobile SDK as a default behaviour so other users can take advantage of it and use SDK Builder without exceptions.
Do you agree ? or do you see some drawbacks or side effect about it ?

Regards,
Denis
thumbnail
Bruno Farache, modificado hace 8 años.

RE: gradlew generate doesn't clean previously generated files

Liferay Master Mensajes: 603 Fecha de incorporación: 14/05/07 Mensajes recientes
Hey Denis, sorry, just saw this message now.

We used to clean up the generated files before but we removed that for some reason. I think it was because portal and plugins classes used to be generated to the same destination folder and I wanted to keep portal classes when generating for plugins, or something like that.

Were you able to add a clean up task as a dependency of the generate task?
thumbnail
Denis Signoretto, modificado hace 8 años.

RE: gradlew generate doesn't clean previously generated files

Expert Mensajes: 375 Fecha de incorporación: 21/04/09 Mensajes recientes
Hi Bruno,

don't worry! No, at the moment I've switched from gradle to Maven (I'm invoking SDK Builder throught the Maven exec plugin).

If I'm not wrong (and understand well), in the current version of Mobile SDK the portal Mobile SDK API are generated within the "liferay-android-sdk" artifact and and plugins Mobile SDK API are generated separately each in a it's own module directory build. I'm wondering if requirement to keep portal classes it's still present in the current version of Mobile SDK and/or if the clean up task (before generate) can be reintroduced.

Bye,
Denis.
thumbnail
Bruno Farache, modificado hace 8 años.

RE: gradlew generate doesn't clean previously generated files

Liferay Master Mensajes: 603 Fecha de incorporación: 14/05/07 Mensajes recientes
Correct, that's what I meant, we can add the clean up back.

Since you moved to maven, it won't affect you anyways.