echinoidea 0.0.2 → 0.0.3

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/README.md CHANGED
@@ -1,24 +1,28 @@
1
1
  # Echinoidea
2
2
 
3
- TODO: Write a gem description
3
+ A command line unity project build helper.
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
7
+ Install it yourself as:
8
8
 
9
- gem 'echinoidea'
9
+ $ gem install echinoidea
10
10
 
11
- And then execute:
11
+ ## Usage
12
12
 
13
- $ bundle
13
+ Create `echinoidea.yml` in root directory of your unity project.
14
14
 
15
- Or install it yourself as:
15
+ ```
16
+ scenes:
17
+ - Assets/Scenes/Foo.unity
18
+ bundle_identifier: com.example.foo #optional
19
+ ```
16
20
 
17
- $ gem install echinoidea
18
-
19
- ## Usage
21
+ Then run `echinoidea`.
20
22
 
21
- TODO: Write usage instructions here
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
@@ -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 :bundle_identifier, :output_directory, :scenes
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
- player_settings_opts["bundleIdentifier"] = "\"#{@bundle_identifier}\"" if @bundle_identifier
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
- /*string errorMsg = */BuildPipeline.BuildPlayer(scene, \"#{@output_directory}\", BuildTarget.iPhone,opt);
51
+
52
+ string[] scenes = {#{scenes}};
53
+ BuildPipeline.BuildPlayer(scenes, \"#{@output_directory}\", BuildTarget.iPhone, opt);
41
54
  EditorApplication.Exit(0);
42
55
  }
43
56
  }"
@@ -1,3 +1,3 @@
1
1
  module Echinoidea
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
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.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: