Is there a restriction in defining component names in Native Gradle builds?


(Ganesh) #1

I tried to name a Native Executable as SVDD.APPLI.T.EQP_SCHED.01. However, I got the following error.

123: unexpected token: 01 @ line 123, column 26.
SVDD.APPLI.T.EQP_SCHED.01(NativeExecutableSpec){
^

1 error

So, to overcome this I enclosed the component name under quotes. However, the name of the directory under $buildDir/exe/, the component name is not reproduced. I get it as sVDD.APPLI.T.EQP_SCHED.01 and my generated executable has a name SVDD.APPLI.T.EQP_SCHED.exe instead of SVDD.APPLI.T.EQP_SCHED.01.exe

How can I overcome this?


(Chris Doré) #2

Instead of relying on the component name, try setting baseName to what you want. https://docs.gradle.org/current/dsl/org.gradle.nativeplatform.NativeExecutableSpec.html

componentXYZ(Native....) {
    baseName 'SVD....'
}

(Ganesh) #3

Hi,

Thanks for the reply but I am still facing issues. Gradle modifies my baseName when creating the executable.

Instead of SVDD.APPLI.T.EQP_SCHED.01.exe, I get SVDD.APPLI.T.EQP_SCHED.exe

I would like to have a deterministic name for the $buildDir/exe/<this_folder> and the name of the executable. Ideally I want these two to be same as component name.