LibSassGradlePlugin implements Plugin<Project> { @Override public void apply(final Project project) { final ExtensionContainer extensions = project.getExtensions(); final PluginParameters libSassParameters = extensions .create("libSassParameters", PluginParameters.class); ((ExtensionAware) libSassParameters).getExtensions().create( "libSassProductionParameters", PluginProductionParameters.class); final TaskContainer tasks = project.getTasks(); tasks.create("compileLibSass", CompileLibSassTask.class); tasks.create("compileLibSassProduction", CompileLibSassProductionTask.class); tasks.create("compileLibSassWithWatch", CompileLibSassWithWatchTask.class); tasks.create("installBourbon", InstallBourbonTask.class); tasks.create("installCompass", InstallCompassTask.class); }  @Override void apply(final Project project);  }
@Test public void checkPlugin_Compile_Task() { final Project project = ProjectBuilder.builder().build(); project.getPlugins().apply("com.github.fgiannesini.libsass.gradle.plugin"); Assert.assertTrue(project.getTasks().getByName("compileLibSass") instanceof CompileLibSassTask); }