nixenvironment 0.0.23 → 0.0.24

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9616d007f2590a37efc28a74252704e4224f7fae
4
- data.tar.gz: 9aca450dec80c7ab997da8bdbcbe23268e2c41f0
3
+ metadata.gz: 25d7a471f861f5ff4e2f6a6260ffdae72890cc7c
4
+ data.tar.gz: b39797b9754c940d764e128335247a34bef53e09
5
5
  SHA512:
6
- metadata.gz: 23e3077afb99d78358f8dfbcc578b20496da0279031a370c2ccd10de575f933621fde644bb85a21c4641aca372072b38233d40c2b6317b8befed943b13fc4257
7
- data.tar.gz: 6fafc3e58d77931d964b72adc9073250ce20b87af6799f8496f9a6d3498453f42928db0e587411ed26187bc66a05edebe2203965dae3affdf8674f79b4121c58
6
+ metadata.gz: 174971b1f0992cc3efd7c30f0cf638b5eddf823e345c09716cd9fc761d7d4d7f6188ccbb6dda6cd87285f143be582e4c5d3c0a7aad3c17ff7c986461873cdff7
7
+ data.tar.gz: 09f278e15fa108180067d66d583533fb4565f8c8358be80ec374c609bda6ea54bdcb4f7a8391d679000ed61f78be69767fed737b935962749327ca5c9fe9d3a7
data/bin/nixenvironment CHANGED
@@ -64,36 +64,14 @@ command :build do |c|
64
64
  c.description = 'Build project for selected configuration and make signed/resigned ipa'
65
65
  c.option '--config NAME', String, 'Select configuration'
66
66
  c.option '--ipa TYPE', String, 'Select sign (ipa, resigned_ipa_for_device, resigned_ipa_for_adhoc_distribution or resigned_ipa_for_appstore)'
67
- c.option '--ci_build VALUE', String, 'Define NIXENV_CI_BUILD environment variable (yes, true, 1 or on to enable)'
67
+ c.option '--ci_build', 'Define NIXENV_CI_BUILD environment variable'
68
68
  c.option '--unity TARGET PLATFORM', String, 'Select target platform to build (ios or android)'
69
69
  c.action do |args, options|
70
- options.default :config => 'Debug', :ipa => 'ipa', :ci_build => 'yes'
70
+ options.default :config => 'Debug', :ipa => 'ipa'
71
71
 
72
- root_working_directory = nil
73
- need_chdir_to_root_working_directory = false
74
-
75
- unity = options.unity
76
- if unity and unity.length > 0
77
- case unity
78
- when 'ios'
79
- ios_project_path = File.join(Dir.pwd, 'Builds/iOS')
80
-
81
- unity_success = system("unity -executeMethod NIXBuilder.MakeiOSBuild -batchmode -quit -customArgs:path='#{ios_project_path}'")
82
- abort('Build unity error!') unless unity_success
83
-
84
- root_working_directory = Dir.pwd
85
- need_chdir_to_root_working_directory = true
86
-
87
- Dir.chdir(ios_project_path)
88
-
89
- $project_to_build = 'Unity-iPhone.xcodeproj'
90
- $project_target_to_build = 'Unity-iPhone'
91
- $infoplist_path = 'Info.plist'
92
- when 'android'
93
- #TODO: implement me!
94
- else
95
- abort("Error: Unknown unity target platform '#{unity}'!")
96
- end
72
+ if options.unity and options.unity.length > 0
73
+ need_to_build_ios, root_working_dir, need_chdir_to_root_working_dir = unity_build(options.unity)
74
+ return unless need_to_build_ios
97
75
  end
98
76
 
99
77
  begin
@@ -104,10 +82,10 @@ command :build do |c|
104
82
  build(build_settings, options.config, options.ipa)
105
83
  restore_info_plist
106
84
  rescue
107
- raise # re-rise exception but chdir to root_working_directory in ensure block first if needed
85
+ raise # re-rise exception but chdir to root_working_dir in ensure block first if needed
108
86
  ensure
109
- if need_chdir_to_root_working_directory and root_working_directory
110
- Dir.chdir(root_working_directory)
87
+ if need_chdir_to_root_working_dir and root_working_dir
88
+ Dir.chdir(root_working_dir)
111
89
  end
112
90
  end
113
91
  end
@@ -176,8 +154,9 @@ end
176
154
  command :clean_working_copy do |c|
177
155
  c.syntax = 'nixenvironment clean_working_copy'
178
156
  c.description = 'Make working copy clean'
157
+ c.option '--all', 'Remove ignored files too'
179
158
  c.action do |args, options|
180
- clean_working_copy
159
+ clean_working_copy(options.all)
181
160
  end
182
161
  end
183
162
 
@@ -275,7 +254,7 @@ def update_config(key, value)
275
254
  end
276
255
 
277
256
  def enable_ci_build(ci_build)
278
- if ci_build == 'yes' or ci_build == 'true' or ci_build == '1' or ci_build == 'on'
257
+ if ci_build
279
258
  ENV['NIXENV_CI_BUILD'] = '1'
280
259
  p('CI_BUILD enabled.')
281
260
  else
@@ -478,6 +457,55 @@ def build(build_settings, config, ipa)
478
457
  end
479
458
  end
480
459
 
460
+ def unity_build(unity)
461
+ root_working_dir = nil
462
+ need_chdir_to_root_working_dir = false
463
+ need_to_build_ios = false
464
+
465
+ save_revision = File.join(BUILD_SCRIPTS_PATH, 'SaveRevision.sh')
466
+ system("#{save_revision}")
467
+
468
+ abort unless working_copy_is_clean?
469
+
470
+ unity_build_scripts_dir = File.join(BUILD_SCRIPTS_PATH, 'UnityBuildAutomationScripts')
471
+ unity_editor_dir = File.join(Dir.pwd, 'Assets/Editor')
472
+
473
+ if File.directory?(unity_editor_dir)
474
+ FileUtils.cp_r(unity_build_scripts_dir, unity_editor_dir)
475
+ else
476
+ abort("Copy UnityBuildAutomationScripts error! #{unity_editor_dir} doesn't exist!")
477
+ end
478
+
479
+ case unity
480
+ when 'ios'
481
+ need_to_build_ios = true
482
+
483
+ ios_project_path = File.join(Dir.pwd, 'Builds/iOS')
484
+
485
+ p('Generating IOS project from UNITY project ...')
486
+ unity_success = system("unity -executeMethod NIXBuilder.MakeiOSBuild -batchmode -quit -customArgs:path='#{ios_project_path}'")
487
+ abort('Build unity error!') unless unity_success
488
+ p('IOS project was generated.')
489
+
490
+ root_working_dir = Dir.pwd
491
+ need_chdir_to_root_working_dir = true
492
+
493
+ clean_working_copy(false)
494
+
495
+ Dir.chdir(ios_project_path)
496
+
497
+ $project_to_build = 'Unity-iPhone.xcodeproj'
498
+ $project_target_to_build = 'Unity-iPhone'
499
+ $infoplist_path = 'Info.plist'
500
+ when 'android'
501
+ #TODO: implement me!
502
+ else
503
+ abort("Error: Unknown unity target platform '#{unity}'!")
504
+ end
505
+
506
+ return need_to_build_ios, root_working_dir, need_chdir_to_root_working_dir
507
+ end
508
+
481
509
  def backup_info_plist
482
510
  p('Backuping Info.plist ...')
483
511
 
@@ -592,8 +620,9 @@ def svn_tag_from_jenkins
592
620
  tag
593
621
  end
594
622
 
595
- def clean_working_copy
623
+ def clean_working_copy(all)
624
+ clean_all = all ? 'all' : nil
596
625
  clean_working_copy = File.join(BUILD_SCRIPTS_PATH, 'CleanWorkingCopy.sh')
597
- clean_success = system("#{clean_working_copy}")
626
+ clean_success = system("#{clean_working_copy} #{clean_all}")
598
627
  abort('Clean working copy error!') unless clean_success
599
628
  end
@@ -1,3 +1,3 @@
1
1
  module Nixenvironment
2
- VERSION = '0.0.23'
2
+ VERSION = '0.0.24'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nixenvironment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karen Arzumanian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-18 00:00:00.000000000 Z
11
+ date: 2014-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler