This patch starts integration for MRI window.
Change-Id: Ifa9780fbdfb411b4613df0ee18407d85e81bd517
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<plugin>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-maven-plugin</artifactId>
- <version>5.0.6</version>
+ <version>6.0.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>5.0.6</version>
+ <version>6.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
import java.util.Collection;
import java.util.List;
import java.util.Map;
-import java.util.Optional;
import java.util.ServiceLoader;
import java.util.Set;
-import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import org.apache.maven.project.MavenProject;
import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.model.api.Module;
+import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
import org.opendaylight.yangtools.yang2sources.spi.BasicCodeGenerator;
import org.opendaylight.yangtools.yang2sources.spi.BuildContextAware;
import org.opendaylight.yangtools.yang2sources.spi.MavenProjectAware;
+import org.opendaylight.yangtools.yang2sources.spi.ModuleResourceResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonatype.plexus.build.incremental.BuildContext;
@Override
public Collection<File> generateSources(final EffectiveModelContext context, final File outputDir,
- final Set<Module> yangModules, final Function<Module, Optional<String>> moduleResourcePathResolver)
- throws IOException {
+ final Set<Module> yangModules, final ModuleResourceResolver moduleResourcePathResolver) throws IOException {
final File outputBaseDir;
outputBaseDir = outputDir == null ? getDefaultOutputBaseDir() : outputDir;
}
private Collection<? extends File> generateModuleInfos(final File outputBaseDir, final Set<Module> yangModules,
- final EffectiveModelContext context, final Function<Module, Optional<String>> moduleResourcePathResolver) {
+ final EffectiveModelContext context, final ModuleResourceResolver moduleResourcePathResolver) {
Builder<File> result = ImmutableSet.builder();
Builder<String> bindingProviders = ImmutableSet.builder();
for (Module module : yangModules) {
}
private Set<File> generateYangModuleInfo(final File outputBaseDir, final Module module,
- final EffectiveModelContext ctx, final Function<Module, Optional<String>> moduleResourcePathResolver,
+ final EffectiveModelContext ctx, final ModuleResourceResolver moduleResourcePathResolver,
final Builder<String> providerSourceSet) {
Builder<File> generatedFiles = ImmutableSet.builder();
- final YangModuleInfoTemplate template = new YangModuleInfoTemplate(module, ctx, moduleResourcePathResolver);
+ final YangModuleInfoTemplate template = new YangModuleInfoTemplate(module, ctx,
+ mod -> moduleResourcePathResolver.findModuleResourcePath(module, YangTextSchemaSource.class));
String moduleInfoSource = template.generate();
if (moduleInfoSource.isEmpty()) {
throw new IllegalStateException("Generated code should not be empty!");
import java.io.IOException;
import java.util.Collection;
import java.util.Map;
-import java.util.Optional;
import java.util.Set;
-import java.util.function.Function;
import org.opendaylight.mdsal.binding.yang.unified.doc.generator.GeneratorImpl;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang2sources.spi.BasicCodeGenerator;
import org.opendaylight.yangtools.yang2sources.spi.BuildContextAware;
+import org.opendaylight.yangtools.yang2sources.spi.ModuleResourceResolver;
import org.sonatype.plexus.build.incremental.BuildContext;
public class DocumentationGeneratorImpl extends GeneratorImpl implements BasicCodeGenerator, BuildContextAware {
@Override
public Collection<File> generateSources(final EffectiveModelContext context, final File outputBaseDir,
- final Set<Module> currentModules, final Function<Module, Optional<String>> moduleResourcePathResolver)
+ final Set<Module> currentModules, final ModuleResourceResolver moduleResourcePathResolver)
throws IOException {
return generate(buildContext, context, outputBaseDir, currentModules);
}
import java.io.IOException;
import java.util.Collection;
import java.util.Map;
-import java.util.Optional;
import java.util.Set;
-import java.util.function.Function;
import org.opendaylight.mdsal.binding.yang.wadl.generator.WadlRestconfGenerator;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang2sources.spi.BasicCodeGenerator;
import org.opendaylight.yangtools.yang2sources.spi.BuildContextAware;
+import org.opendaylight.yangtools.yang2sources.spi.ModuleResourceResolver;
import org.sonatype.plexus.build.incremental.BuildContext;
public class WadlGenerator implements BasicCodeGenerator, BuildContextAware {
@Override
public Collection<File> generateSources(final EffectiveModelContext context, final File outputBaseDir,
- final Set<Module> currentModules, final Function<Module, Optional<String>> moduleResourcePathResolver)
+ final Set<Module> currentModules, final ModuleResourceResolver moduleResourcePathResolver)
throws IOException {
final File outputDir;
if (outputBaseDir == null) {
final DocumentationGeneratorImpl generator = new DocumentationGeneratorImpl();
generator.setBuildContext(new DefaultBuildContext());
Collection<File> generatedFiles = generator.generateSources(context, GENERATOR_OUTPUT_DIR,
- Set.copyOf(context.getModules()), module -> Optional.empty());
+ Set.copyOf(context.getModules()), (module, representation) -> Optional.empty());
assertEquals(4, generatedFiles.size());
}
CodeGeneratorImpl codegen = new CodeGeneratorImpl();
codegen.setBuildContext(new DefaultBuildContext());
codegen.generateSources(context, sourcesOutputDir, Set.copyOf(context.getModules()),
- module -> Optional.of(resourceDirPath + File.separator + module.getName()
+ (module, representation) -> Optional.of(resourceDirPath + File.separator + module.getName()
+ YangConstants.RFC6020_YANG_FILE_EXTENSION));
}
codegen.setMavenProject(new MavenProject());
codegen.setAdditionalConfig(ImmutableMap.of("test", "test"));
Collection<File> files = codegen.generateSources(context, null, Set.copyOf(context.getModules()),
- module -> Optional.of(module.getName()));
+ (module, representation) -> Optional.of(module.getName()));
assertFalse(files.isEmpty());
files.forEach(file -> {
deleteTestDir(file);
final WadlGenerator generator = new WadlGenerator();
generator.setBuildContext(new DefaultBuildContext());
Collection<File> generatedWadlFiles = generator.generateSources(context, GENERATOR_OUTPUT_DIR,
- Set.copyOf(context.getModules()), module -> Optional.empty());
+ Set.copyOf(context.getModules()), (module, representation) -> Optional.empty());
assertEquals(3, generatedWadlFiles.size());
generatedWadlFiles.forEach(file -> assertTrue(file.exists()));
}
final WadlGenerator generator = new WadlGenerator();
generator.setBuildContext(new DefaultBuildContext());
Collection<File> generatedWadlFiles = generator.generateSources(context, null, Set.copyOf(context.getModules()),
- module -> Optional.empty());
+ (module, representation) -> Optional.empty());
assertEquals(3, generatedWadlFiles.size());
generatedWadlFiles.forEach(file -> {
deleteTestDir(file);
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<link>https://commons.apache.org/proper/commons-lang/javadocs/api-3.10/</link>
<link>https://commons.apache.org/proper/commons-codec/apidocs/</link>
- <link>https://www.javadoc.io/doc/org.opendaylight.odlparent/odlparent-docs/7.0.6/</link>
- <link>https://www.javadoc.io/doc/org.opendaylight.yangtools/yangtools-docs/5.0.6/</link>
+ <link>https://www.javadoc.io/doc/org.opendaylight.odlparent/odlparent-docs/8.0.0/</link>
+ <link>https://www.javadoc.io/doc/org.opendaylight.yangtools/yangtools-docs/6.0.0-SNAPSHOT/</link>
</links>
<groups>
<group>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>5.0.6</version>
+ <version>6.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>5.0.6</version>
+ <version>6.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-mdsal-binding-api">
<feature name="odl-mdsal-binding-api">
- <feature version="[5,6)">odl-yangtools-data-api</feature>
+ <feature version="[6,7)">odl-yangtools-data-api</feature>
</feature>
</features>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-mdsal-binding-base">
<feature name="odl-mdsal-binding-base">
- <feature version="[5,6)">odl-yangtools-common</feature>
+ <feature version="[6,7)">odl-yangtools-common</feature>
</feature>
</features>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-mdsal-runtime-api">
<feature name="odl-mdsal-binding-runtime-api">
- <feature version="[5,6)">odl-yangtools-data</feature>
- <feature version="[5,6)">odl-yangtools-parser</feature>
+ <feature version="[6,7)">odl-yangtools-data</feature>
+ <feature version="[6,7)">odl-yangtools-parser</feature>
</feature>
</features>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-mdsal-common">
<feature name="odl-mdsal-common">
- <feature version="[5,6)">odl-yangtools-common</feature>
+ <feature version="[6,7)">odl-yangtools-common</feature>
</feature>
</features>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-mdsal-dom-api">
<feature name="odl-mdsal-dom-api">
- <feature version="[5,6)">odl-yangtools-data-api</feature>
+ <feature version="[6,7)">odl-yangtools-data-api</feature>
</feature>
</features>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-mdsal-dom-broker">
<feature name="odl-mdsal-dom-broker">
- <feature version="[7,8)">odl-lmax-3</feature>
+ <feature version="[8,9)">odl-lmax-3</feature>
</feature>
</features>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-mdsal-eos-common">
<feature name="odl-mdsal-eos-common">
- <feature version="[5,6)">odl-yangtools-data-api</feature>
+ <feature version="[6,7)">odl-yangtools-data-api</feature>
</feature>
</features>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-mdsal-exp-yanglib-api">
<feature name="odl-mdsal-exp-yanglib-api">
- <feature version="[5,6)">odl-yangtools-data-api</feature>
+ <feature version="[6,7)">odl-yangtools-data-api</feature>
</feature>
</features>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-mdsal-uint24-netty">
<feature name="odl-mdsal-uint24-netty">
- <feature version="[5,6)">odl-yangtools-netty</feature>
+ <feature version="[6,7)">odl-yangtools-netty</feature>
</feature>
</features>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>