Naming batch file Gradle's application plugin

Viewed 678

I would like to give a custom file name to my batch file inside the archive/distribution when using Gradle's application plugin. Following is the build.gradle file.

apply plugin: 'application'
mainClassName = 'com.org.test.TestMain';

dependencies {
 compile group: 'com.oracle', name: 'ojdbc7', version: '+'
}

See this picture

I would like to rename test.bat to abc_xyz.bat. in the distribution. Can anyone suggest how this can be possible?

Thank you.

2 Answers

If you're using the Kotlin DSL

tasks.withType<CreateStartScripts> {
    applicationName = "blah"
}

would create blah and blah.bat. Verified with Gradle 6.6.1.

Related