So I am reaching out here because there are some very talented gradle users lurking around (yes I know who some of you are )
I want to do some unit tests for the server application of my engine. And building the tests is not an issue, but running them is.
Due to the serverās complex setup, I cannot just run the tests āin placeā like the normal ātestā task attempts to do. I need to build a folder with the necessary resources in it, and have the run directory for the tests point there. AKA, File myFile = new File("./myFile")
woule be a top level file in that directory for context. An example of these resources are groovy scripts that exist in a ./scripts/
external to the jar.
For my builds, I have a custom set of build tasks that setup all the resources in the distribution folder for the build. But I have no idea how to do the same for the tests, and then run them in that folder.
Also, my build script when creating the distribution adds custom properties to the manifest using:
jar {
manifest {
attributes(
'Main-Class': 'io.tlf.outside.server.Main',
'Implementation-Title': project.name,
'Implementation-Version': version,
'Version-ID': versionId,
'Class-Path': configurations.compile.files.findAll{ !it.getName().startsWith('openjfx-') }.collect{ 'lib/' + it.getName() }.join(' ')
)
}
}
Is there any way to get the unit tests to also include these manifest properties, like a way to āfakeā reading the properties?
Any help would be greatly appreciated.
Thanks,
Trevor