YinBuilder changes to resolve import references, and other fixes. 74/37674/1
authorDavid M. Karr <davidmichaelkarr@gmail.com>
Tue, 5 Apr 2016 23:30:01 +0000 (16:30 -0700)
committerDavid M. Karr <davidmichaelkarr@gmail.com>
Fri, 15 Apr 2016 15:24:20 +0000 (08:24 -0700)
Removed maven-dependency-plugin yangtools references from core plugin,
should all be yangparser plugin now.
Fixed more symbol search scenarios where the source has a prefix and the
target does not.
Added preliminary interface to "new" parser that returns API module, not
DOM Module.
Upgraded artifact version references from Beryllium to latest SNAPSHOT.
Added code in YinBuilder to resolve import references from IndexManager.
Moved all groupid, artifactid, and version references out of Java code
into pom.xml, so release scripts will only have to operate on the
pom.xml file, even if in a custom way.

Change-Id: I3099eae4c84e088a4616c0e9fa216c208d569b57
Signed-off-by: David M. Karr <davidmichaelkarr@gmail.com>
27 files changed:
plugins/com.cisco.yangide.core/.classpath
plugins/com.cisco.yangide.core/META-INF/MANIFEST.MF
plugins/com.cisco.yangide.core/build.properties
plugins/com.cisco.yangide.core/pom.xml
plugins/com.cisco.yangide.core/src/com/cisco/yangide/core/indexing/IndexManager.java
plugins/com.cisco.yangide.core/src/com/cisco/yangide/core/model/YangJarEntry.java
plugins/com.cisco.yangide.core/src/com/cisco/yangide/core/parser/YangParserUtil.java
plugins/com.cisco.yangide.ext.model.editor/.classpath
plugins/com.cisco.yangide.ext.model.editor/build.properties
plugins/com.cisco.yangide.ext.model.editor/pom.xml
plugins/com.cisco.yangide.ext.model.editor/src/main/java/com/cisco/yangide/ext/model/editor/YangMultiPageEditorPart.java
plugins/com.cisco.yangide.ext.model.editor/src/test/java/com/cisco/yangide/ext/model/editor/YinBuilderTest.java
plugins/com.cisco.yangide.ext.model/.classpath
plugins/com.cisco.yangide.ext.model/META-INF/MANIFEST.MF
plugins/com.cisco.yangide.ext.refactoring/.classpath
plugins/com.cisco.yangide.ext.refactoring/META-INF/MANIFEST.MF
plugins/com.cisco.yangide.ext.refactoring/src/com/cisco/yangide/ext/refactoring/actions/RenameSupport.java
plugins/com.cisco.yangide.ui/pom.xml
plugins/com.cisco.yangide.ui/resources/projectpom.properties [new file with mode: 0644]
plugins/com.cisco.yangide.ui/src/com/cisco/yangide/ui/wizards/YangProjectWizard.java
plugins/com.cisco.yangide.ui/src/com/cisco/yangide/ui/wizards/YangProjectWizardPage.java
plugins/com.cisco.yangide.yangparser/.classpath
plugins/com.cisco.yangide.yangparser/META-INF/MANIFEST.MF
plugins/com.cisco.yangide.yangparser/build.properties
plugins/com.cisco.yangide.yangparser/pom.xml
samples/yang-module1/.classpath
samples/yang-module2/.classpath

index 7205ad0d058c972d6317b6a1eb3ac59c3f0c1232..9a4af0739fd33e530d09b98adf2807e72d620fae 100644 (file)
@@ -3,9 +3,6 @@
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry kind="src" path="src/"/>
-       <classpathentry exported="true" kind="lib" path="libs/yang-parser-impl-0.6.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="libs/yang-model-api-0.6.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="libs/antlr4-runtime-4.0.jar"/>
        <classpathentry exported="true" kind="lib" path="libs/mapdb-1.0.4.jar"/>
        <classpathentry kind="output" path="target/classes"/>
 </classpath>
index 25039daad5ad2a10ecef3af58f5ce79ad982fb83..29c765a4dca1b6372de778ff7f4675e05c934679 100644 (file)
@@ -9,11 +9,9 @@ Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.jdt.core;visibility:=reexport,
  org.eclipse.text,
  org.eclipse.core.resources,
- org.eclipse.core.filesystem
+ org.eclipse.core.filesystem,
+ com.cisco.yangide.yangparser;bundle-version="1.1.1"
 Bundle-ClassPath: .,
- libs/yang-parser-impl-0.6.1.jar,
- libs/yang-model-api-0.6.1.jar,
- libs/antlr4-runtime-4.0.jar,
  libs/mapdb-1.0.4.jar
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Bundle-ActivationPolicy: lazy
@@ -21,6 +19,16 @@ Export-Package: com.cisco.yangide.core,
  com.cisco.yangide.core.buffer,
  com.cisco.yangide.core.dom,
  com.cisco.yangide.core.indexing,
- com.cisco.yangide.core.parser,
  com.cisco.yangide.core.model,
- org.antlr.v4.runtime
+ com.cisco.yangide.core.parser
+Import-Package: org.antlr.v4.runtime,
+ org.antlr.v4.runtime.atn,
+ org.antlr.v4.runtime.dfa,
+ org.antlr.v4.runtime.misc,
+ org.antlr.v4.runtime.tree,
+ org.antlr.v4.runtime.tree.pattern,
+ org.antlr.v4.runtime.tree.xpath,
+ org.opendaylight.yangtools.yang.parser.spi.meta,
+ org.opendaylight.yangtools.yang.parser.spi.source,
+ org.opendaylight.yangtools.yang.parser.stmt.reactor,
+ org.opendaylight.yangtools.yang.parser.stmt.rfc6020
index 49fcce4e4a8e51648dc841d79cf99719116b208e..19ad8df1742ec90fe5ab87a9608ed7df6d6d7415 100644 (file)
@@ -10,8 +10,5 @@ source.. = src/
 output.. = target/classes
 bin.includes = META-INF/,\
                .,\
-               libs/yang-parser-impl-0.6.1.jar,\
-               libs/antlr4-runtime-4.0.jar,\
                libs/mapdb-1.0.4.jar,\
-               plugin.xml,\
-               libs/yang-model-api-0.6.1.jar
+               plugin.xml
index 07fc12d7faf3cdee4737390b98915a67fb92b108..5a3bf5bcdfc8c2151d2c31993963894e9987f0dd 100644 (file)
                     <configuration>
                         <outputDirectory>./libs</outputDirectory>
                         <artifactItems>
-                            <artifactItem>
-                                <groupId>org.antlr</groupId>
-                                <artifactId>antlr4-runtime</artifactId>
-                                <version>4.0</version>
-                                <type>jar</type>
-                                <overWrite>true</overWrite>
-                                <destFileName>antlr4-runtime-4.0.jar</destFileName>
-                            </artifactItem>
                             <artifactItem>
                                 <groupId>org.mapdb</groupId>
                                 <artifactId>mapdb</artifactId>
                                 <overWrite>true</overWrite>
                                 <destFileName>mapdb-1.0.4.jar</destFileName>
                             </artifactItem>
-                            <artifactItem>
-                                <groupId>org.opendaylight.yangtools</groupId>
-                                <artifactId>yang-model-api</artifactId>
-                                <version>0.6.1</version>
-                                <type>jar</type>
-                                <overWrite>true</overWrite>
-                                <destFileName>yang-model-api-0.6.1.jar</destFileName>
-                            </artifactItem>
-                            <artifactItem>
-                                <groupId>org.opendaylight.yangtools</groupId>
-                                <artifactId>yang-parser-impl</artifactId>
-                                <version>0.6.1</version>
-                                <type>jar</type>
-                                <overWrite>true</overWrite>
-                                <destFileName>yang-parser-impl-0.6.1.jar</destFileName>
-                            </artifactItem>
                         </artifactItems>
                     </configuration>
                 </execution>
index fec8e0485fd243cb3705ef8789f3b0da10de2364..928a4503e53da8075300f09ab4e4ce5be2b3b2f5 100644 (file)
@@ -392,6 +392,12 @@ public class IndexManager extends JobManager {
             }
         }
 
+        String  nameWithoutPrefix   = name;
+        int colonIndex  = nameWithoutPrefix != null ? nameWithoutPrefix.indexOf(':') : -1; 
+        if (colonIndex != -1) {
+            nameWithoutPrefix   = nameWithoutPrefix.substring(colonIndex + 1);
+        }
+        
         for (Tuple6<String, String, String, ElementIndexType, String, ElementIndexInfo> entry : idxKeywords) {
             if (module != null && module.length() > 0 && !module.equals(entry.a)) {
                 continue;
@@ -405,7 +411,7 @@ public class IndexManager extends JobManager {
                 continue;
             }
 
-            if (name != null && name.length() > 0 && !entry.c.equals(name)) {
+            if (nameWithoutPrefix != null && nameWithoutPrefix.length() > 0 && !entry.c.equals(nameWithoutPrefix)) {
                 continue;
             }
 
@@ -443,6 +449,12 @@ public class IndexManager extends JobManager {
             }
         }
 
+        String  nameWithoutPrefix   = reference.getName();
+        int colonIndex  = nameWithoutPrefix != null ? nameWithoutPrefix.indexOf(':') : -1; 
+        if (colonIndex != -1) {
+            nameWithoutPrefix   = nameWithoutPrefix.substring(colonIndex + 1);
+        }
+
         for (Tuple4<QName, ElementIndexReferenceType, String, ElementIndexReferenceInfo> entry : idxReferences) {
             if (type != null && type != entry.b) {
                 continue;
@@ -461,7 +473,7 @@ public class IndexManager extends JobManager {
                 continue;
             }
 
-            if (reference.getName() != null && !reference.getName().equals(entry.a.getName())) {
+            if (nameWithoutPrefix != null && !nameWithoutPrefix.equals(entry.a.getName())) {
                 continue;
             }
 
index dd3d39a9475366d357f6e580b95dbc4d2c79a175..0b1fde17fcbc0176d619c555adf245830ca209d8 100644 (file)
@@ -72,7 +72,7 @@ public class YangJarEntry extends YangElement {
         return YangElementType.YANG_JAR_ENTRY;
     }
 
-    private char[] getContent() throws YangModelException {
+    public char[] getContent() throws YangModelException {
         try (JarFile file = new JarFile(getParent().getPath().toFile())) {
             ZipEntry entry = file.getEntry(path.toString());
             InputStreamReader in = new InputStreamReader(file.getInputStream(entry), "UTF-8");
index 6b4337870f5967881858e968321a5257054e9f86..f2d1827ac1ab48c972bfd0b3bdf5a19f20d14b2f 100644 (file)
@@ -1,5 +1,6 @@
 /*******************************************************************************
  * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2016 AT&T Incorporated.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -7,7 +8,9 @@
  *******************************************************************************/
 package com.cisco.yangide.core.parser;
 
+import java.io.ByteArrayInputStream;
 import java.util.BitSet;
+import java.util.Set;
 
 import org.antlr.v4.runtime.ANTLRInputStream;
 import org.antlr.v4.runtime.BaseErrorListener;
@@ -26,6 +29,15 @@ import org.eclipse.core.resources.IProject;
 import org.opendaylight.yangtools.antlrv4.code.gen.YangLexer;
 import org.opendaylight.yangtools.antlrv4.code.gen.YangParser;
 import org.opendaylight.yangtools.antlrv4.code.gen.YangParser.YangContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.parser.impl.YangParserListenerImpl;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
+import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
+import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
+import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
+import org.opendaylight.yangtools.yang.parser.stmt.reactor.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangStatementSourceImpl;
 
 import com.cisco.yangide.core.dom.Module;
 
@@ -73,6 +85,27 @@ public class YangParserUtil {
         return module;
     }
 
+    /**
+     * This is a preliminary version of the parser interface that doesn't use the "deprecated"
+     * internal parser.  This still has problems, as I don't see a way to add sources AFTER
+     * the parse is completed, to specify the imported files.
+     * 
+     * @param chars
+     * @param project
+     * @param validationListener
+     * @return
+     * @throws SourceException
+     * @throws ReactorException
+     */
+    public static SchemaContext parseYangFileApiModule(char[] chars, IProject project, IYangValidationListener validationListener) throws SourceException, ReactorException {
+        StatementStreamSource   yangSource  =
+                new YangStatementSourceImpl(new ByteArrayInputStream(new String(chars).getBytes()));
+        CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
+        reactor.addSource(yangSource);
+        SchemaContext   schemaContext   = reactor.buildEffective();
+        return schemaContext;
+    }
+
     public static void validateYangContext(YangContext context, IYangValidationListener validationListener) {
         final ParseTreeWalker walker = new ParseTreeWalker();
         final YangModelBasicValidationListener yangModelParser = new YangModelBasicValidationListener();
@@ -161,7 +194,7 @@ public class YangParserUtil {
             anErrorDetected = true;
         }
 
-        @Override
+        //@Override
         public void reportAmbiguity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, BitSet ambigAlts,
                 ATNConfigSet configs) {
             anErrorDetected = true;
index 42754f8d2150a57a1a398ad9d5803cafcbdfb972..c33c15f00e124e9ac06e575d3addb6a2f1b1e824 100644 (file)
@@ -1,27 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="src" output="target/classes" path="src/main/java">
-               <attributes>
-                       <attribute name="optional" value="true"/>
-                       <attribute name="maven.pomderived" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="src" output="target/test-classes" path="src/test/java">
-               <attributes>
-                       <attribute name="optional" value="true"/>
-                       <attribute name="maven.pomderived" value="true"/>
-               </attributes>
-       </classpathentry>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
-               <attributes>
-                       <attribute name="maven.pomderived" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
-               <attributes>
-                       <attribute name="maven.pomderived" value="true"/>
-               </attributes>
-       </classpathentry>
+       <classpathentry kind="src" path="src/main/java"/>
+       <classpathentry kind="src" path="src/test/java"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="output" path="target/classes"/>
 </classpath>
index 1995660563c7fdc7a2074cc5296cc220fc72391b..35bc460a81d42507b49b5e8a1bcd2ae5fd849061 100644 (file)
@@ -6,7 +6,7 @@
 #  and is available at http://www.eclipse.org/legal/epl-v10.html
 #  
 ###############################################################################
-source.. = src/
+source.. = src/main/java
 output.. = bin/
 bin.includes = icons/,\
                plugin.xml,\
index 5fe0f6f4bc7dcdbf9cfabe1d4b4328562568f149..ddd129b42179a3be854d4036e15dcb562e43c1bc 100644 (file)
@@ -18,7 +18,7 @@
        <artifactId>com.cisco.yangide.ext.model.editor</artifactId>
        <packaging>eclipse-plugin</packaging>
        <properties>
-          <odl-version>0.8.0-Beryllium</odl-version>
+       <odl-version>1.0.0-SNAPSHOT</odl-version>
        </properties>
        <build>
                <sourceDirectory>src/main/java</sourceDirectory>
                <dependency>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
+                       <scope>test</scope>
                </dependency>
                <dependency>
                        <groupId>org.mockito</groupId>
                        <artifactId>mockito-all</artifactId>
+            <scope>test</scope>
                </dependency>
                <dependency>
                        <groupId>org.antlr</groupId>
                        <artifactId>antlr4-runtime</artifactId>
                        <version>4.5.1</version>
+            <scope>test</scope>
                </dependency>
                <dependency>
                        <groupId>org.opendaylight.yangtools</groupId>
                        <artifactId>yang-model-api</artifactId>
                        <version>${odl-version}</version>
+            <scope>test</scope>
                </dependency>
                <dependency>
                        <groupId>org.opendaylight.yangtools</groupId>
                        <artifactId>yang-model-util</artifactId>
                        <version>${odl-version}</version>
+            <scope>test</scope>
                </dependency>
                <dependency>
                        <groupId>org.opendaylight.yangtools</groupId>
                        <artifactId>yang-parser-impl</artifactId>
                        <version>${odl-version}</version>
+            <scope>test</scope>
                </dependency>
                <dependency>
                        <groupId>org.opendaylight.yangtools</groupId>
                        <artifactId>yang-parser-api</artifactId>
                        <version>${odl-version}</version>
+            <scope>test</scope>
                </dependency>
                <dependency>
                        <groupId>org.opendaylight.yangtools</groupId>
                        <artifactId>concepts</artifactId>
                        <version>${odl-version}</version>
+            <scope>test</scope>
                </dependency>
                <dependency>
                        <groupId>org.opendaylight.yangtools</groupId>
                        <artifactId>util</artifactId>
                        <version>${odl-version}</version>
+            <scope>test</scope>
                </dependency>
                <dependency>
                        <groupId>org.opendaylight.yangtools</groupId>
                        <artifactId>object-cache-api</artifactId>
                        <version>${odl-version}</version>
+            <scope>test</scope>
                </dependency>
                <dependency>
                        <groupId>org.opendaylight.yangtools</groupId>
                        <artifactId>yang-model-export</artifactId>
                        <version>${odl-version}</version>
+            <scope>test</scope>
                </dependency>
                <dependency>
                        <groupId>org.opendaylight.yangtools</groupId>
                        <artifactId>yang-common</artifactId>
                        <version>${odl-version}</version>
+            <scope>test</scope>
                </dependency>
         <dependency>
             <groupId>org.assertj</groupId>
index 0907a7171fa82df36f092e44c4b86b54cf6a4c77..f00006dcd280882aa54e0684c3f55bcad8f50461 100644 (file)
@@ -1,5 +1,6 @@
 /*******************************************************************************
  * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2016 AT&T, Inc.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -62,6 +63,7 @@ import com.cisco.yangide.ext.model.editor.sync.ModelSynchronizer;
 
 import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException;
+import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 
 /**
  * @author Konstantin Zaitsev
@@ -208,11 +210,6 @@ public class YangMultiPageEditorPart extends MultiPageEditorPart implements IYan
                         "Yang source has syntax error and diagram view cannot be synchronized correctly.\n"
                                 + "Please correct syntax error first.");
             }
-//            yangSourceViewer.disableProjection();
-//            if (yangSourceViewer.getReconciler() != null) {
-//                yangSourceViewer.getReconciler().uninstall();
-//            }
-//            yangSourceViewer.disableTextListeners();
             try {
                 getEditorSite().getPage().showView("org.eclipse.ui.views.PropertySheet");
             } catch (PartInitException e) {
@@ -221,7 +218,6 @@ public class YangMultiPageEditorPart extends MultiPageEditorPart implements IYan
             yangDiagramEditor.startSourceSelectionUpdater();
         }
         else if (newPageIndex == INDEX_SOURCE_PAGE) {
-//            yangDiagramEditor.stopSourceSelectionUpdater();
             IRegion highlightRange = yangSourceEditor.getHighlightRange();
             yangSourceViewer.enableTextListeners();
             yangSourceViewer.updateDocument();
@@ -379,38 +375,11 @@ public class YangMultiPageEditorPart extends MultiPageEditorPart implements IYan
                 yinBuilder.build(baos);
                 editor.storeContentInYinView(prettyPrintXML(baos.toString()));
             }
-            catch (XMLStreamException | SchemaSourceException | IOException | YangSyntaxErrorException ex) {
+            catch (XMLStreamException | SchemaSourceException | IOException | YangSyntaxErrorException | SourceException ex) {
                 YangCorePlugin.log(ex);
                 return new Status(Status.ERROR, YangCorePlugin.PLUGIN_ID, "Failed to generate Yin file");
             }
 
-//            YangTextSchemaContextResolver   resolver    = YangTextSchemaContextResolver.create("yangide");
-//
-//            try {
-//                com.cisco.yangide.core.dom.Module   module  =
-//                        YangParserUtil.parseYangFile(this.getDocument().get().toCharArray());
-//                List<SourceIdentifier>  sourceIdentifiers   = collectSourceIds(module);
-//                if (sourceIdentifiers.size() == 1) {
-//                    resolver.registerSource(YangTextSchemaSource.delegateForByteSource(sourceIdentifiers.get(0),
-//                            ByteSource.wrap(data.yangSourceEditor.getDocument().get().getBytes())));
-//                }
-//                else {
-//                    for (SourceIdentifier id : sourceIdentifiers) {
-//                        System.out.println("id[" + id + "]");
-//                        // delegate will be a ByteArrayByteSource.
-//                        //                YangTextSchemaSource    source  = YangTextSchemaSource.delegateForByteSource(id, delegate);
-//                        //                resolver.registerSource(source);
-//                    }
-//                }
-//                ByteArrayOutputStream   baos    = new ByteArrayOutputStream();
-//                YinExportUtils.writeModuleToOutputStream(resolver.getSchemaContext().get(), new ModuleApiProxy(module), baos);
-//                data.editor.storeContentInYinView(prettyPrintXML(baos.toString()));
-//            }
-//            catch (XMLStreamException | SchemaSourceException | IOException | YangSyntaxErrorException ex) {
-//                YangCorePlugin.log(ex);
-//                return new Status(Status.ERROR, YangCorePlugin.PLUGIN_ID, "Failed to generate Yin file");
-//            }
-
             return Status.OK_STATUS;
         }
         
@@ -429,17 +398,5 @@ public class YangMultiPageEditorPart extends MultiPageEditorPart implements IYan
             }
             return result;
         }
-        
-//        private List<SourceIdentifier> collectSourceIds(com.cisco.yangide.core.dom.Module module) {
-//            List<SourceIdentifier>  sourceIdList    = new ArrayList<>();
-//            sourceIdList.add(new SourceIdentifier(module.getName(), module.getRevision()));
-//            for (ModuleImport moduleImport : module.getImports().values()) {
-//                sourceIdList.add(new SourceIdentifier(moduleImport.getName(), moduleImport.getRevision()));
-//            }
-//            for (SubModuleInclude subModuleInclude : module.getIncludes().values()) {
-//                sourceIdList.add(new SourceIdentifier(subModuleInclude.getName(), subModuleInclude.getRevision()));
-//            }
-//            return sourceIdList;
-//        }
     }
 }
index c81f3dd19a86affc79c65c6df4592ebcb6969c7c..9019ed30b8e20de4b2320a0fc44f8a39d74b5094 100644 (file)
@@ -25,6 +25,8 @@ import org.mockito.Mock;
 import org.mockito.runners.MockitoJUnitRunner;
 import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
+import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 import org.w3c.dom.Document;
 import org.xml.sax.SAXException;
 
@@ -161,7 +163,7 @@ public class YinBuilderTest {
         assertThat(getXPathResult(xmldoc, "/module/container/leaf/config/@value")).isEqualTo("true");
     }
 
-    private Document buildYinDoc() throws XMLStreamException, SchemaSourceException, IOException, YangSyntaxErrorException, SAXException, ParserConfigurationException {
+    private Document buildYinDoc() throws XMLStreamException, SchemaSourceException, IOException, YangSyntaxErrorException, SAXException, ParserConfigurationException, SourceException, ReactorException {
         ByteArrayOutputStream   baos    = new ByteArrayOutputStream();
         yinBuilder.build(baos);
         return createDOMDoc(baos.toString());
index 46cec6ed2a0bc1805bdc5252d405d5e0ead9bd36..cf36b561195a3e4e3849ff022040558ccc6c3074 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry kind="src" path="src/"/>
        <classpathentry kind="output" path="target/classes"/>
index 0999d5604715055c361a886cb48b206a4011857b..6478bdb127f22d6abb7c4ad6e959055a60402bf9 100644 (file)
@@ -6,7 +6,7 @@ Bundle-Version: 1.1.1.qualifier
 Bundle-ClassPath: .
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Export-Package: com.cisco.yangide.ext.model,
  com.cisco.yangide.ext.model.impl,
  com.cisco.yangide.ext.model.util
index 46cec6ed2a0bc1805bdc5252d405d5e0ead9bd36..cf36b561195a3e4e3849ff022040558ccc6c3074 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry kind="src" path="src/"/>
        <classpathentry kind="output" path="target/classes"/>
index c1a467b468e4ab984c73792f3504538e8dda0880..8817bb315e9fbe7817fe6df3386e14da6052a7ba 100644 (file)
@@ -23,7 +23,7 @@ Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.swt,
  com.cisco.yangide.ui,
  org.eclipse.ui.workbench.texteditor
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Bundle-ActivationPolicy: lazy
 Bundle-ClassPath: .
 Export-Package: com.cisco.yangide.ext.refactoring,
index 302a9d829fc1f7a30632800ce17b488d7c18c2c5..18462185a27d061ee1c1844f913748eaa6d810df 100644 (file)
@@ -29,6 +29,7 @@ import com.cisco.yangide.core.dom.GroupingDefinition;
 import com.cisco.yangide.core.dom.IdentitySchemaNode;
 import com.cisco.yangide.core.dom.Module;
 import com.cisco.yangide.core.dom.ModuleImport;
+import com.cisco.yangide.core.dom.QName;
 import com.cisco.yangide.core.dom.SimpleNode;
 import com.cisco.yangide.core.dom.SubModule;
 import com.cisco.yangide.core.dom.SubModuleInclude;
@@ -173,6 +174,14 @@ public class RenameSupport {
                 || node instanceof BaseReference || node instanceof ModuleImport || node instanceof SubModuleInclude;
     }
 
+    private static String nameWithoutPrefix(String name) {
+        return ((name != null && name.indexOf(':') != -1) ? name.substring(name.indexOf(':') + 1) : name);
+    }
+    
+    private static boolean prefixMatchesModulePrefix(QName component, SimpleNode modulePrefix) {
+        return (component.getPrefix() != null && modulePrefix != null && component.getPrefix().equals(modulePrefix.getValue()));
+    }
+    
     /**
      * @param module module to find
      * @param node original node with definition
@@ -181,6 +190,8 @@ public class RenameSupport {
     public static ASTNamedNode[] findLocalReferences(Module module, final ASTNamedNode node) {
         final List<ASTNamedNode> nodes = new ArrayList<>();
         final String name = node.getName();
+//        final String nameWithoutPrefix  =
+//                ((name != null && name.indexOf(':') != -1) ? name.substring(name.indexOf(':') + 1) : name);
         final SimpleNode<String> modulePrefix = module.getPrefix();
         module.accept(new ASTVisitor() {
             @Override
@@ -191,13 +202,16 @@ public class RenameSupport {
                             || nn instanceof SubModule || nn instanceof IdentitySchemaNode)
                             && nn.getName().equals(name)) {
                         nodes.add(nn);
-                    } else if (nn instanceof TypeReference && ((TypeReference) nn).getType().getName().equals(name)) {
-                        nodes.add(nn);
-                    } else if (nn instanceof UsesNode && ((UsesNode) nn).getGrouping().getName().equals(name)) {
+                    } else if (nn instanceof TypeReference && nameWithoutPrefix(((TypeReference) nn).getType().getName()).equals(nameWithoutPrefix(name))) {
+                        if (prefixMatchesModulePrefix(((TypeReference) nn).getType(), modulePrefix)) {
+                            nodes.add(nn);
+                        }
+                    } else if (nn instanceof UsesNode && nameWithoutPrefix(((UsesNode) nn).getGrouping().getName()).equals(nameWithoutPrefix(name))) {
                         // We add the node if the prefix on the UsesNode matches the module prefix,
                         // either implicitly or explicitly.
-                        if (((UsesNode) nn).getGrouping().getPrefix() != null && modulePrefix != null
-                                && ((UsesNode) nn).getGrouping().getPrefix().equals(modulePrefix.getValue())) {
+                        if (prefixMatchesModulePrefix(((UsesNode) nn).getGrouping(), modulePrefix)) {
+//                        if (((UsesNode) nn).getGrouping().getPrefix() != null && modulePrefix != null
+//                                && ((UsesNode) nn).getGrouping().getPrefix().equals(modulePrefix.getValue())) {
                             nodes.add(nn);
                         }
                     } else if (nn instanceof BaseReference && ((BaseReference) nn).getType().getName().equals(name)) {
index 79e21b187eb411c1e8731f8561b227f2047c34e9..7ac0e4ed30ae7f4512811eba3334e0d374e6527c 100644 (file)
   <artifactId>com.cisco.yangide.ui</artifactId>
   <packaging>eclipse-plugin</packaging>
   <version>1.1.1-SNAPSHOT</version>
+  <properties>
+    <yangbinding_groupid>org.opendaylight.mdsal</yangbinding_groupid>
+    <yangbinding_artifactid>yang-binding</yangbinding_artifactid>
+    <yangbinding_version>0.9.0-SNAPSHOT</yangbinding_version>
+    <mavenplugin_groupid>org.opendaylight.yangtools</mavenplugin_groupid>
+    <mavenplugin_artifactid>yang-maven-plugin</mavenplugin_artifactid>
+    <mavenplugin_version>1.0.0-SNAPSHOT</mavenplugin_version>
+    <codegen_groupid>org.opendaylight.mdsal</codegen_groupid>
+    <codegen_artifactid>maven-sal-api-gen-plugin</codegen_artifactid>
+    <codegen_version>0.9.0-SNAPSHOT</codegen_version>
+    <codegen_classname>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codegen_classname>
+    <codegen_outputdir>target/generated-sources/sal</codegen_outputdir>
+    <odl_release_url>https://nexus.opendaylight.org/content/repositories/opendaylight.release/</odl_release_url>
+    <odl_snapshot_url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</odl_snapshot_url>
+  </properties>
   <build>
     <sourceDirectory>src</sourceDirectory>
+    <resources>
+        <resource>
+            <!-- The intent is to copy properties files from "resources" into the "resources" folder
+            in the resulting jar.  This works.  The doc for the "targetPath" property says that it
+            shouldn't be necessary, but this would write the file to the root without it.
+             -->
+            <directory>resources</directory>
+            <targetPath>resources</targetPath>
+            <filtering>true</filtering>
+            <includes>
+                <include>**/*.properties</include>
+            </includes>
+        </resource>
+    </resources>
   </build>
 </project>
diff --git a/plugins/com.cisco.yangide.ui/resources/projectpom.properties b/plugins/com.cisco.yangide.ui/resources/projectpom.properties
new file mode 100644 (file)
index 0000000..96f0117
--- /dev/null
@@ -0,0 +1,17 @@
+yangbinding_groupid: @yangbinding_groupid@
+yangbinding_artifactid: @yangbinding_artifactid@
+yangbinding_version: @yangbinding_version@
+
+odl_release_url: @odl_release_url@
+odl_snapshot_url: @odl_snapshot_url@
+
+mavenplugin_groupid: @mavenplugin_groupid@
+mavenplugin_artifactid: @mavenplugin_artifactid@
+mavenplugin_version: @mavenplugin_version@
+
+codegen_groupid: @codegen_groupid@
+codegen_artifactid: @codegen_artifactid@
+codegen_version: @codegen_version@
+codegen_classname: @codegen_classname@
+codegen_outputdir: @codegen_outputdir@
+
index 1d2ccb3713321f627876d68f8d17f0f3c0cc8235..ad231af883bb03bdd88a11285bab7abd8e4573f7 100644 (file)
@@ -12,6 +12,7 @@ import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Properties;
 
 import org.apache.maven.model.Build;
 import org.apache.maven.model.Dependency;
@@ -58,6 +59,61 @@ public class YangProjectWizard extends MavenProjectWizard {
     /** YANG tools configuration page. */
     private YangProjectWizardPage yangPage;
 
+    private static Properties projectPom    = new Properties();
+    
+    private static final String PROP_YANGBINDING_GROUPID    = "yangbinding_groupid";
+    private static final String PROP_YANGBINDING_ARTIFACTID = "yangbinding_artifactid";
+    private static final String PROP_YANGBINDING_VERSION    = "yangbinding_version";
+    private static final String PROP_MAVENPLUGIN_GROUPID    = "mavenplugin_groupid";
+    private static final String PROP_MAVENPLUGIN_ARTIFACTID = "mavenplugin_artifactid";
+    private static final String PROP_MAVENPLUGIN_VERSION    = "mavenplugin_version";
+    private static final String PROP_CODEGEN_GROUPID        = "codegen_groupid";
+    private static final String PROP_CODEGEN_ARTIFACTID     = "codegen_artifactid";
+    private static final String PROP_CODEGEN_VERSION        = "codegen_version";
+    private static final String PROP_CODEGEN_CLASSNAME      = "codegen_classname";
+    private static final String PROP_CODEGEN_OUTPUTDIR      = "codegen_outputdir";
+    private static final String PROP_ODL_RELEASE_URL        = "odl_release_url";
+    private static final String PROP_ODL_SNAPSHOT_URL       = "odl_snapshot_url";
+
+    static final String yangbindingGroupId;
+    static final String yangbindingArtifactId;
+    static final String yangbindingVersion;
+    static final String mavenpluginGroupId;
+    static final String mavenpluginArtifactId;
+    static final String mavenpluginVersion;
+    static final String codegenGroupId;
+    static final String codegenArtifactId;
+    static final String codegenVersion;
+    static final String codegenClassname;
+    static final String codegenOutputDir;
+    static final String odlReleaseUrl;
+    static final String odlSnapshotUrl;
+
+    static {
+        try {
+            projectPom.load(YangProjectWizard.class.getClassLoader().getResourceAsStream("resources/projectpom.properties"));
+        } catch (IOException e) {
+            YangUIPlugin.log(e);
+        }
+        
+        yangbindingGroupId      = projectPom.getProperty(PROP_YANGBINDING_GROUPID);
+        yangbindingArtifactId   = projectPom.getProperty(PROP_YANGBINDING_ARTIFACTID);
+        yangbindingVersion      = projectPom.getProperty(PROP_YANGBINDING_VERSION);
+
+        mavenpluginGroupId      = projectPom.getProperty(PROP_MAVENPLUGIN_GROUPID);
+        mavenpluginArtifactId   = projectPom.getProperty(PROP_MAVENPLUGIN_ARTIFACTID);
+        mavenpluginVersion      = projectPom.getProperty(PROP_MAVENPLUGIN_VERSION);
+
+        codegenGroupId          = projectPom.getProperty(PROP_CODEGEN_GROUPID);
+        codegenArtifactId       = projectPom.getProperty(PROP_CODEGEN_ARTIFACTID);
+        codegenVersion          = projectPom.getProperty(PROP_CODEGEN_VERSION);
+        codegenClassname        = projectPom.getProperty(PROP_CODEGEN_CLASSNAME);
+        codegenOutputDir        = projectPom.getProperty(PROP_CODEGEN_OUTPUTDIR);
+
+        odlReleaseUrl           = projectPom.getProperty(PROP_ODL_RELEASE_URL);
+        odlSnapshotUrl          = projectPom.getProperty(PROP_ODL_SNAPSHOT_URL);
+    }
+
     /**
      * Constructor.
      */
@@ -90,8 +146,6 @@ public class YangProjectWizard extends MavenProjectWizard {
         final String yangRoot = yangPage.getRootDir();
         final IFolder folder = project.getFolder(yangRoot);
 
-        final String yangVersion = yangPage.getYangVersion();
-
         final List<CodeGeneratorConfig> generators = yangPage.getCodeGenerators();
 
         Job updateJob = new Job("Yang Project update") {
@@ -102,7 +156,7 @@ public class YangProjectWizard extends MavenProjectWizard {
 
                     IFile pomFile = project.getFile("pom.xml");
                     Model model = MavenPlugin.getMavenModelManager().readMavenModel(pomFile);
-                    updateModel(model, yangVersion, generators, yangRoot);
+                    updateModel(model,generators, yangRoot);
 
                     pomFile.delete(true, new NullProgressMonitor());
                     MavenPlugin.getMavenModelManager().createMavenModel(pomFile, model);
@@ -169,13 +223,13 @@ public class YangProjectWizard extends MavenProjectWizard {
         }
     }
 
-    public void updateModel(Model model, String yangVersion, List<CodeGeneratorConfig> generators, String yangRoot) {
+    public void updateModel(Model model, List<CodeGeneratorConfig> generators, String yangRoot) {
         // Model model = super.getModel();
         model.setBuild(new Build());
         Plugin plugin = new Plugin();
-        plugin.setGroupId("org.opendaylight.yangtools");
-        plugin.setArtifactId("yang-maven-plugin");
-        plugin.setVersion(yangVersion);
+        plugin.setGroupId(mavenpluginGroupId);
+        plugin.setArtifactId(mavenpluginArtifactId);
+        plugin.setVersion(mavenpluginVersion);
 
         for (CodeGeneratorConfig genConf : generators) {
             Dependency dependency = new Dependency();
@@ -218,9 +272,9 @@ public class YangProjectWizard extends MavenProjectWizard {
         model.getProperties().put("maven.compiler.target", "1.8");
 
         Dependency dependency2 = new Dependency();
-        dependency2.setGroupId("org.opendaylight.mdsal");
-        dependency2.setArtifactId("yang-binding");
-        dependency2.setVersion(yangVersion);
+        dependency2.setGroupId(yangbindingGroupId);
+        dependency2.setArtifactId(yangbindingArtifactId);
+        dependency2.setVersion(yangbindingVersion);
         dependency2.setType("jar");
         model.addDependency(dependency2);
     }
index 6d9b7655d9bfd0aba845ce826bbec84a14dabe99..0f41832dc234d9ca2ab71d9258f7c10b2a467b1b 100644 (file)
@@ -7,8 +7,10 @@
  *******************************************************************************/
 package com.cisco.yangide.ui.wizards;
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Properties;
 
 import org.eclipse.jface.viewers.ILabelProviderListener;
 import org.eclipse.jface.viewers.ITableLabelProvider;
@@ -22,7 +24,6 @@ import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Table;
@@ -30,6 +31,8 @@ import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.swt.widgets.TableItem;
 import org.eclipse.swt.widgets.Text;
 
+import com.cisco.yangide.ui.YangUIPlugin;
+
 /**
  * @author Konstantin Zaitsev
  * date: Jun 27, 2014
@@ -37,7 +40,6 @@ import org.eclipse.swt.widgets.Text;
 class YangProjectWizardPage extends WizardPage {
 
     private Text rootDirTxt;
-    private Combo yangVersion;
     private Button exampleFileChk;
     private Table generatorsTable;
     private TableViewer generatorsViewer;
@@ -45,6 +47,7 @@ class YangProjectWizardPage extends WizardPage {
     private Button editBtn;
     private Button addBtn;
 
+    
     protected YangProjectWizardPage() {
         super("yangProjectPage");
         setTitle("YANG Tools Configuration");
@@ -60,10 +63,6 @@ class YangProjectWizardPage extends WizardPage {
         group1.setLayout(new GridLayout(2, false));
         group1.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
 
-        new Label(group1, SWT.NONE).setText("YANG Tools Version:");
-        yangVersion = new Combo(group1, SWT.BORDER | SWT.READ_ONLY);
-        yangVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-
         new Label(group1, SWT.NONE).setText("YANG Files Root Directory:");
         rootDirTxt = new Text(group1, SWT.BORDER);
         rootDirTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
@@ -82,18 +81,13 @@ class YangProjectWizardPage extends WizardPage {
 
         setControl(container);
 
-        // add default values
-        // TODO KOS: load version from repository
-        yangVersion.add("0.8.0-Beryllium");
-        yangVersion.select(0);
-
         // default generator
         CodeGeneratorConfig config = new CodeGeneratorConfig();
-        config.setGroupId("org.opendaylight.mdsal");
-        config.setArtifactId("maven-sal-api-gen-plugin");
-        config.setVersion(yangVersion.getText());
-        config.setGenClassName("org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl");
-        config.setGenOutputDirectory("target/generated-sources/sal");
+        config.setGroupId(YangProjectWizard.codegenGroupId);
+        config.setArtifactId(YangProjectWizard.codegenArtifactId);
+        config.setVersion(YangProjectWizard.codegenVersion);
+        config.setGenClassName(YangProjectWizard.codegenClassname);
+        config.setGenOutputDirectory(YangProjectWizard.codegenOutputDir);
         generatorsViewer.add(config);
     }
 
@@ -241,9 +235,9 @@ class YangProjectWizardPage extends WizardPage {
         return rootDirTxt.getText();
     }
 
-    public String getYangVersion() {
-        return yangVersion.getText();
-    }
+//    public String getYangVersion() {
+//        return yangVersion.getText();
+//    }
 
     public List<CodeGeneratorConfig> getCodeGenerators() {
         List<CodeGeneratorConfig> list = new ArrayList<CodeGeneratorConfig>();
index 34dc38ff2e9db2049ec243d615464541ba719ce0..b671265f9e156802972c05adb85a5edeefe17b4f 100644 (file)
@@ -3,20 +3,20 @@
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry kind="src" path="src/"/>
-       <classpathentry exported="true" kind="lib" path="libs/concepts-0.8.0-Beryllium.jar"/>
-       <classpathentry exported="true" kind="lib" path="libs/object-cache-api-0.8.0-Beryllium.jar"/>
-       <classpathentry exported="true" kind="lib" path="libs/util-0.8.0-Beryllium.jar"/>
-       <classpathentry exported="true" kind="lib" path="libs/yang-model-api-0.8.0-Beryllium.jar"/>
-       <classpathentry exported="true" kind="lib" path="libs/yang-model-export-0.8.0-Beryllium.jar" sourcepath="/home/opnfv/git/opendaylight/yangtools/yang/yang-model-export/src/main/java"/>
-       <classpathentry exported="true" kind="lib" path="libs/yang-model-util-0.8.0-Beryllium.jar" sourcepath="/home/opnfv/git/opendaylight/yangtools/yang/yang-model-util/src/main/java"/>
-       <classpathentry exported="true" kind="lib" path="libs/yang-parser-impl-0.8.0-Beryllium.jar"/>
-       <classpathentry exported="true" kind="lib" path="libs/yang-parser-api-0.8.0-Beryllium.jar"/>
-       <classpathentry exported="true" kind="lib" path="libs/yang-common-0.8.0-Beryllium.jar"/>
        <classpathentry exported="true" kind="lib" path="libs/guava-18.0.jar"/>
        <classpathentry exported="true" kind="lib" path="libs/antlr4-runtime-4.5.1.jar"/>
        <classpathentry exported="true" kind="lib" path="libs/jsr305-3.0.0.jar"/>
        <classpathentry exported="true" kind="lib" path="libs/junit-4.12.jar"/>
        <classpathentry exported="true" kind="lib" path="libs/mockito-all-1.10.19.jar"/>
        <classpathentry exported="true" kind="lib" path="libs/assertj-core-3.4.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="libs/concepts-1.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="libs/object-cache-api-1.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="libs/util-1.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="libs/yang-common-1.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="libs/yang-model-api-1.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="libs/yang-model-export-1.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="libs/yang-model-util-1.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="libs/yang-parser-api-1.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="libs/yang-parser-impl-1.0.0-SNAPSHOT.jar"/>
        <classpathentry kind="output" path="target/classes"/>
 </classpath>
index 199c6dd41f6d1228048a43efc63ef738cee7d5ac..43087c65ce961f54df9899e0ed4c4e6ad337adcb 100644 (file)
@@ -13,28 +13,35 @@ Require-Bundle: org.eclipse.core.runtime,
  com.google.guava;bundle-version="15.0.0",
  org.slf4j.api;bundle-version="1.7.2"
 Bundle-ClassPath: .,
- libs/concepts-0.8.0-Beryllium.jar,
- libs/object-cache-api-0.8.0-Beryllium.jar,
- libs/util-0.8.0-Beryllium.jar,
- libs/yang-model-api-0.8.0-Beryllium.jar,
- libs/yang-model-export-0.8.0-Beryllium.jar,
- libs/yang-model-util-0.8.0-Beryllium.jar,
- libs/yang-parser-impl-0.8.0-Beryllium.jar,
- libs/yang-parser-api-0.8.0-Beryllium.jar,
- libs/yang-common-0.8.0-Beryllium.jar,
  libs/guava-18.0.jar,
  libs/antlr4-runtime-4.5.1.jar,
  libs/jsr305-3.0.0.jar,
  libs/junit-4.12.jar,
  libs/mockito-all-1.10.19.jar,
- libs/assertj-core-3.4.0.jar
+ libs/assertj-core-3.4.0.jar,
+ libs/concepts-1.0.0-SNAPSHOT.jar,
+ libs/object-cache-api-1.0.0-SNAPSHOT.jar,
+ libs/util-1.0.0-SNAPSHOT.jar,
+ libs/yang-common-1.0.0-SNAPSHOT.jar,
+ libs/yang-model-api-1.0.0-SNAPSHOT.jar,
+ libs/yang-model-export-1.0.0-SNAPSHOT.jar,
+ libs/yang-model-util-1.0.0-SNAPSHOT.jar,
+ libs/yang-parser-api-1.0.0-SNAPSHOT.jar,
+ libs/yang-parser-impl-1.0.0-SNAPSHOT.jar
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Bundle-ActivationPolicy: lazy
 Export-Package: org.antlr.v4.runtime,
+ org.antlr.v4.runtime.atn,
+ org.antlr.v4.runtime.dfa,
+ org.antlr.v4.runtime.misc,
+ org.antlr.v4.runtime.tree,
+ org.antlr.v4.runtime.tree.pattern,
+ org.antlr.v4.runtime.tree.xpath,
  org.assertj.core.api,
  org.mockito,
  org.mockito.runners,
  org.mockito.stubbing,
+ org.opendaylight.yangtools.antlrv4.code.gen,
  org.opendaylight.yangtools.concepts,
  org.opendaylight.yangtools.yang.common,
  org.opendaylight.yangtools.yang.model.api,
@@ -47,4 +54,9 @@ Export-Package: org.antlr.v4.runtime,
  org.opendaylight.yangtools.yang.model.repo.spi,
  org.opendaylight.yangtools.yang.model.repo.util,
  org.opendaylight.yangtools.yang.model.util,
- org.opendaylight.yangtools.yang.parser.repo
+ org.opendaylight.yangtools.yang.parser.impl,
+ org.opendaylight.yangtools.yang.parser.repo,
+ org.opendaylight.yangtools.yang.parser.spi.meta,
+ org.opendaylight.yangtools.yang.parser.spi.source,
+ org.opendaylight.yangtools.yang.parser.stmt.reactor,
+ org.opendaylight.yangtools.yang.parser.stmt.rfc6020
index 90fc537e883184cb8a1065c3c192d39b7bd79b6a..2baaaa29ce22542717b0aaa811bd2f5642e531aa 100644 (file)
@@ -11,18 +11,18 @@ output.. = target/classes
 bin.includes = META-INF/,\
                .,\
                plugin.xml,\
-               libs/concepts-0.8.0-Beryllium.jar,\
-               libs/object-cache-api-0.8.0-Beryllium.jar,\
-               libs/util-0.8.0-Beryllium.jar,\
-               libs/yang-model-api-0.8.0-Beryllium.jar,\
-               libs/yang-model-export-0.8.0-Beryllium.jar,\
-               libs/yang-model-util-0.8.0-Beryllium.jar,\
-               libs/yang-parser-impl-0.8.0-Beryllium.jar,\
-               libs/yang-parser-api-0.8.0-Beryllium.jar,\
-               libs/yang-common-0.8.0-Beryllium.jar,\
                libs/guava-18.0.jar,\
                libs/antlr4-runtime-4.5.1.jar,\
                libs/jsr305-3.0.0.jar,\
                libs/junit-4.12.jar,\
                libs/mockito-all-1.10.19.jar,\
-               libs/assertj-core-3.4.0.jar
+               libs/assertj-core-3.4.0.jar,\
+               libs/concepts-1.0.0-SNAPSHOT.jar,\
+               libs/object-cache-api-1.0.0-SNAPSHOT.jar,\
+               libs/util-1.0.0-SNAPSHOT.jar,\
+               libs/yang-common-1.0.0-SNAPSHOT.jar,\
+               libs/yang-model-api-1.0.0-SNAPSHOT.jar,\
+               libs/yang-model-export-1.0.0-SNAPSHOT.jar,\
+               libs/yang-model-util-1.0.0-SNAPSHOT.jar,\
+               libs/yang-parser-api-1.0.0-SNAPSHOT.jar,\
+               libs/yang-parser-impl-1.0.0-SNAPSHOT.jar
index 808e5d4c7a565673737c29fabf8b97be297ba577..97a14e9daadf684de20038864aa9f074ac69fed9 100644 (file)
@@ -26,7 +26,8 @@
   <packaging>eclipse-plugin</packaging>
   <version>1.1.1-SNAPSHOT</version>
   <properties>
-    <odl-version>0.8.0-Beryllium</odl-version>
+    <!-- <odl-version>0.8.0-Beryllium</odl-version> -->
+    <odl-version>1.0.0-SNAPSHOT</odl-version>
   </properties>
   <dependencies>
     <dependency>
index fbbc27ddcb99d4702113b1e038a4b221a2f15904..c663eb3254c9bf2a81e3c52993372dc33e69ff3d 100644 (file)
                        <attribute name="maven.pomderived" value="true"/>
                </attributes>
        </classpathentry>
+       <classpathentry combineaccessrules="false" kind="src" path="/yang-module2"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
                <attributes>
                        <attribute name="maven.pomderived" value="true"/>
                </attributes>
        </classpathentry>
-       <classpathentry kind="src" output="target/classes" path="src/main/yang">
-               <attributes>
-                       <attribute name="ignore_optional_problems" value="true"/>
-                       <attribute name="optional" value="true"/>
-                       <attribute name="maven.pomderived" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="src" output="target/classes" path="target/generated-sources/sal">
-               <attributes>
-                       <attribute name="ignore_optional_problems" value="true"/>
-                       <attribute name="optional" value="true"/>
-                       <attribute name="maven.pomderived" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry combineaccessrules="false" kind="src" path="/yang-module2"/>
        <classpathentry kind="output" path="target/classes"/>
 </classpath>
index d1b0d7ca1f9308c2197e397c73462ef02bd80623..9959c4b81276923dbbaffc08e1d790b4e536ed04 100644 (file)
                </attributes>
        </classpathentry>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-       <classpathentry kind="src" output="target/classes" path="src/main/yang">
-               <attributes>
-                       <attribute name="optional" value="true"/>
-                       <attribute name="maven.pomderived" value="true"/>
-                       <attribute name="ignore_optional_problems" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="src" output="target/classes" path="target/generated-sources/sal">
-               <attributes>
-                       <attribute name="optional" value="true"/>
-                       <attribute name="maven.pomderived" value="true"/>
-                       <attribute name="ignore_optional_problems" value="true"/>
-               </attributes>
-       </classpathentry>
        <classpathentry kind="output" path="target/classes"/>
 </classpath>