echinoidea 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,9 @@ require 'optparse'
7
7
  opt = OptionParser.new
8
8
 
9
9
  OPTS = {}
10
+ opt.on('-d') {|v| OPTS[:d] = v}
10
11
  opt.on('-o VAL') {|v| OPTS[:o] = v }
12
+ opt.on('-t VAL') {|v| OPTS[:t] = v }
11
13
  opt.parse!(ARGV)
12
14
 
13
15
  if OPTS[:o] == nil || OPTS[:o] == ""
@@ -36,5 +38,7 @@ config = YAML.load_file([current_dir, "echinoidea.yml"].join("/"))
36
38
 
37
39
  builder = Echinoidea::Builder.new(current_dir, config)
38
40
  builder.output_directory = OPTS[:o]
41
+ builder.build_target = OPTS[:t] if OPTS[:t]
42
+ builder.debug_mode = true if OPTS[:d]
39
43
 
40
44
  builder.run
@@ -2,7 +2,7 @@ require 'echinoidea/version'
2
2
 
3
3
  class Echinoidea::Builder
4
4
  attr_reader :class_name, :config, :file_path
5
- attr_accessor :output_directory, :scenes
5
+ attr_accessor :build_target, :debug_mode, :output_directory, :scenes
6
6
 
7
7
  def self.unique_builder_class_name
8
8
  "ECBuilder#{Time.now.strftime('%y%m%d%H%M%S')}"
@@ -12,6 +12,8 @@ class Echinoidea::Builder
12
12
  @class_name = self.class.unique_builder_class_name
13
13
  @root_directory = root_directory
14
14
  @config = config
15
+ @build_target = "iPhone" # Default build target
16
+ @debug_mode = false
15
17
  end
16
18
 
17
19
  def file_path
@@ -50,7 +52,7 @@ public class #{@class_name}
50
52
  BuildOptions opt = BuildOptions.SymlinkLibraries;
51
53
 
52
54
  string[] scenes = {#{scenes}};
53
- BuildPipeline.BuildPlayer(scenes, \"#{@output_directory}\", BuildTarget.iPhone, opt);
55
+ BuildPipeline.BuildPlayer(scenes, \"#{@output_directory}\", BuildTarget.#{@build_target}, opt);
54
56
  EditorApplication.Exit(0);
55
57
  }
56
58
  }"
@@ -62,7 +64,8 @@ public class #{@class_name}
62
64
  end
63
65
 
64
66
  def run_unity_command
65
- `/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchMode -executeMethod #{@class_name}.Build -projectPath #{@root_directory}`
67
+ opts = debug_mode ? "" : "-quit -batchMode"
68
+ `/Applications/Unity/Unity.app/Contents/MacOS/Unity #{opts} -executeMethod #{@class_name}.Build -projectPath #{@root_directory}`
66
69
  end
67
70
 
68
71
  def run
@@ -1,3 +1,3 @@
1
1
  module Echinoidea
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: echinoidea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
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: 2012-10-05 00:00:00.000000000 Z
12
+ date: 2012-10-12 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: echinoidea is a command line unity project build helper.
15
15
  email: