Skip to content

Commit fef99b3

Browse files
author
Mihail Slavchev
committed
wrap code into a future
1 parent a764382 commit fef99b3

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

lib/services/android-project-service.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -230,23 +230,24 @@ class AndroidProjectService implements IPlatformProjectService {
230230
}
231231
}
232232

233-
public addLibrary(platformData: IPlatformData, libraryPath: string): IFuture<void> {
234-
var name = path.basename(libraryPath);
235-
var projDir = this.$projectData.projectDir;
236-
var targetPath = path.join(projDir, "lib", platformData.normalizedPlatformName);
237-
this.$fs.ensureDirectoryExists(targetPath).wait();
233+
public addLibrary(platformData: IPlatformData, libraryPath: string): IFuture<void> {
234+
return (() => {
235+
var name = path.basename(libraryPath);
236+
var projDir = this.$projectData.projectDir;
237+
var targetPath = path.join(projDir, "lib", platformData.normalizedPlatformName);
238+
this.$fs.ensureDirectoryExists(targetPath).wait();
238239

239-
this.parseProjectProperties(libraryPath, targetPath);
240+
this.parseProjectProperties(libraryPath, targetPath);
240241

241-
shell.cp("-f", path.join(libraryPath, "*.jar"), targetPath);
242-
var projectLibsDir = path.join(platformData.projectRoot, "libs");
243-
this.$fs.ensureDirectoryExists(projectLibsDir).wait();
244-
shell.cp("-f", path.join(libraryPath, "*.jar"), projectLibsDir);
242+
shell.cp("-f", path.join(libraryPath, "*.jar"), targetPath);
243+
var projectLibsDir = path.join(platformData.projectRoot, "libs");
244+
this.$fs.ensureDirectoryExists(projectLibsDir).wait();
245+
shell.cp("-f", path.join(libraryPath, "*.jar"), projectLibsDir);
245246

246-
var targetLibPath = path.join(targetPath, path.basename(libraryPath));
247+
var targetLibPath = path.join(targetPath, path.basename(libraryPath));
247248

248-
this.updateProjectReferences(platformData.projectRoot, targetLibPath);
249-
return Future.fromResult();
249+
this.updateProjectReferences(platformData.projectRoot, targetLibPath);
250+
}).future<void>()();
250251
}
251252

252253
public getFrameworkFilesExtensions(): string[] {

0 commit comments

Comments
 (0)