nbuild 0.0.3 → 0.0.4
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/lib/nbuild/msi_exec_cmd.rb +39 -0
- data/lib/nbuild/visual_studio_cmd.rb +38 -0
- metadata +14 -5
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'nbuild/cmd'
|
2
|
+
require 'win32/process'
|
3
|
+
|
4
|
+
module Nbuild
|
5
|
+
class MsiExecCmd < Cmd
|
6
|
+
def initialize params={}
|
7
|
+
@params = params
|
8
|
+
end
|
9
|
+
|
10
|
+
def command
|
11
|
+
msi = @params[:msi]
|
12
|
+
command = "/package" if @params[:install]
|
13
|
+
command = "/uninstall" if @params[:uninstall]
|
14
|
+
@params[:parameters] ||= {}
|
15
|
+
parameters = @params[:parameters].map{|k,v| "#{k}=\"#{v}\""}.join(' ')
|
16
|
+
"msiexec.exe #{command} \"#{msi}\" /passive #{parameters}"
|
17
|
+
end
|
18
|
+
|
19
|
+
def execute_internal
|
20
|
+
the_command = self.command
|
21
|
+
puts "executing \"#{the_command}\""
|
22
|
+
process = Process.create(:command_line => the_command)
|
23
|
+
puts "waiting for pid #{process.process_id}"
|
24
|
+
Process.waitpid process.process_id
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def msi_exec_cmd params
|
29
|
+
MsiExecCmd.new(params).execute
|
30
|
+
end
|
31
|
+
|
32
|
+
def install_msi params={}
|
33
|
+
MsiExecCmd.new(params.merge(:install => true)).execute
|
34
|
+
end
|
35
|
+
|
36
|
+
def uninstall_msi params={}
|
37
|
+
MsiExecCmd.new(params.merge(:uninstall => true)).execute
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'nbuild/cmd'
|
2
|
+
require 'win32/process'
|
3
|
+
|
4
|
+
module Nbuild
|
5
|
+
class VisualStudioCmd < Cmd
|
6
|
+
def initialize params={}
|
7
|
+
@params = params
|
8
|
+
version = params.delete(:version)
|
9
|
+
version ||= '9.0'
|
10
|
+
@path = ENV['DEVENV_HOME'] || ENV['ProgramFiles'] +"\\Microsoft Visual Studio #{version}"
|
11
|
+
@path += "\\Common7\\IDE"
|
12
|
+
end
|
13
|
+
|
14
|
+
def command
|
15
|
+
solution = @params[:solution]
|
16
|
+
build = "/Build \"#{@params[:build]}\"" if @params[:build]
|
17
|
+
project = "/Project \"#{@params[:project]}\"" if @params[:project]
|
18
|
+
|
19
|
+
"\"#{@path}\\devenv.exe\" \"#{solution}\" #{build} #{project}"
|
20
|
+
end
|
21
|
+
|
22
|
+
def execute_internal
|
23
|
+
the_command = self.command
|
24
|
+
puts "executing #{the_command}"
|
25
|
+
process = Process.create(:command_line => the_command)
|
26
|
+
puts "waiting for pid #{process.process_id}"
|
27
|
+
Process.waitpid process.process_id
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def visual_studio_command params={}
|
32
|
+
VisualStudioCmd.new(params).execute
|
33
|
+
end
|
34
|
+
|
35
|
+
def visual_studio_2008_command params={}
|
36
|
+
msbuild_command params.merge(:version => '9.0')
|
37
|
+
end
|
38
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nbuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 4
|
9
|
+
version: 0.0.4
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Mark Ryall
|
@@ -9,7 +14,7 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-02-23 00:00:00 +11:00
|
13
18
|
default_executable:
|
14
19
|
dependencies: []
|
15
20
|
|
@@ -28,11 +33,13 @@ files:
|
|
28
33
|
- lib/nbuild/file_filter.rb
|
29
34
|
- lib/nbuild/install_util_cmd.rb
|
30
35
|
- lib/nbuild/msbuild_cmd.rb
|
36
|
+
- lib/nbuild/msi_exec_cmd.rb
|
31
37
|
- lib/nbuild/mstest_cmd.rb
|
32
38
|
- lib/nbuild/ncache_cmd.rb
|
33
39
|
- lib/nbuild/ncover_cmd.rb
|
34
40
|
- lib/nbuild/ndepend_cmd.rb
|
35
41
|
- lib/nbuild/tf.rb
|
42
|
+
- lib/nbuild/visual_studio_cmd.rb
|
36
43
|
- lib/nbuild.rb
|
37
44
|
- README
|
38
45
|
- MIT-LICENSE
|
@@ -49,18 +56,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
49
56
|
requirements:
|
50
57
|
- - ">="
|
51
58
|
- !ruby/object:Gem::Version
|
59
|
+
segments:
|
60
|
+
- 0
|
52
61
|
version: "0"
|
53
|
-
version:
|
54
62
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
63
|
requirements:
|
56
64
|
- - ">="
|
57
65
|
- !ruby/object:Gem::Version
|
66
|
+
segments:
|
67
|
+
- 0
|
58
68
|
version: "0"
|
59
|
-
version:
|
60
69
|
requirements: []
|
61
70
|
|
62
71
|
rubyforge_project:
|
63
|
-
rubygems_version: 1.3.
|
72
|
+
rubygems_version: 1.3.6
|
64
73
|
signing_key:
|
65
74
|
specification_version: 3
|
66
75
|
summary: miscellaneous helpers for creating .net builds
|