HumbleUI / JWM

Cross-platform window management and OS integration library for Java
Apache License 2.0
571 stars 46 forks source link

packaging script does not include native libraries #163

Closed i10416 closed 2 years ago

i10416 commented 2 years ago

I think native libraries should be included in jar like this, but current package script does not do that. Is this intentional?

  subprocess.check_call(["jar",
    "--create",
    "--file", "target/jwm-" + rev + ".jar",
    "-C", "target/classes", ".",
    "-C", "target/maven", "META-INF",
+    "-C", "windows/build", "jwm-x64.dll",
+    "-C", "macos/build", "jwm-x64.dylib",
+    "-C", "linux/build" , "jwm-x64.so"
  ])

https://github.com/HumbleUI/JWM/blob/main/script/package.py#L31

tonsky commented 2 years ago

They are included through target/classes:

[~/ws/relemma] unzip -l ~/Downloads/jars/jwm-main.jar 
Archive:  /Users/tonsky/Downloads/jars/jwm-main.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  10-05-2021 22:38   META-INF/
       61  10-05-2021 22:38   META-INF/MANIFEST.MF
   159519  10-05-2021 22:38   libjwm_arm64.dylib
        4  10-05-2021 22:38   jwm.version
   181704  10-05-2021 22:38   libjwm_x64.so
   518656  10-05-2021 22:38   jwm_x64.dll
   158712  10-05-2021 22:38   libjwm_x64.dylib
        0  10-05-2021 22:38   io/
        0  10-05-2021 22:38   io/github/
        0  10-05-2021 22:38   io/github/humbleui/
        0  10-05-2021 22:38   io/github/humbleui/jwm/
      767  10-05-2021 22:38   io/github/humbleui/jwm/EventWindowRestore.class
     2045  10-05-2021 22:38   io/github/humbleui/jwm/EventMouseMove.class
     4553  10-05-2021 22:38   io/github/humbleui/jwm/App.class
      335  10-05-2021 22:38   io/github/humbleui/jwm/Layer.class
...

This script relies on Github Actions to put native artifacts in target/classes, because it’s a single jar and three artifacts come from three different machines. It can be changed to work locally, too, but it will include only one of three, I assume. Do you need that?

i10416 commented 2 years ago

Yeah, I somehow misunderstood. Thanks.

i10416 commented 2 years ago

Do you need that

164

To build src in dashboard dir from native image dir, I need latest jwm jar packaged with pom. It is easy to copy files generated by package script to local maven repo and configure to fetch jar from there. Maybe I should add another script for publish local.