}
local = buildResourceDir;
if (local != null) {
- final var resource = new Resource();
- resource.setDirectory(local.toString());
- project.addResource(resource);
+ addResourceDir(project, local);
}
}
+ static void addResourceDir(final MavenProject project, final File dir) {
+ var res = new Resource();
+ res.setDirectory(dir.getPath());
+ project.addResource(res);
+ }
+
private @NonNull File buildDirectoryFor(final String name) {
return new File(project.getBuild().getDirectory()
+ File.separatorChar + name
import java.io.File;
import java.io.IOException;
import java.util.Collection;
-import org.apache.maven.model.Resource;
import org.apache.maven.project.MavenProject;
import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
import org.slf4j.Logger;
LOG.debug("Created file {} for {}", file, source.getIdentifier());
}
- setResource(generatedYangDir, project);
+ ProjectFileAccess.addResourceDir(project, generatedYangDir);
LOG.debug("{} YANG files marked as resources: {}", YangToSourcesProcessor.LOG_PREFIX, generatedYangDir);
return stateListBuilder.build();
abstract Collection<FileState> addYangsToMetaInf(MavenProject project,
Collection<YangTextSchemaSource> modelsInProject) throws IOException;
-
- static void setResource(final File targetYangDir, final MavenProject project) {
- Resource res = new Resource();
- res.setDirectory(targetYangDir.getPath());
- project.addResource(res);
- }
}
// add META_INF/services
File generatedServicesDir = new File(new File(project.getBuild().getDirectory(), "generated-sources"), "spi");
- YangProvider.setResource(generatedServicesDir, project);
+ ProjectFileAccess.addResourceDir(project, generatedServicesDir);
LOG.debug("{} Yang services files from: {} marked as resources: {}", LOG_PREFIX, generatedServicesDir,
META_INF_YANG_SERVICES_STRING_JAR);