Summary: | GraalVM: provide json config file for fields/methods to keep for native-to-Java invocation | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Thomas Singer <ts-swt> | ||||||
Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> | ||||||
Status: | NEW --- | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | gautier.desaintmartinlacaze, ivanooi, ts-swt, wim.jongman | ||||||
Version: | 4.18 | ||||||||
Target Milestone: | --- | ||||||||
Hardware: | PC | ||||||||
OS: | All | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Thomas Singer
2020-10-17 03:26:34 EDT
Created attachment 284492 [details]
script, configuration for tiny SWT code
- unpack the .zip file in an empty directory - put the org.eclipse.swt.win32.win32.x86_64.jar as swt.jar in that directory - extract the swt-win32-<build>.dll from the swt.jar as swt-win32.dll in parallel - invoke build.cmd => an .exe file of ~15MB will be created - run that .exe file and enjoy a native SWT application Thomas, this is very interesting. However, it is not clear what you request with this bug. I thought, the subject would be clear enough? Created attachment 284499 [details] build script with some stuff I had to add. (In reply to Thomas Singer from comment #4) > I thought, the subject would be clear enough? If you think the subject has the complete requirement then it is fine. I did not know GraalVM so I would have liked some more information. (In reply to Thomas Singer from comment #1) > Created attachment 284492 [details] > script, configuration for tiny SWT code I tried your example from scratch. * After downloading GraalVM the script complained about missing install-image * I did: gu install native-image Then I found that it required VS so I installed the community edition and the C++ components. After this was done, it still did not build. The process complained about DPUtil being intialized at build time and the script suggested to add: * -H:+TraceClassInitialization and after that it suggested to add: * --initialize-at-build-time=org.eclipse.swt.internal.DPIUtil After this was done, the buld succeeded. And I had a 23MB exe that worked. I have attached the updated script for anyone interested. My created executable has a size of 15MB and the steps work fine on 2 different systems. I just had to use the Visual Studio Installer 2019 to install the C++ build tools. BTW, use $ editbin /SUBSYSTEM:Windows main.exe to remove the console window that occurs when launching. With RCEdit from https://github.com/electron/rcedit it is easy to set an icon for the created executable. |