how to execute 'gradle build' command from gradle.build script

Viewed 4009

I want to execute a gradle build command from build.gradle file.

build.gradle file

apply plugin: 'java'
apply plugin: 'application'
task me{
   //Can we perform gradle build command here.
       }

Question: Can we perform gradle build command inside task me, similarly like we do from command prompt(screenshot attached)..?

Note : I am using windows env, please assume I am providing all other statements in build.gradle file. I am able to build from command prompt by executing

gradle build file.

I want to execute this task me from command prompt and it should be responsible to call gradle build command.(attached screenshot)

enter image description here

2 Answers
Related