Skip to content

Fix(project template) Force bindings regen, if out dir empty. #595

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

Closed
wants to merge 1 commit into from

Conversation

hdeshev
Copy link
Contributor

@hdeshev hdeshev commented Oct 21, 2016

Running tns build ... --bundle runs the clean gradle target and
we can end up deleting bindings *.dex files while the presence of
*.txt files in the generator dir will prevent us from regenerating
them.

The fix checks the output dir and forces regeneration if it has no
files.

Running `tns build ... --bundle` runs the clean gradle target and
we can end up deleting bindings *.dex files while the presence of
*.txt files in the generator dir will prevent us from regenerating
them.

The fix checks the output dir and forces regeneration if it has no
files.
@hdeshev
Copy link
Contributor Author

hdeshev commented Oct 21, 2016

Related to NativeScript/nativescript-cli#2110

@hdeshev
Copy link
Contributor Author

hdeshev commented Oct 21, 2016

Ping @Plamen5kov

@ns-bot
Copy link

ns-bot commented Oct 21, 2016

💚

@petekanev
Copy link
Contributor

petekanev commented Oct 21, 2016

Looks 👍 for invalidating the gradle's up-to-date status.

A definite fix to the problem with SBG not triggering when project's been cleared can be to output interfaces-names.txt, and potentially bindings.txt inside the project's build dir, or (build folder is cleaned on every prepare) make a custom generateBindings task. @Plamen5kov

@Plamen5kov
Copy link
Contributor

@hdeshev I think a better solution would be to make our clean command take care of deleting the generated file in build-tools folder. That way we won't need additional logic to regenerate bindings. Maybe the template platforms/android/build.gradle can call the :asbg:clean command on the subproject. And the subproject can clean it's on generated files.

@hdeshev
Copy link
Contributor Author

hdeshev commented Oct 25, 2016

IMO the "right" solution to this problem is to generate all bindings-related .txt files inside the build/nativescript-bindings subfolder that will get properly cleaned and recreated.

I did a half-hearted attempt at getting that to run, but couldn't get it to work in reasonable time. Perhaps somebody who knows the gradle infrastructure better than me can have a shot.

@Plamen5kov
Copy link
Contributor

I'll take a look.

@Plamen5kov
Copy link
Contributor

closing in favor of: #598

@Plamen5kov Plamen5kov closed this Oct 25, 2016
@Plamen5kov Plamen5kov deleted the hdeshev/static-binding-force-if-no-dexes branch October 25, 2016 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants