shanedell commented on code in PR #1452:
URL: https://github.com/apache/daffodil-vscode/pull/1452#discussion_r2420594775
##########
vite/dev.vite.config.mjs:
##########
@@ -43,35 +43,46 @@ const packageData = jsoncParse(
fs.readFileSync(path.resolve('package.json'), 'utf8')
)
const pkg_version = packageData['version']
-const daffodilVersion = packageData['daffodilVersion']
-const serverPackage = `daffodil-debugger-${daffodilVersion}-${pkg_version}`
-const zipFilePath = path.resolve(
- `debugger/target/universal/${serverPackage}.zip`
-)
+const daffodilScalaVersions = packageData['daffodilScalaVersions']
function unzipAfterBuild() {
return {
name: 'unzip-server-package',
apply: 'build',
async closeBundle() {
- const serverPackageFolder = path.join(
- path.resolve('dist/package'),
- serverPackage
- )
+ Object.entries(daffodilScalaVersions).forEach(
+ async ([_, scalaVersion]) => {
+ const serverPackage =
`daffodil-debugger-${scalaVersion}-${pkg_version}`
+ const jvmFolderName = `jvm-${scalaVersion}`
+ const zipFilePath = path.resolve(
+ `debugger/target/${jvmFolderName}/universal/${serverPackage}.zip`
+ )
+
+ const serverPackageFolder = path.join(
+ path.resolve('dist/package'),
+ serverPackage
+ )
- // remove debugger package folder if exists
- if (fs.existsSync(serverPackageFolder)) {
- fs.rmSync(serverPackageFolder, { recursive: true, force: true })
- }
-
- await new Promise((resolve, reject) => {
- const stream = fs
- .createReadStream(zipFilePath)
- // @ts-ignore types for unzip-stream
- .pipe(unzip.Extract({ path: '.' }))
- stream.on('close', () => resolve())
- stream.on('error', (err) => reject(err))
- })
+ // remove debugger package folder if exists
+ if (fs.existsSync(serverPackageFolder)) {
+ fs.rmSync(serverPackageFolder, { recursive: true, force: true })
+ }
+
+ // if the debugger package doesn't exist continue
+ if (!fs.existsSync(zipFilePath)) {
+ return
+ }
+
+ await new Promise((resolve, reject) => {
Review Comment:
Yeah so this happening so we don't have to bundle the ZIP file. This goes in
tandem with your other comment
(https://github.com/apache/daffodil-vscode/pull/1452#discussion_r2419654816). I
didn't realize we could do that with sbt-native-packager, where its not making
the zip but we would still have all the bin and lib files available. So I will
make a separate issue for cleaning up the build process, basically eliminating
this unzipping part.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]