gjp 0.33.0 → 0.34.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ module Gjp
7
7
 
8
8
  # runs Maven in a subprocess
9
9
  def mvn(options)
10
- run_executable("#{get_maven_commandline(@project.full_path)} #{options.join(' ')}")
10
+ run_executable(get_maven_commandline(@project.full_path, options))
11
11
  end
12
12
 
13
13
  # runs Maven to attempt getting a source jar
@@ -30,7 +30,7 @@ module Gjp
30
30
 
31
31
  # returns a command line for running Maven from the specified
32
32
  # prefix
33
- def get_maven_commandline(prefix)
33
+ def get_maven_commandline(prefix, options)
34
34
  executable = find_executable("mvn")
35
35
 
36
36
  if executable != nil
@@ -38,7 +38,7 @@ module Gjp
38
38
  repo_path = File.join(prefix, "kit", "m2")
39
39
  config_path = File.join(prefix, "kit", "m2", "settings.xml")
40
40
 
41
- "#{mvn_path} -Dmaven.repo.local=#{repo_path} -s#{config_path}"
41
+ "#{mvn_path} -Dmaven.repo.local=#{repo_path} -s#{config_path} #{options.join(' ')}"
42
42
  else
43
43
  raise ExecutableNotFoundError.new("mvn")
44
44
  end
@@ -30,7 +30,7 @@ module Gjp
30
30
  ] +
31
31
  relevant_lines.map do |line|
32
32
  if line =~ /gjp +mvn/
33
- line.gsub(/gjp +mvn/, "#{@maven_runner.get_maven_commandline("$PROJECT_PREFIX")}")
33
+ line.gsub(/gjp +mvn/, "#{@maven_runner.get_maven_commandline("$PROJECT_PREFIX", ["-o"])}")
34
34
  elsif line =~ /gjp +ant/
35
35
  line.gsub(/gjp +ant/, "#{@ant_runner.get_ant_commandline("$PROJECT_PREFIX")}")
36
36
  else
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module Gjp
4
- VERSION = "0.33.0"
4
+ VERSION = "0.34.0"
5
5
  end
@@ -21,12 +21,12 @@ describe Gjp::MavenRunner do
21
21
  executable_path = create_mock_executable("mvn")
22
22
 
23
23
  @project.from_directory do
24
- commandline = @kit_runner.get_maven_commandline(".")
25
- commandline.should eq "./#{executable_path} -Dmaven.repo.local=./kit/m2 -s./kit/m2/settings.xml"
24
+ commandline = @kit_runner.get_maven_commandline(".", ["--otheroption"])
25
+ commandline.should eq "./#{executable_path} -Dmaven.repo.local=./kit/m2 -s./kit/m2/settings.xml --otheroption"
26
26
  end
27
27
  end
28
28
  it "doesn't return commandline options if Maven is not available" do
29
- expect { @kit_runner.get_maven_commandline(".") }.to raise_error(Gjp::ExecutableNotFoundError)
29
+ expect { @kit_runner.get_maven_commandline(".", []) }.to raise_error(Gjp::ExecutableNotFoundError)
30
30
  end
31
31
  end
32
32
 
@@ -41,7 +41,7 @@ describe Gjp::ScriptGenerator do
41
41
 
42
42
  lines.should include("#!/bin/bash\n")
43
43
  lines.should include("cd somewhere significant\n")
44
- lines.should include("$PROJECT_PREFIX/kit/mvn/bin/mvn -Dmaven.repo.local=$PROJECT_PREFIX/kit/m2 -s$PROJECT_PREFIX/kit/m2/settings.xml --options\n")
44
+ lines.should include("$PROJECT_PREFIX/kit/mvn/bin/mvn -Dmaven.repo.local=$PROJECT_PREFIX/kit/m2 -s$PROJECT_PREFIX/kit/m2/settings.xml -o --options\n")
45
45
 
46
46
  lines.should_not include("some earlier command\n")
47
47
  lines.should_not include("gjp dry-run --unwanted-options\n")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gjp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.0
4
+ version: 0.34.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-07 00:00:00.000000000 Z
12
+ date: 2014-01-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake