@@ -103,14 +103,14 @@ object JniCrossPackage extends AutoPlugin {
103
103
IO .createDirectory(platformTargetDir / " docker" )
104
104
IO .createDirectory(platformTargetDir / " lib" )
105
105
106
- // Generate Dockerfile
106
+ // Generate Dockerfile.
107
107
platform.dockerfile.foreach(d => {
108
108
val dockerfilePath = platformTargetDir / " docker" / " Dockerfile"
109
109
log.info(s " Generating Dockerfile in ' $dockerfilePath'. " )
110
110
IO .write(dockerfilePath, d)
111
111
})
112
112
113
- // Compile and generate binaries
113
+ // Compile and generate binaries.
114
114
log.info(s " Generating binaries in ' $platformTargetDir'. " )
115
115
val dockerContainer = s " ${moduleName.value}_ ${platform.name}"
116
116
val exitCode = platform.build(
@@ -119,7 +119,10 @@ object JniCrossPackage extends AutoPlugin {
119
119
srcDir = (baseDirectory.value / " src" / " main" / " native" ).getPath,
120
120
tgtDir = platformTargetDir.getPath,
121
121
libPath = nativeLibPath.value(platform).getPath).map(_ ! log)
122
+
123
+ // Clean up.
122
124
log.info(" Cleaning up after build." )
125
+ IO .deleteFilesEmptyDirs(IO .listFiles(platformTargetDir / " code" ))
123
126
platform.cleanUpAfterBuild(dockerContainer).foreach(_ ! log)
124
127
if (exitCode.getOrElse(0 ) != 0 )
125
128
sys.error(s " An error occurred while cross-compiling for ' $platform'. Exit code: $exitCode. " )
0 commit comments