Shadow jars have a few issues:
- Longer build and deploy times (due to copying, unzipping, rezipping, and sending a larger archive over the wire)
- Manifest and service file entries may be overwritten unless explicitly combined in the build
- Java module boundaries are broken wide open, allowing access to internals not intended for public use
This could be done manually by adding the following block to the artifacts block in a deploy target, but it'd be nicer to have handled automatically by GradleRIO.
developerRobotRuntimeLibs(FileTreeArtifact) {
// Use the runtime classpath of the project
preWorkerThread << { artifact ->
// 'artifact' is the current FileCollectionArtifact instance
// We resolve the configuration here while we still have the Gradle lock
def resolvedFiles = configurations.runtimeClasspath.resolve()
artifact.files.set(project.files(resolvedFiles).asFileTree)
}
// Set the directory on the remote target where libs should be placed
directory = deploy.targets.systemcore.directory + '/wpilib/classpath'
// Use the md5sum cache method to skip existing/unchanged files
cacheMethod = new Md5SumCacheMethod('md5sum')
// Delete old files on the deploy target to avoid stale/unused libraries
deleteOldFiles = true
}
Shadow jars have a few issues:
This could be done manually by adding the following block to the
artifactsblock in a deploy target, but it'd be nicer to have handled automatically by GradleRIO.