Search code examples
androidandroid-studiogradlegradlewgradle-task

How to run gradle tasks from specific ".gradle" file with terminal in android studio?


I am new to writing gradle tasks.

I have added a .gradle file into root of my project in this gradle file there are some tasks, my question is how to run these tasks via Terminal in android studio?

gradle-task

When i run a task with Terminal in android studio it has return following error:

Task 'testTask' not found in root project 'TestProject'.

Solution

  • We must add any custom gradle scripts to build.gradle using apply from
    For example:

    apply from: "$rootDir/test.gradle"