xqcoretools 0.2.0 → 0.2.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/bin/xqcoretools +33 -1
- metadata +2 -2
data/bin/xqcoretools
CHANGED
@@ -11,6 +11,7 @@ require 'execjs'
|
|
11
11
|
require 'fileutils'
|
12
12
|
|
13
13
|
class XQCoreTools < Thor
|
14
|
+
|
14
15
|
desc "processcontent [PLATFORM] [OUTPUT] [PATHS]", "Process content packages"
|
15
16
|
def processcontent(platform, output, paths)
|
16
17
|
|
@@ -30,12 +31,43 @@ class XQCoreTools < Thor
|
|
30
31
|
|
31
32
|
case platform
|
32
33
|
when 'Android'
|
33
|
-
|
34
|
+
copyAssets(output, basePath + '/Content/.')
|
34
35
|
when 'iOS', 'IOS'
|
35
36
|
bundle(output, basePath + '/Content')
|
36
37
|
end
|
37
38
|
end
|
38
39
|
|
40
|
+
desc "copyAssets [OUTPUT] [PATHS]", "Copy asset files to OUTPUT directory"
|
41
|
+
def copyAssets(output, paths)
|
42
|
+
# first, copy recursive from paths to output
|
43
|
+
pathList = paths.split(';')
|
44
|
+
# copy each path to output directory
|
45
|
+
pathList.each do |path|
|
46
|
+
Dir.chdir(path)
|
47
|
+
Dir.glob("**/*", File::FNM_DOTMATCH).each do |file|
|
48
|
+
next if File::directory? file
|
49
|
+
|
50
|
+
basename = File::basename(file)
|
51
|
+
directory = File::dirname(file)
|
52
|
+
if (basename.start_with?("."))
|
53
|
+
basename.slice!(0)
|
54
|
+
end
|
55
|
+
destDir = File.join(output, directory)
|
56
|
+
FileUtils.mkdir_p destDir unless File::directory?(destDir)
|
57
|
+
|
58
|
+
FileUtils.cp file, File.join(destDir, basename)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Create a file listing
|
63
|
+
Dir.chdir(output)
|
64
|
+
File.open(File.join(output, "assets.txt"), 'w') do |file|
|
65
|
+
Dir.glob("**/*").each do |filename|
|
66
|
+
file.puts(filename) unless filename == "assets.txt"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
39
71
|
desc "archive [OUTPUT] [PATHS]", "Generates a compressed archive"
|
40
72
|
def archive(output, paths)
|
41
73
|
FileUtils.rm(output, :force=>true)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xqcoretools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
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: 2013-07-
|
12
|
+
date: 2013-07-29 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Tools for synchronizing multiple CSharp projects and deploying to several
|
15
15
|
platform
|