buildr-examples 0.0.1
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.
- data/LICENSE +176 -0
- data/README.rdoc +35 -0
- data/examples/artifacts/install_upload/app.zip +0 -0
- data/examples/artifacts/install_upload/buildfile +29 -0
- data/examples/artifacts/install_upload/src/main/java/HelloWorld.java +5 -0
- data/examples/artifacts/shared/artifacts.rb +5 -0
- data/examples/artifacts/simple/buildfile +75 -0
- data/examples/artifacts/simple/src/main/java/HelloWorld.java +5 -0
- data/examples/building/apt/buildfile +8 -0
- data/examples/building/apt/run.sh +3 -0
- data/examples/building/apt/src/main/java/Example.java +9 -0
- data/examples/building/chaining/buildfile +13 -0
- data/examples/building/chaining/run.sh +2 -0
- data/examples/building/chaining/src/main/java/Example.java +5 -0
- data/examples/building/chaining/srcs/HelloWorld.java +5 -0
- data/examples/building/compiler/buildfile +42 -0
- data/examples/building/compiler/groovyproject/src/main/groovy/HelloWorld.groovy +9 -0
- data/examples/building/compiler/javaproject/src/main/java/HelloWorld.java +5 -0
- data/examples/building/compiler/run.sh +10 -0
- data/examples/building/compiler/scalaproject/src/main/scala/HelloWorld.scala +5 -0
- data/examples/building/extending_tasks/buildfile +24 -0
- data/examples/building/extending_tasks/run.sh +4 -0
- data/examples/building/extending_tasks/src/main/java/HelloWorld.java +5 -0
- data/examples/building/jjtree/buildfile +10 -0
- data/examples/building/jjtree/run.sh +3 -0
- data/examples/building/jjtree/src/main/jjtree/com/acme/Example.java +7 -0
- data/examples/building/resources/buildfile +23 -0
- data/examples/building/resources/profiles.yaml +12 -0
- data/examples/building/resources/run.sh +6 -0
- data/examples/building/resources/src/main/property-style/ant.txt +1 -0
- data/examples/building/resources/src/main/property-style/erb.txt +1 -0
- data/examples/building/resources/src/main/property-style/maven.txt +1 -0
- data/examples/building/resources/src/main/property-style/regex.txt +1 -0
- data/examples/building/resources/src/main/property-style/ruby.txt +1 -0
- data/examples/building/resources/src/main/resources/filter.txt +1 -0
- data/examples/installing/buildfile +7 -0
- data/examples/installing/run.sh +16 -0
- data/examples/ivy4r/simple/ant-scripts/ivysettings.xml +9 -0
- data/examples/ivy4r/simple/buildfile +10 -0
- data/examples/ivy4r/simple/ivy.xml +6 -0
- data/examples/ivy4r/simple/run.sh +2 -0
- data/examples/ivy4r/simple/src/main/java/HelloWorld.java +8 -0
- data/examples/packaging/include_exclude/README +1 -0
- data/examples/packaging/include_exclude/buildfile +62 -0
- data/examples/packaging/include_exclude/run.sh +4 -0
- data/examples/packaging/include_exclude/src/main/java/HelloWorld.java +5 -0
- data/examples/packaging/include_exclude/src/main/resources/include/some_resource.txt +0 -0
- data/examples/packaging/include_exclude/src/main/resources/some.include +0 -0
- data/examples/packaging/include_exclude/src/main/resources/some_exclude.clu +0 -0
- data/examples/packaging/include_exclude/src/main/resources/some_exclude.ex +0 -0
- data/examples/packaging/include_exclude/src/main/webapp/WEB-INF/web.xml +0 -0
- data/examples/packaging/meta/ADDITIONAL +1 -0
- data/examples/packaging/meta/DISCLAIMER +1 -0
- data/examples/packaging/meta/NOTICE +1 -0
- data/examples/packaging/meta/buildfile +25 -0
- data/examples/packaging/meta/run.sh +2 -0
- data/examples/packaging/meta/src/main/MANIFEST.MF +7 -0
- data/examples/packaging/meta/src/main/java/HelloWorld.java +5 -0
- data/examples/packaging/meta/src/main/resources/some_resource.txt +0 -0
- data/examples/packaging/meta/src/main/webapp/WEB-INF/web.xml +0 -0
- data/examples/packaging/multiple/buildfile +39 -0
- data/examples/packaging/multiple/run.sh +6 -0
- data/examples/packaging/multiple/src/main/java/HelloWorld.java +5 -0
- data/examples/packaging/multiple/src/main/resources/some_resource.txt +0 -0
- data/examples/packaging/multiple/src/main/webapp/WEB-INF/web.xml +0 -0
- data/examples/projects/foo-bar/buildfile +24 -0
- data/examples/projects/foo-bar/run.sh +2 -0
- data/examples/projects/killer-app/buildfile +82 -0
- data/examples/projects/killer-app/run.sh +27 -0
- data/examples/projects/killer-app/teh-api/src/main/java/Example.java +5 -0
- data/examples/projects/killer-app/teh-api/src/test/java/ExampleTest.java +8 -0
- data/examples/projects/killer-app/teh-impl/src/main/java/Example.java +5 -0
- data/examples/projects/killer-app/teh-impl/src/main/resources/META-INF/persistence.xml +18 -0
- data/examples/projects/killer-app/teh-impl/src/test/java/ExampleTest.java +8 -0
- data/examples/projects/silly/buildfile +15 -0
- data/examples/projects/silly/run.sh +2 -0
- data/examples/projects/task/buildfile +12 -0
- data/examples/projects/task/run.sh +5 -0
- data/examples/testing/failing/buildfile +11 -0
- data/examples/testing/failing/run.sh +7 -0
- data/examples/testing/failing/src/main/java/Example.java +5 -0
- data/examples/testing/failing/src/test/java/FailingExampleTest.java +8 -0
- data/examples/testing/frameworks/buildfile +12 -0
- data/examples/testing/frameworks/junit/src/main/java/Example.java +5 -0
- data/examples/testing/frameworks/junit/src/test/java/ExampleTest.java +8 -0
- data/examples/testing/frameworks/run.sh +5 -0
- data/examples/testing/frameworks/testng/src/main/java/Example.java +5 -0
- data/examples/testing/frameworks/testng/src/test/java/ExampleTest.java +9 -0
- data/examples/testing/include_exclude/buildfile +9 -0
- data/examples/testing/include_exclude/run.sh +2 -0
- data/examples/testing/include_exclude/src/main/java/Example.java +5 -0
- data/examples/testing/include_exclude/src/test/java/ExampleTest.java +8 -0
- data/examples/testing/include_exclude/src/test/java/FailingExampleTest.java +8 -0
- data/examples/testing/include_exclude/src/test/java/de/phoet/IncludeTest.java +10 -0
- data/examples/testing/integration/buildfile +12 -0
- data/examples/testing/integration/client/src/main/java/Example.java +5 -0
- data/examples/testing/integration/client/src/test/java/ClientExampleTest.java +8 -0
- data/examples/testing/integration/run.sh +2 -0
- data/examples/testing/integration/server/src/main/java/Example.java +5 -0
- data/examples/testing/integration/server/src/test/java/ServerExampleTest.java +8 -0
- data/examples/testing/running/buildfile +13 -0
- data/examples/testing/running/client/src/main/java/Example.java +5 -0
- data/examples/testing/running/client/src/test/java/ClientExampleTest.java +8 -0
- data/examples/testing/running/run.sh +26 -0
- data/examples/testing/running/server/src/main/java/Example.java +5 -0
- data/examples/testing/running/server/src/test/java/ServerExampleTest.java +8 -0
- data/features/artifacts.feature +42 -0
- data/features/step_definitions/artifacts_steps.rb +19 -0
- data/features/support/env.rb +11 -0
- metadata +213 -0
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# 1. define some dependencies ...
|
|
2
|
+
AXIOM = group('axiom-api', 'axiom-impl', 'axiom-dom', :under=>'org.apache.ws.commons.axiom', :version=>'1.2.4')
|
|
3
|
+
|
|
4
|
+
repositories.remote << "http://www.ibiblio.org/maven2/"
|
|
5
|
+
|
|
6
|
+
define 'foo-bar' do
|
|
7
|
+
|
|
8
|
+
# define the project-version
|
|
9
|
+
project.version = '1.0.0'
|
|
10
|
+
|
|
11
|
+
define 'bar' do
|
|
12
|
+
# 3. ... and reuse them via other project
|
|
13
|
+
# buildr will figure out the right order of projects
|
|
14
|
+
compile.with project('foo').compile.dependencies
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
define 'foo' do
|
|
18
|
+
# 2. ... and use them for compile classpath
|
|
19
|
+
compile.with AXIOM
|
|
20
|
+
|
|
21
|
+
# 4. this would trigger a circular dependency (Circular dependency detected)
|
|
22
|
+
# compile.with project('bar')
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
require "buildr/openjpa"
|
|
2
|
+
|
|
3
|
+
VERSION_NUMBER = '1.0'
|
|
4
|
+
|
|
5
|
+
# define a single dependencies
|
|
6
|
+
AXIS2 = 'org.apache.axis2:axis2:jar:1.2'
|
|
7
|
+
# define a group of dependencies
|
|
8
|
+
AXIOM = group('axiom-api', 'axiom-impl', 'axiom-dom', :under=>'org.apache.ws.commons.axiom', :version=>'1.2.4')
|
|
9
|
+
# and mix them together
|
|
10
|
+
AXIS_OF_WS = [AXIOM, AXIS2]
|
|
11
|
+
OPENJPA = ['org.apache.openjpa:openjpa:jar:1.2.1', 'net.sourceforge.serp:serp:jar:1.12.0']
|
|
12
|
+
HIBERNATE = 'hibernate:hibernate-entitymanager:jar:3.1beta1'
|
|
13
|
+
|
|
14
|
+
# use ibiblio as the artifact repository
|
|
15
|
+
repositories.remote << 'http://www.ibiblio.org/maven2/'
|
|
16
|
+
|
|
17
|
+
desc 'Code. Build. ??? Profit!'
|
|
18
|
+
define 'killer-app' do
|
|
19
|
+
|
|
20
|
+
# set up project specific information
|
|
21
|
+
project.version = VERSION_NUMBER
|
|
22
|
+
project.group = 'acme'
|
|
23
|
+
manifest['Copyright'] = 'Acme Inc (C) 2007'
|
|
24
|
+
compile.options.target = '1.5'
|
|
25
|
+
|
|
26
|
+
desc 'Abstract classes and interfaces'
|
|
27
|
+
define 'teh-api' do
|
|
28
|
+
# create a jar artifact
|
|
29
|
+
package :jar
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
desc 'All those implementation details'
|
|
33
|
+
define 'teh-impl' do
|
|
34
|
+
# add axis and open-jpa to compile classpath
|
|
35
|
+
compile.with AXIS_OF_WS, OPENJPA, HIBERNATE
|
|
36
|
+
# run bytecode enhancer after compilation
|
|
37
|
+
compile { open_jpa_enhance }
|
|
38
|
+
# create a jar
|
|
39
|
+
package :jar
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
desc 'What our users see'
|
|
43
|
+
define 'la-web' do
|
|
44
|
+
# add dependencies to compilation
|
|
45
|
+
compile.with 'org.apache.axis2:axis2:jar:1.2',
|
|
46
|
+
'org.apache.derby:derby:jar:10.1.2.1',
|
|
47
|
+
#this can also be the created artifacts of projects
|
|
48
|
+
projects('teh-api', 'teh-impl')
|
|
49
|
+
|
|
50
|
+
# add the axis-dependencies to the test classpath
|
|
51
|
+
test.with AXIS_OF_WS
|
|
52
|
+
# create a war with the dependencies of side-projects
|
|
53
|
+
package(:war).with :libs=>projects('teh-api', 'teh-impl')
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# create javadoc for all projects ...
|
|
57
|
+
javadoc projects
|
|
58
|
+
# ... and create a javadoc.zip
|
|
59
|
+
package :javadoc
|
|
60
|
+
|
|
61
|
+
# look into resolving paths
|
|
62
|
+
# Relative to the current project
|
|
63
|
+
puts path_to('src', 'main', 'java')
|
|
64
|
+
|
|
65
|
+
# the same using symbols
|
|
66
|
+
puts path_to(:src, :main, :java)
|
|
67
|
+
|
|
68
|
+
# Exactly the same thing
|
|
69
|
+
puts _('src/main/java')
|
|
70
|
+
|
|
71
|
+
# Relative to the teh-impl project
|
|
72
|
+
puts project('teh-impl')._('src/main/java')
|
|
73
|
+
|
|
74
|
+
# shortcut for resolving the path of src
|
|
75
|
+
puts file('src')
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# have a look into the project-structure
|
|
79
|
+
puts projects.inspect
|
|
80
|
+
puts project('killer-app').projects.inspect
|
|
81
|
+
puts project('killer-app:teh-api').inspect
|
|
82
|
+
puts project('killer-app').project('teh-api').inspect
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
echo "build killer-app and all its sub-projects"
|
|
2
|
+
buildr clean build
|
|
3
|
+
|
|
4
|
+
echo "switch to and test only teh-impl"
|
|
5
|
+
cd teh-impl
|
|
6
|
+
buildr test
|
|
7
|
+
|
|
8
|
+
echo "switch to and package only la-web"
|
|
9
|
+
cd ../la-web
|
|
10
|
+
buildr package
|
|
11
|
+
|
|
12
|
+
cd ..
|
|
13
|
+
|
|
14
|
+
echo "build killer-app and all its sub-projects"
|
|
15
|
+
buildr killer-app:build
|
|
16
|
+
|
|
17
|
+
echo "test only teh-impl"
|
|
18
|
+
buildr killer-app:teh-impl:test
|
|
19
|
+
|
|
20
|
+
echo "package only la-web"
|
|
21
|
+
buildr killer-app:la-web:package
|
|
22
|
+
|
|
23
|
+
echo "list all projects"
|
|
24
|
+
buildr help:projects
|
|
25
|
+
|
|
26
|
+
echo "list all tasks"
|
|
27
|
+
buildr help:tasks
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
|
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
|
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
|
|
5
|
+
version="1.0">
|
|
6
|
+
|
|
7
|
+
<persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
|
|
8
|
+
<properties>
|
|
9
|
+
<property name="hibernate.connection.url" value="jdbc:hsqldb:mem:unit-testing-jpa"/>
|
|
10
|
+
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
|
|
11
|
+
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
|
|
12
|
+
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
|
|
13
|
+
<property name="hibernate.connection.username" value="sa"/>
|
|
14
|
+
<property name="hibernate.connection.password" value=""/>
|
|
15
|
+
</properties>
|
|
16
|
+
</persistence-unit>
|
|
17
|
+
|
|
18
|
+
</persistence>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
define 'silly', :version=>'1.0' do
|
|
2
|
+
project.group = 'acme'
|
|
3
|
+
|
|
4
|
+
puts 'Running buildr'
|
|
5
|
+
|
|
6
|
+
# extending the build-task
|
|
7
|
+
build do
|
|
8
|
+
puts 'Building silly'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# print out project-settings
|
|
14
|
+
puts project('silly').version
|
|
15
|
+
puts project('silly').group
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
define 'task' do
|
|
2
|
+
# define a custom task
|
|
3
|
+
task('do-this') do |task|
|
|
4
|
+
puts "you can define your own tasks like #{task}"
|
|
5
|
+
end
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
# define the custom task as a local task
|
|
9
|
+
# you can now call the do-this task via 'buildr do-this'
|
|
10
|
+
Project.local_task('do-this') do |name|
|
|
11
|
+
puts "executing the localtask on #{name}"
|
|
12
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
repositories.remote << 'http://www.ibiblio.org/maven2/'
|
|
2
|
+
|
|
3
|
+
define 'failing', :version=>"1.0" do
|
|
4
|
+
package(:jar)
|
|
5
|
+
test.using :junit
|
|
6
|
+
test.using :fail_on_failure=>false
|
|
7
|
+
test do |test|
|
|
8
|
+
# extension of test task will only get called after a successful test-run
|
|
9
|
+
raise "#{test.failed_tests.size} tests failed"
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
repositories.remote << 'http://www.ibiblio.org/maven2/'
|
|
2
|
+
|
|
3
|
+
define 'integration_testing', :version=>"1.0" do
|
|
4
|
+
# TODO integration testing example
|
|
5
|
+
define 'client' do
|
|
6
|
+
package(:jar)
|
|
7
|
+
end
|
|
8
|
+
define 'server' do
|
|
9
|
+
test.with project('client')
|
|
10
|
+
package(:jar)
|
|
11
|
+
end
|
|
12
|
+
end
|