Committed by
Gerrit Code Review
remove unused files from buck-tools
Change-Id: Ia0858a89a47b338c1593a8806b17d291f1897ea3
Showing
8 changed files
with
0 additions
and
744 deletions
| 1 | python_binary( | 1 | python_binary( |
| 2 | - name = 'download_file', | ||
| 3 | - main = 'download_file.py', | ||
| 4 | - deps = [':util'], | ||
| 5 | - visibility = ['PUBLIC'], | ||
| 6 | -) | ||
| 7 | - | ||
| 8 | -python_binary( | ||
| 9 | name = 'onos-app-writer', | 2 | name = 'onos-app-writer', |
| 10 | main = 'onos_app.py', | 3 | main = 'onos_app.py', |
| 11 | deps = [], | 4 | deps = [], |
| ... | @@ -33,22 +26,6 @@ python_binary( | ... | @@ -33,22 +26,6 @@ python_binary( |
| 33 | visibility = ['PUBLIC'], | 26 | visibility = ['PUBLIC'], |
| 34 | ) | 27 | ) |
| 35 | 28 | ||
| 36 | -python_binary( | ||
| 37 | - name = 'pack_war', | ||
| 38 | - main = 'pack_war.py', | ||
| 39 | - deps = [':util'], | ||
| 40 | - visibility = ['PUBLIC'], | ||
| 41 | -) | ||
| 42 | - | ||
| 43 | -python_library( | ||
| 44 | - name = 'util', | ||
| 45 | - srcs = [ | ||
| 46 | - 'util.py', | ||
| 47 | - '__init__.py' | ||
| 48 | - ], | ||
| 49 | - visibility = ['PUBLIC'], | ||
| 50 | -) | ||
| 51 | - | ||
| 52 | def shquote(s): | 29 | def shquote(s): |
| 53 | return s.replace("'", "'\\''") | 30 | return s.replace("'", "'\\''") |
| 54 | 31 | ... | ... |
buck-tools/GoogleFormat.xml
deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| 2 | -<profiles version="11"> | ||
| 3 | -<profile kind="CodeFormatterProfile" name="Google Format" version="11"> | ||
| 4 | -<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/> | ||
| 5 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/> | ||
| 6 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/> | ||
| 7 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/> | ||
| 8 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/> | ||
| 9 | -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/> | ||
| 10 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/> | ||
| 11 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/> | ||
| 12 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/> | ||
| 13 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/> | ||
| 14 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/> | ||
| 15 | -<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/> | ||
| 16 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/> | ||
| 17 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/> | ||
| 18 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/> | ||
| 19 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/> | ||
| 20 | -<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/> | ||
| 21 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/> | ||
| 22 | -<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/> | ||
| 23 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/> | ||
| 24 | -<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/> | ||
| 25 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/> | ||
| 26 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/> | ||
| 27 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/> | ||
| 28 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="16"/> | ||
| 29 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/> | ||
| 30 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/> | ||
| 31 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/> | ||
| 32 | -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/> | ||
| 33 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/> | ||
| 34 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/> | ||
| 35 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/> | ||
| 36 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/> | ||
| 37 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/> | ||
| 38 | -<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/> | ||
| 39 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/> | ||
| 40 | -<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/> | ||
| 41 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/> | ||
| 42 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/> | ||
| 43 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/> | ||
| 44 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/> | ||
| 45 | -<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/> | ||
| 46 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/> | ||
| 47 | -<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/> | ||
| 48 | -<setting id="org.eclipse.jdt.core.compiler.source" value="1.7"/> | ||
| 49 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/> | ||
| 50 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/> | ||
| 51 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/> | ||
| 52 | -<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/> | ||
| 53 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/> | ||
| 54 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/> | ||
| 55 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/> | ||
| 56 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/> | ||
| 57 | -<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="0"/> | ||
| 58 | -<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/> | ||
| 59 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/> | ||
| 60 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/> | ||
| 61 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/> | ||
| 62 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/> | ||
| 63 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/> | ||
| 64 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/> | ||
| 65 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/> | ||
| 66 | -<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/> | ||
| 67 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/> | ||
| 68 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/> | ||
| 69 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/> | ||
| 70 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/> | ||
| 71 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/> | ||
| 72 | -<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/> | ||
| 73 | -<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/> | ||
| 74 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/> | ||
| 75 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/> | ||
| 76 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/> | ||
| 77 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/> | ||
| 78 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/> | ||
| 79 | -<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/> | ||
| 80 | -<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/> | ||
| 81 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/> | ||
| 82 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/> | ||
| 83 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/> | ||
| 84 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16"/> | ||
| 85 | -<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/> | ||
| 86 | -<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/> | ||
| 87 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/> | ||
| 88 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/> | ||
| 89 | -<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/> | ||
| 90 | -<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/> | ||
| 91 | -<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/> | ||
| 92 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/> | ||
| 93 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/> | ||
| 94 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/> | ||
| 95 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/> | ||
| 96 | -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/> | ||
| 97 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/> | ||
| 98 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/> | ||
| 99 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/> | ||
| 100 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/> | ||
| 101 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/> | ||
| 102 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/> | ||
| 103 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/> | ||
| 104 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/> | ||
| 105 | -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/> | ||
| 106 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/> | ||
| 107 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/> | ||
| 108 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/> | ||
| 109 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/> | ||
| 110 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/> | ||
| 111 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/> | ||
| 112 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/> | ||
| 113 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/> | ||
| 114 | -<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/> | ||
| 115 | -<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/> | ||
| 116 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/> | ||
| 117 | -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/> | ||
| 118 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/> | ||
| 119 | -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/> | ||
| 120 | -<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/> | ||
| 121 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/> | ||
| 122 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/> | ||
| 123 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/> | ||
| 124 | -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/> | ||
| 125 | -<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/> | ||
| 126 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/> | ||
| 127 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/> | ||
| 128 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/> | ||
| 129 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/> | ||
| 130 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/> | ||
| 131 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/> | ||
| 132 | -<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="2"/> | ||
| 133 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/> | ||
| 134 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/> | ||
| 135 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/> | ||
| 136 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/> | ||
| 137 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="do not insert"/> | ||
| 138 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/> | ||
| 139 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/> | ||
| 140 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/> | ||
| 141 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/> | ||
| 142 | -<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/> | ||
| 143 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/> | ||
| 144 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/> | ||
| 145 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/> | ||
| 146 | -<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/> | ||
| 147 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/> | ||
| 148 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/> | ||
| 149 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/> | ||
| 150 | -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/> | ||
| 151 | -<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="3"/> | ||
| 152 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/> | ||
| 153 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/> | ||
| 154 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/> | ||
| 155 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/> | ||
| 156 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/> | ||
| 157 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/> | ||
| 158 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/> | ||
| 159 | -<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.7"/> | ||
| 160 | -<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/> | ||
| 161 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/> | ||
| 162 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/> | ||
| 163 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/> | ||
| 164 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/> | ||
| 165 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/> | ||
| 166 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/> | ||
| 167 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/> | ||
| 168 | -<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/> | ||
| 169 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/> | ||
| 170 | -<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="true"/> | ||
| 171 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/> | ||
| 172 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/> | ||
| 173 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/> | ||
| 174 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/> | ||
| 175 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/> | ||
| 176 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/> | ||
| 177 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/> | ||
| 178 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/> | ||
| 179 | -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/> | ||
| 180 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/> | ||
| 181 | -<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/> | ||
| 182 | -<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false"/> | ||
| 183 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/> | ||
| 184 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/> | ||
| 185 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/> | ||
| 186 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/> | ||
| 187 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/> | ||
| 188 | -<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/> | ||
| 189 | -<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/> | ||
| 190 | -<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/> | ||
| 191 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/> | ||
| 192 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/> | ||
| 193 | -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/> | ||
| 194 | -<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/> | ||
| 195 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/> | ||
| 196 | -<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/> | ||
| 197 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/> | ||
| 198 | -<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/> | ||
| 199 | -<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/> | ||
| 200 | -<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="2"/> | ||
| 201 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/> | ||
| 202 | -<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/> | ||
| 203 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/> | ||
| 204 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/> | ||
| 205 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/> | ||
| 206 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/> | ||
| 207 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/> | ||
| 208 | -<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/> | ||
| 209 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/> | ||
| 210 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/> | ||
| 211 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/> | ||
| 212 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/> | ||
| 213 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/> | ||
| 214 | -<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="0"/> | ||
| 215 | -<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/> | ||
| 216 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/> | ||
| 217 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/> | ||
| 218 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/> | ||
| 219 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="do not insert"/> | ||
| 220 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/> | ||
| 221 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> | ||
| 222 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/> | ||
| 223 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/> | ||
| 224 | -<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/> | ||
| 225 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/> | ||
| 226 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/> | ||
| 227 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/> | ||
| 228 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/> | ||
| 229 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/> | ||
| 230 | -<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.7"/> | ||
| 231 | -<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/> | ||
| 232 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/> | ||
| 233 | -<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/> | ||
| 234 | -<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/> | ||
| 235 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/> | ||
| 236 | -<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/> | ||
| 237 | -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/> | ||
| 238 | -<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/> | ||
| 239 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/> | ||
| 240 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/> | ||
| 241 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/> | ||
| 242 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/> | ||
| 243 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/> | ||
| 244 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/> | ||
| 245 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/> | ||
| 246 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/> | ||
| 247 | -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/> | ||
| 248 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/> | ||
| 249 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/> | ||
| 250 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/> | ||
| 251 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/> | ||
| 252 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/> | ||
| 253 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> | ||
| 254 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/> | ||
| 255 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/> | ||
| 256 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/> | ||
| 257 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/> | ||
| 258 | -<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/> | ||
| 259 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/> | ||
| 260 | -<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/> | ||
| 261 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/> | ||
| 262 | -<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/> | ||
| 263 | -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/> | ||
| 264 | -<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/> | ||
| 265 | -<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/> | ||
| 266 | -</profile> | ||
| 267 | -</profiles> |
buck-tools/__init__.py
deleted
100644 → 0
File mode changed
buck-tools/download_all.py
deleted
100755 → 0
| 1 | -#!/usr/bin/env python | ||
| 2 | -# Copyright (C) 2013 The Android Open Source Project | ||
| 3 | -# | ||
| 4 | -# Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | -# you may not use this file except in compliance with the License. | ||
| 6 | -# You may obtain a copy of the License at | ||
| 7 | -# | ||
| 8 | -# http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | -# | ||
| 10 | -# Unless required by applicable law or agreed to in writing, software | ||
| 11 | -# distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | -# See the License for the specific language governing permissions and | ||
| 14 | -# limitations under the License. | ||
| 15 | - | ||
| 16 | -from optparse import OptionParser | ||
| 17 | -import re | ||
| 18 | -from subprocess import check_call, CalledProcessError, Popen, PIPE | ||
| 19 | - | ||
| 20 | -MAIN = ['//buck-tools/eclipse:classpath'] | ||
| 21 | -PAT = re.compile(r'"(//.*?)" -> "//buck-tools:download_file"') | ||
| 22 | -# TODO(davido): Remove this hack when Buck bugs are fixed: | ||
| 23 | -# https://github.com/facebook/buck/issues/656 | ||
| 24 | -# https://github.com/facebook/buck/issues/658 | ||
| 25 | -JGIT = re.compile(r'//org.eclipse.jgit.*') | ||
| 26 | -CELL = '//lib/jgit' | ||
| 27 | - | ||
| 28 | -opts = OptionParser() | ||
| 29 | -opts.add_option('--src', action='store_true') | ||
| 30 | -args, _ = opts.parse_args() | ||
| 31 | - | ||
| 32 | -targets = set() | ||
| 33 | - | ||
| 34 | -p = Popen(['buck', 'audit', 'classpath', '--dot'] + MAIN, stdout = PIPE) | ||
| 35 | -for line in p.stdout: | ||
| 36 | - m = PAT.search(line) | ||
| 37 | - if m: | ||
| 38 | - n = m.group(1) | ||
| 39 | - if JGIT.match(n): | ||
| 40 | - n = CELL + n[1:] | ||
| 41 | - if args.src and n.endswith('__download_bin'): | ||
| 42 | - n = n[:-13] + 'src' | ||
| 43 | - targets.add(n) | ||
| 44 | -r = p.wait() | ||
| 45 | -if r != 0: | ||
| 46 | - exit(r) | ||
| 47 | - | ||
| 48 | -try: | ||
| 49 | - check_call(['buck', 'build'] + sorted(targets)) | ||
| 50 | -except CalledProcessError as err: | ||
| 51 | - exit(1) |
buck-tools/download_file.py
deleted
100755 → 0
| 1 | -#!/usr/bin/env python | ||
| 2 | -# Copyright (C) 2013 The Android Open Source Project | ||
| 3 | -# | ||
| 4 | -# Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | -# you may not use this file except in compliance with the License. | ||
| 6 | -# You may obtain a copy of the License at | ||
| 7 | -# | ||
| 8 | -# http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | -# | ||
| 10 | -# Unless required by applicable law or agreed to in writing, software | ||
| 11 | -# distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | -# See the License for the specific language governing permissions and | ||
| 14 | -# limitations under the License. | ||
| 15 | - | ||
| 16 | -from __future__ import print_function | ||
| 17 | - | ||
| 18 | -from hashlib import sha1 | ||
| 19 | -from optparse import OptionParser | ||
| 20 | -from os import link, makedirs, path, remove | ||
| 21 | -import shutil | ||
| 22 | -from subprocess import check_call, CalledProcessError | ||
| 23 | -from sys import stderr | ||
| 24 | -from util import hash_file, resolve_url | ||
| 25 | -from zipfile import ZipFile, BadZipfile, LargeZipFile | ||
| 26 | - | ||
| 27 | -GERRIT_HOME = path.expanduser('~/.gerritcodereview') | ||
| 28 | -CACHE_DIR = path.join(GERRIT_HOME, 'buck-cache', 'downloaded-artifacts') | ||
| 29 | -# LEGACY_CACHE_DIR is only used to allow existing workspaces to move already | ||
| 30 | -# downloaded files to the new cache directory. | ||
| 31 | -# Please remove after 3 months (2015-10-07). | ||
| 32 | -LEGACY_CACHE_DIR = path.join(GERRIT_HOME, 'buck-cache') | ||
| 33 | -LOCAL_PROPERTIES = 'local.properties' | ||
| 34 | - | ||
| 35 | - | ||
| 36 | -def safe_mkdirs(d): | ||
| 37 | - if path.isdir(d): | ||
| 38 | - return | ||
| 39 | - try: | ||
| 40 | - makedirs(d) | ||
| 41 | - except OSError as err: | ||
| 42 | - if not path.isdir(d): | ||
| 43 | - raise err | ||
| 44 | - | ||
| 45 | - | ||
| 46 | -def download_properties(root_dir): | ||
| 47 | - """ Get the download properties. | ||
| 48 | - | ||
| 49 | - First tries to find the properties file in the given root directory, | ||
| 50 | - and if not found there, tries in the Gerrit settings folder in the | ||
| 51 | - user's home directory. | ||
| 52 | - | ||
| 53 | - Returns a set of download properties, which may be empty. | ||
| 54 | - | ||
| 55 | - """ | ||
| 56 | - p = {} | ||
| 57 | - local_prop = path.join(root_dir, LOCAL_PROPERTIES) | ||
| 58 | - if not path.isfile(local_prop): | ||
| 59 | - local_prop = path.join(GERRIT_HOME, LOCAL_PROPERTIES) | ||
| 60 | - if path.isfile(local_prop): | ||
| 61 | - try: | ||
| 62 | - with open(local_prop) as fd: | ||
| 63 | - for line in fd: | ||
| 64 | - if line.startswith('download.'): | ||
| 65 | - d = [e.strip() for e in line.split('=', 1)] | ||
| 66 | - name, url = d[0], d[1] | ||
| 67 | - p[name[len('download.'):]] = url | ||
| 68 | - except OSError: | ||
| 69 | - pass | ||
| 70 | - return p | ||
| 71 | - | ||
| 72 | - | ||
| 73 | -def cache_entry(args): | ||
| 74 | - if args.v: | ||
| 75 | - h = args.v | ||
| 76 | - else: | ||
| 77 | - h = sha1(args.u.encode('utf-8')).hexdigest() | ||
| 78 | - name = '%s-%s' % (path.basename(args.o), h) | ||
| 79 | - return path.join(CACHE_DIR, name) | ||
| 80 | - | ||
| 81 | -# Please remove after 3 months (2015-10-07). See LEGACY_CACHE_DIR above. | ||
| 82 | -def legacy_cache_entry(args): | ||
| 83 | - if args.v: | ||
| 84 | - h = args.v | ||
| 85 | - else: | ||
| 86 | - h = sha1(args.u.encode('utf-8')).hexdigest() | ||
| 87 | - name = '%s-%s' % (path.basename(args.o), h) | ||
| 88 | - return path.join(LEGACY_CACHE_DIR, name) | ||
| 89 | - | ||
| 90 | - | ||
| 91 | -opts = OptionParser() | ||
| 92 | -opts.add_option('-o', help='local output file') | ||
| 93 | -opts.add_option('-u', help='URL to download') | ||
| 94 | -opts.add_option('-v', help='expected content SHA-1') | ||
| 95 | -opts.add_option('-x', action='append', help='file to delete from ZIP') | ||
| 96 | -opts.add_option('--exclude_java_sources', action='store_true') | ||
| 97 | -opts.add_option('--unsign', action='store_true') | ||
| 98 | -args, _ = opts.parse_args() | ||
| 99 | - | ||
| 100 | -root_dir = args.o | ||
| 101 | -while root_dir: | ||
| 102 | - root_dir, n = path.split(root_dir) | ||
| 103 | - if n == 'buck-out': | ||
| 104 | - break | ||
| 105 | - | ||
| 106 | -redirects = download_properties(root_dir) | ||
| 107 | -cache_ent = cache_entry(args) | ||
| 108 | -legacy_cache_ent = legacy_cache_entry(args) | ||
| 109 | -src_url = resolve_url(args.u, redirects) | ||
| 110 | - | ||
| 111 | -# Please remove after 3 months (2015-10-07). See LEGACY_CACHE_DIR above. | ||
| 112 | -if not path.exists(cache_ent) and path.exists(legacy_cache_ent): | ||
| 113 | - try: | ||
| 114 | - safe_mkdirs(path.dirname(cache_ent)) | ||
| 115 | - except OSError as err: | ||
| 116 | - print('error creating directory %s: %s' % | ||
| 117 | - (path.dirname(cache_ent), err), file=stderr) | ||
| 118 | - exit(1) | ||
| 119 | - shutil.move(legacy_cache_ent, cache_ent) | ||
| 120 | - | ||
| 121 | -if not path.exists(cache_ent): | ||
| 122 | - try: | ||
| 123 | - safe_mkdirs(path.dirname(cache_ent)) | ||
| 124 | - except OSError as err: | ||
| 125 | - print('error creating directory %s: %s' % | ||
| 126 | - (path.dirname(cache_ent), err), file=stderr) | ||
| 127 | - exit(1) | ||
| 128 | - | ||
| 129 | - print('Download %s' % src_url, file=stderr) | ||
| 130 | - try: | ||
| 131 | - check_call(['curl', '--proxy-anyauth', '-ksfo', cache_ent, src_url]) | ||
| 132 | - except OSError as err: | ||
| 133 | - print('could not invoke curl: %s\nis curl installed?' % err, file=stderr) | ||
| 134 | - exit(1) | ||
| 135 | - except CalledProcessError as err: | ||
| 136 | - print('error using curl: %s' % err, file=stderr) | ||
| 137 | - exit(1) | ||
| 138 | - | ||
| 139 | -if args.v: | ||
| 140 | - have = hash_file(sha1(), cache_ent).hexdigest() | ||
| 141 | - if args.v != have: | ||
| 142 | - print(( | ||
| 143 | - '%s:\n' + | ||
| 144 | - 'expected %s\n' + | ||
| 145 | - 'received %s\n') % (src_url, args.v, have), file=stderr) | ||
| 146 | - try: | ||
| 147 | - remove(cache_ent) | ||
| 148 | - except OSError as err: | ||
| 149 | - if path.exists(cache_ent): | ||
| 150 | - print('error removing %s: %s' % (cache_ent, err), file=stderr) | ||
| 151 | - exit(1) | ||
| 152 | - | ||
| 153 | -exclude = [] | ||
| 154 | -if args.x: | ||
| 155 | - exclude += args.x | ||
| 156 | -if args.exclude_java_sources: | ||
| 157 | - try: | ||
| 158 | - with ZipFile(cache_ent, 'r') as zf: | ||
| 159 | - for n in zf.namelist(): | ||
| 160 | - if n.endswith('.java'): | ||
| 161 | - exclude.append(n) | ||
| 162 | - except (BadZipfile, LargeZipFile) as err: | ||
| 163 | - print('error opening %s: %s' % (cache_ent, err), file=stderr) | ||
| 164 | - exit(1) | ||
| 165 | - | ||
| 166 | -if args.unsign: | ||
| 167 | - try: | ||
| 168 | - with ZipFile(cache_ent, 'r') as zf: | ||
| 169 | - for n in zf.namelist(): | ||
| 170 | - if (n.endswith('.RSA') | ||
| 171 | - or n.endswith('.SF') | ||
| 172 | - or n.endswith('.LIST')): | ||
| 173 | - exclude.append(n) | ||
| 174 | - except (BadZipfile, LargeZipFile) as err: | ||
| 175 | - print('error opening %s: %s' % (cache_ent, err), file=stderr) | ||
| 176 | - exit(1) | ||
| 177 | - | ||
| 178 | -safe_mkdirs(path.dirname(args.o)) | ||
| 179 | -if exclude: | ||
| 180 | - try: | ||
| 181 | - shutil.copyfile(cache_ent, args.o) | ||
| 182 | - except (shutil.Error, IOError) as err: | ||
| 183 | - print('error copying to %s: %s' % (args.o, err), file=stderr) | ||
| 184 | - exit(1) | ||
| 185 | - try: | ||
| 186 | - check_call(['zip', '-d', args.o] + exclude) | ||
| 187 | - except CalledProcessError as err: | ||
| 188 | - print('error removing files from zip: %s' % err, file=stderr) | ||
| 189 | - exit(1) | ||
| 190 | -else: | ||
| 191 | - try: | ||
| 192 | - link(cache_ent, args.o) | ||
| 193 | - except OSError as err: | ||
| 194 | - try: | ||
| 195 | - shutil.copyfile(cache_ent, args.o) | ||
| 196 | - except (shutil.Error, IOError) as err: | ||
| 197 | - print('error copying to %s: %s' % (args.o, err), file=stderr) | ||
| 198 | - exit(1) |
buck-tools/java_doc.defs
deleted
100644 → 0
| 1 | -def java_doc( | ||
| 2 | - name, | ||
| 3 | - title, | ||
| 4 | - pkgs, | ||
| 5 | - paths, | ||
| 6 | - srcs = [], | ||
| 7 | - deps = [], | ||
| 8 | - visibility = [], | ||
| 9 | - do_it_wrong = False, | ||
| 10 | - ): | ||
| 11 | - if do_it_wrong: | ||
| 12 | - sourcepath = paths | ||
| 13 | - else: | ||
| 14 | - sourcepath = ['$SRCDIR/' + n for n in paths] | ||
| 15 | - genrule( | ||
| 16 | - name = name, | ||
| 17 | - cmd = ' '.join([ | ||
| 18 | - 'while ! test -f .buckconfig; do cd ..; done;', | ||
| 19 | - 'javadoc', | ||
| 20 | - '-quiet', | ||
| 21 | - '-protected', | ||
| 22 | - '-encoding UTF-8', | ||
| 23 | - '-charset UTF-8', | ||
| 24 | - '-notimestamp', | ||
| 25 | - '-windowtitle "' + title + '"', | ||
| 26 | - '-link http://docs.oracle.com/javase/7/docs/api', | ||
| 27 | - '-subpackages ', | ||
| 28 | - ':'.join(pkgs), | ||
| 29 | - '-sourcepath ', | ||
| 30 | - ':'.join(sourcepath), | ||
| 31 | - ' -classpath ', | ||
| 32 | - ':'.join(['$(classpath %s)' % n for n in deps]), | ||
| 33 | - '-d $TMP', | ||
| 34 | - ]) + ';jar cf $OUT -C $TMP .', | ||
| 35 | - srcs = srcs, | ||
| 36 | - out = name + '.jar', | ||
| 37 | - visibility = visibility, | ||
| 38 | -) |
buck-tools/pack_war.py
deleted
100755 → 0
| 1 | -#!/usr/bin/env python | ||
| 2 | -# Copyright (C) 2013 The Android Open Source Project | ||
| 3 | -# | ||
| 4 | -# Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | -# you may not use this file except in compliance with the License. | ||
| 6 | -# You may obtain a copy of the License at | ||
| 7 | -# | ||
| 8 | -# http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | -# | ||
| 10 | -# Unless required by applicable law or agreed to in writing, software | ||
| 11 | -# distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | -# See the License for the specific language governing permissions and | ||
| 14 | -# limitations under the License. | ||
| 15 | - | ||
| 16 | -from __future__ import print_function | ||
| 17 | -from optparse import OptionParser | ||
| 18 | -from os import makedirs, path, symlink | ||
| 19 | -from subprocess import check_call | ||
| 20 | -import sys | ||
| 21 | - | ||
| 22 | -opts = OptionParser() | ||
| 23 | -opts.add_option('-o', help='path to write WAR to') | ||
| 24 | -opts.add_option('--lib', action='append', help='target for WEB-INF/lib') | ||
| 25 | -opts.add_option('--pgmlib', action='append', help='target for WEB-INF/pgm-lib') | ||
| 26 | -opts.add_option('--tmp', help='temporary directory') | ||
| 27 | -args, ctx = opts.parse_args() | ||
| 28 | - | ||
| 29 | -war = args.tmp | ||
| 30 | -jars = set() | ||
| 31 | -basenames = set() | ||
| 32 | - | ||
| 33 | -def prune(l): | ||
| 34 | - return [j for e in l for j in e.split(':')] | ||
| 35 | - | ||
| 36 | -def link_jars(libs, directory): | ||
| 37 | - makedirs(directory) | ||
| 38 | - for j in libs: | ||
| 39 | - if j not in jars: | ||
| 40 | - # When jgit is consumed from its own cell, | ||
| 41 | - # potential duplicates should be filtered. | ||
| 42 | - # e.g. jsch.jar will be reached through: | ||
| 43 | - # 1. /home/username/projects/gerrit/buck-out/gen/lib/jsch.jar | ||
| 44 | - # 2. /home/username/projects/jgit/buck-out/gen/lib/jsch.jar | ||
| 45 | - if (j.find('jgit/buck-out/gen/lib') > 0 | ||
| 46 | - and path.basename(j) in basenames): | ||
| 47 | - continue | ||
| 48 | - jars.add(j) | ||
| 49 | - n = path.basename(j) | ||
| 50 | - if j.find('buck-out/gen/gerrit-') > 0: | ||
| 51 | - n = j[j.find('buck-out'):].split('/')[2] + '-' + n | ||
| 52 | - basenames.add(n) | ||
| 53 | - symlink(j, path.join(directory, n)) | ||
| 54 | - | ||
| 55 | -if args.lib: | ||
| 56 | - link_jars(prune(args.lib), path.join(war, 'WEB-INF', 'lib')) | ||
| 57 | -if args.pgmlib: | ||
| 58 | - link_jars(prune(args.pgmlib), path.join(war, 'WEB-INF', 'pgm-lib')) | ||
| 59 | -try: | ||
| 60 | - for s in ctx: | ||
| 61 | - check_call(['unzip', '-q', '-d', war, s]) | ||
| 62 | - check_call(['zip', '-9qr', args.o, '.'], cwd=war) | ||
| 63 | -except KeyboardInterrupt: | ||
| 64 | - print('Interrupted by user', file=sys.stderr) | ||
| 65 | - exit(1) |
buck-tools/util.py
deleted
100644 → 0
| 1 | -# Copyright (C) 2013 The Android Open Source Project | ||
| 2 | -# | ||
| 3 | -# Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 4 | -# you may not use this file except in compliance with the License. | ||
| 5 | -# You may obtain a copy of the License at | ||
| 6 | -# | ||
| 7 | -# http://www.apache.org/licenses/LICENSE-2.0 | ||
| 8 | -# | ||
| 9 | -# Unless required by applicable law or agreed to in writing, software | ||
| 10 | -# distributed under the License is distributed on an "AS IS" BASIS, | ||
| 11 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 12 | -# See the License for the specific language governing permissions and | ||
| 13 | -# limitations under the License. | ||
| 14 | - | ||
| 15 | -import os | ||
| 16 | -from os import path | ||
| 17 | - | ||
| 18 | -REPO_ROOTS = { | ||
| 19 | - 'GERRIT': 'http://gerrit-maven.storage.googleapis.com', | ||
| 20 | - 'GERRIT_API': 'https://gerrit-api.commondatastorage.googleapis.com/release', | ||
| 21 | - 'MAVEN_CENTRAL': 'http://repo1.maven.org/maven2', | ||
| 22 | - 'MAVEN_LOCAL': 'file://' + path.expanduser('~/.m2/repository'), | ||
| 23 | -} | ||
| 24 | - | ||
| 25 | - | ||
| 26 | -def resolve_url(url, redirects): | ||
| 27 | - """ Resolve URL of a Maven artifact. | ||
| 28 | - | ||
| 29 | - prefix:path is passed as URL. prefix identifies known or custom | ||
| 30 | - repositories that can be rewritten in redirects set, passed as | ||
| 31 | - second arguments. | ||
| 32 | - | ||
| 33 | - A special case is supported, when prefix neither exists in | ||
| 34 | - REPO_ROOTS, no in redirects set: the url is returned as is. | ||
| 35 | - This enables plugins to pass custom maven_repository URL as is | ||
| 36 | - directly to maven_jar(). | ||
| 37 | - | ||
| 38 | - Returns a resolved path for Maven artifact. | ||
| 39 | - """ | ||
| 40 | - s = url.find(':') | ||
| 41 | - if s < 0: | ||
| 42 | - return url | ||
| 43 | - scheme, rest = url[:s], url[s+1:] | ||
| 44 | - if scheme in redirects: | ||
| 45 | - root = redirects[scheme] | ||
| 46 | - elif scheme in REPO_ROOTS: | ||
| 47 | - root = REPO_ROOTS[scheme] | ||
| 48 | - else: | ||
| 49 | - return url | ||
| 50 | - root = root.rstrip('/') | ||
| 51 | - rest = rest.lstrip('/') | ||
| 52 | - return '/'.join([root, rest]) | ||
| 53 | - | ||
| 54 | - | ||
| 55 | -def hash_file(hash_obj, path): | ||
| 56 | - """Hash the contents of a file. | ||
| 57 | - | ||
| 58 | - Args: | ||
| 59 | - hash_obj: an open hash object, e.g. hashlib.sha1(). | ||
| 60 | - path: path to the file to hash. | ||
| 61 | - | ||
| 62 | - Returns: | ||
| 63 | - The passed-in hash_obj. | ||
| 64 | - """ | ||
| 65 | - with open(path, 'rb') as f: | ||
| 66 | - while True: | ||
| 67 | - b = f.read(8192) | ||
| 68 | - if not b: | ||
| 69 | - break | ||
| 70 | - hash_obj.update(b) | ||
| 71 | - return hash_obj | ||
| 72 | - | ||
| 73 | - | ||
| 74 | -def hash_bower_component(hash_obj, path): | ||
| 75 | - """Hash the contents of a bower component directory. | ||
| 76 | - | ||
| 77 | - This is a stable hash of a directory downloaded with `bower install`, minus | ||
| 78 | - the .bower.json file, which is autogenerated each time by bower. Used in lieu | ||
| 79 | - of hashing a zipfile of the contents, since zipfiles are difficult to hash in | ||
| 80 | - a stable manner. | ||
| 81 | - | ||
| 82 | - Args: | ||
| 83 | - hash_obj: an open hash object, e.g. hashlib.sha1(). | ||
| 84 | - path: path to the directory to hash. | ||
| 85 | - | ||
| 86 | - Returns: | ||
| 87 | - The passed-in hash_obj. | ||
| 88 | - """ | ||
| 89 | - if not os.path.isdir(path): | ||
| 90 | - raise ValueError('Not a directory: %s' % path) | ||
| 91 | - | ||
| 92 | - path = os.path.abspath(path) | ||
| 93 | - for root, dirs, files in os.walk(path): | ||
| 94 | - dirs.sort() | ||
| 95 | - for f in sorted(files): | ||
| 96 | - if f == '.bower.json': | ||
| 97 | - continue | ||
| 98 | - p = os.path.join(root, f) | ||
| 99 | - hash_obj.update(p[len(path)+1:]) | ||
| 100 | - hash_file(hash_obj, p) | ||
| 101 | - | ||
| 102 | - return hash_obj |
-
Please register or login to post a comment