This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 206253
Collapse All | Expand All

(-)a/autoupdate.services/src/org/netbeans/modules/autoupdate/services/Utilities.java (+6 lines)
Lines 59-68 Link Here
59
import java.util.logging.Logger;
59
import java.util.logging.Logger;
60
import java.util.prefs.Preferences;
60
import java.util.prefs.Preferences;
61
import org.netbeans.Module;
61
import org.netbeans.Module;
62
import org.netbeans.ModuleInstaller;
62
import org.netbeans.ModuleManager;
63
import org.netbeans.ModuleManager;
63
import org.netbeans.api.autoupdate.UpdateElement;
64
import org.netbeans.api.autoupdate.UpdateElement;
64
import org.netbeans.api.autoupdate.UpdateManager;
65
import org.netbeans.api.autoupdate.UpdateManager;
65
import org.netbeans.api.autoupdate.UpdateUnit;
66
import org.netbeans.api.autoupdate.UpdateUnit;
67
import org.netbeans.core.startup.AutomaticDependencies;
66
import org.netbeans.core.startup.Main;
68
import org.netbeans.core.startup.Main;
67
import org.netbeans.core.startup.TopLogging;
69
import org.netbeans.core.startup.TopLogging;
68
import org.netbeans.modules.autoupdate.updateprovider.DummyModuleInfo;
70
import org.netbeans.modules.autoupdate.updateprovider.DummyModuleInfo;
Lines 663-668 Link Here
663
            UpdateElement el,
665
            UpdateElement el,
664
            boolean agressive) {
666
            boolean agressive) {
665
        Set<Dependency> res = new HashSet<Dependency> ();
667
        Set<Dependency> res = new HashSet<Dependency> ();
668
        AutomaticDependencies.Report rep = AutomaticDependencies.getDefault().refineDependenciesAndReport(el.getCodeName(), original);
669
        if (rep.isModified()) {
670
            err.warning(rep.toString());
671
        }
666
        for (Dependency dep : original) {
672
        for (Dependency dep : original) {
667
            Collection<UpdateElement> requestedElements = handleDependency (el, dep, availableInfos, brokenDependencies, agressive);
673
            Collection<UpdateElement> requestedElements = handleDependency (el, dep, availableInfos, brokenDependencies, agressive);
668
            if (requestedElements != null) {
674
            if (requestedElements != null) {
(-)a/core.startup/apichanges.xml (+15 lines)
Lines 56-61 Link Here
56
<!-- ACTUAL CHANGES BEGIN HERE: -->
56
<!-- ACTUAL CHANGES BEGIN HERE: -->
57
57
58
  <changes>
58
  <changes>
59
     <change id="get-default-automatic-dependencies">
60
        <api name="bridge"/>
61
        <summary>getDefault</summary>
62
        <version major="1" minor="39"/>
63
        <date day="13" month="4" year="2012"/>
64
        <author login="jrechtacek"/>
65
        <compatibility addition="yes" binary="compatible" semantic="compatible" />
66
        <description>
67
        <p>
68
            Returns instance of AutomaticDependencies based on default
69
            list of transformations.
70
        </p>
71
        </description>
72
        <class package="org.netbeans.core.startup" name="AutomaticDependencies"/>
73
    </change>
59
     <change id="is.au.visible">
74
     <change id="is.au.visible">
60
        <api name="bridge"/>
75
        <api name="bridge"/>
61
        <summary>isShowInAutoUpdateClient</summary>
76
        <summary>isShowInAutoUpdateClient</summary>
(-)a/core.startup/manifest.mf (-1 / +1 lines)
Lines 3-7 Link Here
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/core/startup/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/core/startup/Bundle.properties
4
OpenIDE-Module-Layer: org/netbeans/core/startup/layer.xml
4
OpenIDE-Module-Layer: org/netbeans/core/startup/layer.xml
5
OpenIDE-Module-Provides: org.openide.modules.InstalledFileLocator
5
OpenIDE-Module-Provides: org.openide.modules.InstalledFileLocator
6
OpenIDE-Module-Specification-Version: 1.38
6
OpenIDE-Module-Specification-Version: 1.39
7
7
(-)a/core.startup/src/org/netbeans/core/startup/AutomaticDependencies.java (+43 lines)
Lines 63-68 Link Here
63
import java.util.logging.Logger;
63
import java.util.logging.Logger;
64
import org.netbeans.ModuleInstaller;
64
import org.netbeans.ModuleInstaller;
65
import org.netbeans.Util;
65
import org.netbeans.Util;
66
import org.openide.filesystems.FileObject;
67
import org.openide.filesystems.FileUtil;
66
import org.openide.modules.Dependency;
68
import org.openide.modules.Dependency;
67
import org.openide.modules.SpecificationVersion;
69
import org.openide.modules.SpecificationVersion;
68
import org.openide.xml.XMLUtil;
70
import org.openide.xml.XMLUtil;
Lines 87-92 Link Here
87
 */
89
 */
88
public final class AutomaticDependencies {
90
public final class AutomaticDependencies {
89
    private static final Logger LOG = Logger.getLogger(AutomaticDependencies.class.getName());
91
    private static final Logger LOG = Logger.getLogger(AutomaticDependencies.class.getName());
92
    private static AutomaticDependencies INSTANCE;
90
93
91
    private AutomaticDependencies() {}
94
    private AutomaticDependencies() {}
92
    
95
    
Lines 98-103 Link Here
98
        return new AutomaticDependencies();
101
        return new AutomaticDependencies();
99
    }
102
    }
100
    
103
    
104
    /** Create default list of transformations.
105
     * This is now all handled from declarative configuration files:
106
     * in the system filesystem, ModuleAutoDeps/*.xml may be added
107
     * according to the DTD "-//NetBeans//DTD Module Automatic Dependencies 1.0//EN".
108
     * 
109
     * @since 1.39
110
     * @return the default list
111
     */
112
    public static AutomaticDependencies getDefault() {
113
        if (INSTANCE != null) {
114
            return INSTANCE;
115
        }
116
        
117
        FileObject depsFolder = FileUtil.getConfigFile("ModuleAutoDeps");
118
        if (depsFolder != null) {
119
            FileObject[] kids = depsFolder.getChildren();
120
            List<URL> urls = new ArrayList<URL>(Math.max(kids.length, 1));
121
            for (FileObject kid : kids) {
122
                if (kid.hasExt("xml")) { // NOI18N
123
                    urls.add(kid.toURL());
124
                }
125
            }
126
            try {
127
                INSTANCE = AutomaticDependencies.parse(urls.toArray(new URL[urls.size()]));
128
            } catch (IOException e) {
129
                Util.err.log(Level.WARNING, null, e);
130
            } catch (SAXException e) {
131
                Util.err.log(Level.WARNING, null, e);
132
            }
133
        }
134
        if (INSTANCE == null) {
135
            // Parsing failed, or no files.
136
            INSTANCE = AutomaticDependencies.empty();
137
        }
138
        if (Util.err.isLoggable(Level.FINE)) {
139
            Util.err.fine("Auto deps: " + INSTANCE);
140
        }
141
        return INSTANCE;
142
    }
143
    
101
    /**
144
    /**
102
     * Create a list of transformations based on some XML files.
145
     * Create a list of transformations based on some XML files.
103
     * They must be valid (this method may not validate them).
146
     * They must be valid (this method may not validate them).
(-)a/core.startup/src/org/netbeans/core/startup/NbInstaller.java (-29 / +1 lines)
Lines 727-734 Link Here
727
    }
727
    }
728
728
729
    
729
    
730
    private AutomaticDependencies autoDepsHandler = null;
731
    
732
    /** Overridden to perform automatic API upgrades.
730
    /** Overridden to perform automatic API upgrades.
733
     * That is, should do nothing on new modules, but for older ones will
731
     * That is, should do nothing on new modules, but for older ones will
734
     * automatically make them depend on things they need.
732
     * automatically make them depend on things they need.
Lines 748-780 Link Here
748
            // Skip them all - useful for unit tests.
746
            // Skip them all - useful for unit tests.
749
            return;
747
            return;
750
        }
748
        }
751
        if (autoDepsHandler == null) {
749
        AutomaticDependencies.Report rep = AutomaticDependencies.getDefault().refineDependenciesAndReport(m.getCodeNameBase(), dependencies);
752
            FileObject depsFolder = FileUtil.getConfigFile("ModuleAutoDeps");
753
            if (depsFolder != null) {
754
                FileObject[] kids = depsFolder.getChildren();
755
                List<URL> urls = new ArrayList<URL>(Math.max(kids.length, 1));
756
                for (FileObject kid : kids) {
757
                    if (kid.hasExt("xml")) { // NOI18N
758
                        urls.add(kid.toURL());
759
                    }
760
                }
761
                try {
762
                    autoDepsHandler = AutomaticDependencies.parse(urls.toArray(new URL[urls.size()]));
763
                } catch (IOException e) {
764
                    Util.err.log(Level.WARNING, null, e);
765
                } catch (SAXException e) {
766
                    Util.err.log(Level.WARNING, null, e);
767
                }
768
            }
769
            if (autoDepsHandler == null) {
770
                // Parsing failed, or no files.
771
                autoDepsHandler = AutomaticDependencies.empty();
772
            }
773
            if (Util.err.isLoggable(Level.FINE)) {
774
                Util.err.fine("Auto deps: " + autoDepsHandler);
775
            }
776
        }
777
        AutomaticDependencies.Report rep = autoDepsHandler.refineDependenciesAndReport(m.getCodeNameBase(), dependencies);
778
        if (rep.isModified()) {
750
        if (rep.isModified()) {
779
            Util.err.warning(rep.toString());
751
            Util.err.warning(rep.toString());
780
        }
752
        }

Return to bug 206253