Skip to content

Conversation

rigor789
Copy link
Member

@rigor789 rigor789 commented Apr 27, 2020

PR Checklist

What is the current behavior?

There is no way to add additional gradlew parameters to a build.

What is the new behavior?

We can now create before-build-task-args hooks where we can modify the args array that's passed to gradlew.

For example, to use wix/Detox - we need to alter a projects app.gradle and build the app with assembleAndroidTest passed to gradlew. To do this, we have to manually run tns prepare android and then run the correct gradlew command with our additional parameters. With this change, we can do this with a hook (would need to add a condition in a real app):

module.exports = function(hookArgs, $errors, $injector) {
    hookArgs.args.unshift('assembleAndroidTest')
    hookArgs.args.push('-DtestBuildType=debug')
}

Implements #2481

@cla-bot cla-bot bot added the cla: yes label Apr 27, 2020
@NathanWalker NathanWalker merged commit 6684a3e into NativeScript:master May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants