msbuild 0.1.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2dda5b75d914ff54ce0fd6a5f9e1204940dbe914
4
+ data.tar.gz: b73712d621c1ab7d1f8e45c707249ea2120527ad
5
+ SHA512:
6
+ metadata.gz: 2128eea2ba64cc040bdd729049ac2b0a1f3d851590e359818f0d062d97e11550e9f07a3fe5c51a3166700d51016dc9aba5bdcf7436e33cc7f99d75a2f1aaec2c
7
+ data.tar.gz: 4ac46ed3229fcb6450e7fffb059a5dc44774915cd6928595c21ebc28db81b919843c0203fcff91234568cfd8203e5508caa6e6f5337b7c6bd6ae7abfbf33d1cb
@@ -0,0 +1,28 @@
1
+ require 'os'
2
+
3
+ class MSBuild
4
+ def self.avaliable_versions
5
+ # override me
6
+ raise RuntimeError.new("Unsupported Platform")
7
+ end
8
+
9
+ attr_reader :path
10
+ attr_reader :version
11
+
12
+ def initialize version, path
13
+ @version = version
14
+ @path = path
15
+ end
16
+
17
+ def build args=nil
18
+ # override me
19
+ end
20
+ end
21
+
22
+ if OS.windows?
23
+ require_relative 'msbuild_windows'
24
+ elsif OS.osx?
25
+ require_relative 'msbuild_osx'
26
+ else
27
+ # current platform is not supported
28
+ end
@@ -0,0 +1,23 @@
1
+ require 'os'
2
+ require 'pathname'
3
+
4
+ class MSBuild
5
+ def self.avaliable_versions
6
+ results = []
7
+
8
+ mono_xbuild_path = "/usr/local/bin/xbuild"
9
+ if File.exists? mono_xbuild_path
10
+ results.push MSBuild.new("mono", mono_xbuild_path)
11
+ end
12
+ unity_xbuild_path = "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/bin/xbuild"
13
+ if File.exists? unity_xbuild_path
14
+ results.push MSBuild.new("unity_mono", unity_xbuild_path)
15
+ end
16
+
17
+ return results
18
+ end
19
+
20
+ def build args=nil
21
+ `#{@path}/xbuild #{args}`
22
+ end
23
+ end
@@ -0,0 +1,46 @@
1
+ require 'os'
2
+ require 'pathname'
3
+ require 'win32/registry'
4
+
5
+ class OS
6
+ def self.is_64bits?
7
+ if OS.windows?
8
+ return ENV.has_key?('ProgramFiles(x86)')
9
+ else
10
+ return OS.bits == 64
11
+ end
12
+ end
13
+ end
14
+
15
+ class MSBuild
16
+ def self.avaliable_versions
17
+ results = []
18
+
19
+ begin
20
+ Win32::Registry::HKEY_LOCAL_MACHINE.open(registry_path) do |reg|
21
+ reg.each_key do |version|
22
+ Win32::Registry::HKEY_LOCAL_MACHINE.open(registry_path + version) do |item|
23
+ results.push MSBuild.new(
24
+ item["MSBuildRuntimeVersion"],
25
+ item["MSBuildToolsPath"])
26
+ end
27
+ end
28
+ end
29
+ rescue
30
+ end
31
+
32
+ return results.uniq { |x| x.version }
33
+ end
34
+
35
+ def self.registry_path
36
+ if OS.is_64bits?
37
+ "Software\\Wow6432Node\\Microsoft\\MSBuild\\ToolsVersions\\"
38
+ else
39
+ "Software\\Microsoft\\MSBuild\\ToolsVersions\\"
40
+ end
41
+ end
42
+
43
+ def build args=nil
44
+ `"#{@path}\\msbuild" #{args}`
45
+ end
46
+ end
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: msbuild
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - pjc0247
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-12-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: os
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: msbuild
28
+ email: pjc0247@naver.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - lib/msbuild.rb
34
+ - lib/msbuild_osx.rb
35
+ - lib/msbuild_windows.rb
36
+ homepage:
37
+ licenses: []
38
+ metadata: {}
39
+ post_install_message:
40
+ rdoc_options: []
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ requirements: []
54
+ rubyforge_project:
55
+ rubygems_version: 2.5.1
56
+ signing_key:
57
+ specification_version: 4
58
+ summary: msbuild
59
+ test_files: []