Hi Wirianto,
you can use the apply from: <scriptfile> feature from Gradle to achieve this.
You can define for each profile a separate scriptfile with all the information needed for the profile. This is just another Gradle build file, so you can use what you know from Gradle. Define dependencies, task, extra plugins, etc. For example if you have a dev and
test profile you can create the files dev-profile.gradle and test-profile.gradle.
In your "main" build file you define everything that is common for all profile and build needs, plus you add the following line:
apply from: "${profile}-profile.gradle"
When you run Gradle you can pass the name of the profile using the -P option:
$ gradle -Pprofile=dev tasks
or
$ gradle -Pprofile=test tasks