Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 293598 | Differences between
and this patch

Collapse All | Expand All

(-).settings/org.eclipse.jdt.core.prefs (-244 / +1 lines)
Lines 1-248 Link Here
1
#Thu Oct 04 14:01:35 BRT 2007
1
#Tue Sep 29 13:43:50 EDT 2009
2
eclipse.preferences.version=1
2
eclipse.preferences.version=1
3
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
4
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
5
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
6
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
7
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
8
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
9
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
10
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
11
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
12
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
13
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
14
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
15
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
17
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
18
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
19
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
20
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
21
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
22
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
23
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
24
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
25
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
26
org.eclipse.jdt.core.formatter.blank_lines_before_field=1
27
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
28
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
29
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
30
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
31
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
32
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
33
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
34
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
35
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
36
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
37
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
38
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
39
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
40
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
41
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
42
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
43
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
44
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
45
org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
3
org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
46
org.eclipse.jdt.core.formatter.comment.format_comments=true
4
org.eclipse.jdt.core.formatter.comment.format_comments=true
47
org.eclipse.jdt.core.formatter.comment.format_header=false
48
org.eclipse.jdt.core.formatter.comment.format_html=true
49
org.eclipse.jdt.core.formatter.comment.format_source_code=true
50
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
51
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
52
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
53
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
54
org.eclipse.jdt.core.formatter.comment.line_length=80
55
org.eclipse.jdt.core.formatter.compact_else_if=true
56
org.eclipse.jdt.core.formatter.continuation_indentation=2
57
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
58
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
59
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
60
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
61
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
62
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
63
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
64
org.eclipse.jdt.core.formatter.indent_empty_lines=false
65
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
66
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
67
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
68
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
69
org.eclipse.jdt.core.formatter.indentation.size=4
70
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
5
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
71
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
72
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
73
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
74
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
75
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
76
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
77
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
78
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
79
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
80
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
81
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
82
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
83
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
84
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
85
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
86
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
87
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
88
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
89
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
90
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
91
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
92
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
93
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
94
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
95
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
96
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
97
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
98
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
99
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
100
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
101
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
102
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
103
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
104
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
105
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
106
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
107
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
108
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
109
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
110
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
111
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
112
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
113
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
114
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
115
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
116
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
117
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
118
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
119
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
120
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
121
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
122
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
123
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
124
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
125
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
126
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
127
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
128
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
129
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
130
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
131
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
132
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
133
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
134
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
135
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
136
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
137
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
138
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
139
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
140
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
141
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
142
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
143
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
144
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
145
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
146
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
147
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
148
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
149
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
150
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
151
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
152
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
153
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
154
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
155
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
156
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
157
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
158
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
159
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
160
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
161
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
162
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
163
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
164
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
165
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
166
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
167
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
168
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
169
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
170
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
171
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
172
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
173
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
174
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
175
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
176
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
177
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
178
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
179
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
180
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
181
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
182
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
183
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
184
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
185
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
186
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
187
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
188
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
189
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
190
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
191
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
192
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
193
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
194
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
195
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
196
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
197
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
198
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
199
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
200
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
201
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
202
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
203
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
204
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
205
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
206
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
207
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
208
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
209
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
210
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
211
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
212
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
213
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
214
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
215
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
216
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
217
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
218
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
219
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
220
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
221
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
222
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
223
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
224
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
225
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
226
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
227
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
228
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
229
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
230
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
231
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
232
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
233
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
234
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
235
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
236
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
237
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
238
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
239
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
240
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
241
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
242
org.eclipse.jdt.core.formatter.lineSplit=80
243
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
244
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
245
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
246
org.eclipse.jdt.core.formatter.tabulation.char=tab
247
org.eclipse.jdt.core.formatter.tabulation.size=4
248
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
(-).settings/org.eclipse.jdt.ui.prefs (-3 / +2 lines)
Lines 1-6 Link Here
1
#Thu Oct 04 14:01:35 BRT 2007
1
#Tue Sep 29 13:43:50 EDT 2009
2
eclipse.preferences.version=1
2
eclipse.preferences.version=1
3
formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile
3
formatter_settings_version=11
4
formatter_settings_version=10
5
internal.default.compliance=default
4
internal.default.compliance=default
6
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
5
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
(-)META-INF/MANIFEST.MF (-1 / +1 lines)
Lines 2-8 Link Here
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %pluginName
3
Bundle-Name: %pluginName
4
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.xlc.core;singleton:=true
4
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.xlc.core;singleton:=true
5
Bundle-Version: 5.0.0.qualifier
5
Bundle-Version: 5.0.3.qualifier
6
Bundle-Vendor: %providerName
6
Bundle-Vendor: %providerName
7
Bundle-Localization: plugin
7
Bundle-Localization: plugin
8
Require-Bundle: org.eclipse.cdt.managedbuilder.core,
8
Require-Bundle: org.eclipse.cdt.managedbuilder.core,
(-)src/org/eclipse/ptp/remote/core/IRemoteProcessBuilder.java (-1 / +8 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation and others.
2
 * Copyright (c) 2007, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 62-67 Link Here
62
	 * @return an IFileStore reference to the working directory
62
	 * @return an IFileStore reference to the working directory
63
	 */
63
	 */
64
	public abstract IFileStore directory();
64
	public abstract IFileStore directory();
65
	
66
	/**
67
	 * Returns the user's home directory on the target system.
68
	 * 
69
	 * @return IFileStore corresponding to the location, or <code>null</code> if the home directory cannot be determined.
70
	 */
71
	public abstract IFileStore getHomeDirectory();
65
72
66
	/**
73
	/**
67
	 * Sets this process builder's working directory.
74
	 * Sets this process builder's working directory.
(-)src/org/eclipse/ptp/remote/core/AbstractRemoteProcessBuilder.java (-1 / +8 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation and others.
2
 * Copyright (c) 2007, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 78-83 Link Here
78
	public IFileStore directory() {
78
	public IFileStore directory() {
79
		return remoteDir;
79
		return remoteDir;
80
	}
80
	}
81
	
82
	/* (non-Javadoc)
83
	 * @see org.eclipse.ptp.remote.core.IRemoteProcessBuilder#getHomeDirectory()
84
	 */
85
	public IFileStore getHomeDirectory() {
86
		return null;
87
	}
81
88
82
	/* (non-Javadoc)
89
	/* (non-Javadoc)
83
	 * @see org.eclipse.ptp.remote.core.IRemoteProcessBuilder#directory(org.eclipse.core.filesystem.IFileStore)
90
	 * @see org.eclipse.ptp.remote.core.IRemoteProcessBuilder#directory(org.eclipse.core.filesystem.IFileStore)
(-)src/org/eclipse/ptp/remote/internal/core/LocalProcessBuilder.java (+11 lines)
Lines 19-31 Link Here
19
19
20
import org.eclipse.cdt.utils.spawner.ProcessFactory;
20
import org.eclipse.cdt.utils.spawner.ProcessFactory;
21
import org.eclipse.core.filesystem.EFS;
21
import org.eclipse.core.filesystem.EFS;
22
import org.eclipse.core.filesystem.IFileStore;
22
import org.eclipse.core.runtime.CoreException;
23
import org.eclipse.core.runtime.CoreException;
23
import org.eclipse.core.runtime.NullProgressMonitor;
24
import org.eclipse.core.runtime.NullProgressMonitor;
25
import org.eclipse.core.runtime.Path;
24
import org.eclipse.ptp.remote.core.AbstractRemoteProcessBuilder;
26
import org.eclipse.ptp.remote.core.AbstractRemoteProcessBuilder;
25
import org.eclipse.ptp.remote.core.IRemoteConnection;
27
import org.eclipse.ptp.remote.core.IRemoteConnection;
26
import org.eclipse.ptp.remote.core.IRemoteProcess;
28
import org.eclipse.ptp.remote.core.IRemoteProcess;
27
29
28
public class LocalProcessBuilder extends AbstractRemoteProcessBuilder {
30
public class LocalProcessBuilder extends AbstractRemoteProcessBuilder {
31
	/* (non-Javadoc)
32
	 * @see org.eclipse.ptp.remote.core.AbstractRemoteProcessBuilder#getHomeDirectory()
33
	 */
34
	@Override
35
	public IFileStore getHomeDirectory() {
36
		String pathString = System.getProperty("user.home");
37
		return EFS.getLocalFileSystem().getStore(new Path(pathString));
38
	}
39
29
	private ProcessFactory localProcessBuilder;
40
	private ProcessFactory localProcessBuilder;
30
41
31
	private Map<String, String> remoteEnv = new HashMap<String, String>();
42
	private Map<String, String> remoteEnv = new HashMap<String, String>();
(-)src/org/eclipse/ptp/rdt/managedbuilder/xlc/ui/RemoteProjectEnvironmentSupplier.java (-5 / +5 lines)
Lines 28-38 Link Here
28
import org.eclipse.ptp.remote.core.IRemoteProcessBuilder;
28
import org.eclipse.ptp.remote.core.IRemoteProcessBuilder;
29
import org.eclipse.ptp.remote.core.IRemoteServices;
29
import org.eclipse.ptp.remote.core.IRemoteServices;
30
import org.eclipse.ptp.remote.core.exception.RemoteConnectionException;
30
import org.eclipse.ptp.remote.core.exception.RemoteConnectionException;
31
import org.eclipse.ptp.services.core.IService;
31
import org.eclipse.ptp.rdt.services.core.IService;
32
import org.eclipse.ptp.services.core.IServiceConfiguration;
32
import org.eclipse.ptp.rdt.services.core.IServiceConfiguration;
33
import org.eclipse.ptp.services.core.IServiceProvider;
33
import org.eclipse.ptp.rdt.services.core.IServiceProvider;
34
import org.eclipse.ptp.services.core.ProjectNotConfiguredException;
34
import org.eclipse.ptp.rdt.services.core.ProjectNotConfiguredException;
35
import org.eclipse.ptp.services.core.ServiceModelManager;
35
import org.eclipse.ptp.rdt.services.core.ServiceModelManager;
36
36
37
/**
37
/**
38
 * Supplies environment variables from the remote system.
38
 * Supplies environment variables from the remote system.
(-)plugin.xml (-28 / +90 lines)
Lines 7-13 Link Here
7
            fileVersion="4.0.0">
7
            fileVersion="4.0.0">
8
      </managedBuildRevision>
8
      </managedBuildRevision>
9
      <builder
9
      <builder
10
            commandLauncher="org.eclipse.ptp.rdt.core.remotemake.RemoteCommandLauncher"
11
            id="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.builder1"
10
            id="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.builder1"
12
            isAbstract="false"
11
            isAbstract="false"
13
            isVariableCaseSensitive="false"
12
            isVariableCaseSensitive="false"
Lines 29-40 Link Here
29
      		errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
28
      		errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
30
			id="org.eclipse.ptp.rdt.managedbuild.config.xlc.exe.debug">
29
			id="org.eclipse.ptp.rdt.managedbuild.config.xlc.exe.debug">
31
			<toolChain
30
			<toolChain
32
                  archList="all"
31
         archList="all"
33
                  configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.xlc.aix.AixConfigurationEnvironmentSupplier"
32
         configurationEnvironmentSupplier="RemoteConfigurationEnvironmentSupplier"
34
                  id="org.eclipse.ptp.rdt.managedbuild.toolchain.xlc.exe.debug"
33
         id="org.eclipse.ptp.rdt.managedbuild.toolchain.xlc.exe.debug"
35
                  name="%ToolChainName.Dbg"
34
         name="%ToolChainName.Dbg"
36
                  osList="all"
35
         osList="all"
37
                  targetTool="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.linker.exe.debug;org.eclipse.ptp.rdt.managedbuild.tool.xlc.cpp.linker.exe.debug">
36
         scannerConfigDiscoveryProfileId="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.RemoteXLCPerProjectProfile"
37
         targetTool="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.linker.exe.debug;org.eclipse.ptp.rdt.managedbuild.tool.xlc.cpp.linker.exe.debug">
38
			      <targetPlatform
38
			      <targetPlatform
39
					  id="org.eclipse.ptp.rdt.managedbuild.target.xlc.platform.exe.debug"
39
					  id="org.eclipse.ptp.rdt.managedbuild.target.xlc.platform.exe.debug"
40
				 	  name="%PlatformName.Dbg"
40
				 	  name="%PlatformName.Dbg"
Lines 48-54 Link Here
48
			      </builder>
48
			      </builder>
49
			      <tool
49
			      <tool
50
                      id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.cpp.compiler.exe.debug"
50
                      id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.cpp.compiler.exe.debug"
51
                      superClass="org.eclipse.ptp.rdt.managedbuild.tool.xlc.cpp.compiler.base">
51
                      superClass="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.compiler.cpp">
52
                      <option
52
                      <option
53
                          id="org.eclipse.ptp.rdt.xlc.cpp.compiler.exe.debug.option.optimization.level"
53
                          id="org.eclipse.ptp.rdt.xlc.cpp.compiler.exe.debug.option.optimization.level"
54
                          defaultValue="xlc.c.compiler.optimization.level.none"
54
                          defaultValue="xlc.c.compiler.optimization.level.none"
Lines 62-68 Link Here
62
                  </tool>
62
                  </tool>
63
                  <tool
63
                  <tool
64
					  id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.compiler.exe.debug"
64
					  id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.compiler.exe.debug"
65
                      superClass="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.compiler.base">
65
                      superClass="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.compiler.c">
66
					  <option
66
					  <option
67
						  id="org.eclipse.ptp.rdt.xlc.c.compiler.exe.debug.option.optimization.level"
67
						  id="org.eclipse.ptp.rdt.xlc.c.compiler.exe.debug.option.optimization.level"
68
						  defaultValue="xlc.c.optimization.level.none"
68
						  defaultValue="xlc.c.optimization.level.none"
Lines 95-105 Link Here
95
			errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
95
			errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
96
			id="org.eclipse.ptp.rdt.managedbuild.config.xlc.exe.release">
96
			id="org.eclipse.ptp.rdt.managedbuild.config.xlc.exe.release">
97
			<toolChain
97
			<toolChain
98
                  archList="all"
98
         archList="all"
99
                  id="org.eclipse.ptp.rdt.managedbuild.toolchain.xlc.exe.release"
99
         configurationEnvironmentSupplier="RemoteConfigurationEnvironmentSupplier"
100
                  name="%ToolChainName.Rel"
100
         id="org.eclipse.ptp.rdt.managedbuild.toolchain.xlc.exe.release"
101
                  osList="all"
101
         name="%ToolChainName.Dbg"
102
                  targetTool="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.linker.exe.release;org.eclipse.ptp.rdt.managedbuild.tool.xlc.cpp.linker.exe.release">
102
         osList="all"
103
         scannerConfigDiscoveryProfileId="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.RemoteXLCPerProjectProfile"
104
         targetTool="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.linker.exe.release;org.eclipse.ptp.rdt.managedbuild.tool.xlc.cpp.linker.exe.release">
103
		          <targetPlatform
105
		          <targetPlatform
104
		              id="org.eclipse.ptp.rdt.managedbuild.target.xlc.platform.exe.release"
106
		              id="org.eclipse.ptp.rdt.managedbuild.target.xlc.platform.exe.release"
105
		              name="%PlatformName.Rel"		             
107
		              name="%PlatformName.Rel"		             
Lines 113-119 Link Here
113
				  </builder> 
115
				  </builder> 
114
				  <tool
116
				  <tool
115
                      id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.cpp.compiler.exe.release"
117
                      id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.cpp.compiler.exe.release"
116
                      superClass="org.eclipse.ptp.rdt.managedbuild.tool.xlc.cpp.compiler.base">                     
118
                      superClass="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.compiler.cpp">                     
117
					  <option
119
					  <option
118
						  id="org.eclipse.ptp.rdt.xlc.cpp.compiler.exe.release.option.optimization.level"
120
						  id="org.eclipse.ptp.rdt.xlc.cpp.compiler.exe.release.option.optimization.level"
119
						  defaultValue="xlc.c.optimization.level.Level5"
121
						  defaultValue="xlc.c.optimization.level.Level5"
Lines 127-133 Link Here
127
                  </tool>
129
                  </tool>
128
                  <tool
130
                  <tool
129
                      id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.compiler.exe.release"
131
                      id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.compiler.exe.release"
130
                      superClass="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.compiler.base">                          
132
                      superClass="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.compiler.c">                          
131
					  <option
133
					  <option
132
						  id="org.eclipse.ptp.rdt.xlc.c.compiler.exe.release.option.optimization.level"
134
						  id="org.eclipse.ptp.rdt.xlc.c.compiler.exe.release.option.optimization.level"
133
						  defaultValue="xlc.c.optimization.level.Level5"
135
						  defaultValue="xlc.c.optimization.level.Level5"
Lines 156-178 Link Here
156
		</configuration>
158
		</configuration>
157
	</projectType>	
159
	</projectType>	
158
	<toolChain
160
	<toolChain
159
                  archList="all"
161
       archList="all"
160
                  configurationEnvironmentSupplier="RemoteConfigurationEnvironmentSupplier"
162
       configurationEnvironmentSupplier="RemoteConfigurationEnvironmentSupplier"
161
                  id="org.eclipse.ptp.rdt.managedbuild.toolchain.xlc.base"
163
       id="org.eclipse.ptp.rdt.managedbuild.toolchain.xlc.base"
162
                  name="%ToolChainName.Dbg"
164
       name="%ToolChainName.Dbg"
163
                  osList="all"
165
       osList="all"
164
                  targetTool="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.linker.exe.debug;org.eclipse.ptp.rdt.managedbuild.tool.xlc.cpp.linker.exe.debug">
166
       scannerConfigDiscoveryProfileId="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.RemoteXLCPerProjectProfile"
167
       targetTool="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.linker.exe.debug;org.eclipse.ptp.rdt.managedbuild.tool.xlc.cpp.linker.exe.debug">
165
			  	  <builder
168
			  	  <builder
166
					  superClass="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.builder1"
169
					  superClass="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.builder1"
167
					  id="org.eclipse.ptp.rdt.managedbuilder.xlc.builder.base">		              
170
					  id="org.eclipse.ptp.rdt.managedbuilder.xlc.builder.base">		              
168
			      </builder>
171
			      </builder>
169
			      <tool
172
			      <tool
170
                      id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.cpp.compiler.base"
173
                      id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.cpp.compiler.base"
171
                      superClass="cdt.managedbuild.tool.xlc.cpp.compiler">
174
                      superClass="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.compiler.cpp">
172
                  </tool>
175
                  </tool>
173
                  <tool
176
                  <tool
174
					  id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.compiler.base"
177
					  id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.compiler.base"
175
                      superClass="cdt.managedbuild.tool.xlc.c.compiler">
178
                      superClass="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.compiler.c">
176
                  </tool>
179
                  </tool>
177
                  <tool
180
                  <tool
178
                      id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.linker.exe.base"
181
                      id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.c.linker.exe.base"
Lines 186-208 Link Here
186
					  id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.assembler.exe.base"
189
					  id="org.eclipse.ptp.rdt.managedbuild.tool.xlc.assembler.exe.base"
187
					  superClass="cdt.managedbuild.tool.xlc.assembler">
190
					  superClass="cdt.managedbuild.tool.xlc.assembler">
188
				  </tool>
191
				  </tool>
189
			 </toolChain>        		
192
			 </toolChain>
193
 <tool
194
       id="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.compiler.cpp"
195
       isAbstract="false"
196
       name="Remote XL C++ Compiler"
197
       superClass="cdt.managedbuild.tool.xlc.cpp.compiler.abstract">
198
           <inputType
199
          id="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.cpp.c.compiler.input"
200
          primaryInput="true"
201
          scannerConfigDiscoveryProfileId="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.RemoteXLCPerProjectProfile|org.eclipse.ptp.rdt.managedbuilder.xlc.ui.RemoteXLCPerFileProfile"
202
          superClass="cdt.managedbuild.tool.xlc.c.compiler.input">
203
          </inputType>
204
    <inputType
205
          id="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.cpp.compiler.input"
206
          primaryInput="true"
207
          scannerConfigDiscoveryProfileId="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.RemoteXLCPerProjectProfile|org.eclipse.ptp.rdt.managedbuilder.xlc.ui.RemoteXLCPerFileProfile"
208
          superClass="cdt.managedbuild.tool.xlc.cpp.compiler.input">
209
    </inputType>
210
    <outputType
211
			outputs="o"
212
            buildVariable="OBJS"
213
            id="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.cpp.compiler.output">
214
            </outputType>
215
 </tool>
216
 <tool
217
       id="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.compiler.c"
218
       isAbstract="false"
219
       name="Remote XL C Compiler"
220
       superClass="cdt.managedbuild.tool.xlc.c.compiler.abstract">
221
    <inputType
222
          id="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.c.compiler.input"
223
          primaryInput="true"
224
          scannerConfigDiscoveryProfileId="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.RemoteXLCPerProjectProfile|org.eclipse.ptp.rdt.managedbuilder.xlc.ui.RemoteXLCPerFileProfile"
225
          superClass="cdt.managedbuild.tool.xlc.c.compiler.input">
226
    </inputType>
227
        <outputType
228
			outputs="o"
229
            buildVariable="OBJS"
230
            id="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.c.compiler.output">
231
            </outputType>
232
 </tool>        		
190
   </extension>
233
   </extension>
191
   <extension
234
   <extension
192
         id="RemoteXLCPerProjectProfile"
235
         id="RemoteXLCPerProjectProfile"
193
         name="%extension.name"
236
         name="%extension.name"
194
         point="org.eclipse.cdt.make.core.ScannerConfigurationDiscoveryProfile">
237
         point="org.eclipse.cdt.make.core.ScannerConfigurationDiscoveryProfile">
195
     <scannerInfoCollector
238
     <scannerInfoCollector
196
            class="org.eclipse.ptp.rdt.core.remotemake.ProjectDescriptionCollector"
239
            class="org.eclipse.cdt.make.xlc.core.scannerconfig.PerProjectXLCScannerInfoCollector"
197
            scope="project"/>
240
            scope="project"/>
198
     		<!-- The ScannerInfoProvider search for the information needed by the profile and send it to the ScannerInfoCollector -->
241
     		<!-- The ScannerInfoProvider search for the information needed by the profile and send it to the ScannerInfoCollector -->
199
		<scannerInfoProvider providerId="org.eclipse.ptp.rdt.managedbuilder.xlc.ui.specsFile">
242
		<scannerInfoProvider providerId="specsFile">
200
			<!-- Specifies the compiler command that returns the information about standard include directories and standard definitions -->
243
			<!-- Specifies the compiler command that returns the information about standard include directories and standard definitions -->
201
			<!-- The compiler command used will be always a C compiler command -->
244
			<!-- The compiler command used will be always a C compiler command -->
202
			<!-- The output for C or C++ projects will be different as the ScannerInfoProvider substitute the ${specs_file} variable below with a dummy "c" file or "cpp" file -->
245
			<!-- The output for C or C++ projects will be different as the ScannerInfoProvider substitute the ${specs_file} variable below with a dummy "c" file or "cpp" file -->
203
			<run
246
			<run
204
					arguments="-E -v ${specs_file_path}"
247
					arguments="-E -v ${specs_file_path}"
205
					command="${XL_compilerRoot}/xlC"
248
					command="xlC"
206
					class="org.eclipse.ptp.rdt.core.remotemake.RemoteSpecsRunSIProvider">
249
					class="org.eclipse.ptp.rdt.core.remotemake.RemoteSpecsRunSIProvider">
207
			</run>
250
			</run>
208
			<!-- Specifies the parser for the output generated by the compiler with the above command line -->
251
			<!-- Specifies the parser for the output generated by the compiler with the above command line -->
Lines 210-215 Link Here
210
					class="org.eclipse.cdt.make.xlc.core.scannerconfig.XlCSpecsConsoleParser">
253
					class="org.eclipse.cdt.make.xlc.core.scannerconfig.XlCSpecsConsoleParser">
211
			</scannerInfoConsoleParser>
254
			</scannerInfoConsoleParser>
212
		</scannerInfoProvider>
255
		</scannerInfoProvider>
256
  <buildOutputProvider>
257
     <scannerInfoConsoleParser
258
           class="org.eclipse.cdt.make.xlc.core.scannerconfig.XLCPerProjectBuildOutputParser">
259
     </scannerInfoConsoleParser>
260
  </buildOutputProvider>
261
   </extension>
262
   <extension
263
         id="RemoteXLCPerFileProfile"
264
         name="Remote XL C/C++ Per File Profile"
265
         point="org.eclipse.cdt.make.core.ScannerConfigurationDiscoveryProfile">
266
      <scannerInfoCollector
267
            class="org.eclipse.cdt.make.xlc.core.scannerconfig.PerFileXLCScannerInfoCollector"
268
            scope="file">
269
      </scannerInfoCollector>
270
      <buildOutputProvider>
271
         <scannerInfoConsoleParser
272
               class="org.eclipse.cdt.make.xlc.core.scannerconfig.XLCPerFileBuildOutputParser">
273
         </scannerInfoConsoleParser>
274
      </buildOutputProvider>
213
   </extension>
275
   </extension>
214
276
215
</plugin>
277
</plugin>
(-)src/RemoteConfigurationEnvironmentSupplier.java (-5 / +5 lines)
Lines 28-38 Link Here
28
import org.eclipse.ptp.remote.core.IRemoteProcessBuilder;
28
import org.eclipse.ptp.remote.core.IRemoteProcessBuilder;
29
import org.eclipse.ptp.remote.core.IRemoteServices;
29
import org.eclipse.ptp.remote.core.IRemoteServices;
30
import org.eclipse.ptp.remote.core.exception.RemoteConnectionException;
30
import org.eclipse.ptp.remote.core.exception.RemoteConnectionException;
31
import org.eclipse.ptp.services.core.IService;
31
import org.eclipse.ptp.rdt.services.core.IService;
32
import org.eclipse.ptp.services.core.IServiceConfiguration;
32
import org.eclipse.ptp.rdt.services.core.IServiceConfiguration;
33
import org.eclipse.ptp.services.core.IServiceProvider;
33
import org.eclipse.ptp.rdt.services.core.IServiceProvider;
34
import org.eclipse.ptp.services.core.ProjectNotConfiguredException;
34
import org.eclipse.ptp.rdt.services.core.ProjectNotConfiguredException;
35
import org.eclipse.ptp.services.core.ServiceModelManager;
35
import org.eclipse.ptp.rdt.services.core.ServiceModelManager;
36
36
37
37
38
/**
38
/**
(-)META-INF/MANIFEST.MF (-7 / +8 lines)
Lines 8-21 Link Here
8
Bundle-Vendor: %Bundle-Vendor
8
Bundle-Vendor: %Bundle-Vendor
9
Require-Bundle: org.eclipse.ui,
9
Require-Bundle: org.eclipse.ui,
10
 org.eclipse.core.runtime,
10
 org.eclipse.core.runtime,
11
 org.eclipse.cdt.managedbuilder.core;bundle-version="5.0.100",
11
 org.eclipse.cdt.managedbuilder.core;bundle-version="[5.0.2.200908281004,5.1.0)",
12
 org.eclipse.cdt.managedbuilder.xlc.core;bundle-version="5.0.0",
12
 org.eclipse.cdt.managedbuilder.xlc.core;bundle-version="[5.0.2.200908281004,5.1.0)",
13
 org.eclipse.cdt.managedbuilder.xlc.ui;bundle-version="6.0.0",
13
 org.eclipse.cdt.managedbuilder.xlc.ui;bundle-version="[5.0.2.200908281004,5.1.0)",
14
 org.eclipse.ptp.rdt.core;bundle-version="1.0.0",
14
 org.eclipse.ptp.rdt.core;bundle-version="1.0.0",
15
 org.eclipse.core.resources;bundle-version="3.5.0",
15
 org.eclipse.core.resources;bundle-version="3.4.0",
16
 org.eclipse.ptp.remote.core;bundle-version="2.1.0",
16
 org.eclipse.ptp.remote.core;bundle-version="[2.1.0,3.0.0)",
17
 org.eclipse.cdt.core;bundle-version="5.1.0",
17
 org.eclipse.cdt.core;bundle-version="[5.0.2.200908281004,5.1.0)",
18
 org.eclipse.ptp.services.core;bundle-version="1.0.0"
18
 org.eclipse.ptp.rdt.services;bundle-version="1.0.1",
19
 org.eclipse.cdt.make.xlc.core;bundle-version="5.0.0"
19
Bundle-RequiredExecutionEnvironment: J2SE-1.5
20
Bundle-RequiredExecutionEnvironment: J2SE-1.5
20
Bundle-ActivationPolicy: lazy
21
Bundle-ActivationPolicy: lazy
21
Export-Package: org.eclipse.ptp.rdt.managedbuilder.xlc.ui
22
Export-Package: org.eclipse.ptp.rdt.managedbuilder.xlc.ui
(-)src/org/eclipse/ptp/rdt/core/remotemake/RemoteRunSIProvider.java (-2 / +26 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
2
 * Copyright (c) 2008, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 20-33 Link Here
20
import org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider;
20
import org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider;
21
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
21
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
22
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
22
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
23
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2;
23
import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
24
import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
24
import org.eclipse.cdt.make.internal.core.StreamMonitor;
25
import org.eclipse.cdt.make.internal.core.StreamMonitor;
25
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
26
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
26
import org.eclipse.cdt.make.internal.core.scannerconfig2.SCMarkerGenerator;
27
import org.eclipse.cdt.make.internal.core.scannerconfig2.SCMarkerGenerator;
28
import org.eclipse.core.filesystem.IFileStore;
27
import org.eclipse.core.resources.IProject;
29
import org.eclipse.core.resources.IProject;
28
import org.eclipse.core.resources.IResource;
30
import org.eclipse.core.resources.IResource;
31
import org.eclipse.core.runtime.IPath;
29
import org.eclipse.core.runtime.IProgressMonitor;
32
import org.eclipse.core.runtime.IProgressMonitor;
30
import org.eclipse.core.runtime.NullProgressMonitor;
33
import org.eclipse.core.runtime.NullProgressMonitor;
34
import org.eclipse.core.runtime.Path;
31
import org.eclipse.core.runtime.SubProgressMonitor;
35
import org.eclipse.core.runtime.SubProgressMonitor;
32
import org.eclipse.ptp.internal.rdt.core.remotemake.RemoteProcessClosure;
36
import org.eclipse.ptp.internal.rdt.core.remotemake.RemoteProcessClosure;
33
import org.eclipse.ptp.rdt.core.RDTLog;
37
import org.eclipse.ptp.rdt.core.RDTLog;
Lines 39-44 Link Here
39
import org.eclipse.ptp.rdt.services.core.IServiceProvider;
43
import org.eclipse.ptp.rdt.services.core.IServiceProvider;
40
import org.eclipse.ptp.rdt.services.core.ServiceModelManager;
44
import org.eclipse.ptp.rdt.services.core.ServiceModelManager;
41
import org.eclipse.ptp.remote.core.IRemoteConnection;
45
import org.eclipse.ptp.remote.core.IRemoteConnection;
46
import org.eclipse.ptp.remote.core.IRemoteFileManager;
42
import org.eclipse.ptp.remote.core.IRemoteProcess;
47
import org.eclipse.ptp.remote.core.IRemoteProcess;
43
import org.eclipse.ptp.remote.core.IRemoteProcessBuilder;
48
import org.eclipse.ptp.remote.core.IRemoteProcessBuilder;
44
import org.eclipse.ptp.remote.core.IRemoteServices;
49
import org.eclipse.ptp.remote.core.IRemoteServices;
Lines 56-62 Link Here
56
	 */
61
	 */
57
	protected abstract List<String> getCommand(IProject project, String providerId, IScannerConfigBuilderInfo2 buildInfo);
62
	protected abstract List<String> getCommand(IProject project, String providerId, IScannerConfigBuilderInfo2 buildInfo);
58
63
59
	
64
	/**
65
	 * Subclasses need to provide the working directory that the command will run in.
66
	 * 
67
	 * @return String
68
	 */
69
	protected abstract IPath getWorkingDirectory(IProject project);
60
	
70
	
61
	public boolean invokeProvider(IProgressMonitor monitor, IResource resource,
71
	public boolean invokeProvider(IProgressMonitor monitor, IResource resource,
62
			String providerId, IScannerConfigBuilderInfo2 buildInfo,
72
			String providerId, IScannerConfigBuilderInfo2 buildInfo,
Lines 96-101 Link Here
96
		
106
		
97
		IProject project = resource.getProject();
107
		IProject project = resource.getProject();
98
		
108
		
109
		if(collector instanceof IScannerInfoCollector2) {
110
			IScannerInfoCollector2 s2 = (IScannerInfoCollector2) collector;
111
			s2.setProject(project);
112
		}
113
		
99
		IRemoteExecutionServiceProvider executionProvider = getExecutionServiceProvider(project);
114
		IRemoteExecutionServiceProvider executionProvider = getExecutionServiceProvider(project);
100
		if(executionProvider == null || monitor.isCanceled())
115
		if(executionProvider == null || monitor.isCanceled())
101
			return false;
116
			return false;
Lines 114-119 Link Here
114
		IRemoteServices remoteServices = executionProvider.getRemoteServices();
129
		IRemoteServices remoteServices = executionProvider.getRemoteServices();
115
		IRemoteProcessBuilder processBuilder = remoteServices.getProcessBuilder(connection, runCommand);
130
		IRemoteProcessBuilder processBuilder = remoteServices.getProcessBuilder(connection, runCommand);
116
		
131
		
132
		// get the configuration directory for the provider... this is where the build
133
		// should execute
134
		String configPath = executionProvider.getConfigLocation();
135
		IRemoteFileManager remoteFileManager = remoteServices.getFileManager(connection);
136
		IFileStore workingDir = remoteFileManager.getResource(new Path(configPath), monitor);
137
138
		// set the working directory for the process to be the config directory
139
		processBuilder.directory(workingDir);
140
		
117
		monitor.worked(1);
141
		monitor.worked(1);
118
		
142
		
119
		// the output of the command goes to the console
143
		// the output of the command goes to the console
(-)src/org/eclipse/ptp/rdt/core/remotemake/RemoteMakeBuilder.java (-3 / +44 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
2
 * Copyright (c) 2008, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 19-26 Link Here
19
import java.util.List;
19
import java.util.List;
20
import java.util.Map;
20
import java.util.Map;
21
21
22
import org.eclipse.cdt.build.core.scannerconfig.CfgInfoContext;
23
import org.eclipse.cdt.build.core.scannerconfig.ICfgScannerConfigBuilderInfo2Set;
24
import org.eclipse.cdt.build.internal.core.scannerconfig2.CfgScannerConfigProfileManager;
22
import org.eclipse.cdt.core.CCorePlugin;
25
import org.eclipse.cdt.core.CCorePlugin;
23
import org.eclipse.cdt.core.ErrorParserManager;
26
import org.eclipse.cdt.core.ErrorParserManager;
27
import org.eclipse.cdt.core.IMarkerGenerator;
28
import org.eclipse.cdt.core.ProblemMarkerInfo;
24
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
29
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
25
import org.eclipse.cdt.core.model.ICModelMarker;
30
import org.eclipse.cdt.core.model.ICModelMarker;
26
import org.eclipse.cdt.core.resources.IConsole;
31
import org.eclipse.cdt.core.resources.IConsole;
Lines 28-40 Link Here
28
import org.eclipse.cdt.make.core.IMakeBuilderInfo;
33
import org.eclipse.cdt.make.core.IMakeBuilderInfo;
29
import org.eclipse.cdt.make.core.MakeBuilder;
34
import org.eclipse.cdt.make.core.MakeBuilder;
30
import org.eclipse.cdt.make.core.MakeCorePlugin;
35
import org.eclipse.cdt.make.core.MakeCorePlugin;
36
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
37
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
38
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2;
39
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector3;
40
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser;
41
import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
31
import org.eclipse.cdt.make.internal.core.MakeMessages;
42
import org.eclipse.cdt.make.internal.core.MakeMessages;
32
import org.eclipse.cdt.make.internal.core.StreamMonitor;
43
import org.eclipse.cdt.make.internal.core.StreamMonitor;
33
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
44
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
45
import org.eclipse.cdt.make.internal.core.scannerconfig2.SCMarkerGenerator;
46
import org.eclipse.cdt.make.internal.core.scannerconfig2.SCProfileInstance;
47
import org.eclipse.cdt.make.internal.core.scannerconfig2.ScannerConfigProfile;
48
import org.eclipse.cdt.make.internal.core.scannerconfig2.ScannerConfigProfileManager;
34
import org.eclipse.cdt.managedbuilder.core.IBuilder;
49
import org.eclipse.cdt.managedbuilder.core.IBuilder;
35
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
50
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
51
import org.eclipse.cdt.managedbuilder.core.IFileInfo;
52
import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
53
import org.eclipse.cdt.managedbuilder.core.IInputType;
36
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
54
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
55
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
56
import org.eclipse.cdt.managedbuilder.core.ITool;
37
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
57
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
58
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
38
import org.eclipse.core.filesystem.IFileStore;
59
import org.eclipse.core.filesystem.IFileStore;
39
import org.eclipse.core.resources.IMarker;
60
import org.eclipse.core.resources.IMarker;
40
import org.eclipse.core.resources.IProject;
61
import org.eclipse.core.resources.IProject;
Lines 206-213 Link Here
206
				final OutputStream stdout = epm.getOutputStream();
227
				final OutputStream stdout = epm.getOutputStream();
207
				final OutputStream stderr = epm.getOutputStream();
228
				final OutputStream stderr = epm.getOutputStream();
208
				
229
				
209
				ConsoleOutputSniffer sniffer = ScannerInfoConsoleParserFactory.getMakeBuilderOutputSniffer(
230
				String scannerDiscID = mbsInfo.getDefaultConfiguration().getToolChain().getScannerConfigDiscoveryProfileId();
210
						stdout, stderr, getProject(), workingDirectory, null, this, null);
231
				
232
				IScannerConfigBuilderInfo2 scBuilderInfo = ScannerConfigProfileManager.
233
                createScannerConfigBuildInfo2(ManagedBuilderCorePlugin.getDefault().getPluginPreferences(),
234
                        scannerDiscID, false);
235
				int foo = 1;
236
				IScannerInfoCollector collector = (IScannerInfoCollector) ScannerConfigProfileManager.getInstance().getSCProfileConfiguration(scannerDiscID).getScannerInfoCollectorElement().createScannerInfoCollector();
237
				
238
				if(collector instanceof IScannerInfoCollector2) {
239
					IScannerInfoCollector2 s2 = (IScannerInfoCollector2) collector;
240
					s2.setProject(currProject);
241
				}
242
				
243
				SCMarkerGenerator markerGenerator = new SCMarkerGenerator();
244
				ConsoleOutputSniffer sniffer = ScannerInfoUtility.createBuildOutputSniffer(stdout, stderr, currProject, mbsInfo.getDefaultConfiguration(), workingDirectory, markerGenerator , collector);
211
				OutputStream consoleOut = (sniffer == null ? stdout : sniffer.getOutputStream());
245
				OutputStream consoleOut = (sniffer == null ? stdout : sniffer.getOutputStream());
212
				OutputStream consoleErr = (sniffer == null ? stderr : sniffer.getErrorStream());
246
				OutputStream consoleErr = (sniffer == null ? stderr : sniffer.getErrorStream());
213
				
247
				
Lines 353-358 Link Here
353
				consoleOut.close();
387
				consoleOut.close();
354
				consoleErr.close();
388
				consoleErr.close();
355
				epm.reportProblems();
389
				epm.reportProblems();
390
				
391
//				if(collector instanceof IScannerInfoCollector2) {
392
//					IScannerInfoCollector2 s2 = (IScannerInfoCollector2) collector;
393
//					s2.updateScannerConfiguration(monitor);
394
//				}
356
				cos.close();
395
				cos.close();
357
			}
396
			}
358
		} catch (Exception e) {
397
		} catch (Exception e) {
Lines 422-425 Link Here
422
		}
461
		}
423
		return makeArray(targets);
462
		return makeArray(targets);
424
	}
463
	}
464
	
465
425
}
466
}
(-)src/org/eclipse/ptp/rdt/core/remotemake/RemoteGCCSpecsRunSIProvider.java (-102 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 * IBM - Initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.ptp.rdt.core.remotemake;
12
13
import java.io.ByteArrayInputStream;
14
import java.io.InputStream;
15
import java.util.ArrayList;
16
import java.util.List;
17
18
import org.eclipse.cdt.core.CCProjectNature;
19
import org.eclipse.cdt.core.CProjectNature;
20
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
21
import org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCScannerConfigUtil;
22
import org.eclipse.core.resources.IFile;
23
import org.eclipse.core.resources.IFolder;
24
import org.eclipse.core.resources.IProject;
25
import org.eclipse.core.resources.IResource;
26
import org.eclipse.core.runtime.CoreException;
27
import org.eclipse.ptp.rdt.core.RDTLog;
28
29
30
/**
31
 * Gets the command to run gcc from the scanner discovery extension point
32
 * and prepares it to run.
33
 * 
34
 * @author Mike Kucera
35
 */
36
public class RemoteGCCSpecsRunSIProvider extends RemoteRunSIProvider {
37
38
	public static final String SPECS_FILE_PATH_VAR = "${specs_file_path}";   //$NON-NLS-1$
39
	public static final String SPECS_FOLDER_NAME   = ".specs"; //$NON-NLS-1$
40
	
41
	
42
	@Override
43
	protected List<String> getCommand(IProject project, String providerId, IScannerConfigBuilderInfo2 buildInfo) {
44
		// get the command that is provided in the extension point
45
		String gcc  = buildInfo.getProviderRunCommand(providerId);
46
		String args = buildInfo.getProviderRunArguments(providerId);
47
		String specsFileName = getSpecsFileName(project);
48
		
49
		if(gcc == null || args == null || specsFileName == null)
50
			return null;
51
		
52
		IFile specsFile;
53
		try {
54
			specsFile = createSpecsFile(project, specsFileName);
55
		} catch (CoreException e) {
56
			RDTLog.logError(e);
57
			return null;
58
		}
59
		
60
		String specsFilePath = specsFile.getLocationURI().getRawPath();
61
		args = args.replace(SPECS_FILE_PATH_VAR, specsFilePath);
62
		
63
		List<String> command = new ArrayList<String>();
64
		command.add(gcc);
65
		for(String arg : args.split(" ")) //$NON-NLS-1$
66
			command.add(arg);
67
		
68
		return command;
69
	}
70
	
71
	
72
	/**
73
	 * Create an empty "specs" file in a hidden directory in the project.
74
	 * Use EFS (via resources) for this for simplicity.
75
	 */
76
	private static IFile createSpecsFile(IProject project, String specsFileName) throws CoreException  {
77
		IFolder specsFolder = project.getFolder(SPECS_FOLDER_NAME);
78
		if(!specsFolder.exists()) {
79
			specsFolder.create(IResource.HIDDEN, true, null); // should not fire resource event
80
		}
81
		
82
		IFile specsFile = specsFolder.getFile(specsFileName);
83
		if(!specsFile.exists()) {
84
			InputStream is = new ByteArrayInputStream("\n".getBytes()); //$NON-NLS-1$
85
			specsFile.create(is, true, null);
86
		}
87
		
88
		return specsFile;
89
	}
90
	
91
	
92
	private static String getSpecsFileName(IProject project) {
93
		try {
94
			if(project.hasNature(CCProjectNature.CC_NATURE_ID))
95
	            return GCCScannerConfigUtil.CPP_SPECS_FILE;
96
	        else if(project.hasNature(CProjectNature.C_NATURE_ID))
97
	            return GCCScannerConfigUtil.C_SPECS_FILE;
98
		} catch(CoreException e) { }
99
		
100
		return null;
101
	}
102
}
(-)src/org/eclipse/ptp/rdt/core/resources/RemoteMakeNature.java (+30 lines)
Lines 139-144 Link Here
139
	}
139
	}
140
140
141
	/**
141
	/**
142
	 * Adds a builder to the build spec for the project.
143
	 * 
144
	 * @param project
145
	 * @param builderID
146
	 * @param mon
147
	 * @throws CoreException
148
	 */
149
	public static void updateProjectDescription(IProject project, String builderID, IProgressMonitor mon) throws CoreException {
150
		// setup builder
151
		IProjectDescription description = project.getDescription();
152
		ICommand[] commands = new ICommand[1];
153
		commands[0] = description.newCommand();
154
		commands[0].setBuilderName(builderID);
155
		description.setBuildSpec(commands);
156
		
157
		// add nature
158
		String[] prevNatures= description.getNatureIds();
159
		for (int i= 0; i < prevNatures.length; i++) {
160
			if (NATURE_ID.equals(prevNatures[i]))
161
				return;
162
		}
163
		String[] newNatures= new String[prevNatures.length + 1];
164
		System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
165
		newNatures[prevNatures.length]= NATURE_ID;
166
		description.setNatureIds(newNatures);
167
		
168
		project.setDescription(description, mon);
169
	}
170
	
171
	/**
142
	 * Removes a builder from the project's build spec.
172
	 * Removes a builder from the project's build spec.
143
	 * 
173
	 * 
144
	 * @param project
174
	 * @param project
(-)plugin.xml (-1 / +4 lines)
Lines 22-27 Link Here
22
      <builder
22
      <builder
23
            id="org.eclipse.ptp.rdt.core.remoteMakeBuilder">
23
            id="org.eclipse.ptp.rdt.core.remoteMakeBuilder">
24
      </builder>
24
      </builder>
25
      <builder
26
            id="org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder">
27
      </builder>
25
   </extension>
28
   </extension>
26
   <extension
29
   <extension
27
         id="org.eclipse.ptp.rdt.core.remoteMakeBuilder"
30
         id="org.eclipse.ptp.rdt.core.remoteMakeBuilder"
Lines 51-57 Link Here
51
         <run
54
         <run
52
               command="gcc"
55
               command="gcc"
53
               arguments="-E -P -v -dD ${specs_file_path}"
56
               arguments="-E -P -v -dD ${specs_file_path}"
54
               class="org.eclipse.ptp.rdt.core.remotemake.RemoteGCCSpecsRunSIProvider"/>
57
               class="org.eclipse.ptp.rdt.core.remotemake.RemoteSpecsRunSIProvider"/>
55
         <scannerInfoConsoleParser class="org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCSpecsConsoleParser"/>
58
         <scannerInfoConsoleParser class="org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCSpecsConsoleParser"/>
56
      </scannerInfoProvider>
59
      </scannerInfoProvider>
57
   </extension>
60
   </extension>
(-)src/org/eclipse/ptp/rdt/core/serviceproviders/IRemoteExecutionServiceProvider.java (+7 lines)
Lines 41-44 Link Here
41
	 * @return IRemoteConnection
41
	 * @return IRemoteConnection
42
	 */
42
	 */
43
	public IRemoteConnection getConnection();
43
	public IRemoteConnection getConnection();
44
	
45
	/**
46
	 * Gets the path to the configuration area on the the server.
47
	 * 
48
	 * @return String
49
	 */
50
	public String getConfigLocation();
44
}
51
}
(-)src/org/eclipse/ptp/rdt/core/remotemake/RemoteSpecsRunSIProvider.java (+224 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 * IBM - Initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.ptp.rdt.core.remotemake;
12
13
import java.io.ByteArrayInputStream;
14
import java.io.IOException;
15
import java.io.InputStream;
16
import java.io.OutputStream;
17
import java.util.ArrayList;
18
import java.util.List;
19
20
import org.eclipse.cdt.core.CCProjectNature;
21
import org.eclipse.cdt.core.CProjectNature;
22
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
23
import org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCScannerConfigUtil;
24
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
25
import org.eclipse.cdt.managedbuilder.macros.BuildMacroException;
26
import org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider;
27
import org.eclipse.cdt.utils.FileSystemUtilityManager;
28
import org.eclipse.core.filesystem.EFS;
29
import org.eclipse.core.filesystem.IFileInfo;
30
import org.eclipse.core.filesystem.IFileStore;
31
import org.eclipse.core.resources.IProject;
32
import org.eclipse.core.runtime.CoreException;
33
import org.eclipse.core.runtime.IPath;
34
import org.eclipse.core.runtime.IProgressMonitor;
35
import org.eclipse.core.runtime.Path;
36
import org.eclipse.ptp.rdt.core.RDTLog;
37
import org.eclipse.ptp.rdt.core.serviceproviders.IRemoteExecutionServiceProvider;
38
import org.eclipse.ptp.rdt.core.services.IRDTServiceConstants;
39
import org.eclipse.ptp.rdt.services.core.IService;
40
import org.eclipse.ptp.rdt.services.core.IServiceConfiguration;
41
import org.eclipse.ptp.rdt.services.core.IServiceProvider;
42
import org.eclipse.ptp.rdt.services.core.ServiceModelManager;
43
import org.eclipse.ptp.remote.core.IRemoteConnection;
44
import org.eclipse.ptp.remote.core.IRemoteFileManager;
45
import org.eclipse.ptp.remote.core.IRemoteProcessBuilder;
46
import org.eclipse.ptp.remote.core.IRemoteServices;
47
import org.eclipse.ptp.remote.core.exception.RemoteConnectionException;
48
49
50
/**
51
 * Gets the command to run gcc from the scanner discovery extension point
52
 * and prepares it to run.
53
 * 
54
 * @author Mike Kucera
55
 */
56
public class RemoteSpecsRunSIProvider extends RemoteRunSIProvider {
57
58
	public static final String SPECS_FILE_PATH_VAR = "${specs_file_path}";   //$NON-NLS-1$
59
	public static final String SPECS_FOLDER_NAME   = ".specs"; //$NON-NLS-1$
60
	private static final String EMPTY_STRING = ""; //$NON-NLS-1$
61
	
62
	
63
	@Override
64
	protected List<String> getCommand(IProject project, String providerId, IScannerConfigBuilderInfo2 buildInfo) {
65
		// get the command that is provided in the extension point
66
		String gcc  = buildInfo.getProviderRunCommand(providerId);
67
		
68
		// resolve macros in the run command
69
		try {
70
			gcc = ManagedBuildManager.getBuildMacroProvider().resolveValue(gcc, EMPTY_STRING, null,
71
					IBuildMacroProvider.CONTEXT_CONFIGURATION,
72
					ManagedBuildManager.getBuildInfo(project).getDefaultConfiguration());
73
		} catch (BuildMacroException e1) {
74
			RDTLog.logError(e1);
75
			return null;
76
		}
77
		
78
		String args = buildInfo.getProviderRunArguments(providerId);
79
		String specsFileName = getSpecsFileName(project);
80
		
81
		if(gcc == null || args == null || specsFileName == null)
82
			return null;
83
		
84
		IFileStore specsFilestore;
85
		try {
86
			specsFilestore = createSpecsFile(project, specsFileName, null);
87
		} catch (CoreException e) {
88
			RDTLog.logError(e);
89
			return null;
90
		} catch (IOException e) {
91
			RDTLog.logError(e);
92
			return null;
93
		}
94
		
95
		String specsFilePath = FileSystemUtilityManager.getDefault().getPathFromURI(specsFilestore.toURI());
96
		args = args.replace(SPECS_FILE_PATH_VAR, specsFilePath);
97
		
98
		List<String> command = new ArrayList<String>();
99
		command.add(gcc);
100
		for(String arg : args.split(" ")) //$NON-NLS-1$
101
			command.add(arg);
102
		
103
		return command;
104
	}
105
	
106
	
107
	/**
108
	 * Create an empty "specs" file in the server folder using EFS.
109
	 * @param monitor 
110
	 * @throws IOException 
111
	 */
112
	private static IFileStore createSpecsFile(IProject project, String specsFileName, IProgressMonitor monitor) throws CoreException, IOException  {
113
		ServiceModelManager smm = ServiceModelManager.getInstance();
114
		IServiceConfiguration serviceConfig = smm.getActiveConfiguration(project);
115
		IService buildService = smm.getService(IRDTServiceConstants.SERVICE_BUILD);
116
		IServiceProvider provider = serviceConfig.getServiceProvider(buildService);
117
		IRemoteExecutionServiceProvider executionProvider = null;
118
		if(provider instanceof IRemoteExecutionServiceProvider) {
119
			executionProvider = (IRemoteExecutionServiceProvider) provider;
120
		}
121
		
122
		if (executionProvider != null) {
123
			
124
			IRemoteServices remoteServices = executionProvider.getRemoteServices();
125
			
126
			IRemoteConnection connection = executionProvider.getConnection();
127
			
128
			if(!connection.isOpen())
129
				try {
130
					connection.open(null);
131
				} catch (RemoteConnectionException e) {
132
					RDTLog.logError(e);
133
				}
134
			
135
			// get the config dir
136
			IRemoteProcessBuilder processBuilder = remoteServices.getProcessBuilder(connection, ""); //$NON-NLS-1$
137
			String configPath = executionProvider.getConfigLocation();
138
			IRemoteFileManager remoteFileManager = remoteServices.getFileManager(connection);
139
			IFileStore workingDir = remoteFileManager.getResource(new Path(configPath), monitor);
140
141
			// set the working directory for the process to be the config directory
142
			processBuilder.directory(workingDir);
143
			
144
			IFileStore specsFile = workingDir.getChild(specsFileName);
145
			
146
			IFileInfo fileInfo = specsFile.fetchInfo();
147
			
148
			if (!fileInfo.exists()) {
149
				InputStream is = new ByteArrayInputStream("\n".getBytes()); //$NON-NLS-1$
150
				OutputStream os = specsFile.openOutputStream(EFS.NONE, null);
151
				try {
152
153
					int data = is.read();
154
					while (data != -1) {
155
						os.write(data);
156
						data = is.read();
157
					}
158
					
159
					is.close();
160
					os.close();
161
				} catch (IOException e) {
162
					RDTLog.logError(e);
163
				}
164
				
165
166
			}
167
			
168
			return specsFile;
169
			
170
		}
171
		
172
		
173
		return null;
174
	}
175
	
176
	
177
	private static String getSpecsFileName(IProject project) {
178
		try {
179
			if(project.hasNature(CCProjectNature.CC_NATURE_ID))
180
	            return GCCScannerConfigUtil.CPP_SPECS_FILE;
181
	        else if(project.hasNature(CProjectNature.C_NATURE_ID))
182
	            return GCCScannerConfigUtil.C_SPECS_FILE;
183
		} catch(CoreException e) { }
184
		
185
		return null;
186
	}
187
188
189
	@Override
190
	protected IPath getWorkingDirectory(IProject project) {
191
		
192
		ServiceModelManager smm = ServiceModelManager.getInstance();
193
		IServiceConfiguration serviceConfig = smm.getActiveConfiguration(project);
194
		IService buildService = smm.getService(IRDTServiceConstants.SERVICE_BUILD);
195
		IServiceProvider provider = serviceConfig.getServiceProvider(buildService);
196
		IRemoteExecutionServiceProvider executionProvider = null;
197
		if(provider instanceof IRemoteExecutionServiceProvider) {
198
			executionProvider = (IRemoteExecutionServiceProvider) provider;
199
		}
200
		
201
		if (executionProvider != null) {
202
			
203
			IRemoteServices remoteServices = executionProvider.getRemoteServices();
204
			
205
			IRemoteConnection connection = executionProvider.getConnection();
206
			
207
			if(!connection.isOpen())
208
				try {
209
					connection.open(null);
210
				} catch (RemoteConnectionException e) {
211
					RDTLog.logError(e);
212
				}
213
			
214
		// get the CWD
215
		IRemoteProcessBuilder processBuilder = remoteServices.getProcessBuilder(connection, ""); //$NON-NLS-1$
216
		IFileStore workingDir = processBuilder.directory();
217
		
218
		// TODO:  this will have to change when the filesystem utility stuff is checked in
219
		IPath path = new Path(FileSystemUtilityManager.getDefault().getPathFromURI(workingDir.toURI()));
220
		return path;
221
		}
222
		return null;
223
	}
224
}
(-)src/org/eclipse/ptp/rdt/core/remotemake/ScannerInfoUtility.java (+133 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 * IBM - Initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.ptp.rdt.core.remotemake;
12
13
import java.io.OutputStream;
14
import java.util.ArrayList;
15
import java.util.List;
16
import java.util.Map;
17
18
import org.eclipse.cdt.build.core.scannerconfig.CfgInfoContext;
19
import org.eclipse.cdt.build.core.scannerconfig.ICfgScannerConfigBuilderInfo2Set;
20
import org.eclipse.cdt.build.internal.core.scannerconfig2.CfgScannerConfigProfileManager;
21
import org.eclipse.cdt.core.IMarkerGenerator;
22
import org.eclipse.cdt.internal.core.ConsoleOutputSniffer;
23
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
24
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
25
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser;
26
import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
27
import org.eclipse.cdt.make.internal.core.scannerconfig2.SCProfileInstance;
28
import org.eclipse.cdt.make.internal.core.scannerconfig2.ScannerConfigProfile;
29
import org.eclipse.cdt.make.internal.core.scannerconfig2.ScannerConfigProfileManager;
30
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
31
import org.eclipse.cdt.managedbuilder.core.IFileInfo;
32
import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
33
import org.eclipse.cdt.managedbuilder.core.IInputType;
34
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
35
import org.eclipse.cdt.managedbuilder.core.ITool;
36
import org.eclipse.core.resources.IProject;
37
import org.eclipse.core.runtime.IPath;
38
39
/**
40
 * @author crecoskie
41
 *
42
 */
43
public class ScannerInfoUtility {
44
	public static  ConsoleOutputSniffer createBuildOutputSniffer(OutputStream outputStream,
45
			OutputStream errorStream,
46
			IProject project,
47
			IConfiguration cfg,
48
			IPath workingDirectory,
49
			IMarkerGenerator markerGenerator,
50
			IScannerInfoCollector collector){
51
		ICfgScannerConfigBuilderInfo2Set container = CfgScannerConfigProfileManager.getCfgScannerConfigBuildInfo(cfg);
52
		Map map = container.getInfoMap();
53
		List clParserList = new ArrayList();
54
		
55
		if(container.isPerRcTypeDiscovery()){
56
			IResourceInfo[] rcInfos = cfg.getResourceInfos();
57
			for(int q = 0; q < rcInfos.length; q++){
58
				IResourceInfo rcInfo = rcInfos[q];
59
				ITool tools[];
60
				if(rcInfo instanceof IFileInfo){
61
					tools = ((IFileInfo)rcInfo).getToolsToInvoke();
62
				} else {
63
					tools = ((IFolderInfo)rcInfo).getFilteredTools();
64
				}
65
				for(int i = 0; i < tools.length; i++){
66
					ITool tool = tools[i];
67
					IInputType[] types = tool.getInputTypes();
68
					
69
					if(types.length != 0){
70
						for(int k = 0; k < types.length; k++){
71
							IInputType type = types[k];
72
							CfgInfoContext c = new CfgInfoContext(rcInfo, tool, type);
73
							contributeToConsoleParserList(project, map, c, workingDirectory, markerGenerator, collector, clParserList);
74
						}
75
					} else {
76
						CfgInfoContext c = new CfgInfoContext(rcInfo, tool, null);
77
						contributeToConsoleParserList(project, map, c, workingDirectory, markerGenerator, collector, clParserList);
78
					}
79
				}
80
			}
81
		} 
82
		
83
		if(clParserList.size() == 0){
84
			contributeToConsoleParserList(project, map, new CfgInfoContext(cfg), workingDirectory, markerGenerator, collector, clParserList);
85
		}
86
		
87
		if(clParserList.size() != 0){
88
			return new ConsoleOutputSniffer(outputStream, errorStream, 
89
					(IScannerInfoConsoleParser[])clParserList.toArray(new IScannerInfoConsoleParser[clParserList.size()]));
90
		}
91
		
92
		return null;
93
	}
94
	
95
	public static boolean contributeToConsoleParserList(
96
			IProject project, 
97
			Map map, 
98
			CfgInfoContext context, 
99
			IPath workingDirectory,
100
			IMarkerGenerator markerGenerator,
101
			IScannerInfoCollector collector,
102
			List parserList){
103
		IScannerConfigBuilderInfo2 info = (IScannerConfigBuilderInfo2)map.get(context);
104
		InfoContext ic = context.toInfoContext();
105
		boolean added = false;
106
		if (info != null && 
107
				info.isAutoDiscoveryEnabled() &&
108
				info.isBuildOutputParserEnabled()) {
109
			
110
			String id = info.getSelectedProfileId();
111
			ScannerConfigProfile profile = ScannerConfigProfileManager.getInstance().getSCProfileConfiguration(id);
112
			if(profile.getBuildOutputProviderElement() != null){
113
				// get the make builder console parser 
114
				SCProfileInstance profileInstance = ScannerConfigProfileManager.getInstance().
115
						getSCProfileInstance(project, ic, id);
116
				
117
				IScannerInfoConsoleParser clParser = profileInstance.createBuildOutputParser();
118
                if (collector == null) {
119
                    collector = profileInstance.getScannerInfoCollector();
120
                }
121
                if(clParser != null){
122
					clParser.startup(project, workingDirectory, collector,
123
                            info.isProblemReportingEnabled() ? markerGenerator : null);
124
					parserList.add(clParser);
125
					added = true;
126
                }
127
			
128
			}
129
		}
130
131
		return added;
132
	}
133
}
(-)src/org/eclipse/cdt/make/xlc/core/scannerconfig/DefaultXlCScannerInfoCollector.java (-24 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.make.xlc.core.scannerconfig;
12
13
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector3;
14
import org.eclipse.cdt.make.internal.core.scannerconfig2.PerProjectSICollector;
15
import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector;
16
17
/**
18
 * @author laggarcia
19
 *
20
 */
21
public class DefaultXlCScannerInfoCollector extends PerProjectSICollector
22
		implements IScannerInfoCollector3, IManagedScannerInfoCollector {
23
24
}
(-).settings/org.eclipse.jdt.core.prefs (-244 / +1 lines)
Lines 1-248 Link Here
1
#Thu Oct 04 14:01:28 BRT 2007
1
#Tue Sep 29 13:43:38 EDT 2009
2
eclipse.preferences.version=1
2
eclipse.preferences.version=1
3
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
4
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
5
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
6
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
7
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
8
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
9
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
10
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
11
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
12
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
13
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
14
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
15
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
17
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
18
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
19
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
20
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
21
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
22
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
23
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
24
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
25
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
26
org.eclipse.jdt.core.formatter.blank_lines_before_field=1
27
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
28
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
29
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
30
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
31
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
32
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
33
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
34
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
35
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
36
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
37
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
38
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
39
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
40
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
41
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
42
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
43
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
44
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
45
org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
3
org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
46
org.eclipse.jdt.core.formatter.comment.format_comments=true
4
org.eclipse.jdt.core.formatter.comment.format_comments=true
47
org.eclipse.jdt.core.formatter.comment.format_header=false
48
org.eclipse.jdt.core.formatter.comment.format_html=true
49
org.eclipse.jdt.core.formatter.comment.format_source_code=true
50
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
51
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
52
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
53
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
54
org.eclipse.jdt.core.formatter.comment.line_length=80
55
org.eclipse.jdt.core.formatter.compact_else_if=true
56
org.eclipse.jdt.core.formatter.continuation_indentation=2
57
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
58
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
59
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
60
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
61
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
62
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
63
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
64
org.eclipse.jdt.core.formatter.indent_empty_lines=false
65
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
66
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
67
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
68
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
69
org.eclipse.jdt.core.formatter.indentation.size=4
70
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
5
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
71
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
72
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
73
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
74
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
75
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
76
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
77
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
78
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
79
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
80
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
81
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
82
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
83
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
84
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
85
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
86
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
87
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
88
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
89
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
90
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
91
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
92
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
93
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
94
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
95
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
96
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
97
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
98
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
99
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
100
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
101
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
102
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
103
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
104
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
105
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
106
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
107
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
108
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
109
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
110
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
111
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
112
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
113
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
114
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
115
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
116
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
117
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
118
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
119
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
120
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
121
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
122
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
123
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
124
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
125
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
126
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
127
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
128
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
129
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
130
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
131
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
132
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
133
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
134
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
135
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
136
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
137
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
138
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
139
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
140
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
141
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
142
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
143
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
144
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
145
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
146
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
147
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
148
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
149
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
150
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
151
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
152
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
153
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
154
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
155
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
156
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
157
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
158
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
159
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
160
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
161
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
162
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
163
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
164
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
165
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
166
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
167
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
168
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
169
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
170
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
171
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
172
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
173
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
174
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
175
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
176
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
177
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
178
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
179
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
180
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
181
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
182
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
183
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
184
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
185
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
186
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
187
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
188
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
189
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
190
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
191
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
192
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
193
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
194
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
195
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
196
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
197
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
198
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
199
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
200
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
201
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
202
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
203
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
204
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
205
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
206
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
207
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
208
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
209
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
210
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
211
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
212
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
213
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
214
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
215
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
216
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
217
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
218
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
219
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
220
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
221
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
222
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
223
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
224
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
225
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
226
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
227
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
228
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
229
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
230
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
231
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
232
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
233
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
234
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
235
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
236
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
237
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
238
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
239
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
240
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
241
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
242
org.eclipse.jdt.core.formatter.lineSplit=80
243
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
244
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
245
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
246
org.eclipse.jdt.core.formatter.tabulation.char=tab
247
org.eclipse.jdt.core.formatter.tabulation.size=4
248
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
(-).settings/org.eclipse.jdt.ui.prefs (-3 / +2 lines)
Lines 1-5 Link Here
1
#Thu Oct 04 14:01:28 BRT 2007
1
#Tue Sep 29 13:43:38 EDT 2009
2
eclipse.preferences.version=1
2
eclipse.preferences.version=1
3
formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile
3
formatter_settings_version=11
4
formatter_settings_version=10
5
internal.default.compliance=default
4
internal.default.compliance=default
(-)src/org/eclipse/cdt/make/xlc/core/scannerconfig/AbstractXLCBuildOutputParser.java (+412 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 * IBM - Initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.make.xlc.core.scannerconfig;
12
13
import java.util.ArrayList;
14
import java.util.HashMap;
15
import java.util.LinkedList;
16
import java.util.List;
17
import java.util.Map;
18
19
import org.eclipse.cdt.core.CCorePlugin;
20
import org.eclipse.cdt.core.IMarkerGenerator;
21
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
22
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser;
23
import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes;
24
import org.eclipse.cdt.make.internal.core.scannerconfig.gnu.AbstractGCCBOPConsoleParserUtility;
25
import org.eclipse.cdt.make.internal.core.scannerconfig.util.CCommandDSC;
26
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
27
import org.eclipse.cdt.make.internal.core.scannerconfig2.SCProfileInstance;
28
import org.eclipse.cdt.make.internal.core.scannerconfig2.ScannerConfigProfileManager;
29
import org.eclipse.cdt.make.internal.core.scannerconfig2.ScannerConfigProfile.BuildOutputProvider;
30
import org.eclipse.core.resources.IFile;
31
import org.eclipse.core.resources.IProject;
32
import org.eclipse.core.resources.IWorkspaceRoot;
33
import org.eclipse.core.resources.ResourcesPlugin;
34
import org.eclipse.core.runtime.IPath;
35
import org.eclipse.core.runtime.Platform;
36
import org.eclipse.core.runtime.content.IContentType;
37
import org.eclipse.core.runtime.content.IContentTypeManager;
38
39
import sun.misc.FpUtils;
40
41
/**
42
 * @author crecoskie
43
 * 
44
 */
45
public abstract class AbstractXLCBuildOutputParser implements IScannerInfoConsoleParser {
46
47
	protected static final String[] COMPILER_INVOCATION = { "xlc", "xlC"//$NON-NLS-1$ //$NON-NLS-2$
48
	};
49
	protected static final String DASHIDASH = "-I-"; //$NON-NLS-1$
50
	protected static final String DASHI = "-I"; //$NON-NLS-1$
51
	protected static final String DASHD = "-D"; //$NON-NLS-1$
52
53
	protected IProject fProject;
54
	protected IScannerInfoCollector fCollector;
55
	protected IPath fWorkingDir;
56
	protected IMarkerGenerator fMarkerGenerator;
57
	protected XLCBuildOutputParserUtility fUtility;
58
59
	protected boolean fBMultiline = false;
60
	protected String fSMultiline = ""; //$NON-NLS-1$
61
62
	protected String[] fCompilerCommands = { "xlc", "xlC" };
63
64
	/**
65
	 * @return Returns the fProject.
66
	 */
67
	protected IProject getProject() {
68
		return fProject;
69
	}
70
71
	/**
72
	 * @return Returns the fCollector.
73
	 */
74
	protected IScannerInfoCollector getCollector() {
75
		return fCollector;
76
	}
77
78
	public void startup(IProject project, IScannerInfoCollector collector) {
79
		fProject = project;
80
		fCollector = collector;
81
		fCompilerCommands = computeCompilerCommands();
82
	}
83
84
	/**
85
	 * Returns array of additional compiler commands to look for
86
	 * 
87
	 * @return String[]
88
	 */
89
	protected String[] computeCompilerCommands() {
90
		if (fProject != null) {
91
			SCProfileInstance profileInstance = ScannerConfigProfileManager.getInstance().getSCProfileInstance(
92
					fProject, ScannerConfigProfileManager.NULL_PROFILE_ID);
93
			BuildOutputProvider boProvider = profileInstance.getProfile().getBuildOutputProviderElement();
94
			if (boProvider != null) {
95
				String compilerCommandsString = boProvider.getScannerInfoConsoleParser().getCompilerCommands();
96
				if (compilerCommandsString != null && compilerCommandsString.length() > 0) {
97
					String[] compilerCommands = compilerCommandsString.split(",\\s*"); //$NON-NLS-1$
98
					if (compilerCommands.length > 0) {
99
						String[] compilerInvocation = new String[COMPILER_INVOCATION.length + compilerCommands.length];
100
						System.arraycopy(COMPILER_INVOCATION, 0, compilerInvocation, 0, COMPILER_INVOCATION.length);
101
						System.arraycopy(compilerCommands, 0, compilerInvocation, COMPILER_INVOCATION.length,
102
								compilerCommands.length);
103
						return compilerInvocation;
104
					}
105
				}
106
			}
107
		}
108
		return COMPILER_INVOCATION;
109
	}
110
111
	/*
112
	 * (non-Javadoc)
113
	 * 
114
	 * @see
115
	 * org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser#processLine
116
	 * (java.lang.String)
117
	 */
118
	public boolean processLine(String line) {
119
		boolean rc = false;
120
		int lineBreakPos = line.length() - 1;
121
		char[] lineChars = line.toCharArray();
122
		while (lineBreakPos >= 0 && Character.isWhitespace(lineChars[lineBreakPos])) {
123
			lineBreakPos--;
124
		}
125
		if (lineBreakPos >= 0) {
126
			if (lineChars[lineBreakPos] != '\\' || (lineBreakPos > 0 && lineChars[lineBreakPos - 1] == '\\')) {
127
				lineBreakPos = -1;
128
			}
129
		}
130
		// check for multiline commands (ends with '\')
131
		if (lineBreakPos >= 0) {
132
			fSMultiline += line.substring(0, lineBreakPos);
133
			fBMultiline = true;
134
			return rc;
135
		}
136
		if (fBMultiline) {
137
			line = fSMultiline + line;
138
			fBMultiline = false;
139
			fSMultiline = ""; //$NON-NLS-1$
140
		}
141
		line = line.trim();
142
		TraceUtil.outputTrace("XLCBuildOutputParser parsing line: [", line, "]"); //$NON-NLS-1$ //$NON-NLS-2$
143
		// make\[[0-9]*\]: error_desc
144
		int firstColon = line.indexOf(':');
145
		String make = line.substring(0, firstColon + 1);
146
		if (firstColon != -1 && make.indexOf("make") != -1) { //$NON-NLS-1$
147
			boolean enter = false;
148
			String msg = line.substring(firstColon + 1).trim();
149
			if ((enter = msg.startsWith("Entering directory")) || //$NON-NLS-1$
150
					(msg.startsWith("Leaving directory"))) { //$NON-NLS-1$
151
				int s = msg.indexOf('`');
152
				int e = msg.indexOf('\'');
153
				if (s != -1 && e != -1) {
154
					String dir = msg.substring(s + 1, e);
155
					if (getUtility() != null) {
156
						getUtility().changeMakeDirectory(dir, getDirectoryLevel(line), enter);
157
					}
158
					return rc;
159
				}
160
			}
161
		}
162
		// call sublclass to process a single line
163
		return processSingleLine(line.trim());
164
	}
165
166
	protected XLCBuildOutputParserUtility getUtility() {
167
		if (fUtility == null)
168
			fUtility = new XLCBuildOutputParserUtility(fProject, fWorkingDir, fMarkerGenerator);
169
170
		return fUtility;
171
	}
172
173
	protected int getDirectoryLevel(String line) {
174
		int s = line.indexOf('[');
175
		int num = 0;
176
		if (s != -1) {
177
			int e = line.indexOf(']');
178
			String number = line.substring(s + 1, e).trim();
179
			try {
180
				num = Integer.parseInt(number);
181
			} catch (NumberFormatException exc) {
182
			}
183
		}
184
		return num;
185
	}
186
187
	/*
188
	 * (non-Javadoc)
189
	 * 
190
	 * @see
191
	 * org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser#shutdown
192
	 * ()
193
	 */
194
	public void shutdown() {
195
		if (getUtility() != null) {
196
			getUtility().reportProblems();
197
		}
198
	}
199
200
	/**
201
	 * Tokenizes a line into an array of commands. Commands are separated by
202
	 * ';', '&&' or '||'. Tokens are separated by whitespace unless found inside
203
	 * of quotes, back-quotes, or double quotes. Outside of single-, double- or
204
	 * back-quotes a backslash escapes white-spaces, all quotes, the backslash,
205
	 * '&' and '|'. A backslash used for escaping is removed. Quotes other than
206
	 * the back-quote plus '&&', '||', ';' are removed, also.
207
	 * 
208
	 * @param line
209
	 *            to tokenize
210
	 * @return array of commands
211
	 */
212
	protected String[][] tokenize(String line, boolean escapeInsideDoubleQuotes) {
213
		ArrayList<String[]> commands = new ArrayList<String[]>();
214
		ArrayList<String> tokens = new ArrayList<String>();
215
		StringBuffer token = new StringBuffer();
216
217
		final char[] input = line.toCharArray();
218
		boolean nextEscaped = false;
219
		char currentQuote = 0;
220
		for (int i = 0; i < input.length; i++) {
221
			final char c = input[i];
222
			final boolean escaped = nextEscaped;
223
			nextEscaped = false;
224
225
			if (currentQuote != 0) {
226
				if (c == currentQuote) {
227
					if (escaped) {
228
						token.append(c);
229
					} else {
230
						if (c == '`') {
231
							token.append(c); // preserve back-quotes
232
						}
233
						currentQuote = 0;
234
					}
235
				} else {
236
					if (escapeInsideDoubleQuotes && currentQuote == '"' && c == '\\') {
237
						nextEscaped = !escaped;
238
						if (escaped) {
239
							token.append(c);
240
						}
241
					} else {
242
						if (escaped) {
243
							token.append('\\');
244
						}
245
						token.append(c);
246
					}
247
				}
248
			} else {
249
				switch (c) {
250
				case '\\':
251
					if (escaped) {
252
						token.append(c);
253
					} else {
254
						nextEscaped = true;
255
					}
256
					break;
257
				case '\'':
258
				case '"':
259
				case '`':
260
					if (escaped) {
261
						token.append(c);
262
					} else {
263
						if (c == '`') {
264
							token.append(c);
265
						}
266
						currentQuote = c;
267
					}
268
					break;
269
				case ';':
270
					if (escaped) {
271
						token.append(c);
272
					} else {
273
						endCommand(token, tokens, commands);
274
					}
275
					break;
276
				case '&':
277
				case '|':
278
					if (escaped || i + 1 >= input.length || input[i + 1] != c) {
279
						token.append(c);
280
					} else {
281
						i++;
282
						endCommand(token, tokens, commands);
283
					}
284
					break;
285
286
				default:
287
					if (Character.isWhitespace(c)) {
288
						if (escaped) {
289
							token.append(c);
290
						} else {
291
							endToken(token, tokens);
292
						}
293
					} else {
294
						if (escaped) {
295
							token.append('\\'); // for windows put backslash
296
												// back onto the token.
297
						}
298
						token.append(c);
299
					}
300
				}
301
			}
302
		}
303
		endCommand(token, tokens, commands);
304
		return commands.toArray(new String[commands.size()][]);
305
	}
306
307
	protected void endCommand(StringBuffer token, ArrayList<String> tokens, ArrayList<String[]> commands) {
308
		endToken(token, tokens);
309
		if (!tokens.isEmpty()) {
310
			commands.add(tokens.toArray(new String[tokens.size()]));
311
			tokens.clear();
312
		}
313
	}
314
315
	protected void endToken(StringBuffer token, ArrayList<String> tokens) {
316
		if (token.length() > 0) {
317
			tokens.add(token.toString());
318
			token.setLength(0);
319
		}
320
	}
321
322
	protected boolean processSingleLine(String line) {
323
		boolean rc = false;
324
		String[][] tokens = tokenize(line, true);
325
		for (int i = 0; i < tokens.length; i++) {
326
			String[] command = tokens[i];
327
			if (processCommand(command)) {
328
				rc = true;
329
			} else { // go inside quotes, if the compiler is called per wrapper
330
						// or shell script
331
				for (int j = 0; j < command.length; j++) {
332
					String[][] subtokens = tokenize(command[j], true);
333
					for (int k = 0; k < subtokens.length; k++) {
334
						String[] subcommand = subtokens[k];
335
						if (subcommand.length > 1) { // only proceed if there is
336
														// any additional info
337
							if (processCommand(subcommand)) {
338
								rc = true;
339
							}
340
						}
341
					}
342
				}
343
			}
344
		}
345
		return rc;
346
	}
347
348
	protected int findCompilerInvocation(String[] tokens) {
349
		for (int i = 0; i < tokens.length; i++) {
350
			final String token = tokens[i].toLowerCase();
351
			final int searchFromOffset = Math.max(token.lastIndexOf('/'), token.lastIndexOf('\\')) + 1;
352
			for (int j = 0; j < fCompilerCommands.length; j++) {
353
				if (token.indexOf(fCompilerCommands[j], searchFromOffset) != -1) {
354
					return i;
355
				}
356
			}
357
		}
358
		return -1;
359
	}
360
361
	public void startup(IProject project, IPath workingDirectory, IScannerInfoCollector collector,
362
			IMarkerGenerator markerGenerator) {
363
		fProject = project;
364
		fWorkingDir = workingDirectory;
365
		fCollector = collector;
366
		fMarkerGenerator = markerGenerator;
367
368
	}
369
370
	abstract protected boolean processCommand(String[] tokens);
371
372
	protected List<String> getFileExtensionsList() {
373
		IContentTypeManager manager = Platform.getContentTypeManager();
374
		List<String> extensions = new LinkedList<String>();
375
		IContentType cSource = manager.getContentType(CCorePlugin.CONTENT_TYPE_CSOURCE);
376
		IContentType cppSource = manager.getContentType(CCorePlugin.CONTENT_TYPE_CXXSOURCE);
377
378
		String[] cExtensions = cSource.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
379
		String[] cppExtensions = cppSource.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
380
381
		for (int k = 0; k < cExtensions.length; k++) {
382
			extensions.add("." + cExtensions[k]);
383
		}
384
385
		for (int k = 0; k < cppExtensions.length; k++) {
386
			extensions.add("." + cppExtensions[k]);
387
		}
388
389
		return extensions;
390
	}
391
392
	protected String[] getFileExtensions() {
393
		IContentTypeManager manager = Platform.getContentTypeManager();
394
		List<String> extensions = new LinkedList<String>();
395
		IContentType cSource = manager.getContentType(CCorePlugin.CONTENT_TYPE_CSOURCE);
396
		IContentType cppSource = manager.getContentType(CCorePlugin.CONTENT_TYPE_CXXSOURCE);
397
398
		String[] cExtensions = cSource.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
399
		String[] cppExtensions = cppSource.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
400
401
		for (int k = 0; k < cExtensions.length; k++) {
402
			extensions.add("." + cExtensions[k]);
403
		}
404
405
		for (int k = 0; k < cppExtensions.length; k++) {
406
			extensions.add("." + cppExtensions[k]);
407
		}
408
409
		return extensions.toArray(new String[0]);
410
	}
411
412
}
(-)src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerFileBuildOutputParser.java (+117 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 * IBM - Initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.make.xlc.core.scannerconfig;
12
13
import java.util.ArrayList;
14
import java.util.HashMap;
15
import java.util.List;
16
import java.util.Map;
17
18
import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes;
19
import org.eclipse.cdt.make.internal.core.scannerconfig.util.CCommandDSC;
20
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
21
import org.eclipse.core.resources.IFile;
22
import org.eclipse.core.resources.IProject;
23
import org.eclipse.core.resources.IWorkspaceRoot;
24
import org.eclipse.core.resources.ResourcesPlugin;
25
import org.eclipse.core.runtime.IPath;
26
27
/**
28
 * @author crecoskie
29
 *
30
 */
31
public class XLCPerFileBuildOutputParser extends AbstractXLCBuildOutputParser {
32
33
	/* (non-Javadoc)
34
	 * @see org.eclipse.cdt.make.xlc.core.scannerconfig.AbstractXLCBuildOutputParser#processCommand(java.lang.String[])
35
	 */
36
	@Override
37
	protected boolean processCommand(String[] tokens) {
38
	    // GCC C/C++ compiler invocation 
39
        int compilerInvocationIndex= findCompilerInvocation(tokens);
40
        if (compilerInvocationIndex < 0) {
41
            return false;
42
        }
43
44
        // find a file name
45
        int extensionsIndex = -1;
46
        boolean found = false;
47
        String filePath = null;
48
        for (int i = compilerInvocationIndex+1; i < tokens.length; i++) {
49
        	String token= tokens[i];
50
            int k = token.lastIndexOf('.');
51
            if (k != -1 && (token.length() - k < 5)) {
52
                String fileExtension = token.substring(k);
53
                extensionsIndex = getFileExtensionsList().indexOf(fileExtension);
54
                if (extensionsIndex != -1) {
55
                    filePath = token;
56
                    found = true;
57
                    break;
58
                }
59
            }
60
        }
61
        if (!found) {
62
            TraceUtil.outputTrace("Error identifying file name :1", tokens, TraceUtil.EOL); //$NON-NLS-1$
63
            return false;
64
        }
65
        // sanity check
66
        if (filePath.indexOf(getFileExtensions()[extensionsIndex]) == -1) {
67
            TraceUtil.outputTrace("Error identifying file name :2", tokens, TraceUtil.EOL); //$NON-NLS-1$
68
            return false;
69
        }
70
        if (fUtility != null) {
71
            IPath pFilePath = fUtility.getAbsolutePath(filePath);
72
            String shortFileName = pFilePath.removeFileExtension().lastSegment();
73
74
            // generalize occurrences of the file name
75
            for (int i = compilerInvocationIndex+1; i < tokens.length; i++) {
76
				String token = tokens[i];
77
				if (token.equals("-include")) { //$NON-NLS-1$
78
					++i;
79
				}
80
				else if (token.equals("-imacros")) { //$NON-NLS-1$
81
					++i;
82
				}
83
				else if (token.equals(filePath)) {
84
					tokens[i]= "LONG_NAME"; //$NON-NLS-1$
85
				}
86
				else if (token.startsWith(shortFileName)) {
87
					tokens[i]= token.replaceFirst(shortFileName, "SHORT_NAME"); //$NON-NLS-1$
88
				}
89
			}
90
            
91
            IFile file= null;
92
            IPath baseDirectory= fUtility.getBaseDirectory();
93
            if (baseDirectory.isPrefixOf(pFilePath)) {
94
				IPath relPath = pFilePath.removeFirstSegments(baseDirectory.segmentCount());
95
				//Note: We add the scanner-config even if the resource doesn't actually
96
				//exist below this project (which may happen when reading existing
97
				//build logs, because resources can be created as part of the build
98
				//and may not exist at the time of analyzing the config but re-built
99
				//later on.
100
				//if (getProject().exists(relPath)) {
101
	            file = getProject().getFile(relPath);
102
            } else {
103
            	file = getUtility().findFileInWorkspace(pFilePath);
104
            }
105
            if (file != null) {
106
                CCommandDSC cmd = getUtility().getNewCCommandDSC(tokens, compilerInvocationIndex, extensionsIndex > 0);
107
	            List cmdList = new ArrayList();
108
	            cmdList.add(cmd);
109
	            Map sc = new HashMap(1);
110
	            sc.put(ScannerInfoTypes.COMPILER_COMMAND, cmdList);
111
	            getCollector().contributeToScannerConfig(file, sc);
112
            } else
113
            	TraceUtil.outputError("Build command for file outside project: "+pFilePath.toString(), tokens); //$NON-NLS-1$
114
        }
115
        return true;	}
116
117
}
(-)src/org/eclipse/cdt/make/xlc/core/scannerconfig/PerProjectXLCScannerInfoCollector.java (+30 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007, 20089 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.make.xlc.core.scannerconfig;
12
13
import java.util.Arrays;
14
import java.util.LinkedList;
15
import java.util.List;
16
import java.util.Map;
17
18
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector3;
19
import org.eclipse.cdt.make.internal.core.scannerconfig2.PerFileSICollector;
20
import org.eclipse.cdt.make.internal.core.scannerconfig2.PerProjectSICollector;
21
import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector;
22
import org.eclipse.core.runtime.IPath;
23
24
/**
25
 * @author laggarcia
26
 *
27
 */
28
public class PerProjectXLCScannerInfoCollector extends PerProjectSICollector
29
		implements IScannerInfoCollector3, IManagedScannerInfoCollector {
30
}
(-)src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCBuildOutputParserUtility.java (+712 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 * IBM - Initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.make.xlc.core.scannerconfig;
12
13
import java.io.File;
14
import java.io.IOException;
15
import java.net.URI;
16
import java.net.URISyntaxException;
17
import java.util.ArrayList;
18
import java.util.HashMap;
19
import java.util.Iterator;
20
import java.util.List;
21
import java.util.Map;
22
import java.util.Vector;
23
24
import org.eclipse.cdt.core.IMarkerGenerator;
25
import org.eclipse.cdt.core.ProblemMarkerInfo;
26
import org.eclipse.cdt.make.core.MakeCorePlugin;
27
import org.eclipse.cdt.make.internal.core.MakeMessages;
28
import org.eclipse.cdt.make.internal.core.scannerconfig.util.CCommandDSC;
29
import org.eclipse.cdt.make.internal.core.scannerconfig.util.KVStringPair;
30
import org.eclipse.cdt.make.internal.core.scannerconfig.util.SCDOptionsEnum;
31
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
32
import org.eclipse.cdt.utils.FileSystemUtilityManager;
33
import org.eclipse.core.resources.IContainer;
34
import org.eclipse.core.resources.IFile;
35
import org.eclipse.core.resources.IProject;
36
import org.eclipse.core.resources.IResource;
37
import org.eclipse.core.resources.IWorkspaceRoot;
38
import org.eclipse.core.runtime.CoreException;
39
import org.eclipse.core.runtime.IPath;
40
import org.eclipse.core.runtime.Path;
41
42
/**
43
 * @author crecoskie
44
 *
45
 */
46
public class XLCBuildOutputParserUtility {
47
    protected class Problem {
48
        protected String description;
49
        protected IResource file;
50
        protected int lineNumber;
51
        protected int severity;
52
        protected String variableName;
53
54
        public Problem(IResource file, int lineNumber, String desciption, int severity, String variableName) {
55
            this.file = file;
56
            this.lineNumber = lineNumber;
57
            this.description = desciption;
58
            this.severity = severity;
59
            this.variableName = variableName;
60
        }
61
    }
62
    public static IPath convertCygpath(IPath path) {
63
    	if (path.segmentCount() > 1 && path.segment(0).equals("cygdrive")) { //$NON-NLS-1$
64
            StringBuffer buf = new StringBuffer(2);
65
            buf.append(Character.toUpperCase(path.segment(1).charAt(0)));
66
            buf.append(':');
67
            path = path.removeFirstSegments(2);
68
            path = path.setDevice(buf.toString());
69
            path = path.makeAbsolute();
70
        }
71
    	return path;
72
	}
73
    private List commandsList2;
74
    private int commandsN = 0;
75
    private List compiledFileList;
76
77
    private Map directoryCommandListMap;
78
79
    private IPath fBaseDirectory;
80
    private String fDefaultMacroDefinitionValue= "1"; //$NON-NLS-1$
81
    private Vector<IPath> fDirectoryStack;
82
    private ArrayList<Problem> fErrors;
83
    private int filesN = 0;
84
85
    private IMarkerGenerator fMarkerGenerator;
86
87
    private IProject project;
88
89
    private int workingDirsN = 0;
90
    
91
	/*
92
	 * For tracking the location of files being compiled
93
	 */
94
	private Map<String, IFile> fFilesInProject;
95
	private List<String> fCollectedFiles;
96
	private List<String> fNameConflicts;
97
98
	/**
99
     * 
100
     */
101
    public XLCBuildOutputParserUtility(IProject project, IPath workingDirectory,
102
                                              IMarkerGenerator markerGenerator) {
103
        fDirectoryStack = new Vector<IPath>();
104
        fErrors = new ArrayList<Problem>();
105
        this.project = project;
106
        fBaseDirectory = getPathForResource(project);
107
        if (workingDirectory != null) {
108
            pushDirectory(workingDirectory);
109
        }
110
    }
111
112
	private IPath getPathForResource(IResource resource) {
113
		// TODO: when the file system utility stuff is in, this will have to call it to get the path
114
		// for now, get the path from the URI
115
		URI locationURI = resource.getLocationURI();
116
		IPath path = new Path(locationURI.getPath());
117
		return path;
118
	}
119
120
    /**
121
     * Adds a mapping filename, generic_command
122
     * @param longFileName
123
     * @param genericLine
124
     */
125
    void addGenericCommandForFile(String longFileName, String genericCommand) {
126
        // if a file name has already been added once, return
127
        if (compiledFileList.contains(longFileName))
128
            return;
129
        compiledFileList.add(longFileName);
130
        
131
        String workingDir = getWorkingDirectory().toString();
132
        List directoryCommandList = (List) directoryCommandListMap.get(workingDir);
133
        if (directoryCommandList == null) {
134
            directoryCommandList = new ArrayList();
135
            directoryCommandListMap.put(workingDir, directoryCommandList);
136
            ++workingDirsN;
137
        }
138
        Map command21FileListMap = null;
139
        for (Iterator i = directoryCommandList.iterator(); i.hasNext(); ) {
140
            command21FileListMap = (Map) i.next();
141
            List fileList = (List) command21FileListMap.get(genericCommand);
142
            if (fileList != null) {
143
                if (!fileList.contains(longFileName)) {
144
                    fileList.add(longFileName);
145
                    ++filesN;
146
                }
147
                return;
148
            }
149
        }
150
        command21FileListMap = new HashMap(1);
151
        directoryCommandList.add(command21FileListMap);
152
        ++commandsN;
153
        List fileList = new ArrayList();
154
        command21FileListMap.put(genericCommand, fileList);
155
        fileList.add(longFileName);
156
        ++filesN;
157
    }
158
159
    /**
160
     * Adds a mapping command line -> file, this time without a dir
161
     * @param longFileName
162
     * @param genericLine
163
     */
164
    void addGenericCommandForFile2(String longFileName, String genericLine) {
165
        // if a file name has already been added once, return
166
        if (compiledFileList.contains(longFileName))
167
            return;
168
        compiledFileList.add(longFileName);
169
170
        String[] tokens = genericLine.split("\\s+"); //$NON-NLS-1$
171
        CCommandDSC command = getNewCCommandDSC(tokens, 0, false); // assume .c file type
172
        int index = commandsList2.indexOf(command);
173
        if (index == -1) {
174
            commandsList2.add(command);
175
            ++commandsN;
176
        }
177
        else {
178
            command = (CCommandDSC) commandsList2.get(index);
179
        }
180
//        // add a file
181
//        command.addFile(longFileName);
182
//        ++filesN;
183
    }
184
185
    public void changeMakeDirectory(String dir, int dirLevel, boolean enterDir) {
186
        if (enterDir) {
187
            /* Sometimes make screws up the output, so
188
             * "leave" events can't be seen.  Double-check level
189
             * here.
190
             */
191
            for (int parseLevel = getDirectoryLevel(); dirLevel < parseLevel; parseLevel = getDirectoryLevel()) {
192
                popDirectory();
193
            }
194
            pushDirectory(new Path(dir));
195
        } else {
196
            popDirectory();
197
            /* Could check to see if they match */
198
        }
199
    }
200
201
    /**
202
     * Called by the console line parsers to generate a problem marker.
203
     */
204
    public void generateMarker(IResource file, int lineNumber, String desc, int severity, String varName) {
205
        // No need to collect markers if marker generator is not present
206
        if (fMarkerGenerator != null) {
207
            Problem problem = new Problem(file, lineNumber, desc, severity, varName);
208
            fErrors.add(problem);
209
        }
210
    }
211
212
    /**
213
     * 
214
     */
215
    void generateReport() {
216
        TraceUtil.metricsTrace("Stats for directory ", //$NON-NLS-1$
217
                   "Generic command: '", "' applicable for:",  //$NON-NLS-1$ //$NON-NLS-2$
218
                   directoryCommandListMap);
219
        TraceUtil.summaryTrace("Discovery summary", workingDirsN, commandsN, filesN); //$NON-NLS-1$
220
    }
221
    
222
    /**
223
     * @param filePath : String
224
     * @return filePath : IPath - not <code>null</code>
225
     */
226
    public IPath getAbsolutePath(String filePath) {
227
        IPath pFilePath;
228
        if (filePath.startsWith("/")) { //$NON-NLS-1$
229
        	return convertCygpath(new Path(filePath));
230
        }
231
        else if (filePath.startsWith("\\") || //$NON-NLS-1$
232
            (!filePath.startsWith(".") && //$NON-NLS-1$
233
             filePath.length() > 2 && filePath.charAt(1) == ':' && 
234
             (filePath.charAt(2) == '\\' || filePath.charAt(2) == '/'))) {
235
            // absolute path
236
            pFilePath = new Path(filePath);
237
        }
238
        else {
239
            // relative path
240
            IPath cwd = getWorkingDirectory();
241
            if (!cwd.isAbsolute()) {
242
                cwd = getBaseDirectory().append(cwd);
243
            }
244
            if (filePath.startsWith("`pwd`")) { //$NON-NLS-1$
245
            	if (filePath.length() > 5 && (filePath.charAt(5) == '/' || filePath.charAt(5) == '\\')) {
246
            		filePath = filePath.substring(6);
247
            	}
248
            	else {
249
            		filePath = filePath.substring(5);
250
            	}
251
            }
252
            pFilePath = cwd.append(filePath);
253
        }
254
        return pFilePath;
255
    }
256
    /**
257
     * @return Returns the fBaseDirectory.
258
     */
259
    public IPath getBaseDirectory() {
260
        return fBaseDirectory;
261
    }
262
    
263
    /**
264
     * Returns all CCommandDSC collected so far.
265
     * Currently this list is not filled, so it will always return an empty list.
266
     * @return List of CCommandDSC
267
     */
268
    public List getCCommandDSCList() {
269
        return new ArrayList(commandsList2);
270
    }
271
    
272
    protected int getDirectoryLevel() {
273
        return fDirectoryStack.size();
274
    }
275
    /**
276
     * @return Returns the fDirectoryStack.
277
     */
278
    protected Vector<IPath> getDirectoryStack() {
279
        return fDirectoryStack;
280
    }
281
    /**
282
     * @return Returns the fErrors.
283
     */
284
    protected ArrayList<Problem> getErrors() {
285
        return fErrors;
286
    }
287
	/**
288
     * @return Returns the fMarkerGenerator.
289
     */
290
    protected IMarkerGenerator getMarkerGenerator() {
291
        return fMarkerGenerator;
292
    }
293
294
    /**
295
     * @param genericLine
296
     * @param cppFileType
297
     * @return CCommandDSC compile command description 
298
     */
299
    public CCommandDSC getNewCCommandDSC(String[] tokens, final int idxOfCompilerCommand, boolean cppFileType) {
300
		ArrayList dirafter = new ArrayList();
301
		ArrayList includes = new ArrayList();
302
        CCommandDSC command = new CCommandDSC(cppFileType, getProject());
303
        command.addSCOption(new KVStringPair(SCDOptionsEnum.COMMAND.toString(), tokens[idxOfCompilerCommand]));
304
        for (int i = idxOfCompilerCommand+1; i < tokens.length; ++i) {
305
        	String token = tokens[i];
306
        	//Target specific options: see GccScannerInfoConsoleParser
307
			if (token.startsWith("-m") ||		//$NON-NLS-1$
308
				token.equals("-ansi") ||		//$NON-NLS-1$
309
				token.equals("-posix") ||		//$NON-NLS-1$
310
				token.equals("-pthread") ||		//$NON-NLS-1$
311
				token.startsWith("-O") ||		//$NON-NLS-1$
312
				token.equals("-fno-inline") ||	//$NON-NLS-1$
313
				token.startsWith("-finline") ||	//$NON-NLS-1$
314
				token.equals("-fno-exceptions") ||	//$NON-NLS-1$
315
				token.equals("-fexceptions") ||		//$NON-NLS-1$
316
				token.equals("-fshort-wchar") ||	//$NON-NLS-1$
317
				token.equals("-fshort-double") ||	//$NON-NLS-1$
318
				token.equals("-fno-signed-char") ||	//$NON-NLS-1$
319
				token.equals("-fsigned-char") ||	//$NON-NLS-1$
320
				token.startsWith("-fabi-version=")	//$NON-NLS-1$
321
			) {		
322
		        command.addSCOption(new KVStringPair(SCDOptionsEnum.COMMAND.toString(), token));
323
				continue;
324
        	}
325
            for (int j = SCDOptionsEnum.MIN; j <= SCDOptionsEnum.MAX; ++j) {
326
                final SCDOptionsEnum optionKind = SCDOptionsEnum.getSCDOptionsEnum(j);
327
				if (token.startsWith(optionKind.toString())) {
328
                    String option = token.substring(
329
                            optionKind.toString().length()).trim();
330
                    if (option.length() > 0) {
331
                        // ex. -I/dir
332
                    }
333
                    else if (optionKind.equals(SCDOptionsEnum.IDASH)) {
334
                    	for (Iterator iter=includes.iterator(); iter.hasNext(); ) {
335
                    		option = (String)iter.next();
336
                            KVStringPair pair = new KVStringPair(SCDOptionsEnum.IQUOTE.toString(), option);
337
                        	command.addSCOption(pair);                    		
338
                    	}
339
                    	includes = new ArrayList();
340
                        // -I- has no parameter
341
                    }
342
                    else {
343
                        // ex. -I /dir
344
                        // take a next token
345
                        if (i+1 < tokens.length && !tokens[i+1].startsWith("-")) { //$NON-NLS-1$
346
                            option = tokens[++i];
347
                        }
348
                        else break;
349
                    }
350
                    
351
                    if (option.length() > 0 && (
352
                            optionKind.equals(SCDOptionsEnum.INCLUDE) ||
353
                            optionKind.equals(SCDOptionsEnum.INCLUDE_FILE) ||
354
                            optionKind.equals(SCDOptionsEnum.IMACROS_FILE) ||
355
                            optionKind.equals(SCDOptionsEnum.IDIRAFTER) ||
356
                            optionKind.equals(SCDOptionsEnum.ISYSTEM) || 
357
                            optionKind.equals(SCDOptionsEnum.IQUOTE) )) {
358
                        option = (getAbsolutePath(option)).toString();
359
                    }
360
                    
361
                    if (optionKind.equals(SCDOptionsEnum.IDIRAFTER)) {
362
                        KVStringPair pair = new KVStringPair(SCDOptionsEnum.INCLUDE.toString(), option);
363
                    	dirafter.add(pair);
364
                    }
365
                    else if (optionKind.equals(SCDOptionsEnum.INCLUDE)) {
366
                    	includes.add(option);
367
                    }
368
                    else { // add the pair
369
                    	if (optionKind.equals(SCDOptionsEnum.DEFINE)) {
370
                        	if (option.indexOf('=') == -1) {
371
                        		option += '='+ fDefaultMacroDefinitionValue;
372
                        	}
373
                    	}
374
                        KVStringPair pair = new KVStringPair(optionKind.toString(), option);
375
                    	command.addSCOption(pair);
376
                    }
377
                    break;
378
                }
379
            }
380
        }
381
        String option;
382
    	for (Iterator iter=includes.iterator(); iter.hasNext(); ) {
383
    		option = (String)iter.next();
384
            KVStringPair pair = new KVStringPair(SCDOptionsEnum.INCLUDE.toString(), option);
385
        	command.addSCOption(pair);                    		
386
    	}
387
    	for (Iterator iter=dirafter.iterator(); iter.hasNext(); ) {
388
        	command.addSCOption((KVStringPair)iter.next());                    		
389
    	}
390
        return command;
391
    }
392
393
    /**
394
     * @return Returns the project.
395
     */
396
    protected IProject getProject() {
397
        return project;
398
    }
399
400
    public IPath getWorkingDirectory() {
401
        if (fDirectoryStack.size() != 0) {
402
            return fDirectoryStack.lastElement();
403
        }
404
        // Fallback to the Project Location
405
        // FIXME: if the build did not start in the Project ?
406
        return fBaseDirectory;
407
    }
408
409
    protected IPath popDirectory() {
410
        int i = getDirectoryLevel();
411
        if (i != 0) {
412
            IPath dir = fDirectoryStack.lastElement();
413
            fDirectoryStack.removeElementAt(i - 1);
414
            return dir;
415
        }
416
        return new Path("");    //$NON-NLS-1$
417
    }
418
419
    protected void pushDirectory(IPath dir) {
420
        if (dir != null) {
421
            IPath pwd = null;
422
            if (fBaseDirectory != null && fBaseDirectory.isPrefixOf(dir)) {
423
                pwd = dir.removeFirstSegments(fBaseDirectory.segmentCount());
424
            } else {
425
                // check if it is a cygpath
426
            	pwd= convertCygpath(dir);
427
            }
428
            fDirectoryStack.addElement(pwd);
429
        }
430
    }
431
432
	public boolean reportProblems() {
433
        boolean reset = false;
434
        for (Iterator<Problem> iter = fErrors.iterator(); iter.hasNext(); ) {
435
            Problem problem = iter.next();
436
            if (problem.severity == IMarkerGenerator.SEVERITY_ERROR_BUILD) {
437
                reset = true;
438
            }
439
            if (problem.file == null) {
440
                fMarkerGenerator.addMarker(new ProblemMarkerInfo(
441
                    project,
442
                    problem.lineNumber,
443
                    problem.description,
444
                    problem.severity,
445
                    problem.variableName));
446
            } else {
447
                fMarkerGenerator.addMarker(new ProblemMarkerInfo(
448
                    problem.file,
449
                    problem.lineNumber,
450
                    problem.description,
451
                    problem.severity,
452
                    problem.variableName));
453
            }
454
        }
455
        fErrors.clear();
456
        return reset;
457
    }
458
459
    public void setDefaultMacroDefinitionValue(String val) {
460
    	if (val != null) {
461
    		fDefaultMacroDefinitionValue= val;
462
    	}
463
	}
464
    
465
    public String getDefaultMacroDefinitionValue() {
466
    	return fDefaultMacroDefinitionValue;
467
    }
468
    
469
	public String normalizePath(String path) {
470
		int column = path.indexOf(':');
471
		if (column > 0) {
472
			char driveLetter = path.charAt(column - 1);
473
			if (Character.isLowerCase(driveLetter)) {
474
				StringBuffer sb = new StringBuffer();
475
				if (column - 1 > 0) {
476
					sb.append(path.substring(0, column-1));
477
				}
478
				sb.append(Character.toUpperCase(driveLetter));
479
				sb.append(path.substring(column));
480
				path = sb.toString();
481
			}
482
		}
483
		if (path.indexOf('.') == -1 || path.equals(".")) {	//$NON-NLS-1$
484
			return (new Path(path)).toString();	// convert separators to '/'
485
		}
486
		// lose "./" segments since they confuse the Path normalization
487
		StringBuffer buf = new StringBuffer(path);
488
		int len = buf.length();
489
		StringBuffer newBuf = new StringBuffer(buf.length());
490
		int scp = 0; // starting copy point
491
		int ssp = 0;	// starting search point
492
		int sdot;
493
		boolean validPrefix;
494
		while (ssp < len && (sdot = buf.indexOf(".", ssp)) != -1) {	//$NON-NLS-1$
495
			validPrefix = false;
496
			int ddot = buf.indexOf("..", ssp);//$NON-NLS-1$
497
			if (sdot < ddot || ddot == -1) {
498
				newBuf.append(buf.substring(scp, sdot));
499
				scp = sdot;
500
				ssp = sdot + 1;
501
				if (ssp < len) {
502
					if (sdot == 0 || buf.charAt(sdot - 1) == '/' || buf.charAt(sdot - 1) == '\\') {
503
						validPrefix = true;
504
					}
505
					char nextChar = buf.charAt(ssp);
506
					if (validPrefix && nextChar == '/') {
507
						++ssp;
508
						scp = ssp;
509
					}
510
					else if (validPrefix && nextChar == '\\') {
511
						++ssp;
512
						if (ssp < len - 1 && buf.charAt(ssp) == '\\') {
513
							++ssp;
514
						}
515
						scp = ssp;
516
					}
517
					else {
518
						// no path delimiter, must be '.' inside the path
519
						scp = ssp - 1;
520
					}
521
				}
522
			}
523
			else if (sdot == ddot) {
524
				ssp = sdot + 2;
525
			}
526
		}
527
		newBuf.append(buf.substring(scp, len));
528
					 
529
		IPath orgPath = new Path(newBuf.toString());
530
		return orgPath.toString();
531
	}
532
533
	
534
	/**
535
	 * Called by the console line parsers to find a file with a given name.
536
	 * @param fileName
537
	 * @return IFile or null
538
	 */
539
	public IFile findFile(String fileName) {
540
		IFile file = findFilePath(fileName);
541
		if (file == null) {
542
			// Try the project's map.
543
			file = findFileName(fileName);
544
			if (file != null) {
545
				// If there is a conflict then try all files in the project.
546
				if (isConflictingName(fileName)) {
547
					file = null;
548
					
549
					// Create a problem marker
550
					final String error = MakeMessages.getString("ConsoleParser.Ambiguous_Filepath_Error_Message"); //$NON-NLS-1$
551
					TraceUtil.outputError(error, fileName);
552
					generateMarker(getProject(), -1, error+fileName, IMarkerGenerator.SEVERITY_WARNING, null);
553
				}
554
			}
555
		}
556
		return file;
557
	}
558
	
559
	/**
560
	 * @param filePath
561
	 * @return
562
	 */
563
	protected IFile findFilePath(String filePath) {
564
		IPath path = null;
565
		IPath fp = new Path(filePath);
566
		if (fp.isAbsolute()) {
567
			if (getBaseDirectory().isPrefixOf(fp)) {
568
				int segments = getBaseDirectory().matchingFirstSegments(fp);
569
				path = fp.removeFirstSegments(segments);
570
			} else {
571
				path = fp;
572
			}
573
		} else {
574
			path = getWorkingDirectory().append(filePath);
575
		}
576
577
		IFile file = null;
578
		// The workspace may throw an IllegalArgumentException
579
		// Catch it and the parser should fallback to scan the entire project.
580
		try {
581
			file = findFileInWorkspace(path);
582
		} catch (Exception e) {
583
		}
584
585
		// We have to do another try, on Windows for cases like "TEST.C" vs "test.c"
586
		// We use the java.io.File canonical path.
587
		if (file == null || !file.exists()) {
588
			File f = path.toFile();
589
			try {
590
				String canon = f.getCanonicalPath();
591
				path = new Path(canon);
592
				file = findFileInWorkspace(path);
593
			} catch (IOException e1) {
594
			}
595
		}
596
		return (file != null && file.exists()) ? file : null;
597
	}
598
599
	/**
600
	 * @param fileName
601
	 * @return
602
	 */
603
	protected IFile findFileName(String fileName) {
604
		IPath path = new Path(fileName);
605
		return (IFile) fFilesInProject.get(path.lastSegment());
606
	}
607
608
	protected IFile findFileInWorkspace(IPath path) {
609
		IFile file = null;
610
		if (path.isAbsolute()) {
611
			IWorkspaceRoot root = getProject().getWorkspace().getRoot();
612
613
			// construct a URI, based on the project's locationURI, that points
614
			// to the given path
615
			URI projectURI = project.getLocationURI();
616
617
			URI newURI = FileSystemUtilityManager.getDefault().replacePath(projectURI, path.toString());
618
619
			IFile[] files = root.findFilesForLocationURI(newURI);
620
621
			for (int i = 0; i < files.length; i++) {
622
				if (files[i].getProject().equals(getProject())) {
623
					file = files[i];
624
					break;
625
				}
626
			}
627
628
		} else {
629
			file = getProject().getFile(path);
630
		}
631
		return file;
632
	}
633
634
	protected void collectFiles(IContainer parent, List result) {
635
		try {
636
			IResource[] resources = parent.members();
637
			for (int i = 0; i < resources.length; i++) {
638
				IResource resource = resources[i];
639
				if (resource instanceof IFile) {
640
					result.add(resource);
641
				} else if (resource instanceof IContainer) {
642
					collectFiles((IContainer) resource, result);
643
				}
644
			}
645
		} catch (CoreException e) {
646
			MakeCorePlugin.log(e.getStatus());
647
		}
648
	}
649
650
	protected boolean isConflictingName(String fileName) {
651
		IPath path = new Path(fileName);
652
		return fNameConflicts.contains(path.lastSegment());
653
	}
654
655
	public List translateRelativePaths(IFile file, String fileName, List includes) {
656
		List translatedIncludes = new ArrayList(includes.size());
657
		for (Iterator i = includes.iterator(); i.hasNext(); ) {
658
			String include = (String) i.next();
659
			IPath includePath = new Path(include);
660
			if (!includePath.isAbsolute() && !includePath.isUNC()) {	// do not translate UNC paths
661
				// First try the current working directory
662
				IPath cwd = getWorkingDirectory();
663
				if (!cwd.isAbsolute()) {
664
					cwd = getBaseDirectory().append(cwd);
665
				}
666
				
667
				IPath filePath = new Path(fileName);
668
				if (!filePath.isAbsolute()) {
669
					// check if the cwd is the right one
670
					// appending fileName to cwd should yield file path
671
					filePath = cwd.append(fileName);
672
				}
673
				if (!filePath.toString().equalsIgnoreCase(file.getLocation().toString())) {
674
					// must be the cwd is wrong
675
					// check if file name starts with ".."
676
					if (fileName.startsWith("..")) {	//$NON-NLS-1$
677
						// probably multiple choices for cwd, hopeless
678
						final String error = MakeMessages.getString("ConsoleParser.Working_Directory_Error_Message"); //$NON-NLS-1$
679
						TraceUtil.outputError(error, fileName);
680
						generateMarker(file, -1, error,	 IMarkerGenerator.SEVERITY_WARNING, fileName);				
681
						break;
682
					}
683
					else {
684
						// remove common segments at the end 
685
						IPath tPath = new Path(fileName);
686
						if (fileName.startsWith(".")) {	//$NON-NLS-1$
687
							tPath = tPath.removeFirstSegments(1);
688
						}
689
						// get the file path from the file
690
						filePath = file.getLocation();
691
						IPath lastFileSegment = filePath.removeFirstSegments(filePath.segmentCount() - tPath.segmentCount());
692
						if (lastFileSegment.matchingFirstSegments(tPath) == tPath.segmentCount()) {
693
							cwd = filePath.removeLastSegments(tPath.segmentCount());
694
						}
695
					}
696
				}
697
				
698
				IPath candidatePath = cwd.append(includePath);
699
				File dir = candidatePath.toFile();
700
				include = candidatePath.toString();
701
				if (!dir.exists()) {
702
					final String error = MakeMessages.getString("ConsoleParser.Nonexistent_Include_Path_Error_Message"); //$NON-NLS-1$
703
					TraceUtil.outputError(error, include);
704
//					generateMarker(file, -1, error+include, IMarkerGenerator.SEVERITY_WARNING, fileName);				
705
				}
706
			}
707
			// TODO VMIR for now add unresolved paths as well
708
			translatedIncludes.add(include);
709
		}
710
		return translatedIncludes;
711
	}
712
}
(-)src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerProjectBuildOutputParser.java (+173 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 * IBM - Initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.make.xlc.core.scannerconfig;
12
13
import java.io.File;
14
import java.io.IOException;
15
import java.util.ArrayList;
16
import java.util.HashMap;
17
import java.util.List;
18
import java.util.Map;
19
20
import org.eclipse.cdt.core.IMarkerGenerator;
21
import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes;
22
import org.eclipse.cdt.make.internal.core.MakeMessages;
23
import org.eclipse.cdt.make.internal.core.scannerconfig.gnu.AbstractGCCBOPConsoleParserUtility;
24
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
25
import org.eclipse.core.resources.IFile;
26
import org.eclipse.core.resources.IProject;
27
import org.eclipse.core.resources.IWorkspaceRoot;
28
import org.eclipse.core.runtime.IPath;
29
import org.eclipse.core.runtime.Path;
30
31
/**
32
 * @author crecoskie
33
 *
34
 */
35
public class XLCPerProjectBuildOutputParser extends
36
		AbstractXLCBuildOutputParser {
37
	
38
	/* (non-Javadoc)
39
	 * @see org.eclipse.cdt.make.xlc.core.scannerconfig.AbstractXLCBuildOutputParser#processCommand(java.lang.String[])
40
	 */
41
	@Override
42
    protected boolean processCommand(String[] tokens) {
43
        int compilerInvocationIdx= findCompilerInvocation(tokens);
44
        if (compilerInvocationIdx<0) {
45
        	return false;
46
        }
47
        
48
        if (compilerInvocationIdx+1 >= tokens.length) {
49
        	return false;
50
        }
51
52
        // Recognized gcc or g++ compiler invocation
53
        List includes = new ArrayList();
54
        List symbols = new ArrayList();
55
        List targetSpecificOptions = new ArrayList();
56
57
        String fileName = null;
58
        for (int j= compilerInvocationIdx+1; j < tokens.length; j++) {
59
			String token = tokens[j];
60
			if (token.equals(DASHIDASH)) {
61
			}
62
        	else if (token.startsWith(DASHI)) {
63
        		String candidate= null;
64
				if (token.length() > 2) {
65
					candidate= token.substring(2).trim();
66
				}
67
				else if (j+1 < tokens.length) {
68
					candidate= tokens[j+1];
69
					if (candidate.startsWith("-")) { //$NON-NLS-1$
70
						candidate= null;
71
					}
72
					else {
73
						j++;
74
					}
75
				}
76
				if (candidate != null && candidate.length() > 0) {
77
					if (getUtility() != null) {
78
						candidate= getUtility().normalizePath(candidate);
79
					}
80
					if (!includes.contains(candidate)) {
81
						includes.add(candidate);
82
					}
83
				}
84
        	}
85
        	else if (token.startsWith(DASHD)) {
86
        		String candidate= null;
87
				if (token.length() > 2) {
88
					candidate= token.substring(2).trim();
89
				}
90
				else if (j+1 < tokens.length) {
91
					candidate= tokens[j+1];
92
					if (candidate.startsWith("-")) { //$NON-NLS-1$
93
						candidate= null;
94
					}
95
					else {
96
						j++;
97
					}
98
				}
99
        		if (candidate != null && candidate.length() > 0) {
100
        			if (candidate.indexOf('=') == -1) {
101
        				candidate+= '='+ getUtility().getDefaultMacroDefinitionValue();
102
        			}
103
        			if (!symbols.contains(candidate)) {
104
        				symbols.add(candidate);
105
        			}
106
        		}
107
        	}
108
			
109
        	else if (fileName == null) {
110
        		int extIndex = token.lastIndexOf('.');
111
        		String extension=null;
112
        		
113
        		if(extIndex != -1)
114
        			extension = token.substring(extIndex);
115
        		
116
        		List<String> extensions = getFileExtensionsList();
117
        		if(extension != null && extensions.contains(extension))
118
        			fileName = token;
119
        	}
120
        }
121
122
        if (fileName == null) {
123
        	return false;  // return when no file was given (analogous to GCCPerFileBOPConsoleParser)
124
        }
125
126
        IProject project = getProject();   
127
        IFile file = null;
128
        List translatedIncludes = includes;
129
        if (includes.size() > 0) {
130
        	if (fileName != null) {
131
        		if (getUtility() != null) {
132
        			file = getUtility().findFile(fileName);
133
        			if (file != null) {
134
        				project = file.getProject();
135
        				translatedIncludes = getUtility().translateRelativePaths(file, fileName, includes);
136
        			}
137
        		}
138
        	}
139
        	else {
140
        		StringBuffer line= new StringBuffer();
141
        		for (int j = 0; j < tokens.length; j++) {
142
					line.append(tokens[j]);
143
					line.append(' ');
144
				}
145
        		final String error = MakeMessages.getString("ConsoleParser.Filename_Missing_Error_Message"); //$NON-NLS-1$ 
146
        		TraceUtil.outputError(error, line.toString());
147
        		if (getUtility() != null) {
148
        			getUtility().generateMarker(getProject(), -1, error + line.toString(), IMarkerGenerator.SEVERITY_WARNING, null);
149
        		}
150
        	}
151
        	if (file == null && getUtility() != null) {	// real world case
152
        		// remove include paths since there was no chance to translate them
153
        		translatedIncludes.clear();
154
        	}
155
        }
156
        // Contribute discovered includes and symbols to the ScannerInfoCollector
157
        if (translatedIncludes.size() > 0 || symbols.size() > 0) {
158
        	Map scannerInfo = new HashMap();
159
        	scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, translatedIncludes);
160
        	scannerInfo.put(ScannerInfoTypes.SYMBOL_DEFINITIONS, symbols);
161
        	scannerInfo.put(ScannerInfoTypes.TARGET_SPECIFIC_OPTION, targetSpecificOptions);
162
        	getCollector().contributeToScannerConfig(project, scannerInfo);
163
164
        	TraceUtil.outputTrace("Discovered scanner info for file \'" + fileName + '\'',	//$NON-NLS-1$
165
        			"Include paths", includes, translatedIncludes, "Defined symbols", symbols);	//$NON-NLS-1$ //$NON-NLS-2$
166
        }
167
		return true;
168
169
}
170
171
172
	
173
}
(-)src/org/eclipse/cdt/make/xlc/core/scannerconfig/PerFileXLCScannerInfoCollector.java (+53 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.make.xlc.core.scannerconfig;
12
13
import java.util.Arrays;
14
import java.util.LinkedList;
15
import java.util.List;
16
import java.util.Map;
17
18
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector3;
19
import org.eclipse.cdt.make.internal.core.scannerconfig2.PerFileSICollector;
20
import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector;
21
import org.eclipse.core.runtime.IPath;
22
23
/**
24
 * @author laggarcia
25
 *
26
 */
27
public class PerFileXLCScannerInfoCollector extends PerFileSICollector
28
		implements IScannerInfoCollector3, IManagedScannerInfoCollector {
29
30
	/* (non-Javadoc)
31
	 * @see org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector#getDefinedSymbols()
32
	 */
33
	public Map getDefinedSymbols() {
34
		return getAllSymbols();
35
	}
36
37
	/* (non-Javadoc)
38
	 * @see org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector#getIncludePaths()
39
	 */
40
	public List getIncludePaths() {
41
		List<String> pathStrings = new LinkedList<String>();
42
		
43
		List<IPath> paths = Arrays.asList(getAllIncludePaths(INCLUDE_PATH));
44
		paths.addAll(Arrays.asList(getAllIncludePaths(QUOTE_INCLUDE_PATH)));
45
		
46
		for(IPath path : paths) {
47
			pathStrings.add(path.toString());
48
		}
49
		
50
		return pathStrings;
51
	}
52
53
}
(-)src/org/eclipse/cdt/managedbuilder/xlc/ui/Messages.java (+1 lines)
Lines 17-22 Link Here
17
	private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.xlc.ui.messages"; //$NON-NLS-1$
17
	private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.xlc.ui.messages"; //$NON-NLS-1$
18
	public static String XLCompiler_v8;
18
	public static String XLCompiler_v8;
19
	public static String XLCompiler_v9;
19
	public static String XLCompiler_v9;
20
	public static String XLCompiler_v10;
20
	public static String XLCompilerPreferencePage_0;
21
	public static String XLCompilerPreferencePage_0;
21
	public static String XLCompilerPreferencePage_1;
22
	public static String XLCompilerPreferencePage_1;
22
	public static String XLCompilerPreferencePage_2;
23
	public static String XLCompilerPreferencePage_2;
(-)src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties (+1 lines)
Lines 11-16 Link Here
11
11
12
XLCompiler_v8=v8.0
12
XLCompiler_v8=v8.0
13
XLCompiler_v9=v9.0
13
XLCompiler_v9=v9.0
14
XLCompiler_v10=v10.1
14
XLCompilerPreferencePage_0=XL C/C++ Compiler Preferences
15
XLCompilerPreferencePage_0=XL C/C++ Compiler Preferences
15
XLCompilerPreferencePage_1=Compiler Root Path:
16
XLCompilerPreferencePage_1=Compiler Root Path:
16
XLCompilerPreferencePage_2=Compiler Version:
17
XLCompilerPreferencePage_2=Compiler Version:
(-)src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceConstants.java (+1 lines)
Lines 24-28 Link Here
24
	
24
	
25
	public static final String P_XL_COMPILER_VERSION_8_NAME = Messages.XLCompiler_v8;
25
	public static final String P_XL_COMPILER_VERSION_8_NAME = Messages.XLCompiler_v8;
26
	public static final String P_XL_COMPILER_VERSION_9_NAME = Messages.XLCompiler_v9;
26
	public static final String P_XL_COMPILER_VERSION_9_NAME = Messages.XLCompiler_v9;
27
	public static final String P_XL_COMPILER_VERSION_10_NAME = Messages.XLCompiler_v10;
27
28
28
}
29
}
(-)src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/XLCompilerPreferencePage.java (-10 / +8 lines)
Lines 58-73 Link Here
58
			{
58
			{
59
				// always return true, as we don't want to fail cases when compiler is installed remotely
59
				// always return true, as we don't want to fail cases when compiler is installed remotely
60
				// just warn user
60
				// just warn user
61
				if (getPage() != null)
61
				if (!super.doCheckState())
62
				{
62
				{
63
					if (!super.doCheckState())
63
					setMessage(Messages.XLCompilerPreferencePage_3, IMessageProvider.WARNING);
64
					{
64
				}
65
						getPage().setMessage(Messages.XLCompilerPreferencePage_3, IMessageProvider.WARNING);
65
				else
66
					}
66
				{
67
					else
67
					setMessage(originalMessage);
68
					{
69
						getPage().setMessage(originalMessage, 0);
70
					}
71
				}
68
				}
72
				
69
				
73
				return true;
70
				return true;
Lines 83-89 Link Here
83
		addField(pathEditor);
80
		addField(pathEditor);
84
		
81
		
85
		String[][] versionEntries = {{PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME, Messages.XLCompiler_v8},
82
		String[][] versionEntries = {{PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME, Messages.XLCompiler_v8},
86
									   {PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME, Messages.XLCompiler_v9}};
83
									   {PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME, Messages.XLCompiler_v9},
84
									   {PreferenceConstants.P_XL_COMPILER_VERSION_10_NAME, Messages.XLCompiler_v10}};
87
		
85
		
88
		addField(new ComboFieldEditor(PreferenceConstants.P_XLC_COMPILER_VERSION,
86
		addField(new ComboFieldEditor(PreferenceConstants.P_XLC_COMPILER_VERSION,
89
				Messages.XLCompilerPreferencePage_2, versionEntries, getFieldEditorParent()));
87
				Messages.XLCompilerPreferencePage_2, versionEntries, getFieldEditorParent()));
(-)META-INF/MANIFEST.MF (-1 / +1 lines)
Lines 2-8 Link Here
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %pluginName
3
Bundle-Name: %pluginName
4
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.xlc.ui; singleton := true
4
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.xlc.ui; singleton := true
5
Bundle-Version: 5.0.0.qualifier
5
Bundle-Version: 5.0.3.qualifier
6
Bundle-Activator: org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin
6
Bundle-Activator: org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin
7
Bundle-Localization: plugin
7
Bundle-Localization: plugin
8
Require-Bundle: org.eclipse.ui,
8
Require-Bundle: org.eclipse.ui,
(-)plugin.xml (-83 / +294 lines)
Lines 127-135 Link Here
127
      </tool>
127
      </tool>
128
	<tool
128
	<tool
129
       command="${XL_compilerRoot}/xlc"
129
       command="${XL_compilerRoot}/xlc"
130
       id="cdt.managedbuild.tool.xlc.c.compiler"
130
       id="cdt.managedbuild.tool.xlc.c.compiler.abstract"
131
       isAbstract="true"
131
       isAbstract="true"
132
       name="%ToolName.compiler.xlc.c"
132
       name="Abstract XL C Compiler"
133
       natureFilter="cnature"
133
       natureFilter="cnature"
134
       outputFlag="-o"
134
       outputFlag="-o"
135
       superClass="org.eclipse.cdt.managedbuilder.xlc.ui.tool.abstractCompiler">
135
       superClass="org.eclipse.cdt.managedbuilder.xlc.ui.tool.abstractCompiler">
Lines 219-241 Link Here
219
           value="__IBMC__">
219
           value="__IBMC__">
220
     </listOptionValue>
220
     </listOptionValue>
221
  </option>
221
  </option>
222
  <option
223
        applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
224
        category="xlc.c.compiler.category.objcc"
225
        command="-qunique"
226
        defaultValue="false"
227
        id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.output.unique.v10"
228
        isAbstract="false"
229
        name="%Option.unique.v10"
230
        resourceFilter="all"
231
        valueType="boolean">
232
  </option>
222
	  </tool>
233
	  </tool>
223
	  <tool
234
	  <tool
224
         command="${XL_compilerRoot}/xlC"
235
         command="${XL_compilerRoot}/xlC"
225
         id="cdt.managedbuild.tool.xlc.cpp.compiler"
236
         id="cdt.managedbuild.tool.xlc.cpp.compiler.abstract"
226
         isAbstract="true"
237
         isAbstract="true"
227
         name="%ToolName.compiler.xlc.cpp"
238
         name="Abstract XL C++ Compiler"
228
         natureFilter="ccnature"
239
         natureFilter="ccnature"
229
         outputFlag="-o"
240
         outputFlag="-o"
230
         superClass="org.eclipse.cdt.managedbuilder.xlc.ui.tool.abstractCompiler">
241
         superClass="org.eclipse.cdt.managedbuilder.xlc.ui.tool.abstractCompiler">
231
           <inputType
232
                 dependencyContentType="org.eclipse.cdt.core.cxxHeader"
233
                 dependencyExtensions="h,H,hpp"
234
                 id="cdt.managedbuild.tool.xlc.cpp.compiler.input"
235
                 scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"
236
                 sourceContentType="org.eclipse.cdt.core.cxxSource"
237
                 sources="c,C,cc,cxx,cpp">
238
          </inputType>
239
           <option
242
           <option
240
                 category="xlc.c.compiler.category.Input"
243
                 category="xlc.c.compiler.category.Input"
241
                 command="-+"
244
                 command="-+"
Lines 275-280 Link Here
275
                 valueType="string">
278
                 valueType="string">
276
           </option>
279
           </option>
277
           <option
280
           <option
281
                 applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
278
                 category="xlc.c.compiler.category.output"
282
                 category="xlc.c.compiler.category.output"
279
                 id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.namemangling"
283
                 id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.namemangling"
280
                 isAbstract="false"
284
                 isAbstract="false"
Lines 313-318 Link Here
313
              </enumeratedOptionValue>
317
              </enumeratedOptionValue>
314
           </option>
318
           </option>
315
           <option
319
           <option
320
                 applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
321
                 category="xlc.c.compiler.category.output"
322
                 id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.namemangling.v10"
323
                 isAbstract="false"
324
                 name="%Option.namemangling.v10.name"
325
                 resourceFilter="all"
326
                 valueType="enumerated">
327
              <enumeratedOptionValue
328
                    id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.namemangling.default"
329
                    isDefault="true"
330
                    name="%Option.default">
331
              </enumeratedOptionValue>
332
              <enumeratedOptionValue
333
                    command="-qnamemangling=ansi"
334
                    id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.namemangling.ansi"
335
                    name="%Option.namemangling.ansi">
336
              </enumeratedOptionValue>
337
              <enumeratedOptionValue
338
                    command="-qnamemangling=v10"
339
                    id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.namemangling.v10"
340
                    name="%Option.namemangling.v10">
341
              </enumeratedOptionValue>
342
              <enumeratedOptionValue
343
                    command="-qnamemangling=v9"
344
                    id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.namemangling.v9"
345
                    name="%Option.namemangling.v9">
346
              </enumeratedOptionValue>
347
              <enumeratedOptionValue
348
                    command="-qnamemangling=v8"
349
                    id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.namemangling.v8"
350
                    name="%Option.namemangling.v8">
351
              </enumeratedOptionValue>
352
              <enumeratedOptionValue
353
                    command="-qnamemangling=v7"
354
                    id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.namemangling.v7"
355
                    name="%Option.namemangling.v7">
356
              </enumeratedOptionValue>
357
              <enumeratedOptionValue
358
                    command="-qnamemangling=v6"
359
                    id="org.eclipse.cdt.managedbuilder.xlc.ui.enumeratedOptionValue22"
360
                    name="%Option.namemangling.v6">
361
              </enumeratedOptionValue>
362
              <enumeratedOptionValue
363
                    command="-qnamemangling=v5"
364
                    id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.namemangling.v5"
365
                    name="%Option.namemangling.v5">
366
              </enumeratedOptionValue>
367
              <enumeratedOptionValue
368
                    command="-qnamemangling=v4"
369
                    id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.namemangling.v4"
370
                    name="%Option.namemangling.v4">
371
              </enumeratedOptionValue>
372
              <enumeratedOptionValue
373
                    command="-qnamemangling=v3"
374
                    id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.namemangling.v3"
375
                    name="%Option.namemangling.v3">
376
              </enumeratedOptionValue>
377
           </option>
378
379
           <option
316
                 category="xlc.c.compiler.category.output"
380
                 category="xlc.c.compiler.category.output"
317
                 id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.objectmodel"
381
                 id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.objectmodel"
318
                 isAbstract="false"
382
                 isAbstract="false"
Lines 370-376 Link Here
370
              </enumeratedOptionValue>
434
              </enumeratedOptionValue>
371
           </option>
435
           </option>
372
           <option
436
           <option
373
                 category="xlc.c.compiler.category.output"
437
                 category="xlc.c.compiler.category.objcc"
374
                 command="-qunique"
438
                 command="-qunique"
375
                 defaultValue="false"
439
                 defaultValue="false"
376
                 id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.output.unique"
440
                 id="org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.output.unique"
Lines 449-460 Link Here
449
      		errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
513
      		errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
450
			id="cdt.managedbuild.config.xlc.exe.debug">
514
			id="cdt.managedbuild.config.xlc.exe.debug">
451
			<toolChain
515
			<toolChain
452
                     archList="all"
516
         archList="all"
453
                     osList="all"
517
         configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.xlc.aix.AixConfigurationEnvironmentSupplier"
454
                     name="%ToolChainName.Dbg"
518
         id="cdt.managedbuild.toolchain.xlc.exe.debug"
455
                     targetTool="cdt.managedbuild.tool.xlc.c.linker.exe.debug;cdt.managedbuild.tool.xlc.cpp.linker.exe.debug"
519
         name="%ToolChainName.Dbg"
456
                     configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.xlc.aix.AixConfigurationEnvironmentSupplier"
520
         osList="all"
457
                     id="cdt.managedbuild.toolchain.xlc.exe.debug">
521
         scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"
522
         targetTool="cdt.managedbuild.tool.xlc.c.linker.exe.debug;cdt.managedbuild.tool.xlc.cpp.linker.exe.debug">
458
			      <targetPlatform
523
			      <targetPlatform
459
					  id="cdt.managedbuild.target.xlc.platform.exe.debug"
524
					  id="cdt.managedbuild.target.xlc.platform.exe.debug"
460
				 	  name="%PlatformName.Dbg"            					  
525
				 	  name="%PlatformName.Dbg"            					  
Lines 514-524 Link Here
514
			errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
579
			errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
515
			id="cdt.managedbuild.config.xlc.exe.release">
580
			id="cdt.managedbuild.config.xlc.exe.release">
516
			<toolChain
581
			<toolChain
517
                     archList="all"
582
           archList="all"
518
                     osList="all"
583
           id="cdt.managedbuild.toolchain.xlc.exe.release"
519
                     name="%ToolChainName.Rel"
584
           name="%ToolChainName.Rel"
520
                     targetTool="cdt.managedbuild.tool.xlc.c.linker.exe.release;cdt.managedbuild.tool.xlc.cpp.linker.exe.release"
585
           osList="all"
521
                     id="cdt.managedbuild.toolchain.xlc.exe.release">
586
           scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"
587
           targetTool="cdt.managedbuild.tool.xlc.c.linker.exe.release;cdt.managedbuild.tool.xlc.cpp.linker.exe.release">
522
		          <targetPlatform
588
		          <targetPlatform
523
		              id="cdt.managedbuild.target.xlc.platform.exe.release"
589
		              id="cdt.managedbuild.target.xlc.platform.exe.release"
524
		              name="%PlatformName.Rel"		             
590
		              name="%PlatformName.Rel"		             
Lines 570-575 Link Here
570
					  superClass="cdt.managedbuild.tool.xlc.assembler">
636
					  superClass="cdt.managedbuild.tool.xlc.assembler">
571
				  </tool>
637
				  </tool>
572
            </toolChain>
638
            </toolChain>
639
            
573
		</configuration>
640
		</configuration>
574
	</projectType>	      		
641
	</projectType>	      		
575
    
642
    
Lines 654-660 Link Here
654
                     id="cdt.managedbuild.toolchain.xlc.so.release">
721
                     id="cdt.managedbuild.toolchain.xlc.so.release">
655
		          <targetPlatform
722
		          <targetPlatform
656
		              id="cdt.managedbuild.target.xlc.platform.so.release"
723
		              id="cdt.managedbuild.target.xlc.platform.so.release"
657
		              name="%PlatformName.Rel"	            
724
		              name="%PlatformName.Rel"		            
658
		              osList="all"
725
		              osList="all"
659
		              archList="all">
726
		              archList="all">
660
		          </targetPlatform>
727
		          </targetPlatform>
Lines 830-840 Link Here
830
               </toolChain>
897
               </toolChain>
831
        </configuration>
898
        </configuration>
832
    </projectType>
899
    </projectType>
900
    
833
    <tool
901
    <tool
834
          errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
902
            errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
835
          id="org.eclipse.cdt.managedbuilder.xlc.ui.tool.abstractCompiler"
903
            id="org.eclipse.cdt.managedbuilder.xlc.ui.tool.abstractCompiler"
836
          isAbstract="true"
904
            isAbstract="true"
837
          name="Abstract XL Compiler">
905
            name="Abstract XL Compiler">
838
         <envVarBuildPath 
906
         <envVarBuildPath 
839
			pathType="buildpathInclude"
907
			pathType="buildpathInclude"
840
			variableList="CPATH,C_INCLUDE_PATH">
908
			variableList="CPATH,C_INCLUDE_PATH">
Lines 1584-1590 Link Here
1584
     </enumeratedOptionValue> 
1652
     </enumeratedOptionValue> 
1585
		</option>
1653
		</option>
1586
				<option
1654
				<option
1587
        applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCv8ApplicabiltyCalculator"
1655
        applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
1588
        category="xlc.c.compiler.category.optimization"
1656
        category="xlc.c.compiler.category.optimization"
1589
        id="xlc.c.compiler.option.optimization.arch"
1657
        id="xlc.c.compiler.option.optimization.arch"
1590
        name="%Option.optimization.arch"
1658
        name="%Option.optimization.arch"
Lines 1716-1722 Link Here
1716
     </enumeratedOptionValue>
1784
     </enumeratedOptionValue>
1717
		</option>
1785
		</option>
1718
        <option
1786
        <option
1719
              applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCv9ApplicabilityCalculator"
1787
              applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
1720
              category="xlc.c.compiler.category.optimization"
1788
              category="xlc.c.compiler.category.optimization"
1721
              id="xlc.c.compiler.option.optimization.arch.9.0"
1789
              id="xlc.c.compiler.option.optimization.arch.9.0"
1722
              name="%Option.optimization.arch"
1790
              name="%Option.optimization.arch"
Lines 1818-1824 Link Here
1818
           </enumeratedOptionValue>
1886
           </enumeratedOptionValue>
1819
        </option>
1887
        </option>
1820
  <option
1888
  <option
1821
        applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCv8ApplicabiltyCalculator"
1889
        applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
1822
        category="xlc.c.compiler.category.optimization"
1890
        category="xlc.c.compiler.category.optimization"
1823
        id="xlc.c.compiler.option.optimization.tune"
1891
        id="xlc.c.compiler.option.optimization.tune"
1824
        name="%Option.optimization.tune"
1892
        name="%Option.optimization.tune"
Lines 1945-1951 Link Here
1945
     </enumeratedOptionValue>
2013
     </enumeratedOptionValue>
1946
  </option>
2014
  </option>
1947
        <option
2015
        <option
1948
              applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCv9ApplicabilityCalculator"
2016
              applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
1949
              category="xlc.c.compiler.category.optimization"
2017
              category="xlc.c.compiler.category.optimization"
1950
              id="xlc.c.compiler.option.optimization.tune.9.0"
2018
              id="xlc.c.compiler.option.optimization.tune.9.0"
1951
              name="%Option.optimization.tune"
2019
              name="%Option.optimization.tune"
Lines 2212-2223 Link Here
2212
			valueType="boolean">
2280
			valueType="boolean">
2213
		</option>
2281
		</option>
2214
		<option
2282
		<option
2215
			defaultValue="false"
2283
        applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
2216
			name="%Option.optimization.smp"
2284
        category="xlc.c.compiler.category.optimization"
2217
			category="xlc.c.compiler.category.optimization"
2285
        command="-qsmp"
2218
			command="-qsmp"
2286
        defaultValue="false"
2219
			id="xlc.c.compiler.option.optimization.smp"
2287
        id="xlc.c.compiler.option.optimization.smp"
2220
			valueType="boolean">
2288
        name="%Option.optimization.smp"
2289
        valueType="boolean">
2290
		</option>
2291
		<option
2292
        applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
2293
        category="xlc.c.compiler.category.optimization"
2294
        command="-qsmp="
2295
        id="xlc.c.compiler.option.optimization.smp.v10"
2296
        name="%Option.optimization.smp.v10"
2297
        tip="%Option.optimization.smp.v10.tooltip"
2298
        valueType="string">
2221
		</option>
2299
		</option>
2222
		<option
2300
		<option
2223
			name="%Option.optimization.Spill"
2301
			name="%Option.optimization.Spill"
Lines 2227-2238 Link Here
2227
			valueType="string">
2305
			valueType="string">
2228
		</option>
2306
		</option>
2229
		<option
2307
		<option
2230
			defaultValue="false"
2308
        applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
2231
			name="%Option.optimization.Strict"
2309
        category="xlc.c.compiler.category.optimization"
2232
			category="xlc.c.compiler.category.optimization"
2310
        command="-qstrict"
2233
			command="-qstrict"
2311
        defaultValue="false"
2234
			id="xlc.c.compiler.option.optimization.strict"
2312
        id="xlc.c.compiler.option.optimization.strict"
2235
			valueType="boolean">
2313
        name="%Option.optimization.Strict"
2314
        valueType="boolean">
2315
		</option>
2316
		<option
2317
        applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
2318
        category="xlc.c.compiler.category.optimization"
2319
        command="-qstrict="
2320
        id="xlc.c.compiler.option.optimization.strict.v10"
2321
        name="%Option.optimization.Strict.v10"
2322
        tip="%Option.optimization.Strict.v10.tooltip"
2323
        valueType="string">
2236
		</option>
2324
		</option>
2237
		<option
2325
		<option
2238
			name="%Option.optimization.loopinduction"
2326
			name="%Option.optimization.loopinduction"
Lines 2431-2441 Link Here
2431
        valueType="string"> 
2519
        valueType="string"> 
2432
		</option>
2520
		</option>
2433
		<option
2521
		<option
2434
			name="%Option.tls"
2522
        applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
2435
			category="xlc.c.compiler.category.cc"
2523
        category="xlc.c.compiler.category.cc"
2436
			command="-qtls="
2524
        command="-qtls="
2437
			id="xlc.c.compiler.option.cc.tls"
2525
        id="xlc.c.compiler.option.cc.tls"
2438
			valueType="string"> 
2526
        name="%Option.tls"
2527
        valueType="string"> 
2528
		</option>
2529
		
2530
		<option
2531
        applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
2532
        category="xlc.c.compiler.category.objcc"
2533
        id="xlc.c.compiler.option.cc.tls.v10"
2534
        name="%Option.tls"
2535
        valueType="enumerated">
2536
     <enumeratedOptionValue
2537
           id="xlc.c.compiler.option.cc.tls.none"
2538
           isDefault="true"
2539
           name="%Option.none">
2540
     </enumeratedOptionValue>
2541
     <enumeratedOptionValue
2542
           command="-qtls=unsupported"
2543
           id="xlc.c.compiler.option.cc.tls.unsupported"
2544
           isDefault="true"
2545
           name="%Option.tls.unsupported">
2546
     </enumeratedOptionValue>
2547
     <enumeratedOptionValue
2548
           command="-qtls=default"
2549
           id="xlc.c.compiler.option.cc.tls.default"
2550
           name="%Option.tls.default">
2551
     </enumeratedOptionValue>
2552
     <enumeratedOptionValue
2553
           command="-qtls=global-dynamic"
2554
           id="xlc.c.compiler.option.cc.tls.global-dynamic"
2555
           name="%Option.tls.global-dynamic">
2556
     </enumeratedOptionValue>
2557
     <enumeratedOptionValue
2558
           command="-qtls=initial-exec"
2559
           id="xlc.c.compiler.option.cc.tls.initial-exec"
2560
           name="%Option.tls.initial-exec">
2561
     </enumeratedOptionValue>
2562
     <enumeratedOptionValue
2563
           command="-qtls=local-exec"
2564
           id="xlc.c.compiler.option.cc.tls.local-exec"
2565
           name="%Option.tls.local-exec">
2566
     </enumeratedOptionValue>
2567
     <enumeratedOptionValue
2568
           command="-qtls=local-dynamic"
2569
           id="xlc.c.compiler.option.cc.tls.local-dynamic"
2570
           name="%Option.tls.local-dynamic">
2571
     </enumeratedOptionValue>
2572
     <enumeratedOptionValue
2573
           command="-qnotls"
2574
           id="xlc.c.compiler.option.cc.tls.notls"
2575
           name="%Option.tls.notls">
2576
     </enumeratedOptionValue> 
2439
		</option>
2577
		</option>
2440
		<optionCategory
2578
		<optionCategory
2441
			name="%OptionCategory.lm"
2579
			name="%OptionCategory.lm"
Lines 2540-2546 Link Here
2540
			
2678
			
2541
		<option
2679
		<option
2542
			name="%Option.info"
2680
			name="%Option.info"
2543
			category="xlc.c.compiler.category.lm"
2681
			category="xlc.c.compiler.category.ecd"
2544
			command="-qinfo="
2682
			command="-qinfo="
2545
			id="xlc.c.compiler.option.lm.info"
2683
			id="xlc.c.compiler.option.lm.info"
2546
			valueType="string"> 
2684
			valueType="string"> 
Lines 2800-2806 Link Here
2800
2938
2801
		<!-- Version 9 Options -->
2939
		<!-- Version 9 Options -->
2802
		       <option
2940
		       <option
2803
              applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCv9ApplicabilityCalculator"
2941
              applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
2804
              category="xlc.c.compiler.category.ifp"
2942
              category="xlc.c.compiler.category.ifp"
2805
              id="xlc.c.compiler.option.ifp.dfp"
2943
              id="xlc.c.compiler.option.ifp.dfp"
2806
              name="%Option.dfp"
2944
              name="%Option.dfp"
Lines 2823-2829 Link Here
2823
        </option>
2961
        </option>
2824
2962
2825
        <option
2963
        <option
2826
              applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCv9ApplicabilityCalculator"
2964
              applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
2827
              category="xlc.c.compiler.category.output"
2965
              category="xlc.c.compiler.category.output"
2828
              command="-C!"
2966
              command="-C!"
2829
              defaultValue="false"
2967
              defaultValue="false"
Lines 2832-2838 Link Here
2832
              valueType="boolean">
2970
              valueType="boolean">
2833
        </option>
2971
        </option>
2834
        <option
2972
        <option
2835
              applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCv9ApplicabilityCalculator"
2973
              applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
2836
              category="xlc.c.compiler.category.ecd"
2974
              category="xlc.c.compiler.category.ecd"
2837
              command="-qoptdebug"
2975
              command="-qoptdebug"
2838
              defaultValue="false"
2976
              defaultValue="false"
Lines 2840-2867 Link Here
2840
              name="%Option.optdebug"
2978
              name="%Option.optdebug"
2841
              valueType="boolean">
2979
              valueType="boolean">
2842
        </option>
2980
        </option>
2843
2981
          <option
2844
		  
2982
                applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
2845
          <inputType
2983
                category="xlc.c.compiler.category.output"
2846
                dependencyContentType="org.eclipse.cdt.core.cHeader"
2984
                id="xlc.c.compiler.option.output.macros"
2847
                dependencyExtensions="h"
2985
                name="%Option.macros"
2848
                id="cdt.managedbuild.tool.xlc.c.compiler.input"
2986
                valueType="enumerated">
2849
                scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"
2987
             <enumeratedOptionValue
2850
                sourceContentType="org.eclipse.cdt.core.cSource"
2988
                   id="xlc.c.compiler.option.output.macros.none"
2851
                sources="c">
2989
                   isDefault="true"
2852
          </inputType>
2990
                   name="%Option.none">
2853
          <outputType
2991
             </enumeratedOptionValue>
2854
			  outputs="o"
2992
             <enumeratedOptionValue
2855
              buildVariable="OBJS"
2993
                   command="-qshowmacros=all"
2856
              id="cdt.managedbuild.tool.xlc.c.compiler.output">
2994
                   id="xlc.c.compiler.option.output.macros.all"
2857
          </outputType>
2995
                   name="%Option.macros.all">
2996
             </enumeratedOptionValue>
2997
             <enumeratedOptionValue
2998
                   command="-qshowmacros=pre"
2999
                   id="xlc.c.compiler.option.output.macros.pre"
3000
                   name="%Option.macros.pre">
3001
             </enumeratedOptionValue>
3002
             <enumeratedOptionValue
3003
                   command="-qshowmacros=nopre"
3004
                   id="xlc.c.compiler.option.output.macros.nopre"
3005
                   name="%Option.macros.nopre">
3006
             </enumeratedOptionValue>
3007
          </option>
3008
          <option
3009
                applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCApplicabilityCalculator"
3010
                category="xlc.c.compiler.category.output"
3011
                command="-qnotimestamps"
3012
                id="xlc.c.compiler.option.output.timestamps"
3013
                name="%Options.timestamps"
3014
                valueType="boolean">
3015
          </option>
3016
          <optionCategory
3017
                id="xlc.c.compiler.category.objcc"
3018
                name="%OptionCategory.objcc">
3019
          </optionCategory>
2858
    </tool>
3020
    </tool>
2859
    <tool
3021
    <tool
2860
          errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
3022
            errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
2861
          id="org.eclipse.cdt.managedbuilder.xlc.ui.tool.abstractLinker"
3023
            id="org.eclipse.cdt.managedbuilder.xlc.ui.tool.abstractLinker"
2862
          isAbstract="true"
3024
            isAbstract="true"
2863
          name="Abstract XL Linker"
3025
            name="Abstract XL Linker"
2864
          outputFlag="-o">
3026
            outputFlag="-o">
2865
                  <envVarBuildPath 
3027
                  <envVarBuildPath 
2866
         	pathType="buildpathLibrary"
3028
         	pathType="buildpathLibrary"
2867
         	variableList="LIBRARY_PATH">
3029
         	variableList="LIBRARY_PATH">
Lines 3053-3063 Link Here
3053
         </outputType>
3215
         </outputType>
3054
    </tool>
3216
    </tool>
3055
     <tool
3217
     <tool
3056
           errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
3218
            errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
3057
           id="org.eclipse.cdt.managedbuilder.xlc.ui.tool.linker.abstractSOLinker"
3219
            id="org.eclipse.cdt.managedbuilder.xlc.ui.tool.linker.abstractSOLinker"
3058
           isAbstract="true"
3220
            isAbstract="true"
3059
           name="Abstract XL Shared Object Linker"
3221
            name="Abstract XL Shared Object Linker"
3060
           superClass="org.eclipse.cdt.managedbuilder.xlc.ui.tool.abstractLinker">
3222
            superClass="org.eclipse.cdt.managedbuilder.xlc.ui.tool.abstractLinker">
3061
            <option
3223
            <option
3062
            	name="%Option.Linking.mkshrobj"
3224
            	name="%Option.Linking.mkshrobj"
3063
				id="xlc.c.link.so.option.shared"
3225
				id="xlc.c.link.so.option.shared"
Lines 3095-3104 Link Here
3095
			    id="cdt.managedbuild.tool.xlc.c.linker.so.debug.output">
3257
			    id="cdt.managedbuild.tool.xlc.c.linker.so.debug.output">
3096
			</outputType>
3258
			</outputType>
3097
    </tool>
3259
    </tool>
3098
3260
     <tool
3099
3261
           id="cdt.managedbuild.tool.xlc.c.compiler"
3100
3262
           isAbstract="false"
3101
3263
           name="Local XL C Compiler"
3264
           superClass="cdt.managedbuild.tool.xlc.c.compiler.abstract">
3265
           <inputType
3266
                 dependencyContentType="org.eclipse.cdt.core.cHeader"
3267
                 dependencyExtensions="h"
3268
                 id="cdt.managedbuild.tool.xlc.c.compiler.input"
3269
                 name="Local C Sources"
3270
                 primaryInput="true"
3271
                 scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"
3272
                 sourceContentType="org.eclipse.cdt.core.cSource"
3273
                 sources="c">
3274
       		</inputType>
3275
       		<outputType
3276
			outputs="o"
3277
            buildVariable="OBJS"
3278
            id="cdt.managedbuild.tool.xlc.c.compiler.output">
3279
            </outputType>
3280
     </tool>
3281
     <tool
3282
           id="cdt.managedbuild.tool.xlc.cpp.compiler"
3283
           isAbstract="false"
3284
           name="Local XL C++ Compiler"
3285
           superClass="cdt.managedbuild.tool.xlc.cpp.compiler.abstract">
3286
           <inputType
3287
                 dependencyContentType="org.eclipse.cdt.core.cHeader"
3288
                 dependencyExtensions="h"
3289
                 id="cdt.managedbuild.tool.xlc.cpp.c.compiler.input"
3290
                 name="Local C Sources"
3291
                 primaryInput="true"
3292
                 scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"
3293
                 sourceContentType="org.eclipse.cdt.core.cSource"
3294
                 sources="c">
3295
           </inputType>
3296
           <inputType
3297
                 dependencyContentType="org.eclipse.cdt.core.cxxHeader"
3298
                 dependencyExtensions="h,H,hpp"
3299
                 id="cdt.managedbuild.tool.xlc.cpp.compiler.input"
3300
                 name="Local C++ Sources"
3301
                 primaryInput="true"
3302
                 scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"
3303
                 sourceContentType="org.eclipse.cdt.core.cxxSource"
3304
                 sources="c,C,cc,cxx,cpp">
3305
          </inputType>
3306
          <outputType
3307
               buildVariable="OBJS"
3308
               id="org.eclipse.cdt.managedbuilder.xlc.cpp.compiler.output"
3309
               outputs="o">
3310
         </outputType>
3311
     </tool>
3102
    
3312
    
3103
	</extension>
3313
	</extension>
3104
   <extension
3314
   <extension
Lines 3156-3161 Link Here
3156
         <projectType
3366
         <projectType
3157
               projectTypeID="cdt.managedbuild.target.xlc.lib">
3367
               projectTypeID="cdt.managedbuild.target.xlc.lib">
3158
         </projectType>
3368
         </projectType>
3369
         
3159
      </wizardPage>
3370
      </wizardPage>
3160
   </extension>
3371
   </extension>
3161
   <extension
3372
   <extension
(-)src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java (-17 / +15 lines)
Lines 1-11 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation and others.
2
 *  Copyright (c) 2007, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 *  All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 *  are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 *  which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 *  http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 * 
8
 * Contributors:
8
 *  Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.managedbuilder.xlc.ui.properties;
11
package org.eclipse.cdt.managedbuilder.xlc.ui.properties;
Lines 45-60 Link Here
45
			{
45
			{
46
				// always return true, as we don't want to fail cases when compiler is installed remotely
46
				// always return true, as we don't want to fail cases when compiler is installed remotely
47
				// just warn user
47
				// just warn user
48
				if (getPage() != null)
48
				if (!super.doCheckState())
49
				{
49
				{
50
					if (!super.doCheckState())
50
					setMessage(Messages.XLCompilerPropertyPage_2, IMessageProvider.WARNING);
51
					{
51
				}
52
						getPage().setMessage(Messages.XLCompilerPropertyPage_2, IMessageProvider.WARNING);
52
				else
53
					}
53
				{
54
					else
54
					setMessage(originalMessage);
55
					{
56
						getPage().setMessage(originalMessage, 0);
57
					}
58
				}
55
				}
59
				
56
				
60
				return true;
57
				return true;
Lines 90-96 Link Here
90
		fPathEditor.setStringValue(currentPath);
87
		fPathEditor.setStringValue(currentPath);
91
		
88
		
92
		String[] versionEntries = {PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME, 
89
		String[] versionEntries = {PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME, 
93
				PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME};
90
				PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME,
91
				PreferenceConstants.P_XL_COMPILER_VERSION_10_NAME};
94
		
92
		
95
		Composite versionParent = getFieldEditorParent();
93
		Composite versionParent = getFieldEditorParent();
96
		
94
		
(-)src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/applicability.properties (+31 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2007, 2008 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
#
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
12
xlc.applicability.version.order=v8.0,v9.0,v10.1
13
14
xlc.c.compiler.option.optimization.arch=v8.0
15
xlc.c.compiler.option.optimization.arch.9.0=v9.0+
16
xlc.c.compiler.option.optimization.tune=v8.0
17
xlc.c.compiler.option.optimization.tune.9.0=v9.0+
18
xlc.c.compiler.option.ifp.dfp=v9.0+
19
xlc.c.compiler.option.preprocessor.PreprocessRemoveComments=v9.0+
20
xlc.c.compiler.option.ecd.optdebug=v9.0+
21
xlc.c.compiler.option.optimization.smp=v8.0,v9.0
22
xlc.c.compiler.option.optimization.smp.v10=v10.1
23
xlc.c.compiler.option.optimization.strict=v8.0,v9.0
24
xlc.c.compiler.option.optimization.strict.v10=v10.1
25
org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.output.unique.v10=v10.1
26
org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.namemangling=v8.0,v9.0
27
org.eclipse.cdt.managedbuilder.xlc.ui.cpp.option.namemangling.v10=v10.1
28
xlc.c.compiler.option.cc.tls=v8.0,v9.0
29
xlc.c.compiler.option.cc.tls.v10=v10.1
30
xlc.c.compiler.option.output.macros=v10.1
31
xlc.c.compiler.option.output.timestamps=v10.1
(-)src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCApplicabilityCalculator.java (+279 lines)
Added Link Here
1
/*******************************************************************************
2
 *  Copyright (c) 2007, 2008 IBM Corporation and others.
3
 *  All rights reserved. This program and the accompanying materials
4
 *  are made available under the terms of the Eclipse Public License v1.0
5
 *  which accompanies this distribution, and is available at
6
 *  http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 *  Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.managedbuilder.xlc.ui.properties;
12
13
import java.io.IOException;
14
import java.io.InputStream;
15
import java.util.ArrayList;
16
import java.util.HashMap;
17
import java.util.Iterator;
18
import java.util.List;
19
import java.util.Map;
20
import java.util.Properties;
21
import java.util.ResourceBundle;
22
import java.util.Set;
23
24
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
25
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
26
import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
27
import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
28
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
29
import org.eclipse.cdt.managedbuilder.core.IOption;
30
import org.eclipse.cdt.managedbuilder.core.IOptionApplicability;
31
import org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin;
32
import org.eclipse.cdt.managedbuilder.xlc.ui.preferences.PreferenceConstants;
33
import org.eclipse.core.resources.IProject;
34
import org.eclipse.core.runtime.CoreException;
35
import org.eclipse.core.runtime.QualifiedName;
36
import org.eclipse.jface.preference.IPreferenceStore;
37
38
/**
39
 * @author rkerimov
40
 * 
41
 * This applicability calculator hides/shows options that are specific to the XL compiler versions
42
 *
43
 */
44
45
public class XLCApplicabilityCalculator implements IOptionApplicability 
46
{
47
	private static final String BUNDLE_NAME = "org/eclipse/cdt/managedbuilder/xlc/ui/properties/applicability.properties";
48
	private static final String PROP_NAME_VERSION_ORDER = "xlc.applicability.version.order";
49
	private static final String PROP_VALUE_PLUS = "+";
50
	
51
	private static boolean initialized;
52
	private static List versionOrder;
53
	private static Map applicabilityMap;
54
	
55
	public XLCApplicabilityCalculator()
56
	{
57
		if (!initialized)
58
		{
59
			Properties props = null;
60
			
61
			ClassLoader loader = this.getClass().getClassLoader();
62
			InputStream input = null; 
63
				
64
			if (loader != null)
65
				input = loader.getResourceAsStream(BUNDLE_NAME);
66
67
			if (input == null)
68
				input = ClassLoader.getSystemResourceAsStream(BUNDLE_NAME);
69
70
			try
71
			{
72
				if (input != null)
73
				{
74
					props = new Properties();
75
					props.load(input);
76
					
77
					Set entrySet = props.entrySet();
78
					Iterator iterator = entrySet.iterator();
79
					while (iterator.hasNext())
80
					{
81
						Map.Entry entry = (Map.Entry) iterator.next();
82
						
83
						String key = (String) entry.getKey();
84
						String value = (String) entry.getValue();
85
						
86
						if (value == null)
87
							value = "";
88
						
89
						if (key.equals(PROP_NAME_VERSION_ORDER))
90
						{
91
							versionOrder = new ArrayList();
92
							String[] versions = value.split(",");
93
							
94
							if (versions != null)
95
							{
96
								for (int i = 0; i < versions.length; i ++)
97
								{
98
									versionOrder.add(versions[i].trim());
99
								}
100
							}
101
						}
102
						else
103
						{
104
							if (applicabilityMap == null)
105
								applicabilityMap = new HashMap();
106
							
107
							List applicList = (List) applicabilityMap.get(key);
108
							if (applicList == null)
109
							{
110
								applicList = new ArrayList();
111
								applicabilityMap.put(key, applicList);
112
							}
113
							
114
							boolean hasGreaterOption = false;
115
							//find if ends with + and set as separate option
116
							if (value.endsWith(PROP_VALUE_PLUS))
117
							{
118
								hasGreaterOption = true;
119
								value = value.substring(0, value.length() - PROP_VALUE_PLUS.length());
120
							}
121
							
122
							String[] versions = value.split(",");
123
							
124
							if (versions != null)
125
							{
126
								for (int i = 0; i < versions.length; i ++)
127
								{
128
									applicList.add(versions[i].trim());
129
								}
130
								
131
							}
132
133
							if (hasGreaterOption)
134
								applicList.add(PROP_VALUE_PLUS);
135
						}
136
					}
137
				}
138
			}
139
			catch (IOException e)
140
			{
141
				e.printStackTrace();
142
			}
143
			finally 
144
			{
145
				if (input != null)
146
				{
147
					try 
148
					{
149
						input.close();
150
					} 
151
					catch (IOException e) 
152
					{
153
						// ignore
154
					}
155
				}
156
			}
157
			
158
			initialized = true;
159
			
160
		}
161
	}
162
	
163
	private boolean isApplicable(IBuildObject configuration, IHoldsOptions holder, IOption option) 
164
	{
165
		// first we check the preference for this project, if it exists
166
		IProject project = null;
167
		if(configuration instanceof IConfiguration) 
168
		{
169
			IConfiguration config = (IConfiguration) configuration;
170
			IManagedProject managedProject = config.getManagedProject();
171
			
172
			project = (IProject) managedProject.getOwner();
173
		}
174
		else if(configuration instanceof IFolderInfo) 
175
		{
176
			IFolderInfo folderInfo = (IFolderInfo) configuration;
177
			
178
			IConfiguration config = folderInfo.getParent();
179
			
180
			IManagedProject managedProject = config.getManagedProject();
181
			
182
			project = (IProject) managedProject.getOwner();
183
			
184
		}
185
		
186
		if (project == null)
187
			return false;
188
189
		String currentVersion = null;
190
		try {
191
			currentVersion = project.getPersistentProperty(new QualifiedName("",
192
					PreferenceConstants.P_XLC_COMPILER_VERSION));
193
		} catch (CoreException e) {
194
			e.printStackTrace();
195
		}
196
		
197
		if(currentVersion == null) 
198
		{
199
			// if the property isn't set, then use the workbench preference
200
			IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore();
201
			currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION);
202
		}
203
204
		//if applicability list is empty that means all options applicable to all versions
205
		if (applicabilityMap == null)
206
			return true;
207
		
208
		//if applicability list for this option is not defined then option has no applicability restrictions 
209
		List applicList = (List) applicabilityMap.get(option.getId());
210
		if (applicList == null || applicList.isEmpty())
211
			return true;
212
		
213
		//if version is defined in the list - perfect match
214
		if (applicList.contains(currentVersion))
215
			return true;
216
		
217
		//if applicability is defined as 'starting from this version and greater', i.e. 'v8.0+',
218
		//then we need to find out if current version is greater than the last valid in the list  
219
		String lastOption = (String) applicList.get(applicList.size() - 1);
220
		
221
		if (lastOption != null && lastOption.equals(PROP_VALUE_PLUS))
222
		{
223
			//if 'greater than' option is specified but no version order exists, consider config error and return false
224
			if (versionOrder == null)
225
				return false;
226
227
			//check for the last valid version in applicability list
228
			String validVersion = null;
229
			//start with element before the +
230
			for (int k = applicList.size() - 2; k >= 0; k --)
231
			{
232
				String version = (String) applicList.get(k);
233
				
234
				if (versionOrder.contains(version))
235
				{
236
					validVersion = version;
237
					break;
238
				}
239
			}
240
			
241
			//if version that applicability starts with doesn't exist - config error
242
			if (validVersion == null)
243
				return false;
244
			
245
			//compare if current compiler version is greater than the applicability version
246
			if (versionOrder.indexOf(currentVersion) > versionOrder.indexOf(validVersion))
247
				return true;
248
		}
249
		
250
		
251
		return false;
252
		
253
	}
254
	
255
	/* (non-Javadoc)
256
	 * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionEnabled(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption)
257
	 */
258
	public boolean isOptionEnabled(IBuildObject configuration,
259
			IHoldsOptions holder, IOption option) {
260
		return isApplicable(configuration, holder, option);
261
	}
262
263
	/* (non-Javadoc)
264
	 * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionUsedInCommandLine(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption)
265
	 */
266
	public boolean isOptionUsedInCommandLine(IBuildObject configuration,
267
			IHoldsOptions holder, IOption option) {
268
		return isApplicable(configuration, holder, option);
269
	}
270
271
	/* (non-Javadoc)
272
	 * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionVisible(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption)
273
	 */
274
	public boolean isOptionVisible(IBuildObject configuration,
275
			IHoldsOptions holder, IOption option) {
276
		return isApplicable(configuration, holder, option);
277
	}
278
279
}
(-)src/org/eclipse/ptp/remote/rse/core/RSEProcessBuilder.java (+75 lines)
Lines 11-22 Link Here
11
package org.eclipse.ptp.remote.rse.core;
11
package org.eclipse.ptp.remote.rse.core;
12
12
13
import java.io.IOException;
13
import java.io.IOException;
14
import java.net.URI;
15
import java.net.URISyntaxException;
14
import java.util.Arrays;
16
import java.util.Arrays;
15
import java.util.HashMap;
17
import java.util.HashMap;
16
import java.util.List;
18
import java.util.List;
17
import java.util.Map;
19
import java.util.Map;
18
20
21
import org.eclipse.core.filesystem.EFS;
22
import org.eclipse.core.filesystem.IFileStore;
23
import org.eclipse.core.runtime.CoreException;
24
import org.eclipse.core.runtime.IPath;
25
import org.eclipse.core.runtime.IStatus;
19
import org.eclipse.core.runtime.NullProgressMonitor;
26
import org.eclipse.core.runtime.NullProgressMonitor;
27
import org.eclipse.core.runtime.Path;
28
import org.eclipse.core.runtime.Status;
20
import org.eclipse.ptp.remote.core.AbstractRemoteProcessBuilder;
29
import org.eclipse.ptp.remote.core.AbstractRemoteProcessBuilder;
21
import org.eclipse.ptp.remote.core.IRemoteConnection;
30
import org.eclipse.ptp.remote.core.IRemoteConnection;
22
import org.eclipse.ptp.remote.core.IRemoteProcess;
31
import org.eclipse.ptp.remote.core.IRemoteProcess;
Lines 142-145 Link Here
142
		return inputString.replaceAll(" ", "\\\\ "); //$NON-NLS-1$ //$NON-NLS-2$
151
		return inputString.replaceAll(" ", "\\\\ "); //$NON-NLS-1$ //$NON-NLS-2$
143
	}
152
	}
144
153
154
	@Override
155
	public IFileStore directory() {
156
		if(super.directory() == null) {
157
			// get CWD
158
			Map<String, String> envMap = environment();
159
			
160
			// check PWD first for UNIX systems
161
			String cwd = envMap.get("PWD");
162
			
163
			// if that didn't work, try %CD% for Windows systems
164
			if(cwd == null) {
165
				cwd = envMap.get("CD");
166
			}
167
			
168
			if(cwd != null) {
169
				URI uri=null;
170
				try {
171
					uri = new URI("rse", connection.getHost().getHostName(), cwd, null);
172
				} catch (URISyntaxException e) {
173
					Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()));
174
				}
175
				try {
176
					return EFS.getStore(uri);
177
				} catch (CoreException e) {
178
					Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()));
179
				}
180
			}
181
				
182
		}
183
		return super.directory();
184
	}
185
	
186
	/* (non-Javadoc)
187
	 * @see org.eclipse.ptp.remote.core.AbstractRemoteProcessBuilder#getHomeDirectory()
188
	 */
189
	public IFileStore getHomeDirectory() {
190
		// determine the home directory using environment variables
191
		Map<String, String> envMap = environment();
192
		
193
		// check HOME first for UNIX systems
194
		String homeDir = envMap.get("HOME");
195
		
196
		// if that didn't work, try %USERPROFILE% for Windows systems
197
		if(homeDir == null) {
198
			homeDir = envMap.get("USERPROFILE");
199
			IPath homePath = new Path(homeDir);
200
			homeDir = "/" + homePath.toString();
201
		}
202
		
203
		if(homeDir != null) {
204
			URI uri=null;
205
			try {
206
				uri = new URI("rse", connection.getHost().getHostName(), homeDir, null);
207
			} catch (URISyntaxException e) {
208
				Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()));
209
			}
210
			try {
211
				return EFS.getStore(uri);
212
			} catch (CoreException e) {
213
				Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()));
214
			}
215
		}
216
		
217
		return null;
218
	}
219
145
}
220
}
(-)src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerFileSICollector.java (-41 / +41 lines)
Lines 61-75 Link Here
61
 * @author vhirsl
61
 * @author vhirsl
62
 */
62
 */
63
public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoCollectorCleaner {
63
public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoCollectorCleaner {
64
	private static final int INCLUDE_PATH 		= 1;
64
	protected static final int INCLUDE_PATH 		= 1;
65
	private static final int QUOTE_INCLUDE_PATH = 2;
65
	protected static final int QUOTE_INCLUDE_PATH = 2;
66
	private static final int INCLUDE_FILE		= 3;
66
	protected static final int INCLUDE_FILE		= 3;
67
	private static final int MACROS_FILE		= 4;
67
	protected static final int MACROS_FILE		= 4;
68
	
68
	
69
    private class ScannerInfoData implements IDiscoveredScannerInfoSerializable {
69
    protected class ScannerInfoData implements IDiscoveredScannerInfoSerializable {
70
        private final Map<Integer, Set<IFile>> commandIdToFilesMap; // command id and set of files it applies to
70
        protected final Map<Integer, Set<IFile>> commandIdToFilesMap; // command id and set of files it applies to
71
        private final Map<IFile, Integer> fileToCommandIdMap;  // maps each file to the corresponding command id
71
        protected final Map<IFile, Integer> fileToCommandIdMap;  // maps each file to the corresponding command id
72
        private final Map<Integer, CCommandDSC> commandIdCommandMap; // map of all commands
72
        protected final Map<Integer, CCommandDSC> commandIdCommandMap; // map of all commands
73
73
74
        public ScannerInfoData() {
74
        public ScannerInfoData() {
75
            commandIdCommandMap = new LinkedHashMap<Integer, CCommandDSC>();  // [commandId, command]
75
            commandIdCommandMap = new LinkedHashMap<Integer, CCommandDSC>();  // [commandId, command]
Lines 153-159 Link Here
153
153
154
    }
154
    }
155
    
155
    
156
    private static class ProjectScannerInfo {
156
    protected static class ProjectScannerInfo {
157
    	IPath[] includePaths;
157
    	IPath[] includePaths;
158
    	IPath[] quoteIncludePaths;
158
    	IPath[] quoteIncludePaths;
159
    	IPath[] includeFiles;
159
    	IPath[] includeFiles;
Lines 169-196 Link Here
169
    }
169
    }
170
    
170
    
171
    public static final String COLLECTOR_ID = MakeCorePlugin.getUniqueIdentifier() + ".PerFileSICollector"; //$NON-NLS-1$
171
    public static final String COLLECTOR_ID = MakeCorePlugin.getUniqueIdentifier() + ".PerFileSICollector"; //$NON-NLS-1$
172
	private static final String CC_ELEM = "compilerCommand"; //$NON-NLS-1$
172
	protected static final String CC_ELEM = "compilerCommand"; //$NON-NLS-1$
173
	private static final String ID_ATTR = "id"; //$NON-NLS-1$
173
	protected static final String ID_ATTR = "id"; //$NON-NLS-1$
174
	private static final String FILE_TYPE_ATTR = "fileType"; //$NON-NLS-1$
174
	protected static final String FILE_TYPE_ATTR = "fileType"; //$NON-NLS-1$
175
	private static final String APPLIES_TO_ATTR = "appliesToFiles"; //$NON-NLS-1$
175
	protected static final String APPLIES_TO_ATTR = "appliesToFiles"; //$NON-NLS-1$
176
	private static final String FILE_ELEM = "file"; //$NON-NLS-1$
176
	protected static final String FILE_ELEM = "file"; //$NON-NLS-1$
177
	private static final String PATH_ATTR = "path"; //$NON-NLS-1$
177
	protected static final String PATH_ATTR = "path"; //$NON-NLS-1$
178
	
178
	
179
    private IProject project;
179
    protected IProject project;
180
    private InfoContext context;
180
    protected InfoContext context;
181
    
181
    
182
    private ScannerInfoData sid; // scanner info data
182
    protected ScannerInfoData sid; // scanner info data
183
    private ProjectScannerInfo psi = null;	// sum of all scanner info
183
    protected ProjectScannerInfo psi = null;	// sum of all scanner info
184
    
184
    
185
//    private List siChangedForFileList; 		// list of files for which scanner info has changed
185
//    protected List siChangedForFileList; 		// list of files for which scanner info has changed
186
	private final Map<IResource, Integer> siChangedForFileMap;		// (file, comandId) map for deltas
186
	protected final Map<IResource, Integer> siChangedForFileMap;		// (file, comandId) map for deltas
187
	private final List<Integer> siChangedForCommandIdList;	// list of command ids for which scanner info has changed
187
	protected final List<Integer> siChangedForCommandIdList;	// list of command ids for which scanner info has changed
188
    
188
    
189
    private final SortedSet<Integer> freeCommandIdPool;   // sorted set of free command ids
189
    protected final SortedSet<Integer> freeCommandIdPool;   // sorted set of free command ids
190
    private int commandIdCounter = 0;
190
    protected int commandIdCounter = 0;
191
    
191
    
192
    /** monitor for data access */
192
    /** monitor for data access */
193
    private final Object fLock = new Object();
193
    protected final Object fLock = new Object();
194
194
195
    /**
195
    /**
196
     * 
196
     * 
Lines 280-286 Link Here
280
     * @param commandId
280
     * @param commandId
281
     * @param scannerInfo
281
     * @param scannerInfo
282
     */
282
     */
283
    private void addScannerInfo(Integer commandId, Map scannerInfo) {
283
    protected void addScannerInfo(Integer commandId, Map scannerInfo) {
284
		assert Thread.holdsLock(fLock);
284
		assert Thread.holdsLock(fLock);
285
        CCommandDSC cmd = sid.commandIdCommandMap.get(commandId);
285
        CCommandDSC cmd = sid.commandIdCommandMap.get(commandId);
286
        if (cmd != null) {
286
        if (cmd != null) {
Lines 303-309 Link Here
303
     * @param file 
303
     * @param file 
304
     * @param object
304
     * @param object
305
     */
305
     */
306
    private void addCompilerCommand(IFile file, CCommandDSC cmd) {
306
    protected void addCompilerCommand(IFile file, CCommandDSC cmd) {
307
		assert Thread.holdsLock(fLock);
307
		assert Thread.holdsLock(fLock);
308
        List<CCommandDSC> existingCommands = new ArrayList<CCommandDSC>(sid.commandIdCommandMap.values());
308
        List<CCommandDSC> existingCommands = new ArrayList<CCommandDSC>(sid.commandIdCommandMap.values());
309
        int index = existingCommands.indexOf(cmd);
309
        int index = existingCommands.indexOf(cmd);
Lines 331-337 Link Here
331
	 * @param file
331
	 * @param file
332
	 * @param cmd
332
	 * @param cmd
333
	 */
333
	 */
334
	private void generateFileDelta(IFile file, CCommandDSC cmd) {
334
	protected void generateFileDelta(IFile file, CCommandDSC cmd) {
335
		assert Thread.holdsLock(fLock);
335
		assert Thread.holdsLock(fLock);
336
        Integer commandId = cmd.getCommandIdAsInteger();
336
        Integer commandId = cmd.getCommandIdAsInteger();
337
		Integer oldCommandId = sid.fileToCommandIdMap.get(file);
337
		Integer oldCommandId = sid.fileToCommandIdMap.get(file);
Lines 350-356 Link Here
350
	 * @param file
350
	 * @param file
351
	 * @param cmd
351
	 * @param cmd
352
	 */
352
	 */
353
	private void applyFileDeltas() {
353
	protected void applyFileDeltas() {
354
		assert Thread.holdsLock(fLock);
354
		assert Thread.holdsLock(fLock);
355
		for (Iterator<IResource> i = siChangedForFileMap.keySet().iterator(); i.hasNext(); ) {
355
		for (Iterator<IResource> i = siChangedForFileMap.keySet().iterator(); i.hasNext(); ) {
356
			IFile file = (IFile) i.next();
356
			IFile file = (IFile) i.next();
Lines 396-402 Link Here
396
		generateProjectScannerInfo();
396
		generateProjectScannerInfo();
397
	}
397
	}
398
398
399
	private void generateProjectScannerInfo() {
399
	protected void generateProjectScannerInfo() {
400
		assert Thread.holdsLock(fLock);
400
		assert Thread.holdsLock(fLock);
401
		psi = new ProjectScannerInfo();
401
		psi = new ProjectScannerInfo();
402
		psi.includePaths = getAllIncludePaths(INCLUDE_PATH);
402
		psi.includePaths = getAllIncludePaths(INCLUDE_PATH);
Lines 406-412 Link Here
406
		psi.definedSymbols = getAllSymbols();
406
		psi.definedSymbols = getAllSymbols();
407
	}
407
	}
408
408
409
	private void removeUnusedCommands() {
409
	protected void removeUnusedCommands() {
410
		assert Thread.holdsLock(fLock);
410
		assert Thread.holdsLock(fLock);
411
        for (Iterator i = sid.commandIdToFilesMap.entrySet().iterator(); i.hasNext(); ) {
411
        for (Iterator i = sid.commandIdToFilesMap.entrySet().iterator(); i.hasNext(); ) {
412
            Entry entry = (Entry) i.next();
412
            Entry entry = (Entry) i.next();
Lines 437-443 Link Here
437
     * @param type
437
     * @param type
438
     * @param object
438
     * @param object
439
     */
439
     */
440
    private void addScannerInfo(ScannerInfoTypes type, List delta) {
440
    protected void addScannerInfo(ScannerInfoTypes type, List delta) {
441
        // TODO Auto-generated method stub
441
        // TODO Auto-generated method stub
442
        
442
        
443
    }
443
    }
Lines 487-493 Link Here
487
        return new PerFileDiscoveredPathInfo();
487
        return new PerFileDiscoveredPathInfo();
488
    }
488
    }
489
489
490
	private boolean scannerInfoChanged() {
490
	protected boolean scannerInfoChanged() {
491
		assert Thread.holdsLock(fLock);
491
		assert Thread.holdsLock(fLock);
492
//		return !siChangedForFileList.isEmpty();
492
//		return !siChangedForFileList.isEmpty();
493
		return !siChangedForFileMap.isEmpty();
493
		return !siChangedForFileMap.isEmpty();
Lines 621-627 Link Here
621
     * 
621
     * 
622
     * @author vhirsl
622
     * @author vhirsl
623
     */
623
     */
624
    private class PerFileDiscoveredPathInfo implements IPerFileDiscoveredPathInfo2 {
624
    protected class PerFileDiscoveredPathInfo implements IPerFileDiscoveredPathInfo2 {
625
        /* (non-Javadoc)
625
        /* (non-Javadoc)
626
         * @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo#getProject()
626
         * @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo#getProject()
627
         */
627
         */
Lines 797-803 Link Here
797
797
798
    }
798
    }
799
    
799
    
800
    private Map<IResource, PathInfo> calculatePathInfoMap(){
800
    protected Map<IResource, PathInfo> calculatePathInfoMap(){
801
		assert Thread.holdsLock(fLock);
801
		assert Thread.holdsLock(fLock);
802
    	Map<IResource, PathInfo> map = new HashMap<IResource, PathInfo>(sid.fileToCommandIdMap.size() + 1);
802
    	Map<IResource, PathInfo> map = new HashMap<IResource, PathInfo>(sid.fileToCommandIdMap.size() + 1);
803
    	Map.Entry entry;
803
    	Map.Entry entry;
Lines 828-834 Link Here
828
    	return map;
828
    	return map;
829
    }
829
    }
830
    
830
    
831
    private static PathInfo createFilePathInfo(CCommandDSC cmd){
831
    protected static PathInfo createFilePathInfo(CCommandDSC cmd){
832
    	IPath[] includes = stringListToPathArray(cmd.getIncludes());
832
    	IPath[] includes = stringListToPathArray(cmd.getIncludes());
833
    	IPath[] quotedIncludes = stringListToPathArray(cmd.getQuoteIncludes());
833
    	IPath[] quotedIncludes = stringListToPathArray(cmd.getQuoteIncludes());
834
    	IPath[] incFiles = stringListToPathArray(cmd.getIncludeFile());
834
    	IPath[] incFiles = stringListToPathArray(cmd.getIncludeFile());
Lines 849-855 Link Here
849
     * @param path
849
     * @param path
850
     * @return
850
     * @return
851
     */
851
     */
852
    private CCommandDSC getCommand(IPath path) {
852
    protected CCommandDSC getCommand(IPath path) {
853
        try {
853
        try {
854
        	IFile file = project.getWorkspace().getRoot().getFile(path);
854
        	IFile file = project.getWorkspace().getRoot().getFile(path);
855
    		return getCommand(file);
855
    		return getCommand(file);
Lines 859-865 Link Here
859
        }
859
        }
860
    }
860
    }
861
861
862
    private CCommandDSC getCommand(IFile file) {
862
    protected CCommandDSC getCommand(IFile file) {
863
        CCommandDSC cmd = null;
863
        CCommandDSC cmd = null;
864
        if (file != null) {
864
        if (file != null) {
865
            Integer cmdId = sid.fileToCommandIdMap.get(file);
865
            Integer cmdId = sid.fileToCommandIdMap.get(file);
Lines 880-886 Link Here
880
     * 
880
     * 
881
     * @return list of IPath(s).
881
     * @return list of IPath(s).
882
     */
882
     */
883
    private IPath[] getAllIncludePaths(int type) {
883
    protected IPath[] getAllIncludePaths(int type) {
884
    	List<String> allIncludes = new ArrayList<String>();
884
    	List<String> allIncludes = new ArrayList<String>();
885
        for (Iterator<Integer> i = sid.commandIdCommandMap.keySet().iterator(); i.hasNext(); ) {
885
        for (Iterator<Integer> i = sid.commandIdCommandMap.keySet().iterator(); i.hasNext(); ) {
886
            Integer cmdId = i.next();
886
            Integer cmdId = i.next();
Lines 921-927 Link Here
921
	 * @param allIncludes
921
	 * @param allIncludes
922
	 * @return
922
	 * @return
923
	 */
923
	 */
924
	private static IPath[] stringListToPathArray(List<String> discovered) {
924
	protected static IPath[] stringListToPathArray(List<String> discovered) {
925
		List<Path> allIncludes = new ArrayList<Path>(discovered.size());
925
		List<Path> allIncludes = new ArrayList<Path>(discovered.size());
926
		for (Iterator<String> j = discovered.iterator(); j.hasNext(); ) {
926
		for (Iterator<String> j = discovered.iterator(); j.hasNext(); ) {
927
		    String include = j.next();
927
		    String include = j.next();
Lines 935-941 Link Here
935
    /**
935
    /**
936
     * @return
936
     * @return
937
     */
937
     */
938
    private Map<String, String> getAllSymbols() {
938
    protected Map<String, String> getAllSymbols() {
939
		assert Thread.holdsLock(fLock);
939
		assert Thread.holdsLock(fLock);
940
        Map<String, String> symbols = new HashMap<String, String>();
940
        Map<String, String> symbols = new HashMap<String, String>();
941
        for (Iterator<Integer> i = sid.commandIdCommandMap.keySet().iterator(); i.hasNext(); ) {
941
        for (Iterator<Integer> i = sid.commandIdCommandMap.keySet().iterator(); i.hasNext(); ) {
(-)src/org/eclipse/ptp/rdt/ui/serviceproviders/RemoteBuildServiceProvider.java (+41 lines)
Lines 10-19 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.ptp.rdt.ui.serviceproviders;
11
package org.eclipse.ptp.rdt.ui.serviceproviders;
12
12
13
import java.net.URI;
14
15
import org.eclipse.cdt.utils.FileSystemUtilityManager;
16
import org.eclipse.core.filesystem.IFileStore;
17
import org.eclipse.core.runtime.IPath;
18
import org.eclipse.core.runtime.Path;
13
import org.eclipse.ptp.rdt.core.serviceproviders.IRemoteExecutionServiceProvider;
19
import org.eclipse.ptp.rdt.core.serviceproviders.IRemoteExecutionServiceProvider;
14
import org.eclipse.ptp.rdt.ui.messages.Messages;
20
import org.eclipse.ptp.rdt.ui.messages.Messages;
15
import org.eclipse.ptp.remote.core.IRemoteConnection;
21
import org.eclipse.ptp.remote.core.IRemoteConnection;
16
import org.eclipse.ptp.remote.core.IRemoteConnectionManager;
22
import org.eclipse.ptp.remote.core.IRemoteConnectionManager;
23
import org.eclipse.ptp.remote.core.IRemoteProcessBuilder;
17
import org.eclipse.ptp.remote.core.IRemoteServices;
24
import org.eclipse.ptp.remote.core.IRemoteServices;
18
import org.eclipse.ptp.remote.core.PTPRemoteCorePlugin;
25
import org.eclipse.ptp.remote.core.PTPRemoteCorePlugin;
19
import org.eclipse.ptp.rdt.services.core.ServiceProvider;
26
import org.eclipse.ptp.rdt.services.core.ServiceProvider;
Lines 38-45 Link Here
38
	public static final String NAME = Messages.getString("RemoteBuildServiceProvider.0"); //$NON-NLS-1$
45
	public static final String NAME = Messages.getString("RemoteBuildServiceProvider.0"); //$NON-NLS-1$
39
46
40
	private IRemoteConnection fRemoteConnection = null;
47
	private IRemoteConnection fRemoteConnection = null;
48
	
49
	private String fConfigLocation = null;
41
50
42
51
52
	private String getDefaultPath(IRemoteServices remoteServices, IRemoteConnection connection) {
53
		// get the user's home directory
54
		IRemoteProcessBuilder processBuilder = remoteServices.getProcessBuilder(connection, ""); //$NON-NLS-1$
55
		IFileStore homeStore = processBuilder.getHomeDirectory();
56
		URI uri = homeStore.toURI();
57
		String pathString = FileSystemUtilityManager.getDefault().getPathFromURI(uri);
58
		IPath path = new Path(pathString);
59
		path = path.append(".eclipsesettings"); //$NON-NLS-1$
60
		return path.toString();
61
		
62
	}
63
	
64
	/* (non-Javadoc)
65
	 * @see org.eclipse.ptp.rdt.core.serviceproviders.IRemoteExecutionServiceProvider#getConfigLocation()
66
	 */
67
	public String getConfigLocation() {
68
		if(isConfigured()) {
69
			if(fConfigLocation != null)
70
				return fConfigLocation;
71
			else {
72
				fConfigLocation = getDefaultPath(getRemoteServices(), getConnection());
73
			}
74
		}
75
		
76
		
77
		return fConfigLocation; // most likely null
78
	}
79
80
	public void setConfigLocation(String configLocation) {
81
		fConfigLocation = configLocation;
82
	}
83
43
	public String getConfigurationString() {
84
	public String getConfigurationString() {
44
		if (isConfigured()) {
85
		if (isConfigured()) {
45
			return getRemoteServices().getName() + ": " + getRemoteConnectionName(); //$NON-NLS-1$
86
			return getRemoteServices().getName() + ": " + getRemoteConnectionName(); //$NON-NLS-1$
(-)src/org/eclipse/ptp/rdt/ui/wizards/RemoteServicesServiceProviderContributor.java (-1 / +14 lines)
Lines 42-47 Link Here
42
	private IRemoteServices fSelectedProvider;
42
	private IRemoteServices fSelectedProvider;
43
	private Map<Integer, IRemoteConnection> fComboIndexToRemoteConnectionMap = new HashMap<Integer, IRemoteConnection>();
43
	private Map<Integer, IRemoteConnection> fComboIndexToRemoteConnectionMap = new HashMap<Integer, IRemoteConnection>();
44
	private IRemoteConnection fSelectedConnection;
44
	private IRemoteConnection fSelectedConnection;
45
	private RemoteBuildServiceFileLocationWidget fBuildConfigLocationWidget;
45
46
46
	
47
	
47
	public void configureServiceProvider(IServiceProvider provider, final Composite container) {
48
	public void configureServiceProvider(IServiceProvider provider, final Composite container) {
Lines 95-101 Link Here
95
        
96
        
96
        // populate the combo with a list of providers
97
        // populate the combo with a list of providers
97
        populateConnectionCombo(connectionCombo);
98
        populateConnectionCombo(connectionCombo);
98
           
99
       
100
        String configPath = RemoteBuildServiceFileLocationWidget.getDefaultPath(fSelectedProvider, fSelectedConnection);
101
        
102
        fBuildConfigLocationWidget = new RemoteBuildServiceFileLocationWidget(container, SWT.NONE, fSelectedProvider, fSelectedConnection, configPath);
103
        GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
104
        data.horizontalSpan = 3;
105
        fBuildConfigLocationWidget.setLayoutData(data); // set layout to grab horizontal space
106
        
107
        
99
        // new connection button
108
        // new connection button
100
        final Button newConnectionButton = new Button(container, SWT.PUSH);
109
        final Button newConnectionButton = new Button(container, SWT.PUSH);
101
        newConnectionButton.setText(Messages.getString("RemoteServicesProviderSelectionDialog.1")); //$NON-NLS-1$
110
        newConnectionButton.setText(Messages.getString("RemoteServicesProviderSelectionDialog.1")); //$NON-NLS-1$
Lines 174-179 Link Here
174
		// set the provider
183
		// set the provider
175
		fProvider.setRemoteToolsProviderID(fSelectedProvider.getId());
184
		fProvider.setRemoteToolsProviderID(fSelectedProvider.getId());
176
		fProvider.setRemoteToolsConnection(fSelectedConnection);
185
		fProvider.setRemoteToolsConnection(fSelectedConnection);
186
		if(fBuildConfigLocationWidget != null) {
187
			fBuildConfigLocationWidget.setRemoteConnection(fSelectedProvider, fSelectedConnection);
188
			fProvider.setConfigLocation(fBuildConfigLocationWidget.getConfigLocationPath());
189
		}
177
190
178
	}
191
	}
179
	
192
	
(-)src/org/eclipse/ptp/rdt/ui/wizards/RemoteMakefileWizardHandler.java (-5 / +6 lines)
Lines 96-106 Link Here
96
		mngr.setProjectDescription(project, des);
96
		mngr.setProjectDescription(project, des);
97
		
97
		
98
		// remove all builders from the project... I really wish there was a less hacky way to do this that wasn't so damn slow
98
		// remove all builders from the project... I really wish there was a less hacky way to do this that wasn't so damn slow
99
		IProjectDescription projectDescription = project.getDescription();
99
//		IProjectDescription projectDescription = project.getDescription();
100
		projectDescription.setBuildSpec(new ICommand[0]);
100
//		projectDescription.setBuildSpec(new ICommand[0]);
101
		project.setDescription(projectDescription, IProject.FORCE, new NullProgressMonitor());
101
//		project.setDescription(projectDescription, IProject.FORCE, new NullProgressMonitor());
102
		RemoteMakeNature.addToBuildSpec(project, RemoteMakeBuilder.REMOTE_MAKE_BUILDER_ID, new NullProgressMonitor());
102
//		RemoteMakeNature.addToBuildSpec(project, RemoteMakeBuilder.REMOTE_MAKE_BUILDER_ID, new NullProgressMonitor());
103
		RemoteMakeNature.addNature(project, new NullProgressMonitor());
103
		RemoteMakeNature.updateProjectDescription(project, RemoteMakeBuilder.REMOTE_MAKE_BUILDER_ID, new NullProgressMonitor());
104
		//RemoteMakeNature.addNature(project, new NullProgressMonitor());
104
		
105
		
105
		// set the build directory by default to be that of the project... the usual workspace macro doesn't work as the workspace resides locally
106
		// set the build directory by default to be that of the project... the usual workspace macro doesn't work as the workspace resides locally
106
		// and the project resides remotely
107
		// and the project resides remotely
(-)src/org/eclipse/ptp/rdt/ui/wizards/RemoteServicesProviderSelectionDialog.java (-2 / +14 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
2
 * Copyright (c) 2008, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 19-24 Link Here
19
import org.eclipse.ptp.rdt.ui.messages.Messages;
19
import org.eclipse.ptp.rdt.ui.messages.Messages;
20
import org.eclipse.ptp.rdt.ui.serviceproviders.RemoteBuildServiceProvider;
20
import org.eclipse.ptp.rdt.ui.serviceproviders.RemoteBuildServiceProvider;
21
import org.eclipse.ptp.remote.core.IRemoteConnection;
21
import org.eclipse.ptp.remote.core.IRemoteConnection;
22
import org.eclipse.ptp.remote.core.IRemoteProcessBuilder;
22
import org.eclipse.ptp.remote.core.IRemoteServices;
23
import org.eclipse.ptp.remote.core.IRemoteServices;
23
import org.eclipse.ptp.remote.core.PTPRemoteCorePlugin;
24
import org.eclipse.ptp.remote.core.PTPRemoteCorePlugin;
24
import org.eclipse.ptp.remote.ui.IRemoteUIConnectionManager;
25
import org.eclipse.ptp.remote.ui.IRemoteUIConnectionManager;
Lines 49-55 Link Here
49
 */
50
 */
50
public class RemoteServicesProviderSelectionDialog extends Dialog {
51
public class RemoteServicesProviderSelectionDialog extends Dialog {
51
52
52
	
53
	private RemoteBuildServiceProvider fProvider;
53
	private RemoteBuildServiceProvider fProvider;
54
	
54
	
55
	private Map<Integer, IRemoteServices> fComboIndexToRemoteServicesProviderMap = new HashMap<Integer, IRemoteServices>();
55
	private Map<Integer, IRemoteServices> fComboIndexToRemoteServicesProviderMap = new HashMap<Integer, IRemoteServices>();
Lines 59-64 Link Here
59
	private Map<Integer, IRemoteConnection> fComboIndexToRemoteConnectionMap = new HashMap<Integer, IRemoteConnection>();
59
	private Map<Integer, IRemoteConnection> fComboIndexToRemoteConnectionMap = new HashMap<Integer, IRemoteConnection>();
60
60
61
	private IRemoteConnection fSelectedConnection;
61
	private IRemoteConnection fSelectedConnection;
62
	
63
	private String fConfigLocation;
64
65
	private RemoteBuildServiceFileLocationWidget fBuildConfigLocationWidget;
62
66
63
	public RemoteServicesProviderSelectionDialog(IServiceProvider provider, Shell parentShell) {
67
	public RemoteServicesProviderSelectionDialog(IServiceProvider provider, Shell parentShell) {
64
		super(parentShell);
68
		super(parentShell);
Lines 128-133 Link Here
128
        newConnectionButton.setText(Messages.getString("RemoteServicesProviderSelectionDialog.1")); //$NON-NLS-1$
132
        newConnectionButton.setText(Messages.getString("RemoteServicesProviderSelectionDialog.1")); //$NON-NLS-1$
129
        updateNewConnectionButtonEnabled(newConnectionButton);
133
        updateNewConnectionButtonEnabled(newConnectionButton);
130
        
134
        
135
        String configPath = RemoteBuildServiceFileLocationWidget.getDefaultPath(fSelectedProvider, fSelectedConnection);
136
        
137
        fBuildConfigLocationWidget = new RemoteBuildServiceFileLocationWidget(container, SWT.NONE, fSelectedProvider, fSelectedConnection, configPath);
138
        GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
139
        data.horizontalSpan = 3;
140
        fBuildConfigLocationWidget.setLayoutData(data); // set layout to grab horizontal space
141
        
131
        
142
        
132
        newConnectionButton.addSelectionListener(new SelectionListener() {
143
        newConnectionButton.addSelectionListener(new SelectionListener() {
133
144
Lines 263-268 Link Here
263
		// set the provider
274
		// set the provider
264
		fProvider.setRemoteToolsProviderID(fSelectedProvider.getId());
275
		fProvider.setRemoteToolsProviderID(fSelectedProvider.getId());
265
		fProvider.setRemoteToolsConnection(fSelectedConnection);
276
		fProvider.setRemoteToolsConnection(fSelectedConnection);
277
		fProvider.setConfigLocation(fBuildConfigLocationWidget.getConfigLocationPath());
266
278
267
	}
279
	}
268
280
(-)src/org/eclipse/ptp/rdt/ui/wizards/ConvertToRemoteWizardPage.java (+4 lines)
Lines 29-34 Link Here
29
import org.eclipse.jface.viewers.IStructuredSelection;
29
import org.eclipse.jface.viewers.IStructuredSelection;
30
import org.eclipse.jface.viewers.SelectionChangedEvent;
30
import org.eclipse.jface.viewers.SelectionChangedEvent;
31
import org.eclipse.ptp.rdt.core.RDTLog;
31
import org.eclipse.ptp.rdt.core.RDTLog;
32
import org.eclipse.ptp.rdt.core.remotemake.RemoteMakeBuilder;
33
import org.eclipse.ptp.rdt.core.resources.RemoteMakeNature;
32
import org.eclipse.ptp.rdt.core.resources.RemoteNature;
34
import org.eclipse.ptp.rdt.core.resources.RemoteNature;
33
import org.eclipse.ptp.rdt.services.core.IServiceConfiguration;
35
import org.eclipse.ptp.rdt.services.core.IServiceConfiguration;
34
import org.eclipse.ptp.rdt.services.core.IServiceModelManager;
36
import org.eclipse.ptp.rdt.services.core.IServiceModelManager;
Lines 126-131 Link Here
126
		monitor.beginTask(Messages.getString("WizardProjectConversion.monitor.convertingToRemoteProject"), 3); //$NON-NLS-1$
128
		monitor.beginTask(Messages.getString("WizardProjectConversion.monitor.convertingToRemoteProject"), 3); //$NON-NLS-1$
127
		try {
129
		try {
128
			RemoteNature.addRemoteNature(project, monitor);
130
			RemoteNature.addRemoteNature(project, monitor);
131
			RemoteMakeNature.updateProjectDescription(project, RemoteMakeBuilder.BUILDER_ID, monitor);
129
			configureServicesForRemoteProject(project);
132
			configureServicesForRemoteProject(project);
130
		} catch (InvocationTargetException e) {
133
		} catch (InvocationTargetException e) {
131
			RDTLog.logError(e);
134
			RDTLog.logError(e);
Lines 144-149 Link Here
144
		monitor.beginTask(Messages.getString("WizardProjectConversion.monitor.convertingToRemoteProject"), 3); //$NON-NLS-1$
147
		monitor.beginTask(Messages.getString("WizardProjectConversion.monitor.convertingToRemoteProject"), 3); //$NON-NLS-1$
145
		try {
148
		try {
146
			RemoteNature.addRemoteNature(project, monitor);
149
			RemoteNature.addRemoteNature(project, monitor);
150
			RemoteMakeNature.updateProjectDescription(project, RemoteMakeBuilder.BUILDER_ID, monitor);
147
			configureServicesForRemoteProject(project);
151
			configureServicesForRemoteProject(project);
148
		} catch (InvocationTargetException e) {
152
		} catch (InvocationTargetException e) {
149
			RDTLog.logError(e);
153
			RDTLog.logError(e);
(-)src/org/eclipse/ptp/rdt/ui/messages/messages.properties (+2 lines)
Lines 28-33 Link Here
28
ServiceModelWidget.2=Configure...
28
ServiceModelWidget.2=Configure...
29
ServiceModelWidget.3=Provider Configuration
29
ServiceModelWidget.3=Provider Configuration
30
ServiceModelWidget.4=Not configured
30
ServiceModelWidget.4=Not configured
31
RemoteBuildServiceFileLocationWidget.0=Select Remote Directory For Build Service Configuration Files
32
RemoteBuildServiceFileLocationWidget.1=Build Configuration Location
31
RemoteBuildServiceProvider.0=RDT Remote Build Service
33
RemoteBuildServiceProvider.0=RDT Remote Build Service
32
NullCIndexServiceProvider.0=Null search query
34
NullCIndexServiceProvider.0=Null search query
33
NullCIndexServiceProvider.1=Null query - no matches to report.
35
NullCIndexServiceProvider.1=Null query - no matches to report.
(-)src/org/eclipse/ptp/rdt/ui/wizards/RemoteBuildServiceFileLocationWidget.java (+170 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Mike Kucera (IBM) - Initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.ptp.rdt.ui.wizards;
12
13
import java.net.URI;
14
import java.util.HashMap;
15
import java.util.Map;
16
17
import org.eclipse.cdt.utils.FileSystemUtilityManager;
18
import org.eclipse.core.filesystem.IFileStore;
19
import org.eclipse.core.runtime.IPath;
20
import org.eclipse.core.runtime.ListenerList;
21
import org.eclipse.core.runtime.Path;
22
import org.eclipse.ptp.rdt.ui.messages.Messages;
23
import org.eclipse.ptp.remote.core.IRemoteConnection;
24
import org.eclipse.ptp.remote.core.IRemoteProcessBuilder;
25
import org.eclipse.ptp.remote.core.IRemoteServices;
26
import org.eclipse.ptp.remote.ui.IRemoteUIServices;
27
import org.eclipse.ptp.remote.ui.PTPRemoteUIPlugin;
28
import org.eclipse.swt.SWT;
29
import org.eclipse.swt.events.ModifyEvent;
30
import org.eclipse.swt.events.ModifyListener;
31
import org.eclipse.swt.events.SelectionAdapter;
32
import org.eclipse.swt.events.SelectionEvent;
33
import org.eclipse.swt.layout.GridData;
34
import org.eclipse.swt.layout.GridLayout;
35
import org.eclipse.swt.widgets.Button;
36
import org.eclipse.swt.widgets.Composite;
37
import org.eclipse.swt.widgets.Group;
38
import org.eclipse.swt.widgets.Text;
39
40
public class RemoteBuildServiceFileLocationWidget extends Composite {
41
42
	private IRemoteConnection fRemoteConnection = null;
43
	private IRemoteServices fRemoteServices = null;
44
	
45
	///private final Label label;
46
	private final Text text;
47
	private final Button browseButton;
48
	//private final Button validateButton;
49
	private final Button defaultButton;
50
	
51
	private Map<String,String> previousSelections = new HashMap<String,String>();
52
	private String fPath;
53
		
54
	public RemoteBuildServiceFileLocationWidget(Composite parent, int style, final IRemoteServices remoteServices, IRemoteConnection initialConnection, String defaultPath) {
55
		super(parent, style);
56
		
57
		fRemoteServices = remoteServices;
58
		fRemoteConnection = initialConnection;
59
		fPath = defaultPath;
60
		
61
		GridLayout layout = new GridLayout(1, false);
62
		layout.marginHeight = 0;
63
		layout.marginWidth = 0;
64
		this.setLayout(layout);
65
		this.setLayoutData(new GridData(GridData.FILL_BOTH));
66
		
67
		Group group = new Group(this, SWT.NONE);
68
		group.setText(Messages.getString(Messages.getString("RemoteBuildServiceFileLocationWidget.1"))); //$NON-NLS-1$
69
		group.setLayout(new GridLayout(2, false));
70
		group.setLayoutData(new GridData(GridData.FILL_BOTH));
71
		
72
		text = new Text(group, SWT.BORDER);
73
		GridData data = new GridData(GridData.FILL_HORIZONTAL);
74
		//data.widthHint = 300;
75
		data.horizontalSpan = 2;
76
		text.setLayoutData(data);
77
		text.addModifyListener(new ModifyListener() {
78
			public void modifyText(ModifyEvent e) {
79
				String path = text.getText();
80
				
81
				previousSelections.put(key(remoteServices, fRemoteConnection), path);
82
				
83
				fPath = path;
84
			}
85
		});
86
		
87
		browseButton = new Button(group, SWT.NONE);
88
		browseButton.setText(Messages.getString("IndexFileLocationWidget.1"));   //$NON-NLS-1$
89
		browseButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
90
		browseButton.addSelectionListener(new SelectionAdapter() {
91
			public void widgetSelected(SelectionEvent e) {
92
				browse();
93
			}
94
		});
95
			
96
		defaultButton = new Button(group, SWT.NONE);
97
		defaultButton.setText(Messages.getString("IndexFileLocationWidget.2"));  //$NON-NLS-1$
98
		defaultButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
99
		defaultButton.addSelectionListener(new SelectionAdapter() {
100
			public void widgetSelected(SelectionEvent e) {
101
				restoreDefault();
102
			}
103
		});
104
		
105
		if(defaultPath != null)
106
			text.setText(defaultPath);
107
	}
108
	
109
	
110
	public IRemoteConnection getConnection() {
111
		return fRemoteConnection;
112
	}
113
114
	
115
	public void setRemoteConnection(IRemoteServices remoteServices, IRemoteConnection connection) {
116
		if(connection == null || remoteServices == null)
117
			throw new IllegalArgumentException();
118
		
119
		fRemoteConnection = connection;
120
		fRemoteServices = remoteServices;
121
122
		String path = previousSelections.get(key(remoteServices, connection));
123
		if(path == null)
124
			path = getDefaultPath(remoteServices, connection);
125
		if(path == null)
126
			path = ""; //$NON-NLS-1$
127
		
128
		text.setText(path); // modify event listener updates map
129
	}
130
	
131
	
132
	public static String getDefaultPath(IRemoteServices remoteServices, IRemoteConnection connection) {
133
		// get the user's home directory
134
		IRemoteProcessBuilder processBuilder = remoteServices.getProcessBuilder(connection, ""); //$NON-NLS-1$
135
		IFileStore homeStore = processBuilder.getHomeDirectory();
136
		URI uri = homeStore.toURI();
137
		String pathString = FileSystemUtilityManager.getDefault().getPathFromURI(uri);
138
		IPath path = new Path(pathString);
139
		path = path.append(".eclipsesettings"); //$NON-NLS-1$
140
		return path.toString();
141
		
142
	}
143
144
145
	private static String key(IRemoteServices remoteServices, IRemoteConnection connection) {
146
		return remoteServices.getName() + ":" + connection.getName(); //$NON-NLS-1$
147
	}
148
	
149
	public String getConfigLocationPath() {
150
		return text.getText();
151
	}
152
		
153
	private void browse() {
154
			IRemoteUIServices uiServices = PTPRemoteUIPlugin.getDefault().getRemoteUIServices(fRemoteServices);
155
			IPath remotePath = uiServices.getUIFileManager().browseDirectory(this.getShell(), Messages.getString("RemoteBuildServiceFileLocationWidget.0"), fPath); //$NON-NLS-1$
156
			if(remotePath != null)
157
				fPath = remotePath.toString();
158
			
159
			text.setText(fPath);
160
		
161
	}
162
163
	private void restoreDefault() {
164
		String defaultPath = getDefaultPath(fRemoteServices, fRemoteConnection);
165
		fPath = defaultPath;
166
		text.setText(fPath);
167
	}
168
	
169
170
}

Return to bug 293598