我想将基于 Eclipse Luna 的 Eclipse RCP 项目从“POM 中的 P2 存储库”方法切换到目标文件方法。 (从 Tycho Documentation 中的方法 2 到方法 1)。 这看起来很简单,但并不是因为我需要支持多种环境。
所以在我旧的 parent-pom 中我有:
function rss(url, n) {
var params = {
headers: {
'Content-Type': "application/json", 'Accept': "application/json",
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36'
},
muteHttpExceptions: true,
method: "GET",
contentType: "application/json",
validateHttpsCertificates: false,
};
var response = UrlFetchApp.fetch(url, params);
html = response.getContentText();
const j_obj = JSON.parse(html);
return j_obj["data"][n]["attributes"]["value"];
}
还有:
<repositories>
<repository>
<id>eclipse platform</id>
<url>https://my-domain/nexus/repository/eclipse_luna_repo/</url>
<layout>p2</layout>
</repository>
<repository>
<id>e4 tools</id>
<url>https://my-domain/nexus/repository/e4_tools/</url>
<layout>p2</layout>
</repository>
</repositories>
这足以将目标平台定义为 Tycho,然后从不同的插件定义中选择所需的依赖项。
如何获得等效的目标文件?
到目前为止,我的尝试如下(用 Target Platform DSL 转换):
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<resolver>p2</resolver>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
但是当我用 Tycho 构建时,我得到以下异常:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="My Target" sequenceNumber="1621516437">
<locations>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.platform.feature.group" version="4.4.2.v20150204-1700"/>
<unit id="org.eclipse.rcp.feature.group" version="4.4.2.v20150204-1700"/>
<unit id="org.eclipse.jdt.feature.group" version="3.10.1.v20150204-1700"/>
<unit id="org.eclipse.equinox.p2.discovery.feature.feature.group" version="1.0.200.v20140512-1802"/>
<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.102.v20150204-1316"/>
<unit id="org.eclipse.ui" version="3.106.1.v20141002-1150"/>
<unit id="org.eclipse.core.filesystem.linux.x86_64" version="1.2.200.v20140124-1940"/>
<unit id="org.eclipse.core.filesystem.win32.x86" version="1.4.0.v20140124-1940"/>
<unit id="org.eclipse.core.net.linux.x86_64" version="1.1.100.v20140124-2013"/>
<unit id="org.eclipse.core.net.win32.x86" version="1.0.100.v20140124-2013"/>
<unit id="org.eclipse.equinox.security.win32.x86" version="1.0.300.v20130327-1442"/>
<unit id="org.eclipse.swt.gtk.linux.x86_64" version="3.103.2.v20150203-1351"/>
<unit id="org.eclipse.swt.win32.win32.x86" version="3.103.2.v20150203-1351"/>
<repository id="eclipse-luna" location="https://my-domain/nexus/repository/eclipse_luna_repo"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.e4.tools.compat" version="0.12.0.v20141113-1753"/>
<unit id="org.eclipse.e4.tools.services" version="0.12.0.v20141120-0900"/>
<repository id="e4_luna_tools" location="https://my-domain/nexus/repository/e4_tools"/>
</location>
</locations>
</target>
我认为有两种解决方案:
org.eclipse.core.filesystem.linux.x86_64 1.2.200.v20140124-1940 cannot be installed in this environment because its filter is not applicable.
Eclipse 可以启动我的程序,而 Tycho 可以构建它。win32 win32 x86_64
和 includeMode="slicer"
includeAllPlatforms="true"
依赖项无法解析。我没有使用 PowerPC
架构。此外,这可能是以下问题的重复:Feature For Multiple OS 但是因为它已经四年了并且没有答案,我想我会再试一次......