Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
View | Details | Raw Unified | Return to bug 126135
Collapse All | Expand All

(-)apisupport/project/src/org/netbeans/modules/apisupport/project/ui/wizard/BasicConfVisualPanel.java (-5 / +25 lines)
 Lines 113-127    Link Here 
113
    }
113
    }
114
    
114
    
115
    private void checkCodeNameBase() {
115
    private void checkCodeNameBase() {
116
        if (!Util.isValidJavaFQN(getCodeNameBaseValue())) {
116
        String dotName = getCodeNameBaseValue();
117
        if (!Util.isValidJavaFQN(dotName)) {
117
            setError(getMessage("MSG_InvalidCNB"));
118
            setError(getMessage("MSG_InvalidCNB"));
118
        } else if (getData().isSuiteComponent() && cnbIsAlreadyInSuite(getData().getSuiteRoot(), getCodeNameBaseValue())) {
119
        } else if (getData().isSuiteComponent() && cnbIsAlreadyInSuite(getData().getSuiteRoot(), dotName)) {
119
            setError(NbBundle.getMessage(BasicConfVisualPanel.class, "MSG_ComponentWithSuchCNBAlreadyInSuite",
120
            setError(NbBundle.getMessage(BasicConfVisualPanel.class, "MSG_ComponentWithSuchCNBAlreadyInSuite", dotName));
120
                    getCodeNameBaseValue()));
121
        } else {
121
        } else {
122
            markValid();
122
            markValid();
123
            // update layer and bundle from the cnb
123
            // update layer and bundle from the cnb
124
            String dotName = getCodeNameBaseValue();
125
            String slashName = dotName.replace('.', '/');
124
            String slashName = dotName.replace('.', '/');
126
            if (!wasBundleUpdated) {
125
            if (!wasBundleUpdated) {
127
                bundleValue.setText(slashName + "/Bundle.properties"); // NOI18N
126
                bundleValue.setText(slashName + "/Bundle.properties"); // NOI18N
 Lines 131-137    Link Here 
131
                layerValue.setText(slashName + "/layer.xml"); // NOI18N
130
                layerValue.setText(slashName + "/layer.xml"); // NOI18N
132
                wasLayerUpdated = false;
131
                wasLayerUpdated = false;
133
            }
132
            }
133
            if (getData().isNetBeansOrg()) {
134
                File repo = new File(getData().getProjectLocation());
135
                // Check if this is in the post-Hg layout.
136
                if (new File(repo, "openide.util").isDirectory() || new File(repo, "core.registry").isDirectory()) {
137
                    // Ensure that official naming conventions are respected.
138
                    String cnbShort = abbreviate(dotName);
139
                    String name = getData().getProjectName();
140
                    if (!name.equals(cnbShort)) {
141
                        setError(NbBundle.getMessage(BasicConfVisualPanel.class, "BasicConfVisualPanel_err_wrong_nborg_name", cnbShort));
142
                    }
143
                }
144
            }
134
        }
145
        }
146
    }
147
    private static String abbreviate(String cnb) {
148
        return cnb.replaceFirst("^org\\.netbeans\\.modules\\.", ""). // NOI18N
149
                   replaceFirst("^org\\.netbeans\\.(libs|lib|api|spi|core)\\.", "$1."). // NOI18N
150
                   replaceFirst("^org\\.netbeans\\.", "o.n."). // NOI18N
151
                   replaceFirst("^org\\.openide\\.", "openide."). // NOI18N
152
                   replaceFirst("^org\\.", "o."). // NOI18N
153
                   replaceFirst("^com\\.sun\\.", "c.s."). // NOI18N
154
                   replaceFirst("^com\\.", "c."); // NOI18N
135
    }
155
    }
136
    
156
    
137
    private void checkBundle() {
157
    private void checkBundle() {
(-)apisupport/project/src/org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties (+2 lines)
 Lines 109-114    Link Here 
109
BasicConfVisualPanel_err_bundle_def_pkg=Cannot use default package for bundle.
109
BasicConfVisualPanel_err_bundle_def_pkg=Cannot use default package for bundle.
110
BasicConfVisualPanel_err_layer_ext=Layer must have "{0}" extension.
110
BasicConfVisualPanel_err_layer_ext=Layer must have "{0}" extension.
111
BasicConfVisualPanel_err_bundle_ext=Bundle must have "{0}" extension.
111
BasicConfVisualPanel_err_bundle_ext=Bundle must have "{0}" extension.
112
# {0} - expected abbreviated CNB
113
BasicConfVisualPanel_err_wrong_nborg_name=For this code name base, module must be in a directory named "{0}".
112
ACS_BasicConfVisualPanel=Basic Module Configuration
114
ACS_BasicConfVisualPanel=Basic Module Configuration
113
ACS_CTL_BundleValue=Localizing Bundle
115
ACS_CTL_BundleValue=Localizing Bundle
114
ACS_CTL_CodeNameBaseValue=Code name base
116
ACS_CTL_CodeNameBaseValue=Code name base
(-)apisupport/project/src/org/netbeans/modules/apisupport/project/universe/ModuleList.java (-1 / +2 lines)
 Lines 919-925    Link Here 
919
     */
919
     */
920
    public static boolean isNetBeansOrg(File dir) {
920
    public static boolean isNetBeansOrg(File dir) {
921
        return new File(dir, "nbbuild").isDirectory() && // NOI18N
921
        return new File(dir, "nbbuild").isDirectory() && // NOI18N
922
                new File(dir, "openide").isDirectory(); // NOI18N
922
                // Check for both pre- and post-Hg layouts.
923
                (new File(dir, "core").isDirectory() || new File(dir, "openide.util").isDirectory()); // NOI18N
923
    }
924
    }
924
    
925
    
925
    /**
926
    /**
(-)apisupport/project/src/org/netbeans/modules/apisupport/project/universe/TestEntry.java (-1 / +1 lines)
 Lines 184-190    Link Here 
184
    public String getNetBeansOrgPath () throws IOException {
184
    public String getNetBeansOrgPath () throws IOException {
185
        File nbcvs =  getNBCVSRoot();
185
        File nbcvs =  getNBCVSRoot();
186
        if (nbcvs != null && ModuleList.isNetBeansOrg(nbcvs) ) {
186
        if (nbcvs != null && ModuleList.isNetBeansOrg(nbcvs) ) {
187
            ModuleList list = ModuleList.getModuleList(new File(nbcvs,"core")); // NOI18N
187
            ModuleList list = ModuleList.findOrCreateModuleListFromNetBeansOrgSources(nbcvs);
188
            ModuleEntry entry = list.getEntry(codeNameBase);
188
            ModuleEntry entry = list.getEntry(codeNameBase);
189
            if (entry == null) {
189
            if (entry == null) {
190
                return null;
190
                return null;

Return to bug 126135
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo