mercure 0.0.10 → 0.0.13

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: b85cc795a9b1d7c44d3ae394f9cab03c92c37c0b
4
- data.tar.gz: d3eb4e46091076619a7be52340218b8a31074e02
3
+ metadata.gz: 217b225bb7c48c73a284fe4da316bb2366544218
4
+ data.tar.gz: 80d66f53bd9931c0e51c221f19286ac49aa4c1af
5
5
  SHA512:
6
- metadata.gz: 7bba4528c9442b52fad452b1f161c7156fcb82893eb516a5dfb7cdc169be0a2d7dac51e8868c1ce016b6e260e720465819fffc38a40b43e700090d64e0897c4d
7
- data.tar.gz: 2c8c507724f85c656cf148ccf79767e6cdb8854df439943c4e8153d5d0005f760c2911dfe21a3ce39ea6296cb617472c06ae8fda7383b0da122f33347a03fade
6
+ metadata.gz: b8224e1e71bc5c1ba79852259d5396654a302fd0305ade5147712f014fd160575f51066406681b68e9d378e396976d5af980d169ac784de66e96710c2be122e3
7
+ data.tar.gz: 4609dd0160f4cc6a6687d3dcf2282a478c6162e98df61248186537d5d8149a06fcc65893d61b94b8d28ddf496a51b7c28490be4bc0d0f6f7bef2de0d3c1fd031
data/lib/mercure.rb CHANGED
@@ -7,7 +7,7 @@ require 'mercure/deploy'
7
7
  module Mercure
8
8
 
9
9
  class Mercure < Thor
10
-
10
+
11
11
  desc "check", "will check if everything necessary for building easily is present"
12
12
  def check
13
13
  puts "checking. Missing tools will be installed, if possible."
@@ -15,23 +15,43 @@ module Mercure
15
15
  end
16
16
 
17
17
  desc "build JOB", "will build the job"
18
+ option :pinailleur, :type => :boolean
18
19
  def build(plist)
19
- buildDeployments plist
20
+ if options[:pinailleur]
21
+ buildDeploymentsByAsking plist
22
+ else
23
+ buildDeployments plist
24
+ end
20
25
  end
21
26
 
22
27
  desc "upload JOB", "will upload the job (must have been 'build' before)"
28
+ option :pinailleur, :type => :boolean
23
29
  def upload(plist)
24
- uploadDeployments plist
30
+ if options[:pinailleur]
31
+ uploadDeploymentsByAsking plist
32
+ else
33
+ uploadDeployments plist
34
+ end
25
35
  end
26
36
 
27
37
  desc "deploy JOB", "will deploy the job (must have been 'build' and 'upload' before)"
38
+ option :pinailleur, :type => :boolean
28
39
  def deploy(plist)
29
- deployDeployments plist
40
+ if options[:pinailleur]
41
+ deployDeploymentsByAsking plist
42
+ else
43
+ deployDeployments plist
44
+ end
30
45
  end
31
46
 
32
47
  desc "pan JOB", "will build, upload and deploy the job"
48
+ option :pinailleur, :type => :boolean
33
49
  def pan(plist)
34
- panDeployments plist
50
+ if options[:pinailleur]
51
+ panDeploymentsByAsking plist
52
+ else
53
+ panDeployments plist
54
+ end
35
55
  end
36
56
 
37
57
  end
data/lib/mercure/build.rb CHANGED
@@ -26,7 +26,7 @@ def buildApp (settings)
26
26
  build_command += " TARGET_BUILD_DIR=\"#{buildDirectory}\"/#{buildConfiguration}-iphoneos"
27
27
  build_command += " CONFIGURATION_BUILD_DIR=\"#{buildDirectory}\"/#{buildConfiguration}-iphoneos"
28
28
  build_command += " clean build"
29
- build_command += " | tee \"#{buildDirectory}/xcodebuild.log\""
29
+ build_command += " | tee \"#{buildDirectory}/#{applicationName}.log\""
30
30
  build_command += " | xcpretty -c --report html"
31
31
 
32
32
  puts build_command
@@ -38,7 +38,7 @@ end
38
38
 
39
39
  def updateBuild (settings)
40
40
 
41
- # updateIcon settings , settings[:deploy]
41
+ updateIcon settings
42
42
 
43
43
  projectInfosPath = plistInAppPath(settings)
44
44
 
@@ -16,58 +16,154 @@ require_relative 'paths.rb'
16
16
  require_relative 'git.rb'
17
17
  require_relative 'upload.rb'
18
18
 
19
+ #
20
+ # Build
21
+ #
19
22
 
20
23
  def buildDeployments (plist)
21
24
 
22
25
  deployments = Plist::parse_xml(plist)
23
26
 
27
+ deployments.each do |deploy|
28
+ buildDeploy deploy
29
+ end
30
+
31
+ end
32
+
33
+ def buildDeploymentsByAsking (plist)
34
+
35
+ deployments = Plist::parse_xml(plist)
36
+
24
37
  deployments.each do |deploy|
25
38
 
26
- puts "Chargement des variables"
27
39
  settings = load_settings deploy
28
40
 
29
- # on s'assure d'être dans la bonne version du code
30
- # si le Info.plist ne contient pas de valeur pour la clé
31
- # :CFBundleVersion (ce qui serait un peu embetant)
32
- # on taggue le commit courant
33
- checkOutGitVersion settings
41
+ choose do |menu|
42
+
43
+ versionText = " dans sa version #{settings[:CFBundleVersion]}" if not settings[:CFBundleVersion].nil?
44
+ menu.prompt = "Veux-tu builder #{settings[:applicationName]}#{versionText} ?"
45
+
46
+ menu.choice(:oui) do
47
+ say("Bon choix !")
48
+ buildDeploy deploy
49
+ end
50
+
51
+ menu.choice(:non) { say("Dommage") }
52
+ end
34
53
 
35
- puts "Création de l'.app"
36
- buildApp settings
37
- updateBuild settings
38
-
39
- puts "Création de l'.ipa et du .plist"
40
- buildArtefacts settings
41
- end
54
+ end
55
+ end
56
+
57
+
58
+ def buildDeploy (deploy)
59
+
60
+ puts "Chargement des variables"
61
+ settings = load_settings deploy
62
+
63
+ # on s'assure d'être dans la bonne version du code
64
+ # si le Info.plist ne contient pas de valeur pour la clé
65
+ # :CFBundleVersion (ce qui serait un peu embetant)
66
+ # on taggue le commit courant
67
+ checkOutGitVersion settings
68
+
69
+ puts "Création de l'.app"
70
+ buildApp settings
71
+ updateBuild settings
72
+
73
+ puts "Création de l'.ipa et du .plist"
74
+ buildArtefacts settings
42
75
 
43
76
  end
44
77
 
78
+
79
+ #
80
+ # Upload
81
+ #
82
+
83
+ def uploadDeploymentsByAsking (plist)
84
+
85
+ deployments = Plist::parse_xml(plist)
86
+
87
+ deployments.each do |deploy|
88
+
89
+ settings = load_settings deploy
90
+
91
+ choose do |menu|
92
+
93
+ versionText = " dans sa version #{settings[:CFBundleVersion]}" if not settings[:CFBundleVersion].nil?
94
+ menu.prompt = "Veux-tu uploader #{settings[:applicationName]}#{versionText} ?"
95
+
96
+ menu.choice(:oui) do
97
+ say("Bon choix !")
98
+ uploadDeployments deploy
99
+ end
100
+
101
+ menu.choice(:non) { say("Dommage") }
102
+ end
103
+
104
+ end
105
+ end
106
+
45
107
  def uploadDeployments (plist)
46
108
 
47
109
  deployments = Plist::parse_xml(plist)
48
110
 
49
111
  deployments.each do |deploy|
50
- puts "Chargement des variables"
112
+ uploadDeploy deploy
113
+ end
114
+ end
115
+
116
+
117
+ def uploadDeploy (deploy)
118
+ puts "Chargement des variables"
119
+ settings = load_settings deploy
120
+
121
+ puts "Téléversement de l'.ipa et du .plist"
122
+ uploadArtefacts settings
123
+ end
124
+
125
+ #
126
+ # Deploy
127
+ #
128
+
129
+ def deployDeploymentsByAsking (plist_path)
130
+
131
+ plist_content = CFPropertyList::List.new(file: plist_path)
132
+ deployments = CFPropertyList.native_types(plist_content.value)
133
+
134
+ deployments.each do |deploy|
135
+
51
136
  settings = load_settings deploy
52
137
 
53
- puts "Téléversement de l'.ipa et du .plist"
54
- uploadArtefacts settings
138
+ choose do |menu|
139
+
140
+ versionText = " dans sa version #{settings[:CFBundleVersion]}" if not settings[:CFBundleVersion].nil?
141
+ menu.prompt = "Veux-tu déployer #{settings[:applicationName]}#{versionText} ?"
142
+
143
+ menu.choice(:oui) do
144
+ say("Bon choix !")
145
+ deployDeploy deploy
146
+ end
147
+
148
+ menu.choice(:non) { say("Dommage") }
149
+ end
150
+
55
151
  end
56
152
 
153
+ puts "sauvegardes des infos de parse"
154
+ plist_content.value = CFPropertyList.guess(deployments)
155
+ plist_content.save(plist_path , CFPropertyList::List::FORMAT_XML)
156
+
57
157
  end
58
158
 
159
+
59
160
  def deployDeployments (plist_path)
60
161
 
61
162
  plist_content = CFPropertyList::List.new(file: plist_path)
62
163
  deployments = CFPropertyList.native_types(plist_content.value)
63
164
 
64
165
  deployments.each do |deploy|
65
- puts "Chargement des variables"
66
- settings = load_settings deploy
67
-
68
- puts "Mise à jour de Parse"
69
- objectId = updateParse settings
70
- deploy["parse"]["objectId"] = objectId
166
+ deployDeploy deploy
71
167
  end
72
168
 
73
169
  puts "sauvegardes des infos de parse"
@@ -76,6 +172,23 @@ def deployDeployments (plist_path)
76
172
 
77
173
  end
78
174
 
175
+
176
+ # I know, I know
177
+ def deployDeploy (deploy)
178
+
179
+ puts "Chargement des variables"
180
+ settings = load_settings deploy
181
+
182
+ puts "Mise à jour de Parse"
183
+ objectId = updateParse settings
184
+ deploy["parse"]["objectId"] = objectId
185
+
186
+ end
187
+
188
+ #
189
+ # pan
190
+ #
191
+
79
192
  def panDeployments (plist)
80
193
 
81
194
  deployments = Plist::parse_xml(plist)
@@ -98,14 +211,12 @@ def panDeployments (plist)
98
211
  puts "Création de l'.ipa et du .plist"
99
212
  buildArtefacts settings
100
213
 
101
- if should_upload
102
- puts "Téléversement de l'.ipa et du .plist"
103
- uploadArtefacts settings
214
+ puts "Téléversement de l'.ipa et du .plist"
215
+ uploadArtefacts settings
104
216
 
105
- puts "Mise à jour de Parse"
106
- updateParse settings
107
- end
108
-
217
+ puts "Mise à jour de Parse"
218
+ updateParse settings
219
+
109
220
  end
110
221
 
111
222
  end
data/lib/mercure/git.rb CHANGED
@@ -1,12 +1,21 @@
1
1
  require 'rubygems'
2
2
  require 'bundler/setup'
3
3
 
4
+ require 'highline/import'
5
+
4
6
  def checkOutGitVersion (settings)
5
7
 
6
8
  tags = `git tag`
7
9
  tag_name = settings[:CFBundleVersion]
8
10
  current_commit = settings[:gitSHA1]
9
11
 
12
+ # choose do |menu|
13
+ # menu.prompt = "Would you like to create a tag for this build ? "
14
+ #
15
+ # menu.choice(:yes) { say("Good choice!") }
16
+ # menu.choice(:no) { say("Too bad") }
17
+ # end
18
+
10
19
  if tags.include?("#{tag_name}\n") == false
11
20
  puts "Le tag #{tag_name} n'existe pas."
12
21
  puts "Nous allons le créer pour pointer vers le commit actuel (#{current_commit})"
@@ -15,7 +24,6 @@ def checkOutGitVersion (settings)
15
24
  end
16
25
 
17
26
  puts "On checkout le tag #{tag_name}"
18
- co_tag = `git checkout #{tag_name}`
19
27
  end
20
28
 
21
29
  def tagGit (settings)
data/lib/mercure/ipa.rb CHANGED
@@ -23,6 +23,8 @@ def generateIpa settings
23
23
  signingIdentity = settings[:signingIdentity]
24
24
  provisioningProfile = settings[:provisioningProfile]
25
25
 
26
+ system("rm -f \"#{dsymPath}\"")
27
+
26
28
  puts "Construction de l'IPA"
27
29
 
28
30
  signingCommand = "/usr/bin/xcrun -sdk iphoneos PackageApplication"
@@ -11,13 +11,13 @@ require_relative 'paths.rb'
11
11
  def updateIcon (settings)
12
12
 
13
13
  iconsBasePath = "#{settings[:projectDirectory]}/PagesJaunes/Data/Images/SPLASH+ICONE"
14
- icons = [["icone_base.png" , "icone.png"] , ["icone_base@2x.png" , "icone@2x.png"]]
14
+ icons = [["Icon_base.png" , "Icon.png"] , ["Icon_base@2x.png" , "Icon@2x.png"]]
15
15
 
16
16
  should_update_icon = settings[:deploy]["icon"]["addExtraInfosInIcon"]
17
17
 
18
- # if !should_update_icon
19
- # return
20
- # end
18
+ if !should_update_icon
19
+ return
20
+ end
21
21
 
22
22
  basePath = appPath(settings)
23
23
 
@@ -40,12 +40,10 @@ def addInfosToIcon (settings , source_file , dest_file)
40
40
  projectInfosPath = settings[:projectInfosPath]
41
41
  projectInfos = Plist::parse_xml(projectInfosPath)
42
42
 
43
- version = projectInfos["CFBundleVersion"]
44
- commit = `git rev-parse --short HEAD`.strip
45
- branch = `git rev-parse --abbrev-ref HEAD`.strip
46
-
47
- width = `identify -format %w #{source_file}`
48
-
43
+ version = projectInfos["CFBundleVersion"]
44
+ commit = `git rev-parse --short HEAD`.strip
45
+ branch = `git rev-parse --abbrev-ref HEAD`.strip
46
+ width = `identify -format %w #{source_file}`
49
47
  caption = iconCaptionForDeploy settings[:deploy]
50
48
 
51
49
  command = "convert -background '#0008'"
@@ -1,3 +1,3 @@
1
1
  module Mercure
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mercure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Meuel