echinoidea 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +14 -10
- data/bin/echinoidea +1 -3
- data/lib/echinoidea/builder.rb +20 -7
- data/lib/echinoidea/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -1,24 +1,28 @@
|
|
1
1
|
# Echinoidea
|
2
2
|
|
3
|
-
|
3
|
+
A command line unity project build helper.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
7
|
+
Install it yourself as:
|
8
8
|
|
9
|
-
gem
|
9
|
+
$ gem install echinoidea
|
10
10
|
|
11
|
-
|
11
|
+
## Usage
|
12
12
|
|
13
|
-
|
13
|
+
Create `echinoidea.yml` in root directory of your unity project.
|
14
14
|
|
15
|
-
|
15
|
+
```
|
16
|
+
scenes:
|
17
|
+
- Assets/Scenes/Foo.unity
|
18
|
+
bundle_identifier: com.example.foo #optional
|
19
|
+
```
|
16
20
|
|
17
|
-
|
18
|
-
|
19
|
-
## Usage
|
21
|
+
Then run `echinoidea`.
|
20
22
|
|
21
|
-
|
23
|
+
```
|
24
|
+
echinoidea -o [OUTPUT_DIRECTORY]
|
25
|
+
```
|
22
26
|
|
23
27
|
## Contributing
|
24
28
|
|
data/bin/echinoidea
CHANGED
@@ -34,9 +34,7 @@ end
|
|
34
34
|
# load config
|
35
35
|
config = YAML.load_file([current_dir, "echinoidea.yml"].join("/"))
|
36
36
|
|
37
|
-
builder = Echinoidea::Builder.new(current_dir)
|
38
|
-
builder.bundle_identifier = config['bundle_identifier'] if config['bundle_identifier']
|
39
|
-
builder.scenes = config['scenes']
|
37
|
+
builder = Echinoidea::Builder.new(current_dir, config)
|
40
38
|
builder.output_directory = OPTS[:o]
|
41
39
|
|
42
40
|
builder.run
|
data/lib/echinoidea/builder.rb
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
require 'echinoidea/version'
|
2
2
|
|
3
3
|
class Echinoidea::Builder
|
4
|
-
attr_reader :class_name, :file_path
|
5
|
-
attr_accessor :
|
4
|
+
attr_reader :class_name, :config, :file_path
|
5
|
+
attr_accessor :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')}"
|
9
9
|
end
|
10
10
|
|
11
|
-
def initialize(root_directory)
|
11
|
+
def initialize(root_directory, config)
|
12
12
|
@class_name = self.class.unique_builder_class_name
|
13
13
|
@root_directory = root_directory
|
14
|
+
@config = config
|
14
15
|
end
|
15
16
|
|
16
17
|
def file_path
|
@@ -20,10 +21,21 @@ class Echinoidea::Builder
|
|
20
21
|
def write_to_file
|
21
22
|
# Thanks to: http://ameblo.jp/principia-ca/entry-11010391965.html
|
22
23
|
File.open(self.file_path,'w'){|f|
|
23
|
-
scenes = @scenes.map{|scene| "\"#{scene}\""}.join(",")
|
24
|
+
scenes = @config['scenes'].map{|scene| "\"#{scene}\""}.join(",")
|
24
25
|
|
25
26
|
player_settings_opts = {}
|
26
|
-
|
27
|
+
|
28
|
+
if @config['bundle_identifier']
|
29
|
+
bundle_identifier = @config['bundle_identifier']
|
30
|
+
player_settings_opts["bundleIdentifier"] = "\"#{bundle_identifier}\""
|
31
|
+
end
|
32
|
+
|
33
|
+
if @config['stripping_level']
|
34
|
+
player_settings_opts["strippingLevel"] = "StrippingLevel.#{@config['stripping_level']}"
|
35
|
+
end
|
36
|
+
if @config['api_compatibility_level']
|
37
|
+
player_settings_opts["apiCompatibilityLevel"] = "ApiCompatibilityLevel.#{@config['api_compatibility_level']}"
|
38
|
+
end
|
27
39
|
|
28
40
|
player_settings_opts_string = player_settings_opts.map{|k,v| "PlayerSettings.#{k} = #{v};"}.join("\n")
|
29
41
|
|
@@ -32,12 +44,13 @@ using UnityEditor;
|
|
32
44
|
using System.Collections;
|
33
45
|
public class #{@class_name}
|
34
46
|
{
|
35
|
-
private static string[] scene = {#{scenes}};
|
36
47
|
public static void Build()
|
37
48
|
{
|
38
49
|
#{player_settings_opts_string}
|
39
50
|
BuildOptions opt = BuildOptions.SymlinkLibraries;
|
40
|
-
|
51
|
+
|
52
|
+
string[] scenes = {#{scenes}};
|
53
|
+
BuildPipeline.BuildPlayer(scenes, \"#{@output_directory}\", BuildTarget.iPhone, opt);
|
41
54
|
EditorApplication.Exit(0);
|
42
55
|
}
|
43
56
|
}"
|
data/lib/echinoidea/version.rb
CHANGED