Index: apisupport/project/src/org/netbeans/modules/apisupport/project/ui/wizard/BasicConfVisualPanel.java =================================================================== RCS file: /shared/data/ccvs/repository/apisupport/project/src/org/netbeans/modules/apisupport/project/ui/wizard/Attic/BasicConfVisualPanel.java,v --- apisupport/project/src/org/netbeans/modules/apisupport/project/ui/wizard/BasicConfVisualPanel.java 26 Sep 2007 20:25:12 -0000 1.37 +++ apisupport/project/src/org/netbeans/modules/apisupport/project/ui/wizard/BasicConfVisualPanel.java 29 Jan 2008 18:17:38 -0000 @@ -113,15 +113,14 @@ } private void checkCodeNameBase() { - if (!Util.isValidJavaFQN(getCodeNameBaseValue())) { + String dotName = getCodeNameBaseValue(); + if (!Util.isValidJavaFQN(dotName)) { setError(getMessage("MSG_InvalidCNB")); - } else if (getData().isSuiteComponent() && cnbIsAlreadyInSuite(getData().getSuiteRoot(), getCodeNameBaseValue())) { - setError(NbBundle.getMessage(BasicConfVisualPanel.class, "MSG_ComponentWithSuchCNBAlreadyInSuite", - getCodeNameBaseValue())); + } else if (getData().isSuiteComponent() && cnbIsAlreadyInSuite(getData().getSuiteRoot(), dotName)) { + setError(NbBundle.getMessage(BasicConfVisualPanel.class, "MSG_ComponentWithSuchCNBAlreadyInSuite", dotName)); } else { markValid(); // update layer and bundle from the cnb - String dotName = getCodeNameBaseValue(); String slashName = dotName.replace('.', '/'); if (!wasBundleUpdated) { bundleValue.setText(slashName + "/Bundle.properties"); // NOI18N @@ -131,7 +130,28 @@ layerValue.setText(slashName + "/layer.xml"); // NOI18N wasLayerUpdated = false; } + if (getData().isNetBeansOrg()) { + File repo = new File(getData().getProjectLocation()); + // Check if this is in the post-Hg layout. + if (new File(repo, "openide.util").isDirectory() || new File(repo, "core.registry").isDirectory()) { + // Ensure that official naming conventions are respected. + String cnbShort = abbreviate(dotName); + String name = getData().getProjectName(); + if (!name.equals(cnbShort)) { + setError(NbBundle.getMessage(BasicConfVisualPanel.class, "BasicConfVisualPanel_err_wrong_nborg_name", cnbShort)); + } + } + } } + } + private static String abbreviate(String cnb) { + return cnb.replaceFirst("^org\\.netbeans\\.modules\\.", ""). // NOI18N + replaceFirst("^org\\.netbeans\\.(libs|lib|api|spi|core)\\.", "$1."). // NOI18N + replaceFirst("^org\\.netbeans\\.", "o.n."). // NOI18N + replaceFirst("^org\\.openide\\.", "openide."). // NOI18N + replaceFirst("^org\\.", "o."). // NOI18N + replaceFirst("^com\\.sun\\.", "c.s."). // NOI18N + replaceFirst("^com\\.", "c."); // NOI18N } private void checkBundle() { Index: apisupport/project/src/org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties =================================================================== RCS file: /shared/data/ccvs/repository/apisupport/project/src/org/netbeans/modules/apisupport/project/ui/wizard/Attic/Bundle.properties,v --- apisupport/project/src/org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties 26 Sep 2007 20:25:12 -0000 1.35 +++ apisupport/project/src/org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties 29 Jan 2008 18:17:38 -0000 @@ -109,6 +109,8 @@ BasicConfVisualPanel_err_bundle_def_pkg=Cannot use default package for bundle. BasicConfVisualPanel_err_layer_ext=Layer must have "{0}" extension. BasicConfVisualPanel_err_bundle_ext=Bundle must have "{0}" extension. +# {0} - expected abbreviated CNB +BasicConfVisualPanel_err_wrong_nborg_name=For this code name base, module must be in a directory named "{0}". ACS_BasicConfVisualPanel=Basic Module Configuration ACS_CTL_BundleValue=Localizing Bundle ACS_CTL_CodeNameBaseValue=Code name base Index: apisupport/project/src/org/netbeans/modules/apisupport/project/universe/ModuleList.java =================================================================== RCS file: /shared/data/ccvs/repository/apisupport/project/src/org/netbeans/modules/apisupport/project/universe/Attic/ModuleList.java,v --- apisupport/project/src/org/netbeans/modules/apisupport/project/universe/ModuleList.java 25 Oct 2007 22:44:55 -0000 1.36 +++ apisupport/project/src/org/netbeans/modules/apisupport/project/universe/ModuleList.java 29 Jan 2008 18:17:38 -0000 @@ -919,7 +919,8 @@ */ public static boolean isNetBeansOrg(File dir) { return new File(dir, "nbbuild").isDirectory() && // NOI18N - new File(dir, "openide").isDirectory(); // NOI18N + // Check for both pre- and post-Hg layouts. + (new File(dir, "core").isDirectory() || new File(dir, "openide.util").isDirectory()); // NOI18N } /** Index: apisupport/project/src/org/netbeans/modules/apisupport/project/universe/TestEntry.java =================================================================== RCS file: /shared/data/ccvs/repository/apisupport/project/src/org/netbeans/modules/apisupport/project/universe/Attic/TestEntry.java,v --- apisupport/project/src/org/netbeans/modules/apisupport/project/universe/TestEntry.java 26 Sep 2007 20:25:22 -0000 1.7 +++ apisupport/project/src/org/netbeans/modules/apisupport/project/universe/TestEntry.java 29 Jan 2008 18:17:38 -0000 @@ -184,7 +184,7 @@ public String getNetBeansOrgPath () throws IOException { File nbcvs = getNBCVSRoot(); if (nbcvs != null && ModuleList.isNetBeansOrg(nbcvs) ) { - ModuleList list = ModuleList.getModuleList(new File(nbcvs,"core")); // NOI18N + ModuleList list = ModuleList.findOrCreateModuleListFromNetBeansOrgSources(nbcvs); ModuleEntry entry = list.getEntry(codeNameBase); if (entry == null) { return null;