buildr 1.2.10 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. data/CHANGELOG +566 -268
  2. data/DISCLAIMER +7 -1
  3. data/KEYS +151 -0
  4. data/NOTICE +23 -8
  5. data/README +122 -22
  6. data/Rakefile +49 -229
  7. data/{lib → addon}/buildr/antlr.rb +23 -10
  8. data/addon/buildr/cobertura.rb +232 -0
  9. data/{lib → addon}/buildr/hibernate.rb +20 -4
  10. data/{lib → addon}/buildr/javacc.rb +27 -12
  11. data/addon/buildr/jdepend.rb +60 -0
  12. data/{lib → addon}/buildr/jetty.rb +34 -18
  13. data/addon/buildr/nailgun.rb +892 -0
  14. data/{lib → addon}/buildr/openjpa.rb +23 -6
  15. data/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
  16. data/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
  17. data/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
  18. data/{lib/buildr/jetty → addon/buildr/org/apache/buildr}/JettyWrapper.java +19 -0
  19. data/{lib → addon}/buildr/xmlbeans.rb +39 -14
  20. data/bin/buildr +21 -7
  21. data/buildr.gemspec +50 -0
  22. data/doc/css/default.css +225 -0
  23. data/doc/css/print.css +95 -0
  24. data/doc/css/syntax.css +43 -0
  25. data/doc/images/apache-incubator-logo.png +0 -0
  26. data/doc/images/buildr-hires.png +0 -0
  27. data/doc/images/buildr.png +0 -0
  28. data/doc/images/note.png +0 -0
  29. data/doc/images/tip.png +0 -0
  30. data/doc/images/zbuildr.tif +0 -0
  31. data/doc/pages/artifacts.textile +317 -0
  32. data/doc/pages/building.textile +501 -0
  33. data/doc/pages/contributing.textile +178 -0
  34. data/doc/pages/download.textile +25 -0
  35. data/doc/pages/extending.textile +229 -0
  36. data/doc/pages/getting_started.textile +337 -0
  37. data/doc/pages/index.textile +63 -0
  38. data/doc/pages/mailing_lists.textile +17 -0
  39. data/doc/pages/more_stuff.textile +367 -0
  40. data/doc/pages/packaging.textile +592 -0
  41. data/doc/pages/projects.textile +449 -0
  42. data/doc/pages/recipes.textile +127 -0
  43. data/doc/pages/settings_profiles.textile +339 -0
  44. data/doc/pages/testing.textile +475 -0
  45. data/doc/pages/troubleshooting.textile +121 -0
  46. data/doc/pages/whats_new.textile +389 -0
  47. data/doc/print.haml +52 -0
  48. data/doc/print.toc.yaml +28 -0
  49. data/doc/scripts/buildr-git.rb +411 -0
  50. data/doc/scripts/install-jruby.sh +44 -0
  51. data/doc/scripts/install-linux.sh +64 -0
  52. data/doc/scripts/install-osx.sh +52 -0
  53. data/doc/site.haml +55 -0
  54. data/doc/site.toc.yaml +44 -0
  55. data/lib/buildr.rb +28 -45
  56. data/lib/buildr/core.rb +27 -0
  57. data/lib/buildr/core/application.rb +373 -0
  58. data/lib/buildr/core/application_cli.rb +134 -0
  59. data/lib/{core → buildr/core}/build.rb +91 -77
  60. data/lib/{core → buildr/core}/checks.rb +116 -95
  61. data/lib/buildr/core/common.rb +155 -0
  62. data/lib/buildr/core/compile.rb +594 -0
  63. data/lib/buildr/core/environment.rb +120 -0
  64. data/lib/buildr/core/filter.rb +258 -0
  65. data/lib/{core → buildr/core}/generate.rb +22 -5
  66. data/lib/buildr/core/help.rb +118 -0
  67. data/lib/buildr/core/progressbar.rb +156 -0
  68. data/lib/{core → buildr/core}/project.rb +468 -213
  69. data/lib/buildr/core/test.rb +690 -0
  70. data/lib/{core → buildr/core}/transports.rb +107 -127
  71. data/lib/buildr/core/util.rb +235 -0
  72. data/lib/buildr/ide.rb +19 -0
  73. data/lib/{java → buildr/ide}/eclipse.rb +86 -60
  74. data/lib/{java → buildr/ide}/idea.ipr.template +16 -0
  75. data/lib/buildr/ide/idea.rb +194 -0
  76. data/lib/buildr/ide/idea7x.ipr.template +290 -0
  77. data/lib/buildr/ide/idea7x.rb +210 -0
  78. data/lib/buildr/java.rb +26 -0
  79. data/lib/buildr/java/ant.rb +71 -0
  80. data/lib/buildr/java/bdd_frameworks.rb +267 -0
  81. data/lib/buildr/java/commands.rb +210 -0
  82. data/lib/buildr/java/compilers.rb +432 -0
  83. data/lib/buildr/java/deprecated.rb +141 -0
  84. data/lib/buildr/java/groovyc.rb +137 -0
  85. data/lib/buildr/java/jruby.rb +99 -0
  86. data/lib/buildr/java/org/apache/buildr/BuildrNail$Main.class +0 -0
  87. data/lib/buildr/java/org/apache/buildr/BuildrNail.class +0 -0
  88. data/lib/buildr/java/org/apache/buildr/BuildrNail.java +41 -0
  89. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
  90. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +116 -0
  91. data/lib/buildr/java/packaging.rb +706 -0
  92. data/lib/{java → buildr/java}/pom.rb +20 -4
  93. data/lib/buildr/java/rjb.rb +142 -0
  94. data/lib/buildr/java/test_frameworks.rb +290 -0
  95. data/lib/buildr/java/version_requirement.rb +172 -0
  96. data/lib/buildr/packaging.rb +21 -0
  97. data/lib/{java → buildr/packaging}/artifact.rb +170 -179
  98. data/lib/buildr/packaging/artifact_namespace.rb +957 -0
  99. data/lib/buildr/packaging/artifact_search.rb +140 -0
  100. data/lib/buildr/packaging/gems.rb +102 -0
  101. data/lib/buildr/packaging/package.rb +233 -0
  102. data/lib/{tasks → buildr/packaging}/tar.rb +18 -1
  103. data/lib/{tasks → buildr/packaging}/zip.rb +153 -105
  104. data/rakelib/apache.rake +126 -0
  105. data/rakelib/changelog.rake +56 -0
  106. data/rakelib/doc.rake +103 -0
  107. data/rakelib/package.rake +44 -0
  108. data/rakelib/release.rake +53 -0
  109. data/rakelib/rspec.rake +81 -0
  110. data/rakelib/rubyforge.rake +45 -0
  111. data/rakelib/scm.rake +49 -0
  112. data/rakelib/setup.rake +59 -0
  113. data/rakelib/stage.rake +45 -0
  114. data/spec/application_spec.rb +316 -0
  115. data/spec/archive_spec.rb +494 -0
  116. data/spec/artifact_namespace_spec.rb +635 -0
  117. data/spec/artifact_spec.rb +738 -0
  118. data/spec/build_spec.rb +193 -0
  119. data/spec/checks_spec.rb +537 -0
  120. data/spec/common_spec.rb +579 -0
  121. data/spec/compile_spec.rb +561 -0
  122. data/spec/groovy_compilers_spec.rb +239 -0
  123. data/spec/java_bdd_frameworks_spec.rb +238 -0
  124. data/spec/java_compilers_spec.rb +446 -0
  125. data/spec/java_packaging_spec.rb +1042 -0
  126. data/spec/java_test_frameworks_spec.rb +414 -0
  127. data/spec/packaging_helper.rb +63 -0
  128. data/spec/packaging_spec.rb +589 -0
  129. data/spec/project_spec.rb +739 -0
  130. data/spec/sandbox.rb +116 -0
  131. data/spec/scala_compilers_spec.rb +239 -0
  132. data/spec/spec.opts +6 -0
  133. data/spec/spec_helpers.rb +283 -0
  134. data/spec/test_spec.rb +871 -0
  135. data/spec/transport_spec.rb +300 -0
  136. data/spec/version_requirement_spec.rb +115 -0
  137. metadata +188 -77
  138. data/lib/buildr/cobertura.rb +0 -89
  139. data/lib/buildr/jdepend.rb +0 -40
  140. data/lib/buildr/jetty/JettyWrapper$1.class +0 -0
  141. data/lib/buildr/jetty/JettyWrapper$BuildrHandler.class +0 -0
  142. data/lib/buildr/jetty/JettyWrapper.class +0 -0
  143. data/lib/buildr/scala.rb +0 -368
  144. data/lib/core/application.rb +0 -188
  145. data/lib/core/common.rb +0 -562
  146. data/lib/core/help.rb +0 -72
  147. data/lib/core/rake_ext.rb +0 -81
  148. data/lib/java/ant.rb +0 -71
  149. data/lib/java/compile.rb +0 -589
  150. data/lib/java/idea.rb +0 -159
  151. data/lib/java/java.rb +0 -432
  152. data/lib/java/packaging.rb +0 -581
  153. data/lib/java/test.rb +0 -795
  154. data/lib/tasks/concat.rb +0 -35
@@ -0,0 +1,290 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Licensed to the Apache Software Foundation (ASF) under one or more
4
+ contributor license agreements. See the NOTICE file distributed with this
5
+ work for additional information regarding copyright ownership. The ASF
6
+ licenses this file to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance with the License.
8
+ You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ License for the specific language governing permissions and limitations under
16
+ the License.
17
+ -->
18
+ <project relativePaths="false" version="4">
19
+ <component name="BuildJarProjectSettings">
20
+ <option name="BUILD_JARS_ON_MAKE" value="false"/>
21
+ </component>
22
+ <component name="CodeStyleProjectProfileManger">
23
+ <option name="PROJECT_PROFILE"/>
24
+ <option name="USE_PROJECT_LEVEL_SETTINGS" value="false"/>
25
+ </component>
26
+ <component name="CodeStyleSettingsManager">
27
+ <option name="PER_PROJECT_SETTINGS"/>
28
+ <option name="USE_PER_PROJECT_SETTINGS" value="false"/>
29
+ </component>
30
+ <component name="CompilerConfiguration">
31
+ <option name="DEFAULT_COMPILER" value="Javac"/>
32
+ <option name="DEPLOY_AFTER_MAKE" value="0"/>
33
+ <resourceExtensions>
34
+ <entry name=".+\.(properties|xml|html|dtd|tld)"/>
35
+ <entry name=".+\.(gif|png|jpeg|jpg)"/>
36
+ </resourceExtensions>
37
+ <wildcardResourcePatterns>
38
+ <entry name="?*.properties"/>
39
+ <entry name="?*.xml"/>
40
+ <entry name="?*.gif"/>
41
+ <entry name="?*.png"/>
42
+ <entry name="?*.jpeg"/>
43
+ <entry name="?*.jpg"/>
44
+ <entry name="?*.html"/>
45
+ <entry name="?*.dtd"/>
46
+ <entry name="?*.tld"/>
47
+ </wildcardResourcePatterns>
48
+ </component>
49
+ <component name="DependenciesAnalyzeManager">
50
+ <option name="myForwardDirection" value="false"/>
51
+ </component>
52
+ <component name="DependencyValidationManager">
53
+ <option name="SKIP_IMPORT_STATEMENTS" value="false"/>
54
+ </component>
55
+ <component name="EclipseCompilerSettings">
56
+ <option name="DEBUGGING_INFO" value="true"/>
57
+ <option name="GENERATE_NO_WARNINGS" value="true"/>
58
+ <option name="DEPRECATION" value="false"/>
59
+ <option name="ADDITIONAL_OPTIONS_STRING" value=""/>
60
+ <option name="MAXIMUM_HEAP_SIZE" value="128"/>
61
+ </component>
62
+ <component name="EclipseEmbeddedCompilerSettings">
63
+ <option name="DEBUGGING_INFO" value="true"/>
64
+ <option name="GENERATE_NO_WARNINGS" value="true"/>
65
+ <option name="DEPRECATION" value="false"/>
66
+ <option name="ADDITIONAL_OPTIONS_STRING" value=""/>
67
+ <option name="MAXIMUM_HEAP_SIZE" value="128"/>
68
+ </component>
69
+ <component name="EntryPointsManager">
70
+ <entry_points version="2.0"/>
71
+ </component>
72
+ <component name="IdProvider" IDEtalkID="8CD0EDF2C11753573BC22F6C470A1027"/>
73
+ <component name="InspectionProjectProfileManager">
74
+ <option name="PROJECT_PROFILE" value="Project Default"/>
75
+ <option name="USE_PROJECT_LEVEL_SETTINGS" value="false"/>
76
+ <scopes/>
77
+ <profiles>
78
+ <profile version="1.0" is_locked="false">
79
+ <option name="myName" value="Project Default"/>
80
+ <option name="myLocal" value="false"/>
81
+ </profile>
82
+ </profiles>
83
+ <list size="0"/>
84
+ </component>
85
+ <component name="JavacSettings">
86
+ <option name="DEBUGGING_INFO" value="true"/>
87
+ <option name="GENERATE_NO_WARNINGS" value="false"/>
88
+ <option name="DEPRECATION" value="true"/>
89
+ <option name="ADDITIONAL_OPTIONS_STRING" value=""/>
90
+ <option name="MAXIMUM_HEAP_SIZE" value="128"/>
91
+ </component>
92
+ <component name="JavadocGenerationManager">
93
+ <option name="OUTPUT_DIRECTORY"/>
94
+ <option name="OPTION_SCOPE" value="protected"/>
95
+ <option name="OPTION_HIERARCHY" value="true"/>
96
+ <option name="OPTION_NAVIGATOR" value="true"/>
97
+ <option name="OPTION_INDEX" value="true"/>
98
+ <option name="OPTION_SEPARATE_INDEX" value="true"/>
99
+ <option name="OPTION_DOCUMENT_TAG_USE" value="false"/>
100
+ <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false"/>
101
+ <option name="OPTION_DOCUMENT_TAG_VERSION" value="false"/>
102
+ <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true"/>
103
+ <option name="OPTION_DEPRECATED_LIST" value="true"/>
104
+ <option name="OTHER_OPTIONS" value=""/>
105
+ <option name="HEAP_SIZE"/>
106
+ <option name="LOCALE"/>
107
+ <option name="OPEN_IN_BROWSER" value="true"/>
108
+ </component>
109
+ <component name="JikesSettings">
110
+ <option name="JIKES_PATH" value=""/>
111
+ <option name="DEBUGGING_INFO" value="true"/>
112
+ <option name="DEPRECATION" value="true"/>
113
+ <option name="GENERATE_NO_WARNINGS" value="false"/>
114
+ <option name="IS_EMACS_ERRORS_MODE" value="true"/>
115
+ <option name="ADDITIONAL_OPTIONS_STRING" value=""/>
116
+ </component>
117
+ <component name="Palette2">
118
+ <group name="Swing">
119
+ <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer"
120
+ icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false"
121
+ can-attach-label="false">
122
+ <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1"/>
123
+ </item>
124
+ <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer"
125
+ icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false"
126
+ can-attach-label="false">
127
+ <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2"/>
128
+ </item>
129
+ <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false"
130
+ auto-create-binding="false" can-attach-label="false">
131
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"/>
132
+ </item>
133
+ <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false"
134
+ auto-create-binding="false" can-attach-label="true">
135
+ <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3"/>
136
+ </item>
137
+ <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false"
138
+ auto-create-binding="true" can-attach-label="false">
139
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1"/>
140
+ <initial-values>
141
+ <property name="text" value="Button"/>
142
+ </initial-values>
143
+ </item>
144
+ <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false"
145
+ auto-create-binding="true" can-attach-label="false">
146
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0"/>
147
+ <initial-values>
148
+ <property name="text" value="RadioButton"/>
149
+ </initial-values>
150
+ </item>
151
+ <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false"
152
+ auto-create-binding="true" can-attach-label="false">
153
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0"/>
154
+ <initial-values>
155
+ <property name="text" value="CheckBox"/>
156
+ </initial-values>
157
+ </item>
158
+ <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false"
159
+ auto-create-binding="false" can-attach-label="false">
160
+ <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0"/>
161
+ <initial-values>
162
+ <property name="text" value="Label"/>
163
+ </initial-values>
164
+ </item>
165
+ <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false"
166
+ auto-create-binding="true" can-attach-label="true">
167
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
168
+ <preferred-size width="150" height="-1"/>
169
+ </default-constraints>
170
+ </item>
171
+ <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false"
172
+ auto-create-binding="true" can-attach-label="true">
173
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
174
+ <preferred-size width="150" height="-1"/>
175
+ </default-constraints>
176
+ </item>
177
+ <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png"
178
+ removable="false" auto-create-binding="true" can-attach-label="true">
179
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
180
+ <preferred-size width="150" height="-1"/>
181
+ </default-constraints>
182
+ </item>
183
+ <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false"
184
+ auto-create-binding="true" can-attach-label="true">
185
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
186
+ <preferred-size width="150" height="50"/>
187
+ </default-constraints>
188
+ </item>
189
+ <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false"
190
+ auto-create-binding="true" can-attach-label="true">
191
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
192
+ <preferred-size width="150" height="50"/>
193
+ </default-constraints>
194
+ </item>
195
+ <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false"
196
+ auto-create-binding="true" can-attach-label="true">
197
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
198
+ <preferred-size width="150" height="50"/>
199
+ </default-constraints>
200
+ </item>
201
+ <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false"
202
+ auto-create-binding="true" can-attach-label="true">
203
+ <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1"/>
204
+ </item>
205
+ <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false"
206
+ auto-create-binding="true" can-attach-label="false">
207
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
208
+ <preferred-size width="150" height="50"/>
209
+ </default-constraints>
210
+ </item>
211
+ <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false"
212
+ auto-create-binding="true" can-attach-label="false">
213
+ <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
214
+ <preferred-size width="150" height="50"/>
215
+ </default-constraints>
216
+ </item>
217
+ <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false"
218
+ auto-create-binding="true" can-attach-label="false">
219
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
220
+ <preferred-size width="150" height="50"/>
221
+ </default-constraints>
222
+ </item>
223
+ <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false"
224
+ auto-create-binding="true" can-attach-label="false">
225
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
226
+ <preferred-size width="200" height="200"/>
227
+ </default-constraints>
228
+ </item>
229
+ <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false"
230
+ auto-create-binding="false" can-attach-label="false">
231
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
232
+ <preferred-size width="200" height="200"/>
233
+ </default-constraints>
234
+ </item>
235
+ <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false"
236
+ auto-create-binding="true" can-attach-label="true">
237
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"/>
238
+ </item>
239
+ <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false"
240
+ auto-create-binding="true" can-attach-label="false">
241
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"/>
242
+ </item>
243
+ <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false"
244
+ auto-create-binding="false" can-attach-label="false">
245
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"/>
246
+ </item>
247
+ <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false"
248
+ auto-create-binding="true" can-attach-label="false">
249
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"/>
250
+ </item>
251
+ <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false"
252
+ auto-create-binding="false" can-attach-label="false">
253
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
254
+ <preferred-size width="-1" height="20"/>
255
+ </default-constraints>
256
+ </item>
257
+ <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png"
258
+ removable="false" auto-create-binding="false" can-attach-label="false">
259
+ <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1"/>
260
+ </item>
261
+ <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false"
262
+ auto-create-binding="true" can-attach-label="false">
263
+ <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2"/>
264
+ </item>
265
+ </group>
266
+ </component>
267
+ <component name="ProjectFileVersion" converted="true"/>
268
+ <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="true" project-jdk-name="1.5"
269
+ project-jdk-type="JavaSDK">
270
+ <output url="file://$PROJECT_DIR$/out"/>
271
+ </component>
272
+ <component name="ResourceManagerContainer">
273
+ <option name="myResourceBundles">
274
+ <value>
275
+ <list size="0"/>
276
+ </value>
277
+ </option>
278
+ </component>
279
+ <component name="RmicSettings">
280
+ <option name="IS_EANABLED" value="false"/>
281
+ <option name="DEBUGGING_INFO" value="true"/>
282
+ <option name="GENERATE_NO_WARNINGS" value="false"/>
283
+ <option name="GENERATE_IIOP_STUBS" value="false"/>
284
+ <option name="ADDITIONAL_OPTIONS_STRING" value=""/>
285
+ </component>
286
+ <component name="VcsDirectoryMappings">
287
+ <mapping directory="" vcs=""/>
288
+ </component>
289
+ <component name="WebServicesPlugin" addRequiredLibraries="true"/>
290
+ </project>
@@ -0,0 +1,210 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); 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, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+
17
+ require 'buildr/core/project'
18
+ require 'buildr/packaging'
19
+ require 'stringio'
20
+ require 'rexml/document'
21
+
22
+ module Buildr
23
+ module Idea7x #:nodoc:
24
+
25
+ include Extension
26
+
27
+ CLASSIFIER = "-7x"
28
+ IML_SUFFIX = CLASSIFIER + ".iml"
29
+ IPR_TEMPLATE = "idea7x.ipr.template"
30
+ MODULE_DIR = "$MODULE_DIR$"
31
+ FILE_PATH_PREFIX = "file://"
32
+ MODULE_DIR_URL = FILE_PATH_PREFIX + MODULE_DIR
33
+ PROJECT_DIR = "$PROJECT_DIR$"
34
+ PROJECT_DIR_URL = FILE_PATH_PREFIX + PROJECT_DIR
35
+
36
+ first_time do
37
+ # Global task "idea" generates artifacts for all projects.
38
+ desc "Generate Idea 7.x artifacts for all projects"
39
+ Project.local_task "idea7x"=>"artifacts"
40
+ end
41
+
42
+ before_define do |project|
43
+ project.recursive_task("idea7x")
44
+ end
45
+
46
+ after_define do |project|
47
+ idea7x = project.task("idea7x")
48
+
49
+ # We need paths relative to the top project's base directory.
50
+ root_path = lambda { |p| f = lambda { |p| p.parent ? f[p.parent] : p.base_dir }; f[p] }[project]
51
+
52
+ sources = Buildr.application.build_files.map { |file| File.expand_path(file) }.select { |file| File.exist?(file) }
53
+ sources << File.expand_path(Buildr.application.buildfile, root_path) if Buildr.application.buildfile
54
+
55
+ # Find a path relative to the project's root directory.
56
+ relative = lambda { |path| Util.relative_path(File.expand_path(path.to_s), project.path_to) }
57
+
58
+ m2repo = Buildr::Repositories.instance.local
59
+ excludes = [ '**/.svn/', '**/CVS/' ].join('|')
60
+
61
+ # Only for projects that are packageable.
62
+ task_name = project.path_to("#{project.name.gsub(':', '-')}#{IML_SUFFIX}")
63
+ idea7x.enhance [ file(task_name) ]
64
+
65
+ # The only thing we need to look for is a change in the Buildfile.
66
+ file(task_name=>sources) do |task|
67
+ # Note: Use the test classpath since Eclipse compiles both "main" and "test" classes using the same classpath
68
+ deps = project.test.compile.dependencies.map(&:to_s) - [ project.compile.target.to_s ]
69
+
70
+ # Convert classpath elements into applicable Project objects
71
+ deps.collect! { |path| Buildr.projects.detect { |prj| prj.packages.detect { |pkg| pkg.to_s == path } } || path }
72
+
73
+ # project_libs: artifacts created by other projects
74
+ project_libs, others = deps.partition { |path| path.is_a?(Project) }
75
+
76
+ # Separate artifacts from Maven2 repository
77
+ m2_libs, others = others.partition { |path| path.to_s.index(m2repo) == 0 }
78
+
79
+ # Generated: classpath elements in the project are assumed to be generated
80
+ generated, libs = others.partition { |path| path.to_s.index(project.path_to.to_s) == 0 }
81
+
82
+ # Project type is going to be the first package type
83
+ if package = project.packages.first
84
+ puts "Writing #{task.name}" if verbose
85
+ File.open(task.name, "w") do |file|
86
+ xml = Builder::XmlMarkup.new(:target=>file, :indent=>2)
87
+ xml.module(:version=>"4", :relativePaths=>"true", :type=>"JAVA_MODULE") do
88
+ xml.component(:name=>"NewModuleRootManager", "inherit-compiler-output"=>"false") do
89
+
90
+ Buildr::Idea7x.generate_compile_output(project, xml, relative)
91
+
92
+ Buildr::Idea7x.generate_content(project, xml, generated, relative)
93
+
94
+ Buildr::Idea7x.generate_order_entries(project_libs, xml)
95
+
96
+ ext_libs = libs.map {|path| "#{MODULE_DIR}/#{path.to_s}" } + m2_libs.map { |path| path.to_s.sub(m2repo, "$M2_REPO$") }
97
+ Buildr::Idea7x.generate_module_libs(xml, ext_libs)
98
+
99
+ xml.orderEntryProperties
100
+ end
101
+ end
102
+ end
103
+ end
104
+ end
105
+
106
+ # Root project aggregates all the subprojects.
107
+ if project.parent == nil
108
+ Buildr::Idea7x.generate_ipr(project, idea7x, sources)
109
+ end
110
+
111
+ end # after_define
112
+
113
+ class << self
114
+
115
+ def generate_order_entries(project_libs, xml)
116
+ xml.orderEntry :type=>"sourceFolder", :forTests=>"false"
117
+ xml.orderEntry :type=>"inheritedJdk"
118
+
119
+ # Classpath elements from other projects
120
+ project_libs.map(&:id).sort.uniq.each do |project_id|
121
+ xml.orderEntry :type=>'module', "module-name"=>"#{project_id}#{CLASSIFIER}"
122
+ end
123
+ end
124
+
125
+ def generate_compile_output(project, xml, relative)
126
+ xml.output(:url=>"#{MODULE_DIR_URL}/#{relative[project.compile.target.to_s]}") if project.compile.target
127
+ xml.tag!("output-test", :url=>"#{MODULE_DIR_URL}/#{relative[project.test.compile.target.to_s]}") if project.test.compile.target
128
+ end
129
+
130
+ def generate_content(project, xml, generated, relative)
131
+ xml.content(:url=>"#{MODULE_DIR_URL}") do
132
+ unless project.compile.sources.empty?
133
+ srcs = project.compile.sources.map { |src| relative[src.to_s] } + generated.map { |src| relative[src.to_s] }
134
+ srcs.sort.uniq.each do |path|
135
+ xml.sourceFolder :url=>"#{MODULE_DIR_URL}/#{path}", :isTestSource=>"false"
136
+ end
137
+ end
138
+ unless project.test.compile.sources.empty?
139
+ test_sources = project.test.compile.sources.map { |src| relative[src.to_s] }
140
+ test_sources.each do |paths|
141
+ paths.sort.uniq.each do |path|
142
+ xml.sourceFolder :url=>"#{MODULE_DIR_URL}/#{path}", :isTestSource=>"true"
143
+ end
144
+ end
145
+ end
146
+ [project.resources=>false, project.test.resources=>true].each do |resources, test|
147
+ resources.each do |path|
148
+ path[0].sources.each do |srcpath|
149
+ xml.sourceFolder :url=>"#{FILE_PATH_PREFIX}#{srcpath}", :isTestSource=>path[1].to_s
150
+ end
151
+ end
152
+ end
153
+ xml.excludeFolder :url=>"#{MODULE_DIR_URL}/#{relative[project.compile.target.to_s]}" if project.compile.target
154
+ end
155
+ end
156
+
157
+ def generate_module_libs(xml, ext_libs)
158
+ ext_libs.each do |path|
159
+ xml.orderEntry :type=>"module-library" do
160
+ xml.library do
161
+ xml.CLASSES do
162
+ xml.root :url=>"jar://#{path}!/"
163
+ end
164
+ xml.JAVADOC
165
+ xml.SOURCES
166
+ end
167
+ end
168
+ end
169
+ end
170
+
171
+ def generate_ipr(project, idea7x, sources)
172
+ task_name = project.path_to("#{project.name.gsub(':', '-')}-7x.ipr")
173
+ idea7x.enhance [ file(task_name) ]
174
+ file(task_name=>sources) do |task|
175
+ puts "Writing #{task.name}" if verbose
176
+
177
+ # Generating just the little stanza that chanages from one project to another
178
+ partial = StringIO.new
179
+ xml = Builder::XmlMarkup.new(:target=>partial, :indent=>2)
180
+ xml.component(:name=>"ProjectModuleManager") do
181
+ xml.modules do
182
+ project.projects.each do |subp|
183
+ module_name = subp.name.gsub(":", "-")
184
+ module_path = subp.name.split(":"); module_path.shift
185
+ module_path = module_path.join(File::SEPARATOR)
186
+ path = "#{module_path}/#{module_name}#{IML_SUFFIX}"
187
+ xml.module :fileurl=>"#{PROJECT_DIR_URL}/#{path}", :filepath=>"#{PROJECT_DIR}/#{path}"
188
+ end
189
+ if package = project.packages.first
190
+ xml.module :fileurl=>"#{PROJECT_DIR_URL}/#{project.name}#{IML_SUFFIX}", :filepath=>"#{PROJECT_DIR}/#{project.name}#{IML_SUFFIX}"
191
+ end
192
+ end
193
+ end
194
+
195
+ # Loading the whole fairly constant crap
196
+ template_xml = REXML::Document.new(File.open(File.join(File.dirname(__FILE__), IPR_TEMPLATE)))
197
+ include_xml = REXML::Document.new(partial.string)
198
+ template_xml.root.add_element(include_xml.root)
199
+ template_xml.write(File.new(task.name, "w"))
200
+ end
201
+ end
202
+
203
+ end
204
+
205
+ end # module Idea7x
206
+ end # module Buildr
207
+
208
+ class Buildr::Project
209
+ include Buildr::Idea7x
210
+ end