doubleshot 0.1.0-java → 0.2.0-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.
- data/Doubleshot +21 -10
- data/README.textile +13 -5
- data/bin/doubleshot +9 -1
- data/ext/java/Aether.java +199 -0
- data/ext/java/ManualWagonProvider.java +24 -0
- data/ext/java/SimpleRepositoryListener.java +77 -0
- data/lib/doubleshot.rb +155 -9
- data/lib/doubleshot/cli.rb +2 -1
- data/lib/doubleshot/cli/options.rb +3 -1
- data/lib/doubleshot/commands/build.rb +47 -9
- data/lib/doubleshot/commands/gem.rb +30 -9
- data/lib/doubleshot/commands/init.rb +41 -10
- data/lib/doubleshot/commands/install.rb +4 -4
- data/lib/doubleshot/commands/jar.rb +60 -2
- data/lib/doubleshot/commands/pom.rb +29 -0
- data/lib/doubleshot/commands/test.rb +85 -32
- data/lib/doubleshot/compiler.rb +20 -17
- data/lib/doubleshot/compiler/classpath.rb +46 -0
- data/lib/doubleshot/configuration.rb +158 -8
- data/lib/doubleshot/dependencies/dependency.rb +16 -15
- data/lib/doubleshot/dependencies/dependency_list.rb +20 -5
- data/lib/doubleshot/dependencies/gem_dependency.rb +35 -0
- data/lib/doubleshot/dependencies/gem_dependency_list.rb +1 -1
- data/lib/doubleshot/dependencies/jar_dependency.rb +64 -1
- data/lib/doubleshot/dependencies/jar_dependency_list.rb +1 -1
- data/lib/doubleshot/jar.rb +13 -2
- data/lib/doubleshot/lockfile.rb +108 -0
- data/lib/doubleshot/pom.rb +42 -0
- data/lib/doubleshot/readonly_collection.rb +6 -2
- data/lib/doubleshot/resolver.rb +22 -0
- data/lib/doubleshot/resolver/jar_resolver.rb +36 -0
- data/lib/doubleshot/setup.rb +1 -47
- data/lib/ruby/blank.rb +3 -3
- data/lib/ruby/pathname.rb +8 -4
- data/lib/ruby/time.rb +1 -2
- data/target/doubleshot.jar +0 -0
- data/test/compiler/classpath_spec.rb +74 -0
- data/test/compiler_spec.rb +89 -10
- data/test/configuration/source_locations_spec.rb +2 -2
- data/test/configuration_spec.rb +115 -17
- data/test/dependencies/dependency_list_spec.rb +26 -4
- data/test/dependencies/dependency_spec.rb +19 -18
- data/test/dependencies/gem_dependency_list_spec.rb +0 -0
- data/test/dependencies/gem_dependency_spec.rb +54 -0
- data/test/dependencies/jar_dependency_list_spec.rb +0 -0
- data/test/dependencies/jar_dependency_spec.rb +62 -1
- data/test/dependencies_spec.rb +4 -4
- data/test/doubleshot_spec.rb +34 -2
- data/test/helper.rb +36 -1
- data/test/lockfile_spec.rb +236 -0
- data/test/pom_spec.rb +66 -0
- data/test/readonly_collection_spec.rb +10 -3
- data/test/resolver/jar_resolver_spec.rb +34 -0
- data/test/resolver_spec.rb +25 -0
- metadata +28 -28
- data/ext/java/Empty.java +0 -0
data/lib/doubleshot/cli.rb
CHANGED
@@ -13,6 +13,18 @@ class Doubleshot::CLI::Commands::Build < Doubleshot::CLI
|
|
13
13
|
def self.options
|
14
14
|
Options.new do |options|
|
15
15
|
options.banner = "Usage: doubleshot build"
|
16
|
+
options.separator ""
|
17
|
+
options.separator "Options"
|
18
|
+
|
19
|
+
options.classpath = []
|
20
|
+
options.on "--classpath CLASSPATH", "Manually set the CLASSPATH the compiler should use." do |classpath|
|
21
|
+
options.classpath = classpath.to_s.split(":")
|
22
|
+
end
|
23
|
+
|
24
|
+
options.conditional = false
|
25
|
+
options.on "--conditional", "Perform a conditional build (determine if there are pending files)." do
|
26
|
+
options.conditional = true
|
27
|
+
end
|
16
28
|
|
17
29
|
options.separator ""
|
18
30
|
options.separator "Summary: #{summary}"
|
@@ -20,15 +32,41 @@ class Doubleshot::CLI::Commands::Build < Doubleshot::CLI
|
|
20
32
|
end
|
21
33
|
|
22
34
|
def self.start(args)
|
23
|
-
|
35
|
+
options = self.options.parse!(args)
|
36
|
+
doubleshot = Doubleshot::current
|
37
|
+
|
38
|
+
if options.conditional && doubleshot.config.target.exist?
|
39
|
+
doubleshot.config.target.rmtree
|
40
|
+
end
|
41
|
+
|
42
|
+
compiler = Doubleshot::Compiler.new(doubleshot.config.source.java, doubleshot.config.target)
|
24
43
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
44
|
+
if doubleshot.config.project == "doubleshot"
|
45
|
+
puts "Bootstrapping Doubleshot build with Maven..."
|
46
|
+
doubleshot.bootstrap!
|
47
|
+
else
|
48
|
+
puts "Performing Doubleshot setup to resolve dependencies..."
|
49
|
+
doubleshot.setup!
|
50
|
+
end
|
51
|
+
|
52
|
+
if options.classpath.empty?
|
53
|
+
doubleshot.classpath
|
54
|
+
else
|
55
|
+
options.classpath
|
56
|
+
end.each do |path|
|
57
|
+
compiler.classpath << path
|
58
|
+
end
|
59
|
+
|
60
|
+
puts "[INFO] Using #{compiler.classpath}"
|
61
|
+
puts
|
62
|
+
|
63
|
+
if compiler.pending? || !options.conditional
|
64
|
+
puts "Compiling..."
|
65
|
+
compiler.build!
|
66
|
+
else
|
67
|
+
puts "Conditional build: No source changes."
|
68
|
+
end
|
31
69
|
|
32
|
-
return
|
70
|
+
return 0
|
33
71
|
end
|
34
|
-
end
|
72
|
+
end
|
@@ -14,7 +14,7 @@ class Doubleshot::CLI::Commands::Gem < Doubleshot::CLI
|
|
14
14
|
options.separator "Options"
|
15
15
|
|
16
16
|
options.test = true
|
17
|
-
options.on "--no-test", "Disable testing as a
|
17
|
+
options.on "--no-test", "Disable testing as a packaging prerequisite." do
|
18
18
|
options.test = false
|
19
19
|
end
|
20
20
|
|
@@ -25,15 +25,36 @@ class Doubleshot::CLI::Commands::Gem < Doubleshot::CLI
|
|
25
25
|
|
26
26
|
def self.start(args)
|
27
27
|
options = self.options.parse!(args)
|
28
|
+
doubleshot = Doubleshot::current
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
if options.test
|
31
|
+
puts "Executing tests..."
|
32
|
+
if Doubleshot::CLI::Commands::Test.start([ "--ci" ]) != 0
|
33
|
+
STDERR.puts "Test failed, aborting Gem creation."
|
34
|
+
return 1
|
35
|
+
end
|
36
|
+
else
|
37
|
+
Doubleshot::CLI::Commands::Build.start(args)
|
38
|
+
end
|
39
|
+
|
40
|
+
unless Pathname::glob(doubleshot.config.source.java + "**/*.java").empty?
|
41
|
+
target = doubleshot.config.target
|
42
|
+
|
43
|
+
jarfile = (target + "#{doubleshot.config.project}.jar")
|
44
|
+
jarfile.delete if jarfile.exist?
|
45
|
+
|
46
|
+
ant.jar jarfile: jarfile, basedir: target do
|
47
|
+
doubleshot.lockfile.jars.each do |jar|
|
48
|
+
zipfileset src: jar.path.expand_path, excludes: "META-INF/*.SF"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# WARN: This is version specific since in HEAD they've changed this to Gem::Package::build.
|
54
|
+
::Gem::Builder.new(doubleshot.config.gemspec).build
|
33
55
|
|
34
|
-
|
35
|
-
::Gem::Builder.new(config.gemspec).build
|
56
|
+
puts(" Size: %.2fM" % (Pathname(doubleshot.config.gemspec.file_name).size.to_f / 1024 / 1024))
|
36
57
|
|
37
|
-
return
|
58
|
+
return 0
|
38
59
|
end
|
39
|
-
end
|
60
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'rexml/document'
|
2
|
+
|
1
3
|
class Doubleshot::CLI::Commands::Init < Doubleshot::CLI
|
2
4
|
|
3
5
|
def self.summary
|
@@ -19,6 +21,7 @@ class Doubleshot::CLI::Commands::Init < Doubleshot::CLI
|
|
19
21
|
|
20
22
|
def self.start(args)
|
21
23
|
session = new(args)
|
24
|
+
|
22
25
|
if session.doubleshot_file.exist?
|
23
26
|
return puts <<-EOS.margin
|
24
27
|
ERROR: A Doubleshot file already exists.
|
@@ -27,6 +30,9 @@ class Doubleshot::CLI::Commands::Init < Doubleshot::CLI
|
|
27
30
|
end
|
28
31
|
session.import_gemspec!
|
29
32
|
session.mark_gemspec_for_deletion!
|
33
|
+
|
34
|
+
session.import_pom! if session.pom_file.exist?
|
35
|
+
|
30
36
|
session.generate_doubleshot_file!
|
31
37
|
|
32
38
|
puts <<-EOS.margin
|
@@ -35,7 +41,7 @@ class Doubleshot::CLI::Commands::Init < Doubleshot::CLI
|
|
35
41
|
Please review it and make changes as you see fit. It will
|
36
42
|
be used for all the things.
|
37
43
|
EOS
|
38
|
-
return
|
44
|
+
return 0
|
39
45
|
end
|
40
46
|
|
41
47
|
def initialize(args)
|
@@ -47,6 +53,10 @@ class Doubleshot::CLI::Commands::Init < Doubleshot::CLI
|
|
47
53
|
Pathname(@path + "Doubleshot")
|
48
54
|
end
|
49
55
|
|
56
|
+
def pom_file
|
57
|
+
Pathname(@path + "pom.xml")
|
58
|
+
end
|
59
|
+
|
50
60
|
def gemspec
|
51
61
|
@gemspec ||= Pathname::glob(@path + "*.gemspec").first
|
52
62
|
end
|
@@ -54,16 +64,17 @@ class Doubleshot::CLI::Commands::Init < Doubleshot::CLI
|
|
54
64
|
def import_gemspec!
|
55
65
|
original = gemspec ? eval_gemspec(gemspec.read) : ::Gem::Specification.new
|
56
66
|
|
67
|
+
@config.project = default original.name, "THE PROJECT NAME"
|
68
|
+
@config.version = default original.version, "9000.1"
|
69
|
+
|
57
70
|
@config.gemspec do |spec|
|
58
|
-
spec.
|
59
|
-
spec.
|
60
|
-
spec.
|
61
|
-
spec.
|
62
|
-
spec.
|
63
|
-
spec.
|
64
|
-
spec.
|
65
|
-
spec.license = default original.license, "MIT-LICENSE"
|
66
|
-
spec.executables = original.executables
|
71
|
+
spec.summary = default original.summary, "SUMMARIZE ME"
|
72
|
+
spec.description = default original.description, "A VERY DETAILED DESCRIPTION"
|
73
|
+
spec.author = default original.author, "WHOAMI"
|
74
|
+
spec.homepage = default original.homepage, "I AM FROM THE INTERNET"
|
75
|
+
spec.email = default original.email, "ME@EXAMPLE.COM"
|
76
|
+
spec.license = default original.license, "MIT-LICENSE"
|
77
|
+
spec.executables = original.executables
|
67
78
|
end
|
68
79
|
|
69
80
|
original.runtime_dependencies.each do |dependency|
|
@@ -77,6 +88,26 @@ class Doubleshot::CLI::Commands::Init < Doubleshot::CLI
|
|
77
88
|
end
|
78
89
|
end
|
79
90
|
|
91
|
+
def import_pom!
|
92
|
+
pom_document = REXML::Document.new pom_file.open
|
93
|
+
|
94
|
+
project = pom_document.get_text("project/artifactId")
|
95
|
+
@config.project = project if (@config.project.nil? or @config.project == "THE PROJECT NAME") and not project.nil?
|
96
|
+
|
97
|
+
@config.group = pom_document.get_text("project/groupId")
|
98
|
+
|
99
|
+
version = pom_document.get_text("project/version")
|
100
|
+
@config.version = version if (@config.version.nil? or @config.version == "9000.1") and not version.nil?
|
101
|
+
|
102
|
+
pom_document.elements.each("project/dependencies/dependency") do |pom_dependency|
|
103
|
+
group_id = pom_dependency.get_text("groupId")
|
104
|
+
artifact_id = pom_dependency.get_text("artifactId")
|
105
|
+
version = pom_dependency.get_text("version")
|
106
|
+
|
107
|
+
@config.jar "#{group_id}:#{artifact_id}:jar:#{version}"
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
80
111
|
def eval_gemspec(contents)
|
81
112
|
puts "Importing Gemspec..."
|
82
113
|
begin
|
@@ -13,7 +13,7 @@ class Doubleshot::CLI::Commands::Install < Doubleshot::CLI
|
|
13
13
|
options.separator "Options"
|
14
14
|
|
15
15
|
options.test = true
|
16
|
-
options.on "--no-test", "Disable testing as a
|
16
|
+
options.on "--no-test", "Disable testing as a packaging prerequisite." do
|
17
17
|
options.test = false
|
18
18
|
end
|
19
19
|
|
@@ -29,7 +29,7 @@ class Doubleshot::CLI::Commands::Install < Doubleshot::CLI
|
|
29
29
|
|
30
30
|
installer = ::Gem::DependencyInstaller.new
|
31
31
|
installer.install Doubleshot::current.config.gemspec.file_name
|
32
|
-
|
33
|
-
return
|
32
|
+
|
33
|
+
return 0
|
34
34
|
end
|
35
|
-
end
|
35
|
+
end
|
@@ -1,7 +1,65 @@
|
|
1
1
|
class Doubleshot::CLI::Commands::Jar < Doubleshot::CLI
|
2
|
+
|
2
3
|
def self.summary
|
3
4
|
<<-EOS.margin
|
4
|
-
|
5
|
+
Package your project as a JAR.
|
5
6
|
EOS
|
6
7
|
end
|
7
|
-
|
8
|
+
|
9
|
+
def self.options
|
10
|
+
Options.new do |options|
|
11
|
+
options.banner = "Usage: doubleshot jar"
|
12
|
+
options.separator ""
|
13
|
+
options.separator "Options"
|
14
|
+
|
15
|
+
options.test = true
|
16
|
+
options.on "--no-test", "Disable testing as a packaging prerequisite." do
|
17
|
+
options.test = false
|
18
|
+
end
|
19
|
+
|
20
|
+
options.sparse = false
|
21
|
+
options.on "--sparse", "Don't include JAR dependencies in your JAR. (For example, if you want to use Maven.)" do
|
22
|
+
options.sparse = true
|
23
|
+
end
|
24
|
+
|
25
|
+
options.separator ""
|
26
|
+
options.separator "Summary: #{summary}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.start(args)
|
31
|
+
options = self.options.parse!(args)
|
32
|
+
doubleshot = Doubleshot::current
|
33
|
+
|
34
|
+
if options.test
|
35
|
+
puts "Executing tests..."
|
36
|
+
if Doubleshot::CLI::Commands::Test.start([ "--ci" ]) != 0
|
37
|
+
STDERR.puts "Test failed, aborting JAR creation."
|
38
|
+
return 1
|
39
|
+
end
|
40
|
+
else
|
41
|
+
Doubleshot::CLI::Commands::Build.start(args)
|
42
|
+
end
|
43
|
+
|
44
|
+
unless Pathname::glob(doubleshot.config.source.java + "**/*.java").empty?
|
45
|
+
target = doubleshot.config.target
|
46
|
+
|
47
|
+
jarfile = (target + "#{doubleshot.config.project}.jar")
|
48
|
+
jarfile.delete if jarfile.exist?
|
49
|
+
|
50
|
+
ant.jar jarfile: jarfile, basedir: target do
|
51
|
+
manifest{
|
52
|
+
attribute(:name => "Main-Class", :value => doubleshot.config.java_main)
|
53
|
+
}
|
54
|
+
fileset dir: doubleshot.config.source.ruby.parent, includes: doubleshot.config.source.ruby.to_s + "/**/*"
|
55
|
+
unless options.sparse
|
56
|
+
doubleshot.lockfile.jars.each do |jar|
|
57
|
+
zipfileset src: jar.path.expand_path, excludes: "META-INF/*.SF"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
return 0
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class Doubleshot::CLI::Commands::Pom < Doubleshot::CLI
|
2
|
+
|
3
|
+
def self.summary
|
4
|
+
<<-EOS.margin
|
5
|
+
Generate a pom.xml based on your Doubleshot file.
|
6
|
+
EOS
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.options
|
10
|
+
Options.new do |options|
|
11
|
+
options.banner = "Usage: doubleshot pom"
|
12
|
+
|
13
|
+
options.separator ""
|
14
|
+
options.separator "Summary: #{summary}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.start(args)
|
19
|
+
require "doubleshot/pom"
|
20
|
+
|
21
|
+
pom = Pathname("pom.xml")
|
22
|
+
pom.rename("pom.xml.#{Time.now.to_i}") if pom.exist?
|
23
|
+
pom.open("w+") do |file|
|
24
|
+
file << Doubleshot::Pom.new(Doubleshot::current.config).to_s
|
25
|
+
end
|
26
|
+
|
27
|
+
return 0
|
28
|
+
end
|
29
|
+
end
|
@@ -8,26 +8,62 @@ class Doubleshot::CLI::Commands::Test < Doubleshot::CLI
|
|
8
8
|
attribute of your Doubleshot configuration.
|
9
9
|
EOS
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
def self.options
|
13
13
|
Options.new do |options|
|
14
|
-
options.banner = "Usage: doubleshot test"
|
15
|
-
|
14
|
+
options.banner = "Usage: doubleshot test [options]"
|
15
|
+
|
16
|
+
options.separator ""
|
17
|
+
options.separator "Options:"
|
18
|
+
|
19
|
+
options.ci_test = false
|
20
|
+
options.on "--ci", "Run all tests, then exit. (No continuous listening for file changes.)" do
|
21
|
+
options.ci_test = true
|
22
|
+
options.build = true
|
23
|
+
end
|
24
|
+
|
16
25
|
options.separator ""
|
17
26
|
options.separator "Summary: #{summary}"
|
18
27
|
end
|
19
28
|
end
|
20
|
-
|
29
|
+
|
21
30
|
def self.start(args)
|
31
|
+
options = self.options.parse!(args)
|
32
|
+
doubleshot = Doubleshot::current
|
33
|
+
|
34
|
+
if Pathname::glob(doubleshot.config.source.tests + "**/*_{spec,test}.rb").empty?
|
35
|
+
puts "No tests found"
|
36
|
+
return 0
|
37
|
+
end
|
38
|
+
|
39
|
+
if options.ci_test
|
40
|
+
if doubleshot.lockfile.exist?
|
41
|
+
puts "--ci: Removing lockfile"
|
42
|
+
doubleshot.lockfile.delete
|
43
|
+
end
|
44
|
+
|
45
|
+
if doubleshot.classpath_cache.exist?
|
46
|
+
puts "--ci: Removing .classpath.cache"
|
47
|
+
doubleshot.classpath_cache.delete
|
48
|
+
end
|
49
|
+
|
50
|
+
if doubleshot.config.target.exist?
|
51
|
+
puts "--ci: Removing target build directory"
|
52
|
+
doubleshot.config.target.rmtree
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
22
56
|
require "listen"
|
23
|
-
|
57
|
+
|
58
|
+
watcher = new(doubleshot.config, options.ci_test)
|
24
59
|
watcher.run
|
25
60
|
end
|
26
|
-
|
27
|
-
def initialize(config)
|
61
|
+
|
62
|
+
def initialize(config, ci_test)
|
28
63
|
@config = config
|
29
64
|
@interrupted = false
|
30
|
-
|
65
|
+
@ci_test = ci_test
|
66
|
+
|
31
67
|
# Hit Ctrl-C once to re-run all specs; twice to exit the program.
|
32
68
|
Signal.trap("INT") do
|
33
69
|
if @interrupted
|
@@ -38,42 +74,56 @@ class Doubleshot::CLI::Commands::Test < Doubleshot::CLI
|
|
38
74
|
run_all_specs
|
39
75
|
@interrupted = false
|
40
76
|
end
|
41
|
-
end
|
77
|
+
end
|
42
78
|
end
|
43
|
-
|
79
|
+
|
44
80
|
def run
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
81
|
+
if @ci_test
|
82
|
+
run_all_specs
|
83
|
+
else
|
84
|
+
Doubleshot::CLI::Commands::Build.start([ "--conditional" ])
|
85
|
+
# Output here just so you know when changes will be
|
86
|
+
# picked up after you start the program.
|
87
|
+
puts "Listening for changes..."
|
88
|
+
listener.start
|
89
|
+
end
|
49
90
|
end
|
50
|
-
|
91
|
+
|
51
92
|
private
|
52
93
|
def listener
|
53
94
|
# This creates a MultiListener
|
54
|
-
Listen.to(@config.source.tests.to_s, @config.source.ruby.to_s).change do |modified, added, removed|
|
95
|
+
Listen.to(@config.source.tests.to_s, @config.source.ruby.to_s, @config.source.java.to_s).change do |modified, added, removed|
|
55
96
|
modified.each do |location|
|
56
97
|
path = Pathname(location)
|
57
|
-
next unless path.extname == ".rb"
|
58
98
|
|
59
|
-
|
99
|
+
next unless path.extname == ".rb" or path.extname == ".java"
|
100
|
+
|
101
|
+
test = if path.basename.to_s =~ /_(spec|test).rb/ && path.child_of?(@config.source.tests)
|
60
102
|
path
|
61
103
|
else
|
62
|
-
relative_path = path.
|
63
|
-
|
104
|
+
relative_path = if path.extname == ".rb"
|
105
|
+
path.relative_path_from(@config.source.ruby.expand_path)
|
106
|
+
else
|
107
|
+
path.relative_path_from(@config.source.java.expand_path)
|
108
|
+
end
|
109
|
+
matcher = relative_path.sub(/(\w+)\.(rb|java)/, "\\1_{spec,test}.rb")
|
64
110
|
matchers = [ matcher, Pathname(matcher.to_s.split("/")[1..-1].join("/")) ]
|
65
|
-
|
111
|
+
|
66
112
|
match = matchers.detect do |matcher|
|
67
113
|
if match = Pathname::glob(@config.source.tests + matcher).first
|
68
|
-
break match
|
114
|
+
break match
|
69
115
|
end
|
70
116
|
end
|
71
117
|
end
|
72
|
-
|
118
|
+
|
73
119
|
if test && test.exist?
|
120
|
+
if path.extname == ".java"
|
121
|
+
Doubleshot::CLI::Commands::Build.start([])
|
122
|
+
end
|
123
|
+
|
74
124
|
duration = Time::measure do
|
75
125
|
puts "\n --- Running test for #{test.to_s} ---\n\n"
|
76
|
-
|
126
|
+
|
77
127
|
org.jruby.Ruby.newInstance.executeScript <<-RUBY, test.to_s
|
78
128
|
begin
|
79
129
|
require #{test.to_s.inspect}
|
@@ -83,7 +133,7 @@ class Doubleshot::CLI::Commands::Test < Doubleshot::CLI
|
|
83
133
|
end
|
84
134
|
RUBY
|
85
135
|
end
|
86
|
-
|
136
|
+
|
87
137
|
puts "Completed in #{duration}s"
|
88
138
|
else
|
89
139
|
puts "\nNo matching test for #{path.relative_path_from(@config.source.ruby.expand_path).to_s}"
|
@@ -91,12 +141,14 @@ class Doubleshot::CLI::Commands::Test < Doubleshot::CLI
|
|
91
141
|
end
|
92
142
|
end
|
93
143
|
end
|
94
|
-
|
144
|
+
|
95
145
|
def run_all_specs
|
146
|
+
exit_status = false
|
96
147
|
duration = Time::measure do
|
97
|
-
|
98
148
|
puts "\n --- Running all tests ---\n\n"
|
99
|
-
|
149
|
+
|
150
|
+
Doubleshot::CLI::Commands::Build.start([ "--conditional" ])
|
151
|
+
|
100
152
|
script = <<-RUBY
|
101
153
|
begin
|
102
154
|
#{
|
@@ -110,10 +162,11 @@ class Doubleshot::CLI::Commands::Test < Doubleshot::CLI
|
|
110
162
|
end
|
111
163
|
RUBY
|
112
164
|
# puts "SCRIPT:", script
|
113
|
-
org.jruby.Ruby.newInstance.executeScript script, "all-specs"
|
165
|
+
exit_status = org.jruby.Ruby.newInstance.executeScript script, "all-specs"
|
114
166
|
end
|
115
|
-
|
167
|
+
|
116
168
|
puts "Completed in #{duration}s"
|
169
|
+
return exit_status
|
117
170
|
end
|
118
|
-
|
119
|
-
end # class Doubleshot::CLI::Commands::Test < Doubleshot::CLI
|
171
|
+
|
172
|
+
end # class Doubleshot::CLI::Commands::Test < Doubleshot::CLI
|