Fix Gradle Plugin

Fix IncludeCheckRemotePlugin to add the default tasks even without defining the extension properties

Issue gh-9846
This commit is contained in:
Marcus Da Coregio
2021-07-30 11:29:53 -03:00
parent d5c953b106
commit 87687bf03f
2 changed files with 18 additions and 7 deletions

View File

@@ -97,4 +97,15 @@ class IncludeCheckRemotePluginTest {
GradleBuild checkRemote = (GradleBuild) this.rootProject.getTasks().named("checkRemote").get();
assertThat(checkRemote.getDir()).isEqualTo(includeRepo.getOutputDirectory());
}
@Test
void applyWhenNoExtensionPropertiesThenRegisterTasks() {
this.rootProject = ProjectBuilder.builder().build();
this.rootProject.getPluginManager().apply(IncludeCheckRemotePlugin.class);
IncludeRepoTask includeRepo = (IncludeRepoTask) this.rootProject.getTasks().named("includeRepo").get();
GradleBuild checkRemote = (GradleBuild) this.rootProject.getTasks().named("checkRemote").get();
assertThat(includeRepo).isNotNull();
assertThat(checkRemote).isNotNull();
}
}