echinoidea 0.0.1
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/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/bin/echinoidea +41 -0
- data/echinoidea.gemspec +19 -0
- data/lib/echinoidea.rb +24 -0
- data/lib/echinoidea/builder.rb +53 -0
- data/lib/echinoidea/version.rb +3 -0
- metadata +56 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2012 Sota Yokoe
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Echinoidea
|
|
2
|
+
|
|
3
|
+
TODO: Write a gem description
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
gem 'echinoidea'
|
|
10
|
+
|
|
11
|
+
And then execute:
|
|
12
|
+
|
|
13
|
+
$ bundle
|
|
14
|
+
|
|
15
|
+
Or install it yourself as:
|
|
16
|
+
|
|
17
|
+
$ gem install echinoidea
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
TODO: Write usage instructions here
|
|
22
|
+
|
|
23
|
+
## Contributing
|
|
24
|
+
|
|
25
|
+
1. Fork it
|
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/echinoidea
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# encoding: UTF-8
|
|
3
|
+
|
|
4
|
+
require 'yaml'
|
|
5
|
+
require "echinoidea"
|
|
6
|
+
require 'optparse'
|
|
7
|
+
opt = OptionParser.new
|
|
8
|
+
|
|
9
|
+
OPTS = {}
|
|
10
|
+
opt.on('-o VAL') {|v| OPTS[:o] = v }
|
|
11
|
+
opt.parse!(ARGV)
|
|
12
|
+
|
|
13
|
+
if OPTS[:o] == nil || OPTS[:o] == ""
|
|
14
|
+
STDERR.puts "Specify output directory with option -o. echinoidea -o output_directory"
|
|
15
|
+
exit
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
current_dir = Dir::pwd
|
|
19
|
+
|
|
20
|
+
if !Echinoidea::project_root_directory?(current_dir)
|
|
21
|
+
STDERR.puts "#{Dir::pwd} is not root directory of a unity project."
|
|
22
|
+
exit
|
|
23
|
+
end
|
|
24
|
+
if !Echinoidea::config_exists?(current_dir)
|
|
25
|
+
STDERR.puts "No echinoidea.yml exists in #{Dir::pwd}"
|
|
26
|
+
exit
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
if !Echinoidea::editor_directory_exists?(current_dir)
|
|
30
|
+
puts "No Editor directory. Create Editor directory."
|
|
31
|
+
Echinoidea::create_editor_directory(current_dir)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# load config
|
|
35
|
+
config = YAML.load_file([current_dir, "echinoidea.yml"].join("/"))
|
|
36
|
+
|
|
37
|
+
builder = Echinoidea::Builder.new(current_dir)
|
|
38
|
+
builder.scenes = config['scenes']
|
|
39
|
+
builder.output_directory = OPTS[:o]
|
|
40
|
+
|
|
41
|
+
builder.run
|
data/echinoidea.gemspec
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'echinoidea/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |gem|
|
|
7
|
+
gem.name = "echinoidea"
|
|
8
|
+
gem.version = Echinoidea::VERSION
|
|
9
|
+
gem.authors = ["Sota Yokoe"]
|
|
10
|
+
gem.email = ["gem@kreuz45.com"]
|
|
11
|
+
gem.description = "A command line unity project build helper"
|
|
12
|
+
gem.summary = "A command line unity project build helper"
|
|
13
|
+
gem.homepage = "https://github.com/yokoe/echinoidea"
|
|
14
|
+
|
|
15
|
+
gem.files = `git ls-files`.split($/)
|
|
16
|
+
gem.executables = "echinoidea"
|
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
18
|
+
gem.require_paths = ["lib"]
|
|
19
|
+
end
|
data/lib/echinoidea.rb
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require "echinoidea/builder"
|
|
2
|
+
require "echinoidea/version"
|
|
3
|
+
|
|
4
|
+
module Echinoidea
|
|
5
|
+
def self.project_root_directory?(path)
|
|
6
|
+
File.exists?([path, "Assets"].join("/"))
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def self.editor_directory_path(root_directory_path)
|
|
10
|
+
[root_directory_path, "Assets", "Editor"].join("/")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def self.editor_directory_exists?(path)
|
|
14
|
+
File.exists?(self.editor_directory_path(path))
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.create_editor_directory(path)
|
|
18
|
+
Dir::mkdir(self.editor_directory_path(path))
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.config_exists?(path)
|
|
22
|
+
File.exists?([path, "echinoidea.yml"].join("/"))
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
require 'echinoidea/version'
|
|
2
|
+
|
|
3
|
+
class Echinoidea::Builder
|
|
4
|
+
attr_reader :class_name, :file_path
|
|
5
|
+
attr_accessor :scenes, :output_directory
|
|
6
|
+
|
|
7
|
+
def self.unique_builder_class_name
|
|
8
|
+
"ECBuilder#{Time.now.strftime('%y%m%d%H%M%S')}"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def initialize(root_directory)
|
|
12
|
+
@class_name = self.class.unique_builder_class_name
|
|
13
|
+
@root_directory = root_directory
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def file_path
|
|
17
|
+
[@root_directory, "Assets", "Editor", "#{@class_name}.cs"].join("/")
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def write_to_file
|
|
21
|
+
# Thanks to: http://ameblo.jp/principia-ca/entry-11010391965.html
|
|
22
|
+
File.open(self.file_path,'w'){|f|
|
|
23
|
+
scenes = @scenes.map{|scene| "\"#{scene}\""}.join(",")
|
|
24
|
+
f.write "using UnityEngine;
|
|
25
|
+
using UnityEditor;
|
|
26
|
+
using System.Collections;
|
|
27
|
+
public class #{@class_name}
|
|
28
|
+
{
|
|
29
|
+
private static string[] scene = {#{scenes}};
|
|
30
|
+
public static void Build()
|
|
31
|
+
{
|
|
32
|
+
BuildOptions opt = BuildOptions.SymlinkLibraries;
|
|
33
|
+
/*string errorMsg = */BuildPipeline.BuildPlayer(scene, \"#{@output_directory}\", BuildTarget.iPhone,opt);
|
|
34
|
+
EditorApplication.Exit(0);
|
|
35
|
+
}
|
|
36
|
+
}"
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
def remove_files
|
|
40
|
+
File.delete(self.file_path)
|
|
41
|
+
File.delete("#{self.file_path}.meta")
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def run_unity_command
|
|
45
|
+
`/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -executeMethod #{@class_name}.Build -projectPath #{@root_directory}`
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def run
|
|
49
|
+
write_to_file
|
|
50
|
+
run_unity_command
|
|
51
|
+
remove_files
|
|
52
|
+
end
|
|
53
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: echinoidea
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Sota Yokoe
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2012-10-03 00:00:00.000000000 Z
|
|
13
|
+
dependencies: []
|
|
14
|
+
description: A command line unity project build helper
|
|
15
|
+
email:
|
|
16
|
+
- gem@kreuz45.com
|
|
17
|
+
executables:
|
|
18
|
+
- echinoidea
|
|
19
|
+
extensions: []
|
|
20
|
+
extra_rdoc_files: []
|
|
21
|
+
files:
|
|
22
|
+
- .gitignore
|
|
23
|
+
- Gemfile
|
|
24
|
+
- LICENSE.txt
|
|
25
|
+
- README.md
|
|
26
|
+
- Rakefile
|
|
27
|
+
- bin/echinoidea
|
|
28
|
+
- echinoidea.gemspec
|
|
29
|
+
- lib/echinoidea.rb
|
|
30
|
+
- lib/echinoidea/builder.rb
|
|
31
|
+
- lib/echinoidea/version.rb
|
|
32
|
+
homepage: https://github.com/yokoe/echinoidea
|
|
33
|
+
licenses: []
|
|
34
|
+
post_install_message:
|
|
35
|
+
rdoc_options: []
|
|
36
|
+
require_paths:
|
|
37
|
+
- lib
|
|
38
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
39
|
+
none: false
|
|
40
|
+
requirements:
|
|
41
|
+
- - ! '>='
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: '0'
|
|
44
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
45
|
+
none: false
|
|
46
|
+
requirements:
|
|
47
|
+
- - ! '>='
|
|
48
|
+
- !ruby/object:Gem::Version
|
|
49
|
+
version: '0'
|
|
50
|
+
requirements: []
|
|
51
|
+
rubyforge_project:
|
|
52
|
+
rubygems_version: 1.8.24
|
|
53
|
+
signing_key:
|
|
54
|
+
specification_version: 3
|
|
55
|
+
summary: A command line unity project build helper
|
|
56
|
+
test_files: []
|