Skip to content

Commit 9ae72e1

Browse files
committed
Add FreeBSD platforms' build.
Part of eclipse-platform/eclipse.platform.releng.aggregator#2959 Most changes are made to the parser of the .product file and its GUI editor to support relevant elements for FreeBSD such as: programArgsFbsd vmArgsFbsd etc.
1 parent e63f3f9 commit 9ae72e1

File tree

23 files changed

+231
-31
lines changed

23 files changed

+231
-31
lines changed

build/org.eclipse.pde.build/scripts/productBuild/allElements.xml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
Copyright (c) 2006, 2008 IBM Corporation and others.
2+
Copyright (c) 2006, 2025 IBM Corporation and others.
33
44
This program and the accompanying materials
55
are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
1010
1111
Contributors:
1212
IBM Corporation - initial API and implementation
13+
Tue Ton - support for FreeBSD
1314
-->
1415
<project name="Product Build allElements Delegator">
1516
<property name="defaultAssemblyEnabled" value="true" />
@@ -66,6 +67,13 @@
6667
</ant>
6768
</target>
6869

70+
<property name="assemble.org.eclipse.pde.build.container.feature.freebsd.gtk.x86_64" value="true" />
71+
<target name="assemble.org.eclipse.pde.build.container.feature.freebsd.gtk.x86_64">
72+
<ant antfile="${assembleScriptName}" dir="${buildDirectory}">
73+
<property name="archiveName" value="${archiveNamePrefix}-freebsd.gtk.x86_64"/>
74+
</ant>
75+
</target>
76+
6977
<property name="assemble.org.eclipse.pde.build.container.feature.group.group.group" value="true" />
7078
<target name="assemble.org.eclipse.pde.build.container.feature.group.group.group">
7179
<ant antfile="${assembleScriptName}" dir="${buildDirectory}">

build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/Utils.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2021 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
1010
*
1111
* Contributors:
1212
* IBM Corporation - initial API and implementation
13+
* Tue Ton - support for FreeBSD
1314
*******************************************************************************/
1415
package org.eclipse.pde.internal.build;
1516

@@ -615,7 +616,7 @@ private static void generateLinkInstruction(AntScript script, String dir, String
615616
arguments.add("-sf"); //$NON-NLS-1$
616617
arguments.add(links[i]);
617618
arguments.add(links[i + 1]);
618-
script.printExecTask("ln", dir, arguments, "Linux"); //$NON-NLS-1$ //$NON-NLS-2$
619+
script.printExecTask("ln", dir, arguments, "Linux,FreeBSD"); //$NON-NLS-1$ //$NON-NLS-2$
619620
arguments.clear();
620621
}
621622
}

build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/ModelBuildScriptGenerator.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2021 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which accompanies this distribution,
@@ -10,6 +10,7 @@
1010
*
1111
* Contributors: IBM - Initial API and implementation Prosyst - create proper
1212
* OSGi bundles (bug 174157)
13+
* Tue Ton - support for FreeBSD
1314
******************************************************************************/
1415
package org.eclipse.pde.internal.build.builder;
1516

@@ -954,7 +955,7 @@ private void generateLinkInstruction(String dir, String files) {
954955
for (int i = 0; i < links.length; i += 2) {
955956
arguments.add(links[i]);
956957
arguments.add(links[i + 1]);
957-
script.printExecTask("ln -s", dir, arguments, "Linux"); //$NON-NLS-1$ //$NON-NLS-2$
958+
script.printExecTask("ln -s", dir, arguments, "Linux,FreeBSD"); //$NON-NLS-1$ //$NON-NLS-2$
958959
arguments.clear();
959960
}
960961
}

build/org.eclipse.pde.build/src_ant/org/eclipse/pde/internal/build/tasks/JNLPGenerator.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2005, 2021 IBM Corporation and others.
2+
* Copyright (c) 2005, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -12,6 +12,7 @@
1212
* IBM Corporation - initial API and implementation
1313
* G&H Softwareentwicklung GmbH - internationalization implementation (bug 150933)
1414
* Michael Seele - remove offline-allowed (bug 153403)
15+
* Tue Ton - support for FreeBSD
1516
*******************************************************************************/
1617

1718
package org.eclipse.pde.internal.build.tasks;
@@ -334,6 +335,9 @@ private String convertOS(String os) {
334335
if ("linux".equalsIgnoreCase(os)) { //$NON-NLS-1$
335336
return "Linux"; //$NON-NLS-1$
336337
}
338+
if ("freebsd".equalsIgnoreCase(os)) { //$NON-NLS-1$
339+
return "FreeBSD"; //$NON-NLS-1$
340+
}
337341
if ("solaris".equalsIgnoreCase(os)) { //$NON-NLS-1$
338342
return "Solaris"; //$NON-NLS-1$
339343
}

build/org.eclipse.pde.build/templates/packager/customTargets.xml

+6
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,10 @@
2525
</ant>
2626
</target>
2727

28+
<target name="assemble.freebsd.gtk.x86_64.xml">
29+
<ant antfile="${assembleScriptName}" >
30+
<property name="archiveName" value="${archiveNamePrefix}-freebsd.gtk.x86_64.zip"/>
31+
</ant>
32+
</target>
33+
2834
</project>

build/org.eclipse.pde.build/templates/packager/packaging.properties

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
###############################################################################
2-
# Copyright (c) 2006, 2016 IBM Corporation and others.
2+
# Copyright (c) 2006, 2025 IBM Corporation and others.
33
#
44
# This program and the accompanying materials
55
# are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
1010
#
1111
# Contributors:
1212
# IBM Corporation - initial API and implementation
13+
# Tue Ton - support for FreeBSD
1314
###############################################################################
1415
# The chmod and links must indicate a path relative to the root directory.
1516

@@ -20,3 +21,4 @@ root.permissions.755=eclipse,*.so*
2021

2122
root.win32.win32.x86_64=eclipse.exe, eclipsec.exe
2223
root.linux.gtk.x86_64=eclipse,libcairo-swt.so,about_files/,about.html,icon.xpm
24+
root.freebsd.gtk.x86_64=eclipse,libcairo-swt.so,about_files/,about.html,icon.xpm

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/exports/ProductExportOperation.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2006, 2022 IBM Corporation and others.
2+
* Copyright (c) 2006, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -12,6 +12,7 @@
1212
* IBM Corporation - initial API and implementation
1313
* Lars Vogel <[email protected]> - Bug 477527
1414
* Martin Karpisek <[email protected]> - Bug 438509
15+
* Tue Ton - support for FreeBSD
1516
*******************************************************************************/
1617
package org.eclipse.pde.internal.core.exports;
1718

@@ -375,6 +376,9 @@ protected HashMap<String, String> createAntBuildProperties(String[][] configs) {
375376
case "win32": //$NON-NLS-1$
376377
images = getWin32Images(info);
377378
break;
379+
case "freebsd": //$NON-NLS-1$
380+
images = getExpandedPath(info.getIconPath(ILauncherInfo.FREEBSD_ICON));
381+
break;
378382
case "linux": //$NON-NLS-1$
379383
images = getExpandedPath(info.getIconPath(ILauncherInfo.LINUX_ICON));
380384
break;

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IArgumentsInfo.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2005, 2018 IBM Corporation and others.
2+
* Copyright (c) 2005, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,17 +11,20 @@
1111
* Contributors:
1212
* IBM Corporation - initial API and implementation
1313
* Martin Karpisek <[email protected]> - Bug 438509
14+
* Tue Ton - support for FreeBSD
1415
*******************************************************************************/
1516
package org.eclipse.pde.internal.core.iproduct;
1617

1718
public interface IArgumentsInfo extends IProductObject {
1819

1920
public static final String P_PROG_ARGS = "programArgs"; //$NON-NLS-1$
21+
public static final String P_PROG_ARGS_FBSD = "programArgsFbsd"; //$NON-NLS-1$
2022
public static final String P_PROG_ARGS_LIN = "programArgsLin"; //$NON-NLS-1$
2123
public static final String P_PROG_ARGS_MAC = "programArgsMac"; //$NON-NLS-1$
2224
public static final String P_PROG_ARGS_WIN = "programArgsWin"; //$NON-NLS-1$
2325

2426
public static final String P_VM_ARGS = "vmArgs"; //$NON-NLS-1$
27+
public static final String P_VM_ARGS_FBSD = "vmArgsFbsd"; //$NON-NLS-1$
2528
public static final String P_VM_ARGS_LIN = "vmArgsLin"; //$NON-NLS-1$
2629
public static final String P_VM_ARGS_MAC = "vmArgsMac"; //$NON-NLS-1$
2730
public static final String P_VM_ARGS_WIN = "vmArgsWin"; //$NON-NLS-1$
@@ -33,6 +36,7 @@ public interface IArgumentsInfo extends IProductObject {
3336
public static final int L_ARGS_LINUX = 1;
3437
public static final int L_ARGS_MACOS = 2;
3538
public static final int L_ARGS_WIN32 = 3;
39+
public static final int L_ARGS_FREEBSD = 4;
3640

3741
public static final int L_ARGS_ARCH_ALL = 0;
3842
public static final int L_ARGS_ARCH_X86 = 1;

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/ILauncherInfo.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2005, 2024 IBM Corporation and others.
2+
* Copyright (c) 2005, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -12,13 +12,15 @@
1212
* IBM Corporation - initial API and implementation
1313
* Martin Karpisek <[email protected]> - Bug 438509
1414
* SAP SE - support macOS bundle URL types
15+
* Tue Ton - support for FreeBSD
1516
*******************************************************************************/
1617
package org.eclipse.pde.internal.core.iproduct;
1718

1819
import java.util.List;
1920

2021
public interface ILauncherInfo extends IProductObject {
2122

23+
String FREEBSD_ICON = "freebsdIcon"; //$NON-NLS-1$
2224
String LINUX_ICON = "linuxIcon"; //$NON-NLS-1$
2325

2426
String MACOSX_ICON = "macosxIcon"; //$NON-NLS-1$

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ArgumentsInfo.java

+56-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2005, 2018 IBM Corporation and others.
2+
* Copyright (c) 2005, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,6 +11,7 @@
1111
* Contributors:
1212
* IBM Corporation - initial API and implementation
1313
* Martin Karpisek <[email protected]> - Bug 438509
14+
* Tue Ton - support for FreeBSD
1415
*******************************************************************************/
1516
package org.eclipse.pde.internal.core.product;
1617

@@ -24,12 +25,14 @@ public class ArgumentsInfo extends ProductObject implements IArgumentsInfo {
2425

2526
private static final long serialVersionUID = 1L;
2627
private final String[] fProgramArgs = new String[8];
28+
private final String[] fProgramArgsFbsd = new String[8];
2729
private final String[] fProgramArgsLin = new String[8];
2830
private final String[] fProgramArgsMac = new String[8];
2931
private final String[] fProgramArgsSol = new String[8];
3032
private final String[] fProgramArgsWin = new String[8];
3133

3234
private final String[] fVMArgs = new String[8];
35+
private final String[] fVMArgsFbsd = new String[8];
3336
private final String[] fVMArgsLin = new String[8];
3437
private final String[] fVMArgsMac = new String[8];
3538
private final String[] fVMArgsSol = new String[8];
@@ -38,11 +41,13 @@ public class ArgumentsInfo extends ProductObject implements IArgumentsInfo {
3841
public ArgumentsInfo(IProductModel model) {
3942
super(model);
4043
this.initializeArgs(fProgramArgs);
44+
this.initializeArgs(fProgramArgsFbsd);
4145
this.initializeArgs(fProgramArgsLin);
4246
this.initializeArgs(fProgramArgsMac);
4347
this.initializeArgs(fProgramArgsSol);
4448
this.initializeArgs(fProgramArgsWin);
4549
this.initializeArgs(fVMArgs);
50+
this.initializeArgs(fVMArgsFbsd);
4651
this.initializeArgs(fVMArgsLin);
4752
this.initializeArgs(fVMArgsMac);
4853
this.initializeArgs(fVMArgsSol);
@@ -74,6 +79,13 @@ public void setProgramArguments(String args, int platform, int arch) {
7479
firePropertyChanged(P_PROG_ARGS, old, fProgramArgs[arch]);
7580
}
7681
break;
82+
case L_ARGS_FREEBSD :
83+
old = fProgramArgsFbsd[arch];
84+
fProgramArgsFbsd[arch] = args;
85+
if (isEditable()) {
86+
firePropertyChanged(P_PROG_ARGS_FBSD, old, fProgramArgsFbsd[arch]);
87+
}
88+
break;
7789
case L_ARGS_LINUX :
7890
old = fProgramArgsLin[arch];
7991
fProgramArgsLin[arch] = args;
@@ -108,6 +120,8 @@ public String getProgramArguments(int platform, int arch) {
108120
switch (platform) {
109121
case L_ARGS_ALL :
110122
return fProgramArgs[arch];
123+
case L_ARGS_FREEBSD :
124+
return fProgramArgsFbsd[arch];
111125
case L_ARGS_LINUX :
112126
return fProgramArgsLin[arch];
113127
case L_ARGS_MACOS :
@@ -138,6 +152,9 @@ public String getCompleteProgramArguments(String os, String arch) {
138152
if (Platform.OS_WIN32.equals(os)) {
139153
archArgs = archIndex > 0 ? getProgramArguments(L_ARGS_WIN32, archIndex) + " " + archArgsAllPlatforms : archArgsAllPlatforms; //$NON-NLS-1$
140154
return getCompleteArgs(archArgs, getProgramArguments(L_ARGS_WIN32), fProgramArgs[L_ARGS_ARCH_ALL]);
155+
} else if (Platform.OS_FREEBSD.equals(os)) {
156+
archArgs = archIndex > 0 ? getProgramArguments(L_ARGS_FREEBSD, archIndex) + " " + archArgsAllPlatforms : archArgsAllPlatforms; //$NON-NLS-1$
157+
return getCompleteArgs(archArgs, getProgramArguments(L_ARGS_FREEBSD), fProgramArgs[L_ARGS_ARCH_ALL]);
141158
} else if (Platform.OS_LINUX.equals(os)) {
142159
archArgs = archIndex > 0 ? getProgramArguments(L_ARGS_LINUX, archIndex) + " " + archArgsAllPlatforms : archArgsAllPlatforms; //$NON-NLS-1$
143160
return getCompleteArgs(archArgs, getProgramArguments(L_ARGS_LINUX), fProgramArgs[L_ARGS_ARCH_ALL]);
@@ -168,6 +185,13 @@ public void setVMArguments(String args, int platform, int arch) {
168185
firePropertyChanged(P_VM_ARGS, old, fVMArgs[arch]);
169186
}
170187
break;
188+
case L_ARGS_FREEBSD :
189+
old = fVMArgsFbsd[arch];
190+
fVMArgsFbsd[arch] = args;
191+
if (isEditable()) {
192+
firePropertyChanged(P_VM_ARGS_FBSD, old, fVMArgsFbsd[arch]);
193+
}
194+
break;
171195
case L_ARGS_LINUX :
172196
old = fVMArgsLin[arch];
173197
fVMArgsLin[arch] = args;
@@ -202,6 +226,8 @@ public String getVMArguments(int platform, int arch) {
202226
switch (platform) {
203227
case L_ARGS_ALL :
204228
return fVMArgs[arch];
229+
case L_ARGS_FREEBSD :
230+
return fVMArgsFbsd[arch];
205231
case L_ARGS_LINUX :
206232
return fVMArgsLin[arch];
207233
case L_ARGS_MACOS :
@@ -233,6 +259,9 @@ public String getCompleteVMArguments(String os, String arch) {
233259
if (Platform.OS_WIN32.equals(os)) {
234260
archArgs = archIndex > 0 ? getVMArguments(L_ARGS_WIN32, archIndex) + " " + archArgsAllPlatforms : archArgsAllPlatforms; //$NON-NLS-1$
235261
return getCompleteArgs(archArgs, getVMArguments(L_ARGS_WIN32), fVMArgs[L_ARGS_ARCH_ALL]);
262+
} else if (Platform.OS_FREEBSD.equals(os)) {
263+
archArgs = archIndex > 0 ? getVMArguments(L_ARGS_FREEBSD, archIndex) + " " + archArgsAllPlatforms : archArgsAllPlatforms; //$NON-NLS-1$
264+
return getCompleteArgs(archArgs, getVMArguments(L_ARGS_FREEBSD), fVMArgs[L_ARGS_ARCH_ALL]);
236265
} else if (Platform.OS_LINUX.equals(os)) {
237266
archArgs = archIndex > 0 ? getVMArguments(L_ARGS_LINUX, archIndex) + " " + archArgsAllPlatforms : archArgsAllPlatforms; //$NON-NLS-1$
238267
return getCompleteArgs(archArgs, getVMArguments(L_ARGS_LINUX), fVMArgs[L_ARGS_ARCH_ALL]);
@@ -267,6 +296,10 @@ public void parse(Node node) {
267296
parentArgs = fProgramArgs;
268297
fProgramArgs[L_ARGS_ARCH_ALL] = getText(child).trim();
269298
break;
299+
case P_PROG_ARGS_FBSD:
300+
parentArgs = fProgramArgsFbsd;
301+
fProgramArgsFbsd[L_ARGS_ARCH_ALL] = getText(child).trim();
302+
break;
270303
case P_PROG_ARGS_LIN:
271304
parentArgs = fProgramArgsLin;
272305
fProgramArgsLin[L_ARGS_ARCH_ALL] = getText(child).trim();
@@ -283,6 +316,10 @@ public void parse(Node node) {
283316
parentArgs = fVMArgs;
284317
fVMArgs[L_ARGS_ARCH_ALL] = getText(child).trim();
285318
break;
319+
case P_VM_ARGS_FBSD:
320+
parentArgs = fVMArgsFbsd;
321+
fVMArgsFbsd[L_ARGS_ARCH_ALL] = getText(child).trim();
322+
break;
286323
case P_VM_ARGS_LIN:
287324
parentArgs = fVMArgsLin;
288325
fVMArgsLin[L_ARGS_ARCH_ALL] = getText(child).trim();
@@ -336,6 +373,15 @@ public void write(String indent, java.io.PrintWriter writer) {
336373
writeArchArgs(fProgramArgs, subIndent, writer);
337374
writer.println(subIndent + "</" + P_PROG_ARGS + ">"); //$NON-NLS-1$ //$NON-NLS-2$
338375
}
376+
if (hasArgs(fProgramArgsFbsd)) {
377+
writer.print(subIndent + "<" + P_PROG_ARGS_FBSD + ">"); //$NON-NLS-1$ //$NON-NLS-2$
378+
if (fProgramArgsFbsd[L_ARGS_ARCH_ALL].length() > 0) {
379+
writer.print(getWritableString(fProgramArgsFbsd[L_ARGS_ARCH_ALL]));
380+
}
381+
writer.println();
382+
writeArchArgs(fProgramArgsFbsd, subIndent, writer);
383+
writer.println(subIndent + "</" + P_PROG_ARGS_FBSD + ">"); //$NON-NLS-1$ //$NON-NLS-2$
384+
}
339385
if (hasArgs(fProgramArgsLin)) {
340386
writer.print(subIndent + "<" + P_PROG_ARGS_LIN + ">"); //$NON-NLS-1$ //$NON-NLS-2$
341387
if (fProgramArgsLin[L_ARGS_ARCH_ALL].length() > 0) {
@@ -372,6 +418,15 @@ public void write(String indent, java.io.PrintWriter writer) {
372418
writeArchArgs(fVMArgs, subIndent, writer);
373419
writer.println(subIndent + "</" + P_VM_ARGS + ">"); //$NON-NLS-1$ //$NON-NLS-2$
374420
}
421+
if (hasArgs(fVMArgsFbsd)) {
422+
writer.print(subIndent + "<" + P_VM_ARGS_FBSD + ">"); //$NON-NLS-1$ //$NON-NLS-2$
423+
if (fVMArgsFbsd[L_ARGS_ARCH_ALL].length() > 0) {
424+
writer.print(getWritableString(fVMArgsFbsd[L_ARGS_ARCH_ALL]));
425+
}
426+
writer.println();
427+
writeArchArgs(fVMArgsFbsd, subIndent, writer);
428+
writer.println(subIndent + "</" + P_VM_ARGS_FBSD + ">"); //$NON-NLS-1$ //$NON-NLS-2$
429+
}
375430
if (hasArgs(fVMArgsLin)) {
376431
writer.print(subIndent + "<" + P_VM_ARGS_LIN + ">"); //$NON-NLS-1$ //$NON-NLS-2$
377432
if (fVMArgsLin[L_ARGS_ARCH_ALL].length() > 0) {

0 commit comments

Comments
 (0)