nixenvironment 0.0.24 → 0.0.25

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: 25d7a471f861f5ff4e2f6a6260ffdae72890cc7c
4
- data.tar.gz: b39797b9754c940d764e128335247a34bef53e09
3
+ metadata.gz: 69e8cf4ca774b93ced28488e4f834b6081742024
4
+ data.tar.gz: 4e6f5b36b7fc976e55cea4ba43ed7d30b823f7b0
5
5
  SHA512:
6
- metadata.gz: 174971b1f0992cc3efd7c30f0cf638b5eddf823e345c09716cd9fc761d7d4d7f6188ccbb6dda6cd87285f143be582e4c5d3c0a7aad3c17ff7c986461873cdff7
7
- data.tar.gz: 09f278e15fa108180067d66d583533fb4565f8c8358be80ec374c609bda6ea54bdcb4f7a8391d679000ed61f78be69767fed737b935962749327ca5c9fe9d3a7
6
+ metadata.gz: 6a68ed923a7fc37043c80ae741024e06401999493c5f52d98e05b750114f66133e429b8913f92b892e868fa9b05296e04a7af205fce980b925b18e2e2c151a1b
7
+ data.tar.gz: 95205e01f3d48a13d498ae9c933028bb80a70f0244f2f9da870d824e56cb4e468662e64087c7abf05152ad84a1dfb01a36dac6c1e44aced003feb5c6205bc16a
data/bin/nixenvironment CHANGED
@@ -65,7 +65,7 @@ command :build do |c|
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
67
  c.option '--ci_build', 'Define NIXENV_CI_BUILD environment variable'
68
- c.option '--unity TARGET PLATFORM', String, 'Select target platform to build (ios or android)'
68
+ c.option '--unity TARGET PLATFORM', String, 'Select target platform for unity build (ios or android)'
69
69
  c.action do |args, options|
70
70
  options.default :config => 'Debug', :ipa => 'ipa'
71
71
 
@@ -94,9 +94,23 @@ end
94
94
  command :deploy do |c|
95
95
  c.syntax = 'nixenvironment deploy'
96
96
  c.description = 'Deploy built artifacts to given server'
97
+ c.option '--unity TARGET PLATFORM', String, 'Select target platform for unity deploy (ios or android)'
97
98
  c.action do |args, options|
98
- read_config(options)
99
- deploy
99
+ if options.unity and options.unity.length > 0
100
+ need_to_deploy_ios, root_working_dir, need_chdir_to_root_working_dir = unity_deploy(options.unity)
101
+ return unless need_to_deploy_ios
102
+ end
103
+
104
+ begin
105
+ read_config(options)
106
+ deploy
107
+ rescue
108
+ raise # re-rise exception but chdir to root_working_dir in ensure block first if needed
109
+ ensure
110
+ if need_chdir_to_root_working_dir and root_working_dir
111
+ Dir.chdir(root_working_dir)
112
+ end
113
+ end
100
114
  end
101
115
  end
102
116
 
@@ -479,15 +493,14 @@ def unity_build(unity)
479
493
  case unity
480
494
  when 'ios'
481
495
  need_to_build_ios = true
482
-
483
- ios_project_path = File.join(Dir.pwd, 'Builds/iOS')
496
+ root_working_dir = Dir.pwd
497
+ ios_project_path = File.join(root_working_dir, UNITY_BUILDS_IOS_PATH)
484
498
 
485
499
  p('Generating IOS project from UNITY project ...')
486
- unity_success = system("unity -executeMethod NIXBuilder.MakeiOSBuild -batchmode -quit -customArgs:path='#{ios_project_path}'")
500
+ unity_success = system("unity -executeMethod NIXBuilder.MakeiOSBuild -projectPath #{root_working_dir} -batchmode -logFile -quit -customArgs:path='#{ios_project_path}'")
487
501
  abort('Build unity error!') unless unity_success
488
502
  p('IOS project was generated.')
489
503
 
490
- root_working_dir = Dir.pwd
491
504
  need_chdir_to_root_working_dir = true
492
505
 
493
506
  clean_working_copy(false)
@@ -555,6 +568,28 @@ def deploy
555
568
  abort('Deploy error!') unless deploy_success
556
569
  end
557
570
 
571
+ def unity_deploy(unity)
572
+ root_working_dir = nil
573
+ need_chdir_to_root_working_dir = false
574
+ need_to_deploy_ios = false
575
+
576
+ case unity
577
+ when 'ios'
578
+ root_working_dir = Dir.pwd
579
+ need_chdir_to_root_working_dir = true
580
+ need_to_deploy_ios = true
581
+
582
+ ios_project_path = File.join(root_working_dir, UNITY_BUILDS_IOS_PATH)
583
+ Dir.chdir(ios_project_path)
584
+ when 'android'
585
+ #TODO: implement me!
586
+ else
587
+ abort("Error: Unknown unity target platform '#{unity}'!")
588
+ end
589
+
590
+ return need_to_deploy_ios, root_working_dir, need_chdir_to_root_working_dir
591
+ end
592
+
558
593
  def clean
559
594
  remove_temporary_files = File.join(BUILD_SCRIPTS_PATH, 'RemoveTemporaryFiles.sh')
560
595
 
@@ -4,6 +4,8 @@ module Nixenvironment
4
4
 
5
5
  BUILD_SCRIPTS_PATH = File.join(Dir.home, NIXENV_ROOT, BUILD_SCRIPTS)
6
6
 
7
+ UNITY_BUILDS_IOS_PATH = 'Builds/iOS'
8
+
7
9
  REPO_LIST = {
8
10
  BUILD_SCRIPTS => 'https://bitbucket.org/nixsolutions/ninbas.git',
9
11
  # 'nixipl' : 'https://bitbucket.org/nixsolutions/nixipl.git',
@@ -1,3 +1,3 @@
1
1
  module Nixenvironment
2
- VERSION = '0.0.24'
2
+ VERSION = '0.0.25'
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.24
4
+ version: 0.0.25
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-19 00:00:00.000000000 Z
11
+ date: 2014-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler