문제 설명
Eclipse RCP 제품 파일 ‑ 플랫폼별 종속성이 있는 여러 플랫폼을 처리하는 방법 (Eclipse RCP Product File ‑ how to handle multiple platforms with platform specific dependencies)
.product
파일에 기본 SWT 플러그인에 대한 참조가 포함된 Eclipse RCP 애플리케이션이 있습니다.
<plugins>
<plugin id="org.eclipse.equinox.launcher.win32.win32.x86_64" fragment="true"/>
<plugin id="org.eclipse.swt.win32.win32.x86_64" fragment="true"/>
</plugins>
그러나 다른 플랫폼(예: Mac)에서는 해당 플러그인을 확인할 수 없습니다. . 해당 플러그인의 Mac 버전(예: org.eclipse.swt.cocoa.macosx.x86_64
)을 사용하면 모든 것이 잘 작동합니다.
다른 플러그인을 지정하는 방법이 있습니까? 다른 환경이나 더 일반적인 플러그인이 있습니까?
다중 플랫폼 RCP 제품을 배포할 때 상황이 복잡해집니다. 하지만 지금은 최대한 간단하게 만들려고 노력하고 있습니다. 여러 플랫폼의 개발자가 최종 사용자가 아닌 애플리케이션을 시작하고 실행할 수 있도록 합니다.
참조 솔루션
방법 1:
Use a feature based product file rather than plug‑in based.
The feature.xml file defining a feature can specify the OS / GUI / architecture.
This is what the standard Eclipse org.eclipse.e4.rcp
feature.xml has for the SWT plug‑in / fragments:
<plugin
id="org.eclipse.equinox.launcher.cocoa.macosx.x86_64"
os="macosx"
ws="cocoa"
arch="x86_64"
download‑size="40"
install‑size="88"
version="1.1.1100.v20190907‑0426"
fragment="true"/>
<plugin
id="org.eclipse.equinox.launcher.gtk.linux.ppc64le"
os="linux"
ws="gtk"
arch="ppc64le"
download‑size="76"
install‑size="253"
version="1.1.1100.v20190907‑0426"
fragment="true"/>
<plugin
id="org.eclipse.equinox.launcher.gtk.linux.x86_64"
os="linux"
ws="gtk"
arch="x86_64"
download‑size="69"
install‑size="166"
version="1.1.1100.v20190907‑0426"
fragment="true"/>
<plugin
id="org.eclipse.equinox.launcher.win32.win32.x86_64"
os="win32"
ws="win32"
arch="x86_64"
download‑size="80"
install‑size="161"
version="1.1.1100.v20190907‑0426"
fragment="true"/>
<plugin
id="org.eclipse.swt"
download‑size="16"
install‑size="32"
version="3.114.0.v20200304‑0601"
unpack="false"/>
방법 2:
Based on the solution provided by greg‑449, I noticed that you can have multiple contradicting plugins without issue ‑ i.e. both Windows & Mac plugins can be specified and at runtime Eclipse will use whatever it can find.
This means that by specifying both plugins, despite one always being displayed as an error (as it's unresolvable on that platform), it works fine.