multiple build enhancements for #127 and #131
[yosql.git] / yosql-tooling / yosql-tooling-gradle / src / main / java / wtf / metio / yosql / tooling / gradle / YoSqlPlugin.java
blobf5f634e6b1f0c03a258bea1cd5d98e0e19887562
1 /*
2 * This file is part of yosql. It is subject to the license terms in the LICENSE file found in the top-level
3 * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of yosql,
4 * including this file, may be copied, modified, propagated, or distributed except according to the terms contained
5 * in the LICENSE file.
6 */
8 package wtf.metio.yosql.tooling.gradle;
10 import org.gradle.api.Plugin;
11 import org.gradle.api.Project;
13 /**
14 * The YoSQL Gradle plugin. It configures the {@link YoSqlExtension} and registers the {@link GenerateTask}.
16 public class YoSqlPlugin implements Plugin<Project> {
18 @Override
19 public void apply(final Project project) {
20 final var extension = project.getExtensions().create("yosql", YoSqlExtension.class);
22 project.getTasks().register("generateJavaCode", GenerateTask.class, task ->
23 task.getFiles().set(extension.files()));