buildr-iidea 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
data/NOTICE ADDED
@@ -0,0 +1,16 @@
1
+ = COPYRIGHT NOTICES
2
+
3
+ Copyright 2010 Peter Donald
4
+
5
+ Copyright 2010 Rhett Sutphin
6
+
7
+ Apache Buildr
8
+ Copyright 2007-2009 The Apache Software Foundation
9
+
10
+ This product includes software developed at
11
+ The Apache Software Foundation (http://www.apache.org/).
12
+
13
+ Copyright 2007 Intalio
14
+
15
+ This product includes software developed by Intalio
16
+ http://www.intalio.com
data/README.rdoc ADDED
@@ -0,0 +1,286 @@
1
+ = Intellij IDEA support for buildr
2
+
3
+ This extension provides tasks to generate Intellij IDEA project files by issuing:
4
+
5
+ $ buildr iidea:generate
6
+
7
+ This task will generate an .iml file for every project (or subproject) and a .ipr
8
+ that you can directly open for the root project.
9
+
10
+ The generated project files can be removed by issuing;
11
+
12
+ $ buildr iidea:clean
13
+
14
+ The iidea task generates the project files based on the settings of each project and
15
+ extension specific settings. The main and test source trees are added to the .iml
16
+ file for each project as are the respective resource directories. The target and report
17
+ directories are excluded from the project. If the project files exist on the filesystem
18
+ the extension will replace specific component sections in the xml with the generated
19
+ component configurations.
20
+
21
+ Dependencies come in two forms. Dependencies on other projects and dependencies on
22
+ external jars. Dependencies on other projects are added as module dependencies in the
23
+ .iml while jars are added as regular file dependencies. Dependencies are exported from
24
+ the .iml file if they are compile dependencies.
25
+
26
+ == Installation
27
+
28
+ The extension is packaged as a gem named "buildr-iidea", consult the ruby gems installation
29
+ steps but typically it is either
30
+
31
+ sudo gem install buildr-iidea
32
+
33
+ for MRI ruby or
34
+
35
+ jgem install buildr-iidea
36
+
37
+ for jruby.
38
+
39
+ The user then needs to add the following require into the build file:
40
+
41
+ require 'buildr_iidea'
42
+
43
+ == Idea Specific Directives
44
+
45
+ The extension specific settings of subprojects inherit the parent projects settings
46
+ unless overwritten.
47
+
48
+ === Project file naming
49
+
50
+ The extension will use the last element of the projects name when generating the .ipr
51
+ and .iml files. i.e. A project named "foo" will generate "foo.iml" and "foo.ipr" while
52
+ a project named "foo:bar" will generate "bar/bar.iml" and no ipr. (The .ipr project
53
+ files are only generated for base project). The name can be modified by setting the
54
+ "ipr.suffix" or "iml.suffix" settins which specifies the suffix appended to the
55
+ filenames. The user can also overide the name completely by setting "ipr.id" or "iml.id".
56
+
57
+ ==== Example: Setting id
58
+
59
+ define "foo" do
60
+ ipr.id = "beep"
61
+ define "bar" do
62
+ iml.id = "baz"
63
+ end
64
+ end
65
+
66
+ Will generate:
67
+
68
+ beep.ipr
69
+ foo.iml
70
+ bar/baz.iml
71
+
72
+ ==== Example: Setting suffix
73
+
74
+ define "foo" do
75
+ ipr.suffix = "-suffix1"
76
+ iml.suffix = "-suffix2"
77
+ define "bar"
78
+ end
79
+
80
+ Will generate:
81
+
82
+ foo-suffix1.ipr
83
+ foo-suffix2.iml
84
+ bar/bar-suffix2.iml
85
+
86
+ === VCS Integration
87
+
88
+ The extension will attempt to guess the VCS type of the project by looking for a .svn
89
+ or .git directory in the base projects directory. If either of these are set it will
90
+ configure the component as appropriate. Otherwise the user will need to manually specify
91
+ the project to one of either 'Git' or 'svn' using the ipr.vcs setting.
92
+
93
+ ==== Example
94
+
95
+ define "foo" do
96
+ ipr.vcs = 'Git'
97
+ end
98
+
99
+ === Dependency generation
100
+
101
+ When file dependencies are inserted into an .iml file absolute paths are used by default.
102
+ The user can override this by setting the "iml.local_repository_env_override" setting.
103
+ If set to nil absolute paths are used. If set to a non-null value the path to the local
104
+ maven repository will be replaced with the specified environment variable.
105
+
106
+ ==== Example: Setting local_repository_env_override
107
+
108
+ define "foo" do
109
+ iml.local_repository_env_override = "MAVEN_REPOSITORY"
110
+ compile.with 'group:id:jar:1.0'
111
+ end
112
+
113
+ Will generate a dependency with a path like:
114
+
115
+ jar://$MAVEN_REPOSITORY$/group/id/1.0/id-1.0.jar!/
116
+
117
+ rather than the default
118
+
119
+ jar:///home/peter/.m2/repository/group/id/1.0/id-1.0.jar!/
120
+
121
+ === Module Facets
122
+
123
+ Facets are IDEAs mechanism for adding support for languages, tools and frameworks other than
124
+ core java. A facet can be added to a project so that it can be deployed as a web application
125
+ or a hibernate application. A facet can also be used t provide support for other languages
126
+ such as ruby and scala. The extension makes it possible to generate .iml with the appropriate
127
+ facets via the "iml.add_facet" method. It should be noted that facets are NOT inherited by
128
+ subprojects.
129
+
130
+ ==== Example
131
+
132
+ This example adds the web facet to a project.
133
+
134
+ define "foo" do
135
+ iml.add_facet("Web","web") do |facet|
136
+ facet.configuration do |conf|
137
+ conf.descriptors do |desc|
138
+ desc.deploymentDescriptor :name => 'web.xml',
139
+ :url => "file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml",
140
+ :optional => "false", :version => "2.4"
141
+ end
142
+ conf.webroots do |webroots|
143
+ webroots.root :url => "file://$MODULE_DIR$/src/main/webapp", :relative => "/"
144
+ end
145
+ end
146
+ end
147
+ end
148
+
149
+ === Custom Component Sections
150
+
151
+ If the extension does not provide capability to generate configuration for a particular
152
+ IDEA plugin the user can provide their own configuration data via the "ipr.add_component"
153
+ or "iml.add_component" methods.
154
+
155
+ ==== Example: Adding .ipr specific component
156
+
157
+ This example changes the compiler configuration for project.
158
+
159
+ define "foo" do
160
+ ipr.add_component("CompilerConfiguration") do |component|
161
+ component.option :name => 'DEFAULT_COMPILER', :value => 'Javac'
162
+ component.option :name => 'DEPLOY_AFTER_MAKE', :value => '0'
163
+ component.resourceExtensions do |xml|
164
+ xml.entry :name => '.+\.nonexistent'
165
+ end
166
+ component.wildcardResourceExtensions do |xml|
167
+ xml.entry :name => '?*.nonexistent'
168
+ end
169
+ end
170
+ end
171
+
172
+ ==== Example: Adding .iml specific component
173
+
174
+ This example adds the web facet to a project. Note: This overrides the facets defined by
175
+ the "iml.add_facet" method.
176
+
177
+ define "foo" do
178
+ iml.add_component("FacetManager") do |component|
179
+ component.facet :type => 'web', :name => 'Web' do |facet|
180
+ facet.configuration do |conf|
181
+ conf.descriptors do |desc|
182
+ desc.deploymentDescriptor :name => 'web.xml',
183
+ :url => "file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml",
184
+ :optional => "false", :version => "2.4"
185
+ end
186
+ conf.webroots do |webroots|
187
+ webroots.root :url => "file://$MODULE_DIR$/src/main/webapp", :relative => "/"
188
+ end
189
+ end
190
+ end
191
+ end
192
+ end
193
+
194
+ === Templates
195
+
196
+ The underlying project files are xml the contain elements for a number of "components".
197
+ The extension will load any existing project files and replace or add any component
198
+ elements that are generated by the extension. The extension also allows the user to specify
199
+ a template with either ipr.template or iml.template settings. If a template is specified
200
+ it will be loaded and any component elements in these documents will be merged into the base
201
+ document prior to merging in generated sections. Templates are useful if you want to enforce
202
+ certain configuration options (i.e. project specific code style).
203
+
204
+ ==== Example
205
+
206
+ define "foo" do
207
+ ipr.template = 'project.ipr.template'
208
+ iml.template = 'module.ipr.template'
209
+ end
210
+
211
+ === Groups
212
+
213
+ IDEA provides the facility to organise modules into groups. By default the extension does not
214
+ do this but it can be enabled by iml.group setting. If that setting is set to true then the
215
+ .iml file will be placed in a group based on the parent projects name. If the setting is a string
216
+ then that is used as the name of the group.
217
+
218
+ ==== Example
219
+
220
+ define "foo" do
221
+ iml.group = true
222
+ define 'bar' do
223
+ define 'baz'
224
+ end
225
+ define 'rab' do
226
+ iml.group = "MyGroup"
227
+ end
228
+ end
229
+
230
+ Will place the generated .imls in the following groups:
231
+
232
+ foo.iml => ''
233
+ bar/bar.iml => 'foo'
234
+ bar/baz/baz.iml => 'foo/bar'
235
+ rab/rab.iml => 'MyGroup'
236
+
237
+ === Add Extra .iml files to .ipr
238
+
239
+ The 'ipr.extra_modules' setting makes it possible to add extra modules to the generated iml file.
240
+ The setting is an array of filenames relative to the base project directory.
241
+
242
+ ==== Example
243
+
244
+ define "foo" do
245
+ ipr.extra_modules << 'other.iml'
246
+ ipr.extra_modules << 'other_other.iml'
247
+ end
248
+
249
+ Will add the 'other.iml' and 'other_other.iml' files to the .ipr project files.
250
+
251
+ == Compatibility
252
+
253
+ It's been tested with IDEA 9.x.
254
+
255
+ == Future Work
256
+
257
+ The following is a list of feature requests for future versions of the extension. Feel free to
258
+ jump in and supply a patch if you have gone ahead and implemented the feature.
259
+
260
+ === Auto-generate Web Facet
261
+
262
+ Any project that defines a war package should have a web facet autogenerated for it.
263
+
264
+ === Auto-generate Scala Facet
265
+
266
+ Any project that contains scala source code should have a scala facet autogenerated for it.
267
+
268
+ === Support generation of IDEA files into separate hierarchy
269
+
270
+ Add the ability for the module and project files to be generated off into a different
271
+ directory hierarchy. i.e. Generate project modules into .idea_project in projects base
272
+ directory.
273
+
274
+ === Populate SOURCES and JAVADOC for dependencies
275
+
276
+ Add tasks 'iidea:deps:sources:download' and 'iidea:deps:javadoc:download' that downloads
277
+ missing :classifier => 'sources' and :classifier => 'javadoc' dependencies for all the
278
+ :classifier => 'jar' dependencies in the project. When generating the project files the task
279
+ should populate the SOURCES and JAVADOC if the relevant artifact is present in the local
280
+ repository.
281
+
282
+ === Fix tests to work when installed as a gem
283
+
284
+ The library should determine whether it is installed as a gem and if so use the gem to
285
+ invoke the the tests. See http://rubygems.rubyforge.org/rubygems-update/Gem.html#M000228
286
+ for a possible interface to determine if currently installed as a gem.