@@ -126,19 +126,7 @@ async def _create_test_src(self):
126
126
app_id = self .test_app_config ['application-id' ]
127
127
self .logger .info (f'Creating test app "{ app_name } " with application-id "{ app_id } "...' )
128
128
129
- mustache_context = {
130
- 'application-id' : app_id ,
131
- 'plugins' : self .test_app_config ['plugins' ] if 'plugins' in self .test_app_config else [],
132
- 'dependencies' : [
133
- {
134
- 'key' : x ,
135
- 'version' : self .artifact_versions [x ]
136
- } for x in self .test_app_config ['dependencies' ]
137
- ] if 'dependencies' in self .test_app_config else [],
138
- }
139
-
140
- if app_name != 'baseline' :
141
- mustache_context ['plugins' ].append ('com.google.gms.google-services' )
129
+ mustache_context = await self ._prepare_mustache_context ()
142
130
143
131
shutil .copytree ('template' , self .test_app_dir )
144
132
with chdir (self .test_app_dir ):
@@ -181,6 +169,33 @@ async def _upload_apks_to_ftl(self):
181
169
182
170
await self ._exec_subprocess (executable , args )
183
171
172
+ async def _prepare_mustache_context (self ):
173
+ app_name = self .test_app_config ['name' ]
174
+ app_id = self .test_app_config ['application-id' ]
175
+
176
+ mustache_context = {
177
+ 'application-id' : app_id ,
178
+ 'plugins' : [],
179
+ 'dependencies' : [],
180
+ }
181
+
182
+ if app_name != 'baseline' :
183
+ mustache_context ['plugins' ].append ('com.google.gms.google-services' )
184
+
185
+ if 'plugins' in self .test_app_config :
186
+ mustache_context ['plugins' ].extend (self .test_app_config ['plugins' ])
187
+
188
+ if 'dependencies' in self .test_app_config :
189
+ for dep in self .test_app_config ['dependencies' ]:
190
+ if '@' in dep :
191
+ key , version = dep .split ('@' , 1 )
192
+ dependency = {'key' : key , 'version' : version }
193
+ else :
194
+ dependency = {'key' : dep , 'version' : self .artifact_versions [dep ]}
195
+ mustache_context ['dependencies' ].append (dependency )
196
+
197
+ return mustache_context
198
+
184
199
async def _exec_subprocess (self , executable , args ):
185
200
command = " " .join ([executable , * args ])
186
201
self .logger .info (f'Executing command: "{ command } "...' )
0 commit comments