Antwrap 0.6.0-java → 0.7.0-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,69 @@
1
+ == 0.7 / 2008-02-16
2
+
3
+ * Antwrap has been re-licensed under the Apache Software License. This was done to make Antwrap compatible with the Buildr project, and the Ant library.
4
+ * All Antwrap classes and modules are now contained inside an 'Antwrap' module.
5
+
6
+ == 0.6 / 2007-06-18
7
+
8
+ * The Antwrap syntax was changed. Blocks passed to a task are no longer evaluated within the context of the task itself. Instead, the AntProject itself will now yield
9
+ to the block and pass itself as a parameter. While slightly more verbose, this is idiomatic Ruby and allows you to use objects and invoke methods that are not in the
10
+ scope of the task.
11
+
12
+ The Old Way:
13
+
14
+ @ant.path(:id => "other.class.path"){
15
+ pathelement(:location => "classes")
16
+ pathelement(:location => "config")
17
+ }
18
+
19
+ The New Way:
20
+
21
+ def find_location
22
+ return "classes"
23
+ end
24
+
25
+ @ant.path(:id => "other.class.path"){ |ant|
26
+ ant.pathelement(:location => find_location())
27
+ ant.pathelement(:location => "config")
28
+ }
29
+
30
+ == 0.5.4 / 2007-06-13
31
+
32
+ * Using an Array instance as a value to a task will result in an ArgumentError. This is to prevent situations where a user passes an array of files/paths and the :to_s method joins
33
+ the contents together without an appropriate separator. For example; ["file1.txt", "file2.txt"].to_s --> "file1.txtfile2.txt" Instead, users are encouraged to do something
34
+ like; ["file1.txt", "file2.txt"].join(File::PATH_SEPARATOR).to_s --> "file1.txt:file2.txt"
35
+
36
+ == 0.5.3 / 2007-06-13
37
+
38
+ * Antwrap now supports any attribute value that responds to the :to_s method. Fixnum, Boolean, and other objects can now be passed to a task. For example, the following code uses the
39
+ 'true' constant rather than the String 'true';
40
+
41
+ @ant.javac(:srcdir => @resource_dir + '/src',
42
+ :destdir => @output_dir + '/classes',
43
+ :debug => true,
44
+ :verbose => true)
45
+
46
+ == 0.5.2 / 2007-04-17
47
+
48
+ * The AntProject instance now accepts an :ant_home parameter in the constructor. If provided, it will attempt to add the Ant jar files to the Classpath dynamically. For
49
+ example: @ant = AntProject.new(:ant_home=>\"/Users/fooman/tools/apache-ant-1.7.0\")
50
+
51
+ == 0.5.0 / 2007-03-16
52
+
53
+ * Added support for both the Ruby and JRuby platforms. The Ruby platform Antwrap gem depends on the Ruby Java Bridge (RJB) gem. The JRuby platform gem uses the JRuby's 'java' module.
54
+
55
+ == 0.4.0 / 2007-03-04
56
+
57
+ * Resolved some scope problems with keywords such as :mkdir, :java, etc.
58
+
59
+ == 0.3.0 / 2007-02-19
60
+
61
+ * Antwrap now supports Ant versions 1.5.4, 1.6.5, and 1.7.0.
62
+
63
+ == 0.2.0 / 2007-01-30
64
+
65
+ * Added support for Antcontrib tasks (those with reserved words such as if/else). The Antwrap convert script will prepend a task (that is a ruby reserved word) with an underscore.
66
+
67
+ == 0.1 / 2007-01-20
68
+
69
+ * Initial release of the Antwrap gem.
data/LICENSE ADDED
@@ -0,0 +1,201 @@
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
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,16 @@
1
+ History.txt
2
+ LICENSE
3
+ Manifest.txt
4
+ README.txt
5
+ Rakefile
6
+ docs/index.html
7
+ docs/index_files/Brander.css
8
+ docs/index_files/blankdot.gif
9
+ docs/index_files/blankdot.html
10
+ docs/index_files/urchin.js
11
+ lib/ant_project.rb
12
+ lib/ant_task.rb
13
+ lib/antwrap.rb
14
+ lib/antwrap_utilities.rb
15
+ lib/jruby_modules.rb
16
+ lib/rjb_modules.rb
@@ -0,0 +1,344 @@
1
+ = Antwrap
2
+ by Caleb Powell
3
+ http://rubyforge.org/projects/antwrap/
4
+
5
+ == DESCRIPTION:
6
+
7
+ A Ruby module that wraps the Apache Ant build tool. Antwrap can be used to invoke Ant Tasks from a Ruby or a JRuby script.
8
+
9
+ == FEATURES/PROBLEMS:
10
+
11
+ Antwrap runs on the native Ruby interpreter via the RJB (Ruby Java Bridge gem) and on the JRuby interpreter. Antwrap is compatible with Ant versions 1.5.4,
12
+ 1.6.5 and 1.7.0. For more information, see the Project Info (http://rubyforge.org/projects/antwrap/) page.
13
+
14
+ == SYNOPSIS:
15
+
16
+ Antwrap is a Ruby library that can be used to invoke Ant tasks. It is being used in the Buildr (http://incubator.apache.org/buildr/) project to execute
17
+ Ant (http://ant.apache.org/) tasks in a Java project. If you are tired of fighting with Ant or Maven XML files in your Java project, take some time to
18
+ check out Buildr!
19
+
20
+ == USAGE:
21
+
22
+ The Antwrap library is pretty simple to use, and should look very familiar to anyone who has written Ant tasks using XML.
23
+ You begin by instantiating an AntProject;
24
+
25
+ --------
26
+ @ant = AntProject.new()
27
+ --------
28
+
29
+ You can pass in a Hash of project options like so;
30
+
31
+ --------
32
+ options = {:ant_home=>"/Users/fooman/tools/apache-ant-1.7.0", :name=>"FooProject", :basedir=> some_dir,
33
+ :declarative=> true, :logger=> Logger.new(STDOUT), :loglevel=> Logger::DEBUG}
34
+
35
+ @ant = AntProject.new(options)
36
+ --------
37
+
38
+ The default options for an AntProject are as follow
39
+
40
+ 1. :name = The name of your AntProject. The default is ''.
41
+ 2. :basedir = The location of your project base directory. The default is File.pwd.
42
+ 3. :declarative = If true, the AntProject will execute the task when you invoke it. If false, it will return an instance of the task. Default value is true.
43
+ 4. :logger = The Logger to use. The default id Logger.new(STDOUT)
44
+ 5. :loglevel = The log level. Default is Logger::Error
45
+ 6. :ant_home = The location of you Ant installation. If provided, Antwrap will locate and load the Ant Jar files into the CLASSPATH. It will only do this once per Ruby process, so even if you create multiple AntProject instances, it only loads the required files once. If :ant_home is not provided, it is assumed that you have added the Ant jar files to your CLASSPATH manually.
46
+
47
+ Once you have an AntProject instance, you can begin invoking tasks. To do so, you simply invoke the desired task on the AntProject. You pass in
48
+ task attributes via a Hash, and you pass in child tasks inside a block. For example;
49
+
50
+ --------
51
+ @ant.path(:id => "other.class.path"){ |ant|
52
+ ant.pathelement(:location => "classes")
53
+ ant.pathelement(:location => "config")
54
+ }
55
+
56
+ @ant.path(:id => "common.class.path"){|ant|
57
+ ant.fileset(:dir => "${common.dir}/lib"){
58
+ ant.include(:name => "**/*.jar")
59
+ }
60
+ ant.pathelement(:location => "${common.classes}")
61
+ }
62
+
63
+ @ant.javac(:srcdir => "test", :destdir => "classes"){|ant|
64
+ ant.classpath(:refid => "common.class.path")
65
+ ant.classpath(:refid => "foo.class.path")
66
+ }
67
+ --------
68
+
69
+ *Declarative Mode
70
+
71
+ By default, Antwrap runs in declarative mode. This means that the AntProject will execute the tasks as you declare them. Alternatively, you can declare your
72
+ Ant project to run in non-declarative mode, so that it only executes tasks upon the invocation of the execute() method (this is a more Object Oriented
73
+ approach, and may be useful in some circumstances). For example;
74
+
75
+ --------
76
+ @ant = AntProject.new({:name=>"FooProject", :declarative=> false})
77
+
78
+ javac_task = @ant.javac(:srcdir => "test", :destdir => "classes"){|ant|
79
+ ant.classpath(:refid => "common.class.path")
80
+ ant.classpath(:refid => "foo.class.path")
81
+ }
82
+
83
+ javac_task.execute
84
+ --------
85
+
86
+ *Reserved Words
87
+
88
+ If your Ant task conflicts with a Ruby reserved word, you can prep-end an underscore. For example, Ant-Contrib
89
+ tasks such as 'if' and 'else' conflict with the Ruby reserved words;
90
+
91
+ --------
92
+ @ant._if(){|ant|
93
+
94
+ ant._equals(:arg1 => "${bar}", :arg2 => "bar")
95
+
96
+ ant._then(){
97
+ ant.echo(:message => "if 1 is equal")
98
+ }
99
+ ant._else(){
100
+ ant.echo(:message => "if 1 is not equal")
101
+ }
102
+ }
103
+ --------
104
+
105
+ Under most circumstances, you won't need to use these tasks because the Ruby language (OK... any general-purpose programming language) can handle
106
+ conditionals better than Ant. Indeed, the awkwardness of conditional operations in Ant scripts is likely one of the
107
+ reasons why you want to move to a build system such as Buildr.
108
+
109
+ *Content Data
110
+
111
+ Content data is added via a 'pcdata' attribute:
112
+
113
+ --------
114
+ @ant.echo(:pcdata => "<foo&bar>")
115
+ --------
116
+
117
+ == REQUIREMENTS:
118
+
119
+ rjb >= 1.0.3 (on MRI Ruby)
120
+ hoe >= 1.3.0
121
+
122
+ == INSTALL:
123
+
124
+ Installing Antwrap is done via the RubyGem gem command. In your OS shell type;
125
+
126
+ $ gem install antwrap
127
+
128
+ You will be prompted with the following options:
129
+
130
+ $Select which gem to install for your platform (powerpc-darwin8.0)
131
+ 1. Antwrap 0.7.0 (java)
132
+ 2. Antwrap 0.7.0 (ruby)
133
+
134
+ If you are using the native Ruby interpreter or running the Buildr project, then you want to select the ruby option (in this case, #2).
135
+ If you are using Antwrap on the JRuby interpreter, select the java option. The native Ruby version of Antwrap depends on another
136
+ gem called RJB (RubyJavaBridge) and you will be prompted to install this as part of the Antwrap installation. Do so. The RJB gem makes it possible
137
+ for a Ruby script to instantiate Java classes via the Java Native Interface. If you chose the java gem, there are no further dependencies. Check the
138
+ RJB site for how to get RJB running (usually, it's just a matter of setting the $JAVA_HOME and the $LD_LIBRARY_PATH environment variables).
139
+
140
+
141
+ == LICENSE:
142
+
143
+ Apache License
144
+ Version 2.0, January 2004
145
+ http://www.apache.org/licenses/
146
+
147
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
148
+
149
+ 1. Definitions.
150
+
151
+ "License" shall mean the terms and conditions for use, reproduction,
152
+ and distribution as defined by Sections 1 through 9 of this document.
153
+
154
+ "Licensor" shall mean the copyright owner or entity authorized by
155
+ the copyright owner that is granting the License.
156
+
157
+ "Legal Entity" shall mean the union of the acting entity and all
158
+ other entities that control, are controlled by, or are under common
159
+ control with that entity. For the purposes of this definition,
160
+ "control" means (i) the power, direct or indirect, to cause the
161
+ direction or management of such entity, whether by contract or
162
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
163
+ outstanding shares, or (iii) beneficial ownership of such entity.
164
+
165
+ "You" (or "Your") shall mean an individual or Legal Entity
166
+ exercising permissions granted by this License.
167
+
168
+ "Source" form shall mean the preferred form for making modifications,
169
+ including but not limited to software source code, documentation
170
+ source, and configuration files.
171
+
172
+ "Object" form shall mean any form resulting from mechanical
173
+ transformation or translation of a Source form, including but
174
+ not limited to compiled object code, generated documentation,
175
+ and conversions to other media types.
176
+
177
+ "Work" shall mean the work of authorship, whether in Source or
178
+ Object form, made available under the License, as indicated by a
179
+ copyright notice that is included in or attached to the work
180
+ (an example is provided in the Appendix below).
181
+
182
+ "Derivative Works" shall mean any work, whether in Source or Object
183
+ form, that is based on (or derived from) the Work and for which the
184
+ editorial revisions, annotations, elaborations, or other modifications
185
+ represent, as a whole, an original work of authorship. For the purposes
186
+ of this License, Derivative Works shall not include works that remain
187
+ separable from, or merely link (or bind by name) to the interfaces of,
188
+ the Work and Derivative Works thereof.
189
+
190
+ "Contribution" shall mean any work of authorship, including
191
+ the original version of the Work and any modifications or additions
192
+ to that Work or Derivative Works thereof, that is intentionally
193
+ submitted to Licensor for inclusion in the Work by the copyright owner
194
+ or by an individual or Legal Entity authorized to submit on behalf of
195
+ the copyright owner. For the purposes of this definition, "submitted"
196
+ means any form of electronic, verbal, or written communication sent
197
+ to the Licensor or its representatives, including but not limited to
198
+ communication on electronic mailing lists, source code control systems,
199
+ and issue tracking systems that are managed by, or on behalf of, the
200
+ Licensor for the purpose of discussing and improving the Work, but
201
+ excluding communication that is conspicuously marked or otherwise
202
+ designated in writing by the copyright owner as "Not a Contribution."
203
+
204
+ "Contributor" shall mean Licensor and any individual or Legal Entity
205
+ on behalf of whom a Contribution has been received by Licensor and
206
+ subsequently incorporated within the Work.
207
+
208
+ 2. Grant of Copyright License. Subject to the terms and conditions of
209
+ this License, each Contributor hereby grants to You a perpetual,
210
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
211
+ copyright license to reproduce, prepare Derivative Works of,
212
+ publicly display, publicly perform, sublicense, and distribute the
213
+ Work and such Derivative Works in Source or Object form.
214
+
215
+ 3. Grant of Patent License. Subject to the terms and conditions of
216
+ this License, each Contributor hereby grants to You a perpetual,
217
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
218
+ (except as stated in this section) patent license to make, have made,
219
+ use, offer to sell, sell, import, and otherwise transfer the Work,
220
+ where such license applies only to those patent claims licensable
221
+ by such Contributor that are necessarily infringed by their
222
+ Contribution(s) alone or by combination of their Contribution(s)
223
+ with the Work to which such Contribution(s) was submitted. If You
224
+ institute patent litigation against any entity (including a
225
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
226
+ or a Contribution incorporated within the Work constitutes direct
227
+ or contributory patent infringement, then any patent licenses
228
+ granted to You under this License for that Work shall terminate
229
+ as of the date such litigation is filed.
230
+
231
+ 4. Redistribution. You may reproduce and distribute copies of the
232
+ Work or Derivative Works thereof in any medium, with or without
233
+ modifications, and in Source or Object form, provided that You
234
+ meet the following conditions:
235
+
236
+ (a) You must give any other recipients of the Work or
237
+ Derivative Works a copy of this License; and
238
+
239
+ (b) You must cause any modified files to carry prominent notices
240
+ stating that You changed the files; and
241
+
242
+ (c) You must retain, in the Source form of any Derivative Works
243
+ that You distribute, all copyright, patent, trademark, and
244
+ attribution notices from the Source form of the Work,
245
+ excluding those notices that do not pertain to any part of
246
+ the Derivative Works; and
247
+
248
+ (d) If the Work includes a "NOTICE" text file as part of its
249
+ distribution, then any Derivative Works that You distribute must
250
+ include a readable copy of the attribution notices contained
251
+ within such NOTICE file, excluding those notices that do not
252
+ pertain to any part of the Derivative Works, in at least one
253
+ of the following places: within a NOTICE text file distributed
254
+ as part of the Derivative Works; within the Source form or
255
+ documentation, if provided along with the Derivative Works; or,
256
+ within a display generated by the Derivative Works, if and
257
+ wherever such third-party notices normally appear. The contents
258
+ of the NOTICE file are for informational purposes only and
259
+ do not modify the License. You may add Your own attribution
260
+ notices within Derivative Works that You distribute, alongside
261
+ or as an addendum to the NOTICE text from the Work, provided
262
+ that such additional attribution notices cannot be construed
263
+ as modifying the License.
264
+
265
+ You may add Your own copyright statement to Your modifications and
266
+ may provide additional or different license terms and conditions
267
+ for use, reproduction, or distribution of Your modifications, or
268
+ for any such Derivative Works as a whole, provided Your use,
269
+ reproduction, and distribution of the Work otherwise complies with
270
+ the conditions stated in this License.
271
+
272
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
273
+ any Contribution intentionally submitted for inclusion in the Work
274
+ by You to the Licensor shall be under the terms and conditions of
275
+ this License, without any additional terms or conditions.
276
+ Notwithstanding the above, nothing herein shall supersede or modify
277
+ the terms of any separate license agreement you may have executed
278
+ with Licensor regarding such Contributions.
279
+
280
+ 6. Trademarks. This License does not grant permission to use the trade
281
+ names, trademarks, service marks, or product names of the Licensor,
282
+ except as required for reasonable and customary use in describing the
283
+ origin of the Work and reproducing the content of the NOTICE file.
284
+
285
+ 7. Disclaimer of Warranty. Unless required by applicable law or
286
+ agreed to in writing, Licensor provides the Work (and each
287
+ Contributor provides its Contributions) on an "AS IS" BASIS,
288
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
289
+ implied, including, without limitation, any warranties or conditions
290
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
291
+ PARTICULAR PURPOSE. You are solely responsible for determining the
292
+ appropriateness of using or redistributing the Work and assume any
293
+ risks associated with Your exercise of permissions under this License.
294
+
295
+ 8. Limitation of Liability. In no event and under no legal theory,
296
+ whether in tort (including negligence), contract, or otherwise,
297
+ unless required by applicable law (such as deliberate and grossly
298
+ negligent acts) or agreed to in writing, shall any Contributor be
299
+ liable to You for damages, including any direct, indirect, special,
300
+ incidental, or consequential damages of any character arising as a
301
+ result of this License or out of the use or inability to use the
302
+ Work (including but not limited to damages for loss of goodwill,
303
+ work stoppage, computer failure or malfunction, or any and all
304
+ other commercial damages or losses), even if such Contributor
305
+ has been advised of the possibility of such damages.
306
+
307
+ 9. Accepting Warranty or Additional Liability. While redistributing
308
+ the Work or Derivative Works thereof, You may choose to offer,
309
+ and charge a fee for, acceptance of support, warranty, indemnity,
310
+ or other liability obligations and/or rights consistent with this
311
+ License. However, in accepting such obligations, You may act only
312
+ on Your own behalf and on Your sole responsibility, not on behalf
313
+ of any other Contributor, and only if You agree to indemnify,
314
+ defend, and hold each Contributor harmless for any liability
315
+ incurred by, or claims asserted against, such Contributor by reason
316
+ of your accepting any such warranty or additional liability.
317
+
318
+ END OF TERMS AND CONDITIONS
319
+
320
+ APPENDIX: How to apply the Apache License to your work.
321
+
322
+ To apply the Apache License to your work, attach the following
323
+ boilerplate notice, with the fields enclosed by brackets "[]"
324
+ replaced with your own identifying information. (Don't include
325
+ the brackets!) The text should be enclosed in the appropriate
326
+ comment syntax for the file format. We also recommend that a
327
+ file or class name and description of purpose be included on the
328
+ same "printed page" as the copyright notice for easier
329
+ identification within third-party archives.
330
+
331
+ Copyright [yyyy] [name of copyright owner]
332
+
333
+ Licensed under the Apache License, Version 2.0 (the "License");
334
+ you may not use this file except in compliance with the License.
335
+ You may obtain a copy of the License at
336
+
337
+ http://www.apache.org/licenses/LICENSE-2.0
338
+
339
+ Unless required by applicable law or agreed to in writing, software
340
+ distributed under the License is distributed on an "AS IS" BASIS,
341
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
342
+ See the License for the specific language governing permissions and
343
+ limitations under the License.
344
+