private void registerSourceSets()

in src/main/java/software/amazon/smithy/gradle/SmithyPlugin.java [227:244]


    private void registerSourceSets(Project project) {
        // Add the smithy source set to all Java source sets.
        // By default, look in model/ and src/main/smithy, src/test/smithy.
        for (SourceSet sourceSet : project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets()) {
            String name = sourceSet.getName();
            SourceDirectorySet sds = project.getObjects().sourceDirectorySet(name, name + " Smithy sources");
            sourceSet.getExtensions().add("smithy", sds);
            SOURCE_DIRS.forEach(sourceDir -> sds.srcDir(sourceDir.replace("$name", name)));
            project.getLogger().debug("Adding Smithy extension to {} Java convention", name);

            // Include Smithy models and the generated manifest in the JAR.
            if (name.equals("main")) {
                File metaInf = SmithyUtils.getSmithyResourceTempDir(project).getParentFile().getParentFile();
                project.getLogger().debug("Registering Smithy resource artifacts with Java resources: {}", metaInf);
                sourceSet.getResources().srcDir(metaInf);
            }
        }
    }