Skip to content

Commit

Permalink
Check for AspectJ and android conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
larsgrefer committed Dec 15, 2022
1 parent af507ce commit a6c2df4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Expand Up @@ -33,6 +33,13 @@ public void apply(Project project) {
throw new IllegalStateException("Another aspectj plugin (which is excludes this one) has already been applied to the project.");
}

project.getPlugins().withId("com.android.application", ignored -> {
throw new IllegalStateException("The 'io.freefair.aspectj' plugin is not compatible with android projects");
});
project.getPlugins().withId("com.android.library", ignored -> {
throw new IllegalStateException("The 'io.freefair.aspectj' plugin is not compatible with android projects");
});

this.project = project;
project.getPlugins().apply(AspectJBasePlugin.class);
project.getPlugins().apply(JavaBasePlugin.class);
Expand Down
Expand Up @@ -36,6 +36,13 @@ public void apply(Project project) {
throw new IllegalStateException("Another aspectj plugin (which is excludes this one) has already been applied to the project.");
}

project.getPlugins().withId("com.android.application", ignored -> {
throw new IllegalStateException("The 'io.freefair.aspectj.post-compile-weaving' plugin is not compatible with android projects");
});
project.getPlugins().withId("com.android.library", ignored -> {
throw new IllegalStateException("The 'io.freefair.aspectj.post-compile-weaving' plugin is not compatible with android projects");
});

this.project = project;
aspectjBasePlugin = project.getPlugins().apply(AspectJBasePlugin.class);

Expand Down

0 comments on commit a6c2df4

Please sign in to comment.