How to compile the specified configuration file like maven?

In IDEA, there is a project with two different configuration files, test and product. How to specify the configuration file when you package it into jar with the “gradle build” command, just like “mvn package -P test” in maven

image