Skip to content

Commit 9d6833b

Browse files
authored
Merge pull request #1842 from NativeScript/plamen5kov/automatic_clean
cli cleans android project when plugins are updated in anyway
2 parents 1d12186 + ab294a4 commit 9d6833b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/services/android-project-service.ts

+9
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,15 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
423423
}
424424

425425
public afterPrepareAllPlugins(): IFuture<void> {
426+
427+
let projectRoot = this.platformData.projectRoot;
428+
429+
let gradleBin = this.useGradleWrapper(projectRoot) ? path.join(projectRoot, "gradlew") : "gradle";
430+
if (this.$hostInfo.isWindows) {
431+
gradleBin += ".bat";
432+
}
433+
this.spawn(gradleBin, ["clean"], { stdio: "inherit", cwd: this.platformData.projectRoot }).wait();
434+
426435
return Future.fromResult();
427436
}
428437

0 commit comments

Comments
 (0)