limited_build_works 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87421a7800b22577f94eed35180bcc83352be515
4
- data.tar.gz: 883fb953984caef0440b5f03acb9ba095d1cd54e
3
+ metadata.gz: c1c8c07ff2350d4e0e1c1b94cb0b106c76201d86
4
+ data.tar.gz: 7d3edba647db767efc403bf83c9c3420e6102263
5
5
  SHA512:
6
- metadata.gz: 4545d8d787dcf965d27ffa28ba822203f2b391dc9dd7d2fe20fd8df2332e51bbb4571689cad0dd783e4976b6d5cf3a76189ef7617bbedb624bd0068b61da13c5
7
- data.tar.gz: f0cad0fb75b39f206f33ee952201e27a861032645dc16a0452f29acb35f25b3fde0ca39cc1c1a5c02dd2eab435c364230163e43dd68ce76daea1b65ebe24ec79
6
+ metadata.gz: 25d612cd8e25f1b97e0f1b4ff0ab5a6a03ddd56c47c43a15e8aa9cc718782e114f93fcc9c23547d46691cf45d507222f6faad15af457be3b5f1f5e04ccd3c6c0
7
+ data.tar.gz: 3e47097e4f8d9eadbedebe9fc3875571522aefd7a915327f37a7070f40e81ed0c9d5c3454a02c910f07c30c5afe164c98b896ebb0d5e7ba98c61f072c0d2d290
@@ -1,2 +1,4 @@
1
1
  require "limited_build_works/version"
2
2
  require "limited_build_works/xcode"
3
+ require "limited_build_works/mcs"
4
+ require "limited_build_works/android"
@@ -0,0 +1,26 @@
1
+ require "ult"
2
+
3
+ module LimitedBuildWorks
4
+ module Android
5
+ extend self
6
+
7
+ def build_ndk( ndk_root, project_path, add_options = {}, &callback )
8
+ options = {
9
+ "NDK_PROJECT_PATH" => project_path,
10
+ }.merge!( add_options )
11
+ option_strings = []
12
+ options.each{|key, value|
13
+ option_strings.push "#{key}=#{value}"
14
+ }
15
+ status, outputs, errors, command = Ult.execute( "#{ndk_root}/ndk-build -B #{option_strings.join( ' ' )} #{command}" )
16
+ puts "#{command}"
17
+ callback.call( status, outputs, errors, command ) if ! callback.nil?
18
+ if 0 == status
19
+ puts outputs
20
+ else
21
+ puts outputs
22
+ puts errors
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,30 @@
1
+ require "ult"
2
+
3
+ module LimitedBuildWorks
4
+ module Mcs
5
+ extend self
6
+
7
+ def build( options = {}, command = "" )
8
+ option_strings = []
9
+ options.each{|key, value|
10
+ option_strings.push "#{key}:#{value}"
11
+ }
12
+ Ult.execute( "mcs #{option_strings.join( ' ' )} #{command}" )
13
+ end
14
+
15
+ def build_lib( output, srcs, add_options = {} )
16
+ options = {
17
+ "/target" => "library",
18
+ "/out" => output,
19
+ }
20
+ status, outputs, errors, command = build( options.merge( add_options ), srcs.join( " " ) )
21
+ puts command
22
+ if 0 != status
23
+ puts outputs
24
+ puts errors
25
+ output = ""
26
+ end
27
+ output
28
+ end
29
+ end
30
+ end
@@ -1,3 +1,3 @@
1
1
  module LimitedBuildWorks
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -4,15 +4,15 @@ module LimitedBuildWorks
4
4
  module Xcode
5
5
  extend self
6
6
 
7
- def build( options = {}, action = "" )
7
+ def build( options = {}, command = "" )
8
8
  option_strings = []
9
9
  options.each{|key, value|
10
10
  option_strings.push "#{key} #{value}"
11
11
  }
12
- Ult.execute( "xcodebuild #{option_strings.join( ' ' )} #{action}" )
12
+ Ult.execute( "xcodebuild #{option_strings.join( ' ' )} #{command}" )
13
13
  end
14
14
 
15
- def build_ios_arch( project, target, configuration, output_dir, arch, add_options = {} )
15
+ def build_ios_arch( project, target, configuration, output_dir, arch, add_options = {}, &callback )
16
16
  case arch
17
17
  when /arm*/
18
18
  sdk = "iphoneos"
@@ -30,23 +30,27 @@ module LimitedBuildWorks
30
30
  "-sdk" => sdk,
31
31
  "-arch" => arch,
32
32
  }
33
- action = "clean build CONFIGURATION_BUILD_DIR=#{output_dir}/#{arch}"
34
- status, outputs, errors, command = build( options.merge( add_options ), action )
33
+ status, outputs, errors, command = build( options.merge( add_options ), "clean build CONFIGURATION_BUILD_DIR=#{output_dir}/#{arch}" )
35
34
  puts "[#{arch}] #{command}"
35
+ callback.call( status, outputs, errors, command ) if ! callback.nil?
36
36
  if 0 == status
37
37
  outputs.each{|line|
38
38
  return $2 if /^(Libtool|Ld)\s(.+?)\s/ =~ line
39
39
  }
40
40
  else
41
+ puts outputs
41
42
  puts errors
42
43
  end
43
44
  ""
44
45
  end
45
46
 
46
- def build_ios_archs( project, target, configuration, output_dir, archs, add_options = {} )
47
+ def build_ios_archs( project, target, configuration, output_dir, archs, add_options = {}, &callback )
48
+ callback = lambda{|status, outputs, errors, command|} if callback.nil?
47
49
  results = []
48
50
  archs.each{|arch|
49
- result = build_ios_arch( project, target, configuration, output_dir, arch, add_options )
51
+ result = build_ios_arch( project, target, configuration, output_dir, arch, add_options ){|status, outputs, errors, command|
52
+ callback.call( status, outputs, errors, command )
53
+ }
50
54
  return "" if ! Ult.file?( result )
51
55
 
52
56
  results.push result
@@ -59,6 +63,7 @@ module LimitedBuildWorks
59
63
  return dst if 0 == status
60
64
 
61
65
  puts command
66
+ puts outputs
62
67
  puts errors
63
68
  ""
64
69
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: limited_build_works
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - liveralmask
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-10 00:00:00.000000000 Z
11
+ date: 2017-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,8 @@ files:
66
66
  - bin/console
67
67
  - bin/setup
68
68
  - lib/limited_build_works.rb
69
+ - lib/limited_build_works/android.rb
70
+ - lib/limited_build_works/mcs.rb
69
71
  - lib/limited_build_works/version.rb
70
72
  - lib/limited_build_works/xcode.rb
71
73
  - limited_build_works.gemspec