Skip to content

Invoke gradle fullClean on android after removing a native plugin #2369

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

Merged
merged 1 commit into from
Jan 3, 2017

Conversation

petekanev
Copy link
Contributor

Depends on: NativeScript/android#664

Moved native plugin clean logic to android build.gradle. Now when removing a plugin with android libraries in the form of jars and aars, the android build directory is invalidated, such that a full build will be necessary the next time the project is ran.

Addresses #2270

@petekanev petekanev requested a review from Plamen5kov December 21, 2016 12:26
@petekanev petekanev force-pushed the pete/clean-on-remove-native-plugin-android branch from be389db to 3f6daa3 Compare December 22, 2016 08:31
}
return Future.fromResult();
}

private cleanProject(projectRoot: string, options: string[]): void {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the method has async operation (.wait() ), so it must return IFuture<void> instead of void.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I wait() the asynchronous spawn, doesn't that mean that the method will execute synchronously, as the async operation is resolved within the method?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but think of the async method in a C# manner:
You can use await only in methods marked as async.
Futures allow such inconsistency - to have .wait in a pure sync method, but it's a common practice to wrap your code in a Future, when anywhere in the body you are using .wait. Also Promises and async/await in TypeScript does not allow having await without the method being marked as async, so it will be easier to replace the IFuture with Promise in the method definition.

Copy link
Contributor

@Plamen5kov Plamen5kov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great

@petekanev petekanev force-pushed the pete/clean-on-remove-native-plugin-android branch from 3f6daa3 to 51da72b Compare January 3, 2017 11:52
@petekanev petekanev force-pushed the pete/clean-on-remove-native-plugin-android branch from 51da72b to bc6fdf8 Compare January 3, 2017 12:04
@petekanev petekanev merged commit e830dfe into master Jan 3, 2017
@petekanev petekanev deleted the pete/clean-on-remove-native-plugin-android branch January 3, 2017 13:57
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.

3 participants