stevedlawrence commented on code in PR #1452:
URL: https://github.com/apache/daffodil-vscode/pull/1452#discussion_r2414336502
##########
vite/package.vite.config.mjs:
##########
@@ -109,23 +121,38 @@ function copyToPkgDirPlugin() {
{ from: 'src/styles/styles.css', to: `${pkg_dir}/src/styles/styles.css` },
{ from: 'src/tdmlEditor/', to: `${pkg_dir}/src/tdmlEditor` },
]
- const serverPackageFolder = path.join(
- path.resolve('dist/package'),
- serverPackage
- )
-
- console.debug(`== [Vite] | serverPackageFolder: ${serverPackageFolder}`)
- // remove debugger package folder if exists
- if (fs.existsSync(serverPackageFolder)) {
- fs.rmSync(serverPackageFolder, { recursive: true })
+
+ const serverPackageFolders = {
+ scala2_12: path.join(
+ path.resolve('dist/package'),
+ `daffodil-debugger-${daffodilVersions['scala2.12']}-${pkg_version}`
+ ),
+ scala2_13: path.join(
+ path.resolve('dist/package'),
+ `daffodil-debugger-${daffodilVersions['scala2.13']}-${pkg_version}`
+ ),
+ scala3: path.join(
+ path.resolve('dist/package'),
+ `daffodil-debugger-${daffodilVersions['scala3']}-${pkg_version}`
+ ),
Review Comment:
> I would prefer doing a single bin as well but not sure how to make
sbt-native-packager work that way, so may be best to go multiple for now, one
for each scala binary version.
I think we mainly just use sbt-native-packager to easily organize jars and
transitive directories. The single bin doesn't necessarily have to be part of
sbt-native-packager and its configuration. You could create a custom script and
package it into the vsix like you do any other vsix artifact. It just has to
know how to reference the directories of jars that are packaged in the vsix
file.
You could potentially even simplifiy things, for example, instead of running
`sbt Universal/packageBin`, you could run `sbt Universal/stage`, which creates
directories like
```
./target/jvm-3/universal
├── scripts
│ └── bin
│ ├── daffodil-debugger
│ └── daffodil-debugger.bat
└── stage
├── bin
│ ├── daffodil-debugger
│ └── daffodil-debugger.bat
└── lib
└── *.jar # all your jars
```
That doesn't create the zip that packageBin usually does. Then you could
configure yarn/vsix/etc to package just the lib directories and ignore the
scripts/bin directories.
That ultimately gives you a single script and three lib directories that the
script can reference.
It does mean you have to maintain a custom script, which is a bit more of a
maintenance burden instead of letting sbt-native-packager do it. Might be best
to stick with separate scripts for now and then if that becomes a pain for
whatever reason (e.g. hard to integrate the Daffodil cache jars) we could
always be follow up with the above change.
--
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]