buildr 1.4.25-java → 1.5.0.dev2-java
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.
- checksums.yaml +4 -4
- data/CHANGELOG +50 -0
- data/NOTICE +1 -1
- data/README.rdoc +1 -1
- data/addon/buildr/bnd.rb +0 -6
- data/addon/buildr/custom_pom.rb +6 -0
- data/addon/buildr/org/apache/buildr/BuildrNail$Main.class +0 -0
- data/addon/buildr/org/apache/buildr/BuildrNail.class +0 -0
- data/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
- data/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
- data/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
- data/addon/buildr/wsgen.rb +27 -27
- data/buildr.buildfile +1 -1
- data/buildr.gemspec +13 -9
- data/doc/_config.yml +3 -1
- data/doc/_layouts/default.html +1 -1
- data/doc/artifacts.textile +42 -0
- data/doc/download.textile +18 -6
- data/doc/languages.textile +15 -1
- data/doc/packaging.textile +1 -1
- data/doc/preface.textile +1 -1
- data/doc/projects.textile +13 -0
- data/doc/releasing.textile +14 -0
- data/doc/settings_profiles.textile +4 -0
- data/lib/buildr.rb +1 -0
- data/lib/buildr/core/application.rb +2 -3
- data/lib/buildr/core/build.rb +21 -34
- data/lib/buildr/core/compile.rb +0 -12
- data/lib/buildr/core/filter.rb +7 -0
- data/lib/buildr/core/generate.rb +1 -0
- data/lib/buildr/core/project.rb +14 -4
- data/lib/buildr/core/test.rb +2 -4
- data/lib/buildr/core/transports.rb +2 -0
- data/lib/buildr/groovy/bdd.rb +0 -7
- data/lib/buildr/ide/eclipse.rb +3 -3
- data/lib/buildr/java/ant.rb +0 -6
- data/lib/buildr/java/bdd.rb +0 -7
- data/lib/buildr/java/commands.rb +1 -1
- data/lib/buildr/java/deprecated.rb +0 -60
- data/lib/buildr/java/ecj.rb +16 -3
- data/lib/buildr/java/jruby.rb +19 -1
- data/lib/buildr/java/packaging.rb +4 -8
- data/lib/buildr/java/pom.rb +17 -12
- data/lib/buildr/java/rjb.rb +21 -3
- data/lib/buildr/java/tests.rb +0 -21
- data/lib/buildr/packaging/archive.rb +1 -1
- data/lib/buildr/packaging/artifact.rb +132 -3
- data/lib/buildr/packaging/zip.rb +32 -29
- data/lib/buildr/packaging/ziptask.rb +7 -5
- data/lib/buildr/scala.rb +0 -1
- data/lib/buildr/scala/bdd.rb +28 -122
- data/lib/buildr/scala/compiler.rb +24 -10
- data/lib/buildr/scala/doc.rb +0 -1
- data/lib/buildr/scala/org/apache/buildr/Specs2Runner.class +0 -0
- data/lib/buildr/scala/org/apache/buildr/Specs2Runner.java +4 -3
- data/lib/buildr/scala/org/apache/buildr/ZincRunner.class +0 -0
- data/lib/buildr/scala/org/apache/buildr/ZincRunner.java +37 -0
- data/lib/buildr/scala/tests.rb +18 -26
- data/lib/buildr/version.rb +1 -1
- data/spec/addon/bnd_spec.rb +5 -5
- data/spec/addon/custom_pom_spec.rb +38 -32
- data/spec/addon/jaxb_xjc_spec.rb +0 -4
- data/spec/core/application_spec.rb +4 -5
- data/spec/core/build_spec.rb +10 -51
- data/spec/core/common_spec.rb +7 -0
- data/spec/core/compile_spec.rb +0 -6
- data/spec/core/console_spec.rb +1 -1
- data/spec/core/generate_from_eclipse_spec.rb +22 -8
- data/spec/core/project_spec.rb +34 -70
- data/spec/core/test_spec.rb +6 -9
- data/spec/core/transport_spec.rb +16 -7
- data/spec/groovy/compiler_spec.rb +2 -2
- data/spec/java/ant_spec.rb +0 -5
- data/spec/java/compiler_spec.rb +4 -4
- data/spec/java/ecj_spec.rb +244 -45
- data/spec/java/java_spec.rb +7 -9
- data/spec/java/packaging_spec.rb +23 -23
- data/spec/java/pom_spec.rb +37 -0
- data/spec/java/tests_spec.rb +0 -5
- data/spec/packaging/archive_spec.rb +1 -1
- data/spec/packaging/artifact_spec.rb +129 -7
- data/spec/packaging/packaging_spec.rb +1 -1
- data/spec/sandbox.rb +2 -2
- data/spec/scala/bdd_spec.rb +0 -101
- data/spec/scala/compiler_spec.rb +20 -16
- data/spec/scala/doc_spec.rb +0 -11
- data/spec/scala/tests_spec.rb +6 -15
- data/spec/spec_helpers.rb +1 -1
- data/spec/xpath_matchers.rb +2 -1
- metadata +30 -16
- data/addon/buildr/cobertura.rb +0 -21
- data/addon/buildr/emma.rb +0 -21
data/lib/buildr/scala/doc.rb
CHANGED
Binary file
|
@@ -24,9 +24,10 @@ public class Specs2Runner {
|
|
24
24
|
public static void main(String[] args) {
|
25
25
|
try {
|
26
26
|
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
27
|
-
Class clazz = loader.loadClass("org.specs2.runner.ClassRunner");
|
28
|
-
|
29
|
-
|
27
|
+
Class clazz = loader.loadClass("org.specs2.runner.ClassRunner$");
|
28
|
+
Field singleton = clazz.getField("MODULE$");
|
29
|
+
Object instance = singleton.get(null);
|
30
|
+
Method main = clazz.getMethod("run", String[].class);
|
30
31
|
main.invoke(instance, new Object[] { args });
|
31
32
|
} catch (Exception e) {
|
32
33
|
throw new RuntimeException(e);
|
Binary file
|
@@ -0,0 +1,37 @@
|
|
1
|
+
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
+
* contributor license agreements. See the NOTICE file distributed with this
|
3
|
+
* work for additional information regarding copyright ownership. The ASF
|
4
|
+
* licenses this file to you under the Apache License, Version 2.0 (the
|
5
|
+
* "License"); you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
12
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
13
|
+
* License for the specific language governing permissions and limitations
|
14
|
+
* under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
package org.apache.buildr;
|
18
|
+
|
19
|
+
import java.lang.reflect.Field;
|
20
|
+
import java.lang.reflect.Method;
|
21
|
+
|
22
|
+
public class ZincRunner {
|
23
|
+
|
24
|
+
public static void main(String[] args) {
|
25
|
+
try {
|
26
|
+
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
27
|
+
Class clazz = loader.loadClass("com.typesafe.zinc.Main$");
|
28
|
+
Field singleton = clazz.getField("MODULE$");
|
29
|
+
Object instance = singleton.get(null);
|
30
|
+
Method main = clazz.getMethod("main", String[].class);
|
31
|
+
main.invoke(instance, new Object[] { args });
|
32
|
+
} catch (Exception e) {
|
33
|
+
throw new RuntimeException(e);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
}
|
data/lib/buildr/scala/tests.rb
CHANGED
@@ -39,8 +39,10 @@ module Buildr::Scala#:nodoc:
|
|
39
39
|
'1.7'
|
40
40
|
when Buildr::Scala.version?("2.8.1")
|
41
41
|
'1.8'
|
42
|
-
|
42
|
+
when Buildr::Scala.version < "2.11"
|
43
43
|
'1.10.0'
|
44
|
+
else
|
45
|
+
'1.12.5'
|
44
46
|
end
|
45
47
|
|
46
48
|
class << self
|
@@ -53,7 +55,14 @@ module Buildr::Scala#:nodoc:
|
|
53
55
|
end
|
54
56
|
|
55
57
|
def artifact
|
56
|
-
Buildr.settings.build['scala.check.artifact']
|
58
|
+
custom = Buildr.settings.build['scala.check.artifact']
|
59
|
+
return custom if !!custom
|
60
|
+
case
|
61
|
+
when Buildr::Scala.version < "2.11"
|
62
|
+
"scalacheck_#{Buildr::Scala.version_without_build}"
|
63
|
+
else
|
64
|
+
"scalacheck_#{Buildr::Scala.version_major_minor}"
|
65
|
+
end
|
57
66
|
end
|
58
67
|
|
59
68
|
def dependencies
|
@@ -70,13 +79,6 @@ module Buildr::Scala#:nodoc:
|
|
70
79
|
["#{group}:#{artifact}:jar:#{version}"]
|
71
80
|
end
|
72
81
|
end
|
73
|
-
|
74
|
-
private
|
75
|
-
def const_missing(const)
|
76
|
-
return super unless const == :REQUIRES # TODO: remove in 1.5
|
77
|
-
Buildr.application.deprecated "Please use Scala::Check.dependencies/.version instead of ScalaCheck::REQUIRES/VERSION"
|
78
|
-
dependencies
|
79
|
-
end
|
80
82
|
end
|
81
83
|
end
|
82
84
|
|
@@ -92,8 +94,10 @@ module Buildr::Scala#:nodoc:
|
|
92
94
|
VERSION = case
|
93
95
|
when Buildr::Scala.version?(2.7)
|
94
96
|
'1.3'
|
95
|
-
|
97
|
+
when Buildr::Scala.version < "2.11"
|
96
98
|
'1.8'
|
99
|
+
else
|
100
|
+
'2.2.6'
|
97
101
|
end
|
98
102
|
|
99
103
|
class << self
|
@@ -107,25 +111,20 @@ module Buildr::Scala#:nodoc:
|
|
107
111
|
return custom if (custom =~ /:/)
|
108
112
|
if Buildr::Scala.version?(2.7, 2.8)
|
109
113
|
"org.scalatest:scalatest:jar:#{version}"
|
110
|
-
|
114
|
+
elsif Buildr::Scala.version < "2.11"
|
111
115
|
"org.scalatest:scalatest_#{Buildr::Scala.version_without_build}:jar:#{version}"
|
116
|
+
else
|
117
|
+
"org.scalatest:scalatest_#{Buildr::Scala.version_major_minor}:jar:#{version}"
|
112
118
|
end
|
113
119
|
end
|
114
120
|
|
115
121
|
def dependencies
|
116
|
-
[specs] + Check.dependencies + JMock.dependencies + JUnit.dependencies + Mockito.dependencies
|
122
|
+
[specs] + Check.dependencies + JMock.dependencies + JUnit.dependencies + Mockito.dependencies + ["org.scala-lang.modules:scala-xml_2.11:jar:1.0.5"]
|
117
123
|
end
|
118
124
|
|
119
125
|
def applies_to?(project) #:nodoc:
|
120
126
|
!Dir[project.path_to(:source, :test, :scala, '**/*.scala')].empty?
|
121
127
|
end
|
122
|
-
|
123
|
-
private
|
124
|
-
def const_missing(const)
|
125
|
-
return super unless const == :REQUIRES # TODO: remove in 1.5
|
126
|
-
Buildr.application.deprecated "Please use Scala::Test.dependencies/.version instead of ScalaTest::REQUIRES/VERSION"
|
127
|
-
dependencies
|
128
|
-
end
|
129
128
|
end
|
130
129
|
|
131
130
|
# annotation-based group inclusion
|
@@ -210,11 +209,4 @@ module Buildr::Scala#:nodoc:
|
|
210
209
|
|
211
210
|
end
|
212
211
|
|
213
|
-
|
214
|
-
# Backwards compatibility stuff. Remove in 1.5.
|
215
|
-
module Buildr#:nodoc:
|
216
|
-
ScalaCheck = Scala::Check
|
217
|
-
ScalaTest = Scala::ScalaTest
|
218
|
-
end
|
219
|
-
|
220
212
|
Buildr::TestFramework << Buildr::Scala::ScalaTest
|
data/lib/buildr/version.rb
CHANGED
data/spec/addon/bnd_spec.rb
CHANGED
@@ -20,7 +20,7 @@ Sandbox.require_optional_extension 'buildr/bnd'
|
|
20
20
|
def open_zip_file(file = 'target/foo-2.1.3.jar')
|
21
21
|
jar_filename = @foo._(file)
|
22
22
|
File.should be_exist(jar_filename)
|
23
|
-
Zip::
|
23
|
+
Zip::File.open(jar_filename) do |zip|
|
24
24
|
yield zip
|
25
25
|
end
|
26
26
|
end
|
@@ -33,7 +33,7 @@ end
|
|
33
33
|
|
34
34
|
describe Buildr::Bnd do
|
35
35
|
before do
|
36
|
-
repositories.remote <<
|
36
|
+
repositories.remote << "http://central.maven.org/maven2"
|
37
37
|
end
|
38
38
|
|
39
39
|
describe "project.bnd version (assure backward compatibility)" do
|
@@ -130,13 +130,13 @@ SRC
|
|
130
130
|
|
131
131
|
it "produces a .jar containing correct .class files for root project" do
|
132
132
|
open_zip_file do |zip|
|
133
|
-
zip.
|
133
|
+
zip.exist?('com/biz/Foo.class').should be_true
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
137
137
|
it "produces a .jar containing resoruces from resource directory root project" do
|
138
138
|
open_zip_file do |zip|
|
139
|
-
zip.
|
139
|
+
zip.exist?('IRIS-INF/iris.config').should be_true
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|
@@ -167,7 +167,7 @@ SRC
|
|
167
167
|
|
168
168
|
it "produces a .jar containing correct .class files for subproject project" do
|
169
169
|
open_zip_file('bar/target/foo-bar-2.2.jar') do |zip|
|
170
|
-
zip.
|
170
|
+
zip.exist?('com/biz/bar/Bar.class').should be_true
|
171
171
|
end
|
172
172
|
end
|
173
173
|
|
@@ -21,7 +21,11 @@ if false
|
|
21
21
|
require File.expand_path('../spec_helpers', File.dirname(__FILE__))
|
22
22
|
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'xpath_matchers'))
|
23
23
|
|
24
|
-
|
24
|
+
# Next line should work but does not
|
25
|
+
#Sandbox.require_optional_extension 'buildr/custom_pom'
|
26
|
+
|
27
|
+
# Next line should not be used but is required
|
28
|
+
require 'buildr/custom_pom'
|
25
29
|
|
26
30
|
describe Buildr::CustomPom do
|
27
31
|
|
@@ -63,19 +67,21 @@ describe Buildr::CustomPom do
|
|
63
67
|
verify_dependency_version(pom_xml, artifact_id, version)
|
64
68
|
verify_dependency_scope(pom_xml, artifact_id, scope)
|
65
69
|
verify_dependency_optional(pom_xml, artifact_id, optional)
|
70
|
+
pom_xml.should match_xpath("#{dependency_xpath(artifact_id)}/exclusions/exclusion/groupId", '*')
|
71
|
+
pom_xml.should match_xpath("#{dependency_xpath(artifact_id)}/exclusions/exclusion/artifactId", '*')
|
66
72
|
end
|
67
73
|
|
68
|
-
describe
|
74
|
+
describe 'with explicitly specified pom details' do
|
69
75
|
before do
|
70
|
-
|
76
|
+
%w(id-provided id-optional id-runtime id-test).each do |artifact_id|
|
71
77
|
artifact("group:#{artifact_id}:jar:1.0") do |t|
|
72
78
|
mkdir_p File.dirname(t.to_s)
|
73
|
-
Zip::
|
79
|
+
Zip::OutputStream.open t.to_s do |zip|
|
74
80
|
zip.put_next_entry 'empty.txt'
|
75
81
|
end
|
76
82
|
end
|
77
83
|
end
|
78
|
-
write 'src/main/java/Example.java',
|
84
|
+
write 'src/main/java/Example.java', 'public class Example {}'
|
79
85
|
|
80
86
|
@foo = define 'foo' do
|
81
87
|
project.group = 'org.myproject'
|
@@ -103,47 +109,47 @@ describe Buildr::CustomPom do
|
|
103
109
|
#$stderr.puts @pom_xml.to_s
|
104
110
|
end
|
105
111
|
|
106
|
-
it
|
107
|
-
@pom_xml.should match_xpath(
|
108
|
-
@pom_xml.should match_xpath(
|
109
|
-
@pom_xml.should match_xpath(
|
110
|
-
@pom_xml.should match_xpath(
|
112
|
+
it 'has correct static metadata' do
|
113
|
+
@pom_xml.should match_xpath('/project/modelVersion', '4.0.0')
|
114
|
+
@pom_xml.should match_xpath('/project/parent/groupId', 'org.sonatype.oss')
|
115
|
+
@pom_xml.should match_xpath('/project/parent/artifactId', 'oss-parent')
|
116
|
+
@pom_xml.should match_xpath('/project/parent/version', '7')
|
111
117
|
end
|
112
118
|
|
113
|
-
it
|
114
|
-
@pom_xml.should match_xpath(
|
115
|
-
@pom_xml.should match_xpath(
|
116
|
-
@pom_xml.should match_xpath(
|
117
|
-
@pom_xml.should match_xpath(
|
118
|
-
@pom_xml.should match_xpath(
|
119
|
-
@pom_xml.should match_xpath(
|
120
|
-
@pom_xml.should match_xpath(
|
119
|
+
it 'has correct project level metadata' do
|
120
|
+
@pom_xml.should match_xpath('/project/groupId', 'org.myproject')
|
121
|
+
@pom_xml.should match_xpath('/project/artifactId', 'foo')
|
122
|
+
@pom_xml.should match_xpath('/project/version', '1.0')
|
123
|
+
@pom_xml.should match_xpath('/project/packaging', 'jar')
|
124
|
+
@pom_xml.should match_xpath('/project/name', 'foo')
|
125
|
+
@pom_xml.should match_xpath('/project/description', 'foo')
|
126
|
+
@pom_xml.should match_xpath('/project/url', 'https://github.com/jbloggs/myproject')
|
121
127
|
end
|
122
128
|
|
123
|
-
it
|
124
|
-
@pom_xml.should match_xpath(
|
125
|
-
@pom_xml.should match_xpath(
|
126
|
-
@pom_xml.should match_xpath(
|
129
|
+
it 'has correct scm details' do
|
130
|
+
@pom_xml.should match_xpath('/project/scm/connection', 'scm:git:git@github.com:jbloggs/myproject')
|
131
|
+
@pom_xml.should match_xpath('/project/scm/developerConnection', 'scm:git:git@github.com:jbloggs/myproject')
|
132
|
+
@pom_xml.should match_xpath('/project/scm/url', 'git@github.com:jbloggs/myproject')
|
127
133
|
end
|
128
134
|
|
129
|
-
it
|
130
|
-
@pom_xml.should match_xpath(
|
131
|
-
@pom_xml.should match_xpath(
|
135
|
+
it 'has correct issueManagement details' do
|
136
|
+
@pom_xml.should match_xpath('/project/issueManagement/url', 'https://github.com/jbloggs/myproject/issues')
|
137
|
+
@pom_xml.should match_xpath('/project/issueManagement/system', 'GitHub Issues')
|
132
138
|
end
|
133
139
|
|
134
|
-
it
|
135
|
-
@pom_xml.should match_xpath(
|
136
|
-
@pom_xml.should match_xpath(
|
137
|
-
@pom_xml.should match_xpath(
|
138
|
-
@pom_xml.should match_xpath(
|
140
|
+
it 'has correct developers details' do
|
141
|
+
@pom_xml.should match_xpath('/project/developers/developer/id', 'jbloggs')
|
142
|
+
@pom_xml.should match_xpath('/project/developers/developer/name', 'Joe Bloggs')
|
143
|
+
@pom_xml.should match_xpath('/project/developers/developer/email', 'jbloggs@example.com')
|
144
|
+
@pom_xml.should match_xpath('/project/developers/developer/roles/role', 'Project Lead')
|
139
145
|
end
|
140
146
|
|
141
|
-
it
|
147
|
+
it 'has correct license details' do
|
142
148
|
verify_license(@pom_xml, 'The Apache Software License, Version 2.0', 'http://www.apache.org/licenses/LICENSE-2.0.txt')
|
143
149
|
verify_license(@pom_xml, 'GNU General Public License (GPL) version 3.0', 'http://www.gnu.org/licenses/gpl-3.0.html')
|
144
150
|
end
|
145
151
|
|
146
|
-
it
|
152
|
+
it 'has correct dependency details' do
|
147
153
|
verify_dependency(@pom_xml, 'id-runtime', 'group', '1.0', nil, nil)
|
148
154
|
verify_dependency(@pom_xml, 'id-optional', 'group', '1.0', nil, 'true')
|
149
155
|
verify_dependency(@pom_xml, 'id-provided', 'group', '1.0', 'provided', nil)
|
data/spec/addon/jaxb_xjc_spec.rb
CHANGED
@@ -15,7 +15,6 @@
|
|
15
15
|
|
16
16
|
require File.expand_path('../spec_helpers', File.dirname(__FILE__))
|
17
17
|
|
18
|
-
if Java.java.lang.System.getProperty("java.runtime.version") >= "1.6"
|
19
18
|
Sandbox.require_optional_extension 'buildr/jaxb_xjc'
|
20
19
|
|
21
20
|
XSD_CONTENT = <<XSD
|
@@ -125,6 +124,3 @@ describe Buildr::JaxbXjc do
|
|
125
124
|
end
|
126
125
|
end
|
127
126
|
|
128
|
-
elsif Buildr::VERSION >= '1.5'
|
129
|
-
raise "JVM version guard in #{__FILE__} should be removed since it is assumed that Java 1.5 is no longer supported."
|
130
|
-
end
|
@@ -30,6 +30,10 @@ describe Buildr::Application do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
describe '#run' do
|
33
|
+
before(:each) do
|
34
|
+
FileUtils.touch 'Buildfile'
|
35
|
+
end
|
36
|
+
|
33
37
|
it 'should execute *_load methods in order' do
|
34
38
|
order = [:load_gems, :load_artifact_ns, :load_tasks, :raw_load_buildfile]
|
35
39
|
order.each { |method| Buildr.application.should_receive(method).ordered }
|
@@ -149,11 +153,6 @@ describe Buildr::Application do
|
|
149
153
|
Buildr.application.gems.size.should be(2)
|
150
154
|
end
|
151
155
|
|
152
|
-
it 'should return a Gem::Specification for each installed gem' do
|
153
|
-
load_with_yaml
|
154
|
-
Buildr.application.gems.each { |gem| gem.should be_kind_of(Gem::Specification) }
|
155
|
-
end
|
156
|
-
|
157
156
|
it 'should parse Gem name correctly' do
|
158
157
|
load_with_yaml
|
159
158
|
Buildr.application.gems.map(&:name).should include('rspec', 'rake')
|
data/spec/core/build_spec.rb
CHANGED
@@ -149,57 +149,6 @@ describe Project, '#clean' do
|
|
149
149
|
end
|
150
150
|
end
|
151
151
|
|
152
|
-
|
153
|
-
describe Project, '#target' do
|
154
|
-
before :each do
|
155
|
-
@project = define('foo', :layout=>Layout.new)
|
156
|
-
end
|
157
|
-
|
158
|
-
it 'should default to target' do
|
159
|
-
@project.target.should eql('target')
|
160
|
-
end
|
161
|
-
|
162
|
-
it 'should set layout :target' do
|
163
|
-
@project.target = 'bar'
|
164
|
-
@project.layout.expand(:target).should point_to_path('bar')
|
165
|
-
end
|
166
|
-
|
167
|
-
it 'should come from layout :target' do
|
168
|
-
@project.layout[:target] = 'baz'
|
169
|
-
@project.target.should eql('baz')
|
170
|
-
end
|
171
|
-
|
172
|
-
it 'should be removed in version 1.5 since it was deprecated in version 1.3' do
|
173
|
-
Buildr::VERSION.should < '1.5'
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
|
178
|
-
describe Project, '#reports' do
|
179
|
-
before :each do
|
180
|
-
@project = define('foo', :layout=>Layout.new)
|
181
|
-
end
|
182
|
-
|
183
|
-
it 'should default to reports' do
|
184
|
-
@project.reports.should eql('reports')
|
185
|
-
end
|
186
|
-
|
187
|
-
it 'should set layout :reports' do
|
188
|
-
@project.reports = 'bar'
|
189
|
-
@project.layout.expand(:reports).should point_to_path('bar')
|
190
|
-
end
|
191
|
-
|
192
|
-
it 'should come from layout :reports' do
|
193
|
-
@project.layout[:reports] = 'baz'
|
194
|
-
@project.reports.should eql('baz')
|
195
|
-
end
|
196
|
-
|
197
|
-
it 'should be removed in version 1.5 since it was deprecated in version 1.3' do
|
198
|
-
Buildr::VERSION.should < '1.5'
|
199
|
-
end
|
200
|
-
end
|
201
|
-
|
202
|
-
|
203
152
|
describe Hg do
|
204
153
|
describe '#current_branch' do
|
205
154
|
it 'should return the correct branch' do
|
@@ -678,6 +627,16 @@ shared_examples_for 'a release process' do
|
|
678
627
|
write 'buildfile', 'define foo'
|
679
628
|
lambda { @release.extract_version }.should raise_error('Looking for THIS_VERSION = "..." in your Buildfile, none found')
|
680
629
|
end
|
630
|
+
|
631
|
+
it 'should use version.rb instead of buildfile, if present' do
|
632
|
+
write 'version.rb', "VERSION_NUMBER = '1.0.0-SNAPSHOT'"
|
633
|
+
@release.extract_version.should == '1.0.0-SNAPSHOT'
|
634
|
+
end
|
635
|
+
|
636
|
+
it 'should complain if there is a version.rb file, but it contains no version number' do
|
637
|
+
write 'version.rb', "#SOMETHING SOMETHING"
|
638
|
+
lambda { @release.extract_version }.should raise_error('Looking for THIS_VERSION = "..." in your Buildfile, none found')
|
639
|
+
end
|
681
640
|
end
|
682
641
|
|
683
642
|
describe '#with_release_candidate_version' do
|
data/spec/core/common_spec.rb
CHANGED
@@ -401,6 +401,13 @@ describe Buildr::Filter do
|
|
401
401
|
read(file).should eql("#{File.basename(file)} with value1 and value2")
|
402
402
|
end
|
403
403
|
end
|
404
|
+
|
405
|
+
it 'should not apply filters to binary files' do
|
406
|
+
["jpg", "jpeg", "gif", "png"].each { |ext| write "images/file.#{ext}", 'something' }
|
407
|
+
filter = @filter.from('images').into('target').using('key1'=>'value1', 'key2'=>'value2')
|
408
|
+
filter.instance_variable_get("@mapper").should_not_receive(:maven_transform)
|
409
|
+
filter.run
|
410
|
+
end
|
404
411
|
|
405
412
|
it 'should apply hash mapping using Ant style' do
|
406
413
|
1.upto(4) { |i| write "src/file#{i}", "file#{i} with @key1@ and @key2@" }
|