buildr-examples 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. data/LICENSE +176 -0
  2. data/README.rdoc +35 -0
  3. data/examples/artifacts/install_upload/app.zip +0 -0
  4. data/examples/artifacts/install_upload/buildfile +29 -0
  5. data/examples/artifacts/install_upload/src/main/java/HelloWorld.java +5 -0
  6. data/examples/artifacts/shared/artifacts.rb +5 -0
  7. data/examples/artifacts/simple/buildfile +75 -0
  8. data/examples/artifacts/simple/src/main/java/HelloWorld.java +5 -0
  9. data/examples/building/apt/buildfile +8 -0
  10. data/examples/building/apt/run.sh +3 -0
  11. data/examples/building/apt/src/main/java/Example.java +9 -0
  12. data/examples/building/chaining/buildfile +13 -0
  13. data/examples/building/chaining/run.sh +2 -0
  14. data/examples/building/chaining/src/main/java/Example.java +5 -0
  15. data/examples/building/chaining/srcs/HelloWorld.java +5 -0
  16. data/examples/building/compiler/buildfile +42 -0
  17. data/examples/building/compiler/groovyproject/src/main/groovy/HelloWorld.groovy +9 -0
  18. data/examples/building/compiler/javaproject/src/main/java/HelloWorld.java +5 -0
  19. data/examples/building/compiler/run.sh +10 -0
  20. data/examples/building/compiler/scalaproject/src/main/scala/HelloWorld.scala +5 -0
  21. data/examples/building/extending_tasks/buildfile +24 -0
  22. data/examples/building/extending_tasks/run.sh +4 -0
  23. data/examples/building/extending_tasks/src/main/java/HelloWorld.java +5 -0
  24. data/examples/building/jjtree/buildfile +10 -0
  25. data/examples/building/jjtree/run.sh +3 -0
  26. data/examples/building/jjtree/src/main/jjtree/com/acme/Example.java +7 -0
  27. data/examples/building/resources/buildfile +23 -0
  28. data/examples/building/resources/profiles.yaml +12 -0
  29. data/examples/building/resources/run.sh +6 -0
  30. data/examples/building/resources/src/main/property-style/ant.txt +1 -0
  31. data/examples/building/resources/src/main/property-style/erb.txt +1 -0
  32. data/examples/building/resources/src/main/property-style/maven.txt +1 -0
  33. data/examples/building/resources/src/main/property-style/regex.txt +1 -0
  34. data/examples/building/resources/src/main/property-style/ruby.txt +1 -0
  35. data/examples/building/resources/src/main/resources/filter.txt +1 -0
  36. data/examples/installing/buildfile +7 -0
  37. data/examples/installing/run.sh +16 -0
  38. data/examples/ivy4r/simple/ant-scripts/ivysettings.xml +9 -0
  39. data/examples/ivy4r/simple/buildfile +10 -0
  40. data/examples/ivy4r/simple/ivy.xml +6 -0
  41. data/examples/ivy4r/simple/run.sh +2 -0
  42. data/examples/ivy4r/simple/src/main/java/HelloWorld.java +8 -0
  43. data/examples/packaging/include_exclude/README +1 -0
  44. data/examples/packaging/include_exclude/buildfile +62 -0
  45. data/examples/packaging/include_exclude/run.sh +4 -0
  46. data/examples/packaging/include_exclude/src/main/java/HelloWorld.java +5 -0
  47. data/examples/packaging/include_exclude/src/main/resources/include/some_resource.txt +0 -0
  48. data/examples/packaging/include_exclude/src/main/resources/some.include +0 -0
  49. data/examples/packaging/include_exclude/src/main/resources/some_exclude.clu +0 -0
  50. data/examples/packaging/include_exclude/src/main/resources/some_exclude.ex +0 -0
  51. data/examples/packaging/include_exclude/src/main/webapp/WEB-INF/web.xml +0 -0
  52. data/examples/packaging/meta/ADDITIONAL +1 -0
  53. data/examples/packaging/meta/DISCLAIMER +1 -0
  54. data/examples/packaging/meta/NOTICE +1 -0
  55. data/examples/packaging/meta/buildfile +25 -0
  56. data/examples/packaging/meta/run.sh +2 -0
  57. data/examples/packaging/meta/src/main/MANIFEST.MF +7 -0
  58. data/examples/packaging/meta/src/main/java/HelloWorld.java +5 -0
  59. data/examples/packaging/meta/src/main/resources/some_resource.txt +0 -0
  60. data/examples/packaging/meta/src/main/webapp/WEB-INF/web.xml +0 -0
  61. data/examples/packaging/multiple/buildfile +39 -0
  62. data/examples/packaging/multiple/run.sh +6 -0
  63. data/examples/packaging/multiple/src/main/java/HelloWorld.java +5 -0
  64. data/examples/packaging/multiple/src/main/resources/some_resource.txt +0 -0
  65. data/examples/packaging/multiple/src/main/webapp/WEB-INF/web.xml +0 -0
  66. data/examples/projects/foo-bar/buildfile +24 -0
  67. data/examples/projects/foo-bar/run.sh +2 -0
  68. data/examples/projects/killer-app/buildfile +82 -0
  69. data/examples/projects/killer-app/run.sh +27 -0
  70. data/examples/projects/killer-app/teh-api/src/main/java/Example.java +5 -0
  71. data/examples/projects/killer-app/teh-api/src/test/java/ExampleTest.java +8 -0
  72. data/examples/projects/killer-app/teh-impl/src/main/java/Example.java +5 -0
  73. data/examples/projects/killer-app/teh-impl/src/main/resources/META-INF/persistence.xml +18 -0
  74. data/examples/projects/killer-app/teh-impl/src/test/java/ExampleTest.java +8 -0
  75. data/examples/projects/silly/buildfile +15 -0
  76. data/examples/projects/silly/run.sh +2 -0
  77. data/examples/projects/task/buildfile +12 -0
  78. data/examples/projects/task/run.sh +5 -0
  79. data/examples/testing/failing/buildfile +11 -0
  80. data/examples/testing/failing/run.sh +7 -0
  81. data/examples/testing/failing/src/main/java/Example.java +5 -0
  82. data/examples/testing/failing/src/test/java/FailingExampleTest.java +8 -0
  83. data/examples/testing/frameworks/buildfile +12 -0
  84. data/examples/testing/frameworks/junit/src/main/java/Example.java +5 -0
  85. data/examples/testing/frameworks/junit/src/test/java/ExampleTest.java +8 -0
  86. data/examples/testing/frameworks/run.sh +5 -0
  87. data/examples/testing/frameworks/testng/src/main/java/Example.java +5 -0
  88. data/examples/testing/frameworks/testng/src/test/java/ExampleTest.java +9 -0
  89. data/examples/testing/include_exclude/buildfile +9 -0
  90. data/examples/testing/include_exclude/run.sh +2 -0
  91. data/examples/testing/include_exclude/src/main/java/Example.java +5 -0
  92. data/examples/testing/include_exclude/src/test/java/ExampleTest.java +8 -0
  93. data/examples/testing/include_exclude/src/test/java/FailingExampleTest.java +8 -0
  94. data/examples/testing/include_exclude/src/test/java/de/phoet/IncludeTest.java +10 -0
  95. data/examples/testing/integration/buildfile +12 -0
  96. data/examples/testing/integration/client/src/main/java/Example.java +5 -0
  97. data/examples/testing/integration/client/src/test/java/ClientExampleTest.java +8 -0
  98. data/examples/testing/integration/run.sh +2 -0
  99. data/examples/testing/integration/server/src/main/java/Example.java +5 -0
  100. data/examples/testing/integration/server/src/test/java/ServerExampleTest.java +8 -0
  101. data/examples/testing/running/buildfile +13 -0
  102. data/examples/testing/running/client/src/main/java/Example.java +5 -0
  103. data/examples/testing/running/client/src/test/java/ClientExampleTest.java +8 -0
  104. data/examples/testing/running/run.sh +26 -0
  105. data/examples/testing/running/server/src/main/java/Example.java +5 -0
  106. data/examples/testing/running/server/src/test/java/ServerExampleTest.java +8 -0
  107. data/features/artifacts.feature +42 -0
  108. data/features/step_definitions/artifacts_steps.rb +19 -0
  109. data/features/support/env.rb +11 -0
  110. metadata +213 -0
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/README.rdoc ADDED
@@ -0,0 +1,35 @@
1
+ == Installation
2
+
3
+ Install buildr[http://buildr.apache.org] for JRuby:
4
+
5
+ export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
6
+ gem install buildr ivy4r cucumber
7
+
8
+ buildr --version
9
+ => Buildr 1.4.1 (JRuby 1.5.1)
10
+
11
+ == Running Examples
12
+
13
+ The examples are wrapped in cucumber-spec[http://cukes.info/] and can be executed via:
14
+
15
+ rake cucumber
16
+
17
+ == Requirements
18
+
19
+ The examples are tested with JRuby[http://jruby.org] on Mac OS X Snowleopard.
20
+
21
+ == RVM and JRuby on the Mac
22
+
23
+ Install RVM and JRuby following this guide[http://blog.nofail.de/2010/01/xruby-on-the-mac/], make sure Developer- Tools[http://developer.apple.com/tools/xcode/] are installed with Unix-Support.
24
+
25
+ The project comes with a .rvmrc[http://rvm.beginrescueend.com/workflow/rvmrc/], setting the default to JRuby 1.5.1 for convenience:
26
+
27
+ cd buildr-examples
28
+ ruby -v
29
+ => jruby 1.5.1 (ruby 1.8.7 patchlevel 249) (2010-06-06 f3a3480) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_20) [x86_64-java]
30
+
31
+ == License
32
+
33
+ Using Apache license so buildr project can test/integrate/distribute this stuff.
34
+
35
+ (see LICENSE file)
@@ -0,0 +1,29 @@
1
+ repositories.remote << "http://www.ibiblio.org/maven2/"
2
+ repositories.release_to = "file:///#{ENV['HOME']}/.m2/repository/"
3
+
4
+ define "install_upload", :version=>"1.0.0" do
5
+ # some remote url
6
+ url = 'http://github.com/phoet/buildr-examples/raw/master/examples/artifacts/install_upload/app.zip'
7
+ # download the artifact
8
+ app_zip = download('target/app.zip'=>url)
9
+ # unzip the artifact to specified location
10
+ bean_jar = file('target/app/bean.jar'=>unzip('target/app'=>app_zip))
11
+ # specify the artifact
12
+ bean = artifact('example.com:beans:jar:1.0').from(bean_jar)
13
+ # use the artifact for compilation
14
+ compile.with bean
15
+ # install the artifact locally
16
+ install bean
17
+ # upload the artifact to release server (wich is local too in this example)
18
+ upload bean
19
+
20
+ desc 'task for installing an artifact'
21
+ task 'install_directly' do
22
+ install(bean).invoke
23
+ end
24
+
25
+ desc 'task for uploading an artifact'
26
+ task 'uploading_directly' do
27
+ upload(bean).invoke
28
+ end
29
+ end
@@ -0,0 +1,5 @@
1
+ public class HelloWorld {
2
+ public static void main(String[] args){
3
+ System.out.println("Hello World!");
4
+ }
5
+ }
@@ -0,0 +1,5 @@
1
+ SHARED_LIB = struct(
2
+ :activation =>'javax.activation:activation:jar:1.1',
3
+ :persistence =>'javax.persistence:persistence-api:jar:1.0',
4
+ :stream =>'stax:stax-api:jar:1.0.1'
5
+ )
@@ -0,0 +1,75 @@
1
+ repositories.remote << "http://www.ibiblio.org/maven2/"
2
+
3
+ # shared artifacts
4
+ require '../shared/artifacts'
5
+
6
+ # just an artifact version
7
+ AXIS_VERSION = '1.2'
8
+ # a single artifact
9
+ AXIS2 = 'org.apache.tapestry:tapestry-framework:jar:4.1.1'
10
+ # as a hash
11
+ AXIS = { :group=>'org.apache.axis2', :id=>'axis2', :version=>'1.2' }
12
+ # a group of aftifacts
13
+ # use Buildr::group() in define
14
+ AXIOM = group('axiom-api', 'axiom-impl', 'axiom-dom', :under=>'org.apache.ws.commons.axiom', :version=>'1.2.4')
15
+ # a list of artifacts
16
+ OPENJPA = ['org.apache.openjpa:openjpa:jar:1.2.1', 'net.sourceforge.serp:serp:jar:1.12.0']
17
+ # nest artifacts
18
+ AXIS_OF_WS = [AXIS2, AXIOM]
19
+ # group using a struct
20
+ JAVAX = struct(
21
+ :activation =>'javax.activation:activation:jar:1.1',
22
+ :persistence =>'javax.persistence:persistence-api:jar:1.0',
23
+ :stream =>'stax:stax-api:jar:1.0.1'
24
+ )
25
+ # external artifact
26
+ DOJO = '0.2.2'
27
+
28
+ desc 'proxy-task for setting specific proxy-config'
29
+ task 'proxy' do
30
+ options.proxy.http = 'http://myproxy:8080'
31
+ # currently fails with 'stack level too deep'
32
+ # options.proxy.exclude << '*.mycompany.com'
33
+ # options.proxy.exclude << 'localhost'
34
+ end
35
+
36
+ desc 'repo-task for setting local repo-config'
37
+ task 'repo' do
38
+ # put stuff like this in your buildr.rb in the user-directory
39
+ # this is actually the default setting
40
+ repositories.local = '~/.m2/repository'
41
+ end
42
+
43
+ define "simple", :version=>"1.0.0" do
44
+
45
+ # works ...
46
+ compile.with "org.apache.axis2:axis2:jar:#{AXIS_VERSION}"
47
+ # ... but this is better
48
+ compile.with AXIS2
49
+
50
+ # use a hash
51
+ compile.with AXIS
52
+
53
+ # use with lists of dependencies ...
54
+ compile.with AXIS2, AXIOM
55
+ # ... or mix with arrays
56
+ compile.with OPENJPA, AXIS_OF_WS
57
+
58
+ # struct shortcut
59
+ compile.with JAVAX.persistence, OPENJPA
60
+
61
+ # struct from shared
62
+ compile.with SHARED_LIB.stream, SHARED_LIB.activation
63
+
64
+ # artifacts can be treated as hashes
65
+ puts "first artifact: #{compile.dependencies.first.to_hash.inspect}"
66
+
67
+ # invoke download of artifacts directly
68
+ artifact('org.apache.openjpa:openjpa:jar:1.2.1').invoke
69
+ artifacts(OPENJPA).each(&:invoke)
70
+
71
+ # download artifact from given url
72
+ url = "http://download.dojotoolkit.org/release-#{DOJO}/dojo-#{DOJO}-widget.zip"
73
+ download(artifact("dojo:dojo:zip:widget:#{DOJO}")=>url)
74
+
75
+ end
@@ -0,0 +1,5 @@
1
+ public class HelloWorld {
2
+ public static void main(String[] args){
3
+ System.out.println("Hello World!");
4
+ }
5
+ }
@@ -0,0 +1,8 @@
1
+ repositories.remote << "http://www.ibiblio.org/maven2/"
2
+
3
+ define "apt", :version=>"1.0.0" do
4
+ compile.using :javac
5
+ # add apt-generated sources to compilation
6
+ # --> disabled, because i dont have a working apt-example
7
+ #compile.from apt
8
+ end
@@ -0,0 +1,3 @@
1
+ echo "just build to use apt"
2
+ echo "apt example disabled, because of missing example stuff..."
3
+ #buildr
@@ -0,0 +1,9 @@
1
+ import java.lang.annotation.*;
2
+
3
+ @Documented
4
+ @Retention(RetentionPolicy.RUNTIME)
5
+ @Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.PACKAGE, ElementType.FIELD})
6
+ public @interface Example {
7
+ String value();
8
+ Priority priority() default Priority.MEDIUM;
9
+ }
@@ -0,0 +1,13 @@
1
+ repositories.remote << "http://www.ibiblio.org/maven2/"
2
+
3
+ define "chaining", :version=>"1.0.0" do
4
+
5
+ info "currently we compile to: #{compile.target}"
6
+ compile.into _(:target, "classes")
7
+ info "and now we compile to: #{compile.target}"
8
+
9
+ compile.from(_('srcs')).with('org.apache.axis2:axis2:jar:1.2').into(_(:target, "classes")).using(:target=>'1.5')
10
+
11
+ compile.dependencies.each {|source| info "#{source}"}
12
+ compile.sources.each {|source| info "#{source}"}
13
+ end
@@ -0,0 +1,2 @@
1
+ echo "just compile to see chaining"
2
+ buildr compile
@@ -0,0 +1,5 @@
1
+ public class Example {
2
+ public void callMe(){
3
+ System.out.println("I got called!");
4
+ }
5
+ }
@@ -0,0 +1,5 @@
1
+ public class HelloWorld {
2
+ public static void main(String[] args){
3
+ System.out.println("Hello World!");
4
+ }
5
+ }
@@ -0,0 +1,42 @@
1
+ require 'buildr/scala'
2
+ require 'buildr/groovy'
3
+ # configure a different groovy-version
4
+ Buildr::Groovy::Groovyc::REQUIRES.groovy = '1.7.1'
5
+
6
+ repositories.remote << "http://www.ibiblio.org/maven2/"
7
+
8
+ define "compiler" do
9
+
10
+ # define the project-version
11
+ project.version = '1.0.0'
12
+
13
+ # define project-specific options
14
+ compile.options.target = '1.5'
15
+ compile.options.lint = 'all'
16
+ # compile.using :target=>'1.5', :lint=>'all' => does the same in one line
17
+
18
+ compile.options.warning = 'off'
19
+
20
+ # define a groovy subproject
21
+ define "groovyproject" do
22
+ compile.using(:groovyc) # you dont have to define the compiler, buildr will look for the .groovy extension in src/main/groovy
23
+ package(:jar)
24
+ end
25
+
26
+ # define a java subproject
27
+ define "javaproject" do
28
+ compile.from(_(:src, :main, :java)) # compile from src/main/java
29
+ compile.with('org.apache.axis2:axis2:jar:1.2') # use axis as dependency
30
+ compile.into(_(:target, :classes)) # compile into target/classes
31
+ compile.using(:target=>'1.6') # compile using Java 6 compiler
32
+ # you could have chained all calls to compile, because the methods all return the task they configure
33
+ package(:jar)
34
+ end
35
+
36
+ # define a scala subproject
37
+ define "scalaproject" do
38
+ compile.using(:scalac) # you dont have to define the compiler, buildr will look for the .scala extension in src/main/scala
39
+ package(:jar)
40
+ end
41
+
42
+ end