echinoidea 0.0.1 → 0.0.2
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/bin/echinoidea +1 -0
- data/lib/echinoidea/builder.rb +9 -2
- data/lib/echinoidea/version.rb +1 -1
- metadata +1 -1
data/bin/echinoidea
CHANGED
@@ -35,6 +35,7 @@ end
|
|
35
35
|
config = YAML.load_file([current_dir, "echinoidea.yml"].join("/"))
|
36
36
|
|
37
37
|
builder = Echinoidea::Builder.new(current_dir)
|
38
|
+
builder.bundle_identifier = config['bundle_identifier'] if config['bundle_identifier']
|
38
39
|
builder.scenes = config['scenes']
|
39
40
|
builder.output_directory = OPTS[:o]
|
40
41
|
|
data/lib/echinoidea/builder.rb
CHANGED
@@ -2,7 +2,7 @@ require 'echinoidea/version'
|
|
2
2
|
|
3
3
|
class Echinoidea::Builder
|
4
4
|
attr_reader :class_name, :file_path
|
5
|
-
attr_accessor :
|
5
|
+
attr_accessor :bundle_identifier, :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')}"
|
@@ -21,6 +21,12 @@ class Echinoidea::Builder
|
|
21
21
|
# Thanks to: http://ameblo.jp/principia-ca/entry-11010391965.html
|
22
22
|
File.open(self.file_path,'w'){|f|
|
23
23
|
scenes = @scenes.map{|scene| "\"#{scene}\""}.join(",")
|
24
|
+
|
25
|
+
player_settings_opts = {}
|
26
|
+
player_settings_opts["bundleIdentifier"] = "\"#{@bundle_identifier}\"" if @bundle_identifier
|
27
|
+
|
28
|
+
player_settings_opts_string = player_settings_opts.map{|k,v| "PlayerSettings.#{k} = #{v};"}.join("\n")
|
29
|
+
|
24
30
|
f.write "using UnityEngine;
|
25
31
|
using UnityEditor;
|
26
32
|
using System.Collections;
|
@@ -29,6 +35,7 @@ public class #{@class_name}
|
|
29
35
|
private static string[] scene = {#{scenes}};
|
30
36
|
public static void Build()
|
31
37
|
{
|
38
|
+
#{player_settings_opts_string}
|
32
39
|
BuildOptions opt = BuildOptions.SymlinkLibraries;
|
33
40
|
/*string errorMsg = */BuildPipeline.BuildPlayer(scene, \"#{@output_directory}\", BuildTarget.iPhone,opt);
|
34
41
|
EditorApplication.Exit(0);
|
@@ -42,7 +49,7 @@ public class #{@class_name}
|
|
42
49
|
end
|
43
50
|
|
44
51
|
def run_unity_command
|
45
|
-
`/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -
|
52
|
+
`/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchMode -executeMethod #{@class_name}.Build -projectPath #{@root_directory}`
|
46
53
|
end
|
47
54
|
|
48
55
|
def run
|
data/lib/echinoidea/version.rb
CHANGED