Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Naming batch file Gradle's application plugin

Tags:

gradle

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.

like image 615
Subbu Avatar asked Oct 18 '25 15:10

Subbu


2 Answers

Try:

createStartScripts {
    applicationName = 'abc_xyz'
}

Not tested it though...

like image 60
tim_yates Avatar answered Oct 22 '25 06:10

tim_yates


If you're using the Kotlin DSL

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

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

like image 24
Abhijit Sarkar Avatar answered Oct 22 '25 07:10

Abhijit Sarkar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!