1
1
/*******************************************************************************
2
- * Copyright (c) 2005, 2018 IBM Corporation and others.
2
+ * Copyright (c) 2005, 2025 IBM Corporation and others.
3
3
*
4
4
* This program and the accompanying materials
5
5
* are made available under the terms of the Eclipse Public License 2.0
11
11
* Contributors:
12
12
* IBM Corporation - initial API and implementation
13
13
* Martin Karpisek <[email protected] > - Bug 438509
14
+ * Tue Ton - support for FreeBSD
14
15
*******************************************************************************/
15
16
package org .eclipse .pde .internal .core .product ;
16
17
@@ -24,12 +25,14 @@ public class ArgumentsInfo extends ProductObject implements IArgumentsInfo {
24
25
25
26
private static final long serialVersionUID = 1L ;
26
27
private final String [] fProgramArgs = new String [8 ];
28
+ private final String [] fProgramArgsFbsd = new String [8 ];
27
29
private final String [] fProgramArgsLin = new String [8 ];
28
30
private final String [] fProgramArgsMac = new String [8 ];
29
31
private final String [] fProgramArgsSol = new String [8 ];
30
32
private final String [] fProgramArgsWin = new String [8 ];
31
33
32
34
private final String [] fVMArgs = new String [8 ];
35
+ private final String [] fVMArgsFbsd = new String [8 ];
33
36
private final String [] fVMArgsLin = new String [8 ];
34
37
private final String [] fVMArgsMac = new String [8 ];
35
38
private final String [] fVMArgsSol = new String [8 ];
@@ -38,11 +41,13 @@ public class ArgumentsInfo extends ProductObject implements IArgumentsInfo {
38
41
public ArgumentsInfo (IProductModel model ) {
39
42
super (model );
40
43
this .initializeArgs (fProgramArgs );
44
+ this .initializeArgs (fProgramArgsFbsd );
41
45
this .initializeArgs (fProgramArgsLin );
42
46
this .initializeArgs (fProgramArgsMac );
43
47
this .initializeArgs (fProgramArgsSol );
44
48
this .initializeArgs (fProgramArgsWin );
45
49
this .initializeArgs (fVMArgs );
50
+ this .initializeArgs (fVMArgsFbsd );
46
51
this .initializeArgs (fVMArgsLin );
47
52
this .initializeArgs (fVMArgsMac );
48
53
this .initializeArgs (fVMArgsSol );
@@ -74,6 +79,13 @@ public void setProgramArguments(String args, int platform, int arch) {
74
79
firePropertyChanged (P_PROG_ARGS , old , fProgramArgs [arch ]);
75
80
}
76
81
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 ;
77
89
case L_ARGS_LINUX :
78
90
old = fProgramArgsLin [arch ];
79
91
fProgramArgsLin [arch ] = args ;
@@ -108,6 +120,8 @@ public String getProgramArguments(int platform, int arch) {
108
120
switch (platform ) {
109
121
case L_ARGS_ALL :
110
122
return fProgramArgs [arch ];
123
+ case L_ARGS_FREEBSD :
124
+ return fProgramArgsFbsd [arch ];
111
125
case L_ARGS_LINUX :
112
126
return fProgramArgsLin [arch ];
113
127
case L_ARGS_MACOS :
@@ -138,6 +152,9 @@ public String getCompleteProgramArguments(String os, String arch) {
138
152
if (Platform .OS_WIN32 .equals (os )) {
139
153
archArgs = archIndex > 0 ? getProgramArguments (L_ARGS_WIN32 , archIndex ) + " " + archArgsAllPlatforms : archArgsAllPlatforms ; //$NON-NLS-1$
140
154
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 ]);
141
158
} else if (Platform .OS_LINUX .equals (os )) {
142
159
archArgs = archIndex > 0 ? getProgramArguments (L_ARGS_LINUX , archIndex ) + " " + archArgsAllPlatforms : archArgsAllPlatforms ; //$NON-NLS-1$
143
160
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) {
168
185
firePropertyChanged (P_VM_ARGS , old , fVMArgs [arch ]);
169
186
}
170
187
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 ;
171
195
case L_ARGS_LINUX :
172
196
old = fVMArgsLin [arch ];
173
197
fVMArgsLin [arch ] = args ;
@@ -202,6 +226,8 @@ public String getVMArguments(int platform, int arch) {
202
226
switch (platform ) {
203
227
case L_ARGS_ALL :
204
228
return fVMArgs [arch ];
229
+ case L_ARGS_FREEBSD :
230
+ return fVMArgsFbsd [arch ];
205
231
case L_ARGS_LINUX :
206
232
return fVMArgsLin [arch ];
207
233
case L_ARGS_MACOS :
@@ -233,6 +259,9 @@ public String getCompleteVMArguments(String os, String arch) {
233
259
if (Platform .OS_WIN32 .equals (os )) {
234
260
archArgs = archIndex > 0 ? getVMArguments (L_ARGS_WIN32 , archIndex ) + " " + archArgsAllPlatforms : archArgsAllPlatforms ; //$NON-NLS-1$
235
261
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 ]);
236
265
} else if (Platform .OS_LINUX .equals (os )) {
237
266
archArgs = archIndex > 0 ? getVMArguments (L_ARGS_LINUX , archIndex ) + " " + archArgsAllPlatforms : archArgsAllPlatforms ; //$NON-NLS-1$
238
267
return getCompleteArgs (archArgs , getVMArguments (L_ARGS_LINUX ), fVMArgs [L_ARGS_ARCH_ALL ]);
@@ -267,6 +296,10 @@ public void parse(Node node) {
267
296
parentArgs = fProgramArgs ;
268
297
fProgramArgs [L_ARGS_ARCH_ALL ] = getText (child ).trim ();
269
298
break ;
299
+ case P_PROG_ARGS_FBSD :
300
+ parentArgs = fProgramArgsFbsd ;
301
+ fProgramArgsFbsd [L_ARGS_ARCH_ALL ] = getText (child ).trim ();
302
+ break ;
270
303
case P_PROG_ARGS_LIN :
271
304
parentArgs = fProgramArgsLin ;
272
305
fProgramArgsLin [L_ARGS_ARCH_ALL ] = getText (child ).trim ();
@@ -283,6 +316,10 @@ public void parse(Node node) {
283
316
parentArgs = fVMArgs ;
284
317
fVMArgs [L_ARGS_ARCH_ALL ] = getText (child ).trim ();
285
318
break ;
319
+ case P_VM_ARGS_FBSD :
320
+ parentArgs = fVMArgsFbsd ;
321
+ fVMArgsFbsd [L_ARGS_ARCH_ALL ] = getText (child ).trim ();
322
+ break ;
286
323
case P_VM_ARGS_LIN :
287
324
parentArgs = fVMArgsLin ;
288
325
fVMArgsLin [L_ARGS_ARCH_ALL ] = getText (child ).trim ();
@@ -336,6 +373,15 @@ public void write(String indent, java.io.PrintWriter writer) {
336
373
writeArchArgs (fProgramArgs , subIndent , writer );
337
374
writer .println (subIndent + "</" + P_PROG_ARGS + ">" ); //$NON-NLS-1$ //$NON-NLS-2$
338
375
}
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
+ }
339
385
if (hasArgs (fProgramArgsLin )) {
340
386
writer .print (subIndent + "<" + P_PROG_ARGS_LIN + ">" ); //$NON-NLS-1$ //$NON-NLS-2$
341
387
if (fProgramArgsLin [L_ARGS_ARCH_ALL ].length () > 0 ) {
@@ -372,6 +418,15 @@ public void write(String indent, java.io.PrintWriter writer) {
372
418
writeArchArgs (fVMArgs , subIndent , writer );
373
419
writer .println (subIndent + "</" + P_VM_ARGS + ">" ); //$NON-NLS-1$ //$NON-NLS-2$
374
420
}
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
+ }
375
430
if (hasArgs (fVMArgsLin )) {
376
431
writer .print (subIndent + "<" + P_VM_ARGS_LIN + ">" ); //$NON-NLS-1$ //$NON-NLS-2$
377
432
if (fVMArgsLin [L_ARGS_ARCH_ALL ].length () > 0 ) {
0 commit comments