Ditscheridou
Ditscheridou

Reputation: 391

Trigger Gradle Task after import Eclipse Project

We ported our custom Gradle setup (GWT, builder configuration etc.) for Eclipse from the STS Gradle Plugin to the Buildship Plugin.

We use special self-developed tasks which are performed automatically after an import of a Gradle project through the STS plugin via the eclipse-task and afterEclipseImport-task. Does the new Buildship plugin allow to trigger tasks after the import in Eclipse in a similar manner?

Has anyone of you successfully triggered a Gradle task after project import with the Gradle Buildship plugin?

Upvotes: 3

Views: 334

Answers (1)

Crusha K. Rool
Crusha K. Rool

Reputation: 1502

Better late than never: It has been introduced in Buildship 3.1 and requires Gradle 5.4 or above: https://www.eclipse.org/community/eclipse_newsletter/2019/june/buildship.php

You can register tasks to be executed every time Eclipse is synchronizing the workspace with the working copy:

eclipse {
    synchronizationTasks myCustomSyncTask
}

And tasks to be executed every time Eclipse is performing a build:

eclipse {
    autoBuildTasks myCustomBuildTask
}

Upvotes: 0

Related Questions