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 237155
Collapse All | Expand All

(-)a/java.j2sedeploy/manifest.mf (-1 / +1 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.java.j2sedeploy
2
OpenIDE-Module: org.netbeans.modules.java.j2sedeploy
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/j2sedeploy/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/j2sedeploy/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.5
4
OpenIDE-Module-Specification-Version: 1.6
5
AutoUpdate-Show-In-Client: false
5
AutoUpdate-Show-In-Client: false
6
6
(-)a/java.j2sedeploy/nbproject/project.xml (-2 / +2 lines)
Lines 29-35 Link Here
29
                    <compile-dependency/>
29
                    <compile-dependency/>
30
                    <run-dependency>
30
                    <run-dependency>
31
                        <release-version>1</release-version>
31
                        <release-version>1</release-version>
32
                        <specification-version>1.67</specification-version>
32
                        <specification-version>1.72</specification-version>
33
                    </run-dependency>
33
                    </run-dependency>
34
                </dependency>
34
                </dependency>
35
                <dependency>
35
                <dependency>
Lines 38-44 Link Here
38
                    <compile-dependency/>
38
                    <compile-dependency/>
39
                    <run-dependency>
39
                    <run-dependency>
40
                        <release-version>1</release-version>
40
                        <release-version>1</release-version>
41
                        <specification-version>1.55</specification-version>
41
                        <specification-version>1.58</specification-version>
42
                    </run-dependency>
42
                    </run-dependency>
43
                </dependency>
43
                </dependency>
44
                <dependency>
44
                <dependency>
(-)a/java.j2sedeploy/src/org/netbeans/modules/java/j2sedeploy/J2SEDeployGeneratedFilesInterceptor.java (-1 / +1 lines)
Lines 49-56 Link Here
49
import org.netbeans.api.project.ProjectManager;
49
import org.netbeans.api.project.ProjectManager;
50
import org.netbeans.api.project.ProjectUtils;
50
import org.netbeans.api.project.ProjectUtils;
51
import org.netbeans.api.project.ant.AntBuildExtender;
51
import org.netbeans.api.project.ant.AntBuildExtender;
52
import org.netbeans.modules.java.j2seproject.api.GeneratedFilesInterceptor;
53
import org.netbeans.spi.project.ProjectServiceProvider;
52
import org.netbeans.spi.project.ProjectServiceProvider;
53
import org.netbeans.spi.project.ant.GeneratedFilesInterceptor;
54
import org.netbeans.spi.project.support.ant.GeneratedFilesHelper;
54
import org.netbeans.spi.project.support.ant.GeneratedFilesHelper;
55
import org.openide.filesystems.FileUtil;
55
import org.openide.filesystems.FileUtil;
56
import org.openide.util.Exceptions;
56
import org.openide.util.Exceptions;
(-)a/java.j2seembedded/manifest.mf (-1 / +1 lines)
Lines 3-7 Link Here
3
OpenIDE-Module: org.netbeans.modules.java.j2seembedded
3
OpenIDE-Module: org.netbeans.modules.java.j2seembedded
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/j2seembedded/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/j2seembedded/Bundle.properties
5
OpenIDE-Module-Layer: org/netbeans/modules/java/j2seembedded/resources/layer.xml
5
OpenIDE-Module-Layer: org/netbeans/modules/java/j2seembedded/resources/layer.xml
6
OpenIDE-Module-Specification-Version: 1.0
6
OpenIDE-Module-Specification-Version: 1.1
7
7
(-)a/java.j2seembedded/nbproject/project.xml (-2 / +2 lines)
Lines 65-71 Link Here
65
                    <compile-dependency/>
65
                    <compile-dependency/>
66
                    <run-dependency>
66
                    <run-dependency>
67
                        <release-version>1</release-version>
67
                        <release-version>1</release-version>
68
                        <specification-version>1.71</specification-version>
68
                        <specification-version>1.72</specification-version>
69
                    </run-dependency>
69
                    </run-dependency>
70
                </dependency>
70
                </dependency>
71
                <dependency>
71
                <dependency>
Lines 100-106 Link Here
100
                    <compile-dependency/>
100
                    <compile-dependency/>
101
                    <run-dependency>
101
                    <run-dependency>
102
                        <release-version>1</release-version>
102
                        <release-version>1</release-version>
103
                        <specification-version>1.56</specification-version>
103
                        <specification-version>1.58</specification-version>
104
                    </run-dependency>
104
                    </run-dependency>
105
                </dependency>
105
                </dependency>
106
                <dependency>
106
                <dependency>
(-)a/java.j2seembedded/src/org/netbeans/modules/java/j2seembedded/project/RemoteGeneratedFilesInterceptor.java (-1 / +1 lines)
Lines 50-57 Link Here
50
import org.netbeans.api.project.ProjectManager;
50
import org.netbeans.api.project.ProjectManager;
51
import org.netbeans.api.project.ProjectUtils;
51
import org.netbeans.api.project.ProjectUtils;
52
import org.netbeans.api.project.ant.AntBuildExtender;
52
import org.netbeans.api.project.ant.AntBuildExtender;
53
import org.netbeans.modules.java.j2seproject.api.GeneratedFilesInterceptor;
54
import org.netbeans.spi.project.ProjectServiceProvider;
53
import org.netbeans.spi.project.ProjectServiceProvider;
54
import org.netbeans.spi.project.ant.GeneratedFilesInterceptor;
55
import org.netbeans.spi.project.support.ant.GeneratedFilesHelper;
55
import org.netbeans.spi.project.support.ant.GeneratedFilesHelper;
56
import org.openide.filesystems.FileUtil;
56
import org.openide.filesystems.FileUtil;
57
import org.openide.util.Exceptions;
57
import org.openide.util.Exceptions;
(-)a/java.j2seproject/manifest.mf (-1 / +1 lines)
Lines 2-7 Link Here
2
OpenIDE-Module: org.netbeans.modules.java.j2seproject/1
2
OpenIDE-Module: org.netbeans.modules.java.j2seproject/1
3
OpenIDE-Module-Layer: org/netbeans/modules/java/j2seproject/ui/resources/layer.xml
3
OpenIDE-Module-Layer: org/netbeans/modules/java/j2seproject/ui/resources/layer.xml
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/j2seproject/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/j2seproject/Bundle.properties
5
OpenIDE-Module-Implementation-Version: 47
5
OpenIDE-Module-Implementation-Version: 48
6
AutoUpdate-Show-In-Client: false
6
AutoUpdate-Show-In-Client: false
7
7
(-)a/java.j2seproject/nbproject/project.properties (-1 / +1 lines)
Lines 42-48 Link Here
42
42
43
javac.compilerargs=-Xlint -Xlint:-serial
43
javac.compilerargs=-Xlint -Xlint:-serial
44
javac.source=1.7
44
javac.source=1.7
45
spec.version.base=1.71.0
45
spec.version.base=1.72.0
46
46
47
javadoc.arch=${basedir}/arch.xml
47
javadoc.arch=${basedir}/arch.xml
48
javadoc.apichanges=${basedir}/apichanges.xml
48
javadoc.apichanges=${basedir}/apichanges.xml
(-)a/java.j2seproject/src/org/netbeans/modules/java/j2seproject/GeneratedFilesInterceptorSupport.java (-99 lines)
Removed Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2013 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.java.j2seproject;
43
44
import java.io.IOException;
45
import java.net.URL;
46
import org.netbeans.api.annotations.common.NonNull;
47
import org.netbeans.api.project.Project;
48
import org.netbeans.modules.java.j2seproject.api.GeneratedFilesInterceptor;
49
import org.netbeans.spi.project.support.ant.GeneratedFilesHelper;
50
import org.openide.util.Parameters;
51
52
/**
53
 *
54
 * @author Tomas Zezula
55
 */
56
class GeneratedFilesInterceptorSupport {
57
58
    private final Project prj;
59
    private final GeneratedFilesHelper genFilesHelper;
60
61
    GeneratedFilesInterceptorSupport(
62
            @NonNull final Project prj,
63
            @NonNull final GeneratedFilesHelper genFilesHelper) {
64
        Parameters.notNull("prj", prj); //NOI18N
65
        Parameters.notNull("genFilesHelper", genFilesHelper);   //NOI18N
66
        this.prj = prj;
67
        this.genFilesHelper = genFilesHelper;
68
    }
69
70
    void generateBuildScriptFromStylesheet(
71
            @NonNull final String path,
72
            @NonNull final URL stylesheet) throws IOException {
73
        genFilesHelper.generateBuildScriptFromStylesheet(path, stylesheet);
74
        callInterceptors(prj, path);
75
    }
76
    
77
    boolean refreshBuildScript(
78
            @NonNull final String path,
79
            @NonNull final URL stylesheet,
80
            @NonNull final boolean checkForProjectXmlModified) throws IOException {                
81
         final boolean ret = genFilesHelper.refreshBuildScript(path, stylesheet, checkForProjectXmlModified);
82
         if (ret) {
83
             callInterceptors(prj, path);
84
         }
85
         return ret;
86
    }   
87
88
    private static void callInterceptors(
89
            @NonNull final Project prj,
90
            @NonNull final String path) {
91
        final Iterable<? extends GeneratedFilesInterceptor> interceptors =
92
                prj.getLookup().lookupAll(GeneratedFilesInterceptor.class);
93
        for (GeneratedFilesInterceptor interceptor : interceptors) {
94
            interceptor.fileGenerated(prj, path);
95
        }
96
    }
97
    
98
99
}
(-)a/java.j2seproject/src/org/netbeans/modules/java/j2seproject/api/GeneratedFilesInterceptor.java (-64 lines)
Removed Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2013 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.java.j2seproject.api;
43
44
import org.netbeans.api.annotations.common.NonNull;
45
import org.netbeans.api.project.Project;
46
import org.openide.util.Lookup;
47
48
/**
49
 * Notifies the J2SE Project extension about build script update.
50
 * The J2SEProject calls all the instances of the @link GeneratedFilesInterceptor}
51
 * registered in the project {@link Lookup} when a a build script file has been
52
 * updated or created.
53
 * @author Tomas Zezula
54
 * @since 1.58
55
 */
56
public interface GeneratedFilesInterceptor {
57
58
    /**
59
     * Called when the build script file has been updated or created.
60
     * @param project the project for which the build script was updated.
61
     * @param path the relative path to generated file from project directory.
62
     */
63
    void fileGenerated(@NonNull Project project, @NonNull String path);
64
}
(-)a/javafx2.project/manifest.mf (-1 / +1 lines)
Lines 3-6 Link Here
3
OpenIDE-Module: org.netbeans.modules.javafx2.project
3
OpenIDE-Module: org.netbeans.modules.javafx2.project
4
OpenIDE-Module-Layer: org/netbeans/modules/javafx2/project/layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/javafx2/project/layer.xml
5
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javafx2/project/Bundle.properties
5
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javafx2/project/Bundle.properties
6
OpenIDE-Module-Specification-Version: 1.22
6
OpenIDE-Module-Specification-Version: 1.23
(-)a/javafx2.project/nbproject/project.xml (-2 / +2 lines)
Lines 99-105 Link Here
99
                    <compile-dependency/>
99
                    <compile-dependency/>
100
                    <run-dependency>
100
                    <run-dependency>
101
                        <release-version>1</release-version>
101
                        <release-version>1</release-version>
102
                        <specification-version>1.71</specification-version>
102
                        <specification-version>1.72</specification-version>
103
                    </run-dependency>
103
                    </run-dependency>
104
                </dependency>
104
                </dependency>
105
                <dependency>
105
                <dependency>
Lines 160-166 Link Here
160
                    <compile-dependency/>
160
                    <compile-dependency/>
161
                    <run-dependency>
161
                    <run-dependency>
162
                        <release-version>1</release-version>
162
                        <release-version>1</release-version>
163
                        <specification-version>1.39</specification-version>
163
                        <specification-version>1.58</specification-version>
164
                    </run-dependency>
164
                    </run-dependency>
165
                </dependency>
165
                </dependency>
166
                <dependency>
166
                <dependency>
(-)a/javafx2.project/src/org/netbeans/modules/javafx2/project/JFXGeneratedFilesInterceptor.java (-1 / +1 lines)
Lines 48-55 Link Here
48
import org.netbeans.api.project.ProjectManager;
48
import org.netbeans.api.project.ProjectManager;
49
import org.netbeans.api.project.ProjectUtils;
49
import org.netbeans.api.project.ProjectUtils;
50
import org.netbeans.api.project.ant.AntBuildExtender;
50
import org.netbeans.api.project.ant.AntBuildExtender;
51
import org.netbeans.modules.java.j2seproject.api.GeneratedFilesInterceptor;
52
import org.netbeans.spi.project.ProjectServiceProvider;
51
import org.netbeans.spi.project.ProjectServiceProvider;
52
import org.netbeans.spi.project.ant.GeneratedFilesInterceptor;
53
import org.netbeans.spi.project.support.ant.GeneratedFilesHelper;
53
import org.netbeans.spi.project.support.ant.GeneratedFilesHelper;
54
import org.openide.filesystems.FileUtil;
54
import org.openide.filesystems.FileUtil;
55
import org.openide.util.Exceptions;
55
import org.openide.util.Exceptions;
(-)a/javawebstart/manifest.mf (-1 / +1 lines)
Lines 2-6 Link Here
2
OpenIDE-Module: org.netbeans.modules.javawebstart
2
OpenIDE-Module: org.netbeans.modules.javawebstart
3
OpenIDE-Module-Layer: org/netbeans/modules/javawebstart/layer.xml
3
OpenIDE-Module-Layer: org/netbeans/modules/javawebstart/layer.xml
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javawebstart/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javawebstart/Bundle.properties
5
OpenIDE-Module-Specification-Version: 1.25
5
OpenIDE-Module-Specification-Version: 1.26
6
AutoUpdate-Show-In-Client: false
6
AutoUpdate-Show-In-Client: false
(-)a/javawebstart/nbproject/project.xml (-2 / +2 lines)
Lines 108-114 Link Here
108
                    <compile-dependency/>
108
                    <compile-dependency/>
109
                    <run-dependency>
109
                    <run-dependency>
110
                        <release-version>1</release-version>
110
                        <release-version>1</release-version>
111
                        <specification-version>1.63</specification-version>
111
                        <specification-version>1.72</specification-version>
112
                    </run-dependency>
112
                    </run-dependency>
113
                </dependency>
113
                </dependency>
114
                <dependency>
114
                <dependency>
Lines 143-149 Link Here
143
                    <compile-dependency/>
143
                    <compile-dependency/>
144
                    <run-dependency>
144
                    <run-dependency>
145
                        <release-version>1</release-version>
145
                        <release-version>1</release-version>
146
                        <specification-version>1.23</specification-version>
146
                        <specification-version>1.58</specification-version>
147
                    </run-dependency>
147
                    </run-dependency>
148
                </dependency>
148
                </dependency>
149
                <dependency>
149
                <dependency>
(-)a/javawebstart/src/org/netbeans/modules/javawebstart/JWSGeneratedFilesInterceptor.java (-1 / +1 lines)
Lines 48-56 Link Here
48
import org.netbeans.api.project.ProjectManager;
48
import org.netbeans.api.project.ProjectManager;
49
import org.netbeans.api.project.ProjectUtils;
49
import org.netbeans.api.project.ProjectUtils;
50
import org.netbeans.api.project.ant.AntBuildExtender;
50
import org.netbeans.api.project.ant.AntBuildExtender;
51
import org.netbeans.modules.java.j2seproject.api.GeneratedFilesInterceptor;
52
import org.netbeans.modules.javawebstart.ui.customizer.JWSProjectPropertiesUtils;
51
import org.netbeans.modules.javawebstart.ui.customizer.JWSProjectPropertiesUtils;
53
import org.netbeans.spi.project.ProjectServiceProvider;
52
import org.netbeans.spi.project.ProjectServiceProvider;
53
import org.netbeans.spi.project.ant.GeneratedFilesInterceptor;
54
import org.netbeans.spi.project.support.ant.GeneratedFilesHelper;
54
import org.netbeans.spi.project.support.ant.GeneratedFilesHelper;
55
import org.openide.filesystems.FileUtil;
55
import org.openide.filesystems.FileUtil;
56
import org.openide.util.Exceptions;
56
import org.openide.util.Exceptions;
(-)a/project.ant/apichanges.xml (-1 / +16 lines)
Lines 107-113 Link Here
107
    <!-- ACTUAL CHANGES BEGIN HERE: -->
107
    <!-- ACTUAL CHANGES BEGIN HERE: -->
108
108
109
    <changes>
109
    <changes>
110
110
        <change id="GeneratedFilesInterceptor">
111
            <api name="general"/>
112
            <summary>Added <code>GeneratedFilesInterceptor</code> called by <code>GeneratedFilesHelper</code> when it generates a file</summary>
113
            <version major="1" minor="1.58"/>
114
            <date year="2013" month="10" day="15"/>
115
            <author login="tzezula"/>
116
            <compatibility addition="yes">
117
            </compatibility>
118
            <description>
119
                <p>
120
                   Added <code>GeneratedFilesInterceptor</code> callback called by <code>GeneratedFilesHelper</code> when it
121
                   generates or regenerates a file.
122
                </p>
123
            </description>
124
            <class package="org.netbeans.spi.project.ant" name="GeneratedFilesInterceptor"/>
125
        </change>
111
        <change id="license_header_customizer">
126
        <change id="license_header_customizer">
112
            <api name="general"/>
127
            <api name="general"/>
113
            <summary>Added <code>CustomizerUtilities.createLicenseHeaderCustomizerPanel</code></summary>
128
            <summary>Added <code>CustomizerUtilities.createLicenseHeaderCustomizerPanel</code></summary>
(-)a/project.ant/manifest.mf (-1 / +1 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.project.ant/1
2
OpenIDE-Module: org.netbeans.modules.project.ant/1
3
OpenIDE-Module-Specification-Version: 1.57
3
OpenIDE-Module-Specification-Version: 1.58
4
OpenIDE-Module-Layer: org/netbeans/modules/project/ant/resources/mf-layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/project/ant/resources/mf-layer.xml
5
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bundle.properties
5
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bundle.properties
6
OpenIDE-Module-Install: org/netbeans/modules/project/ant/AntProjectModule.class
6
OpenIDE-Module-Install: org/netbeans/modules/project/ant/AntProjectModule.class
(-)f5a36f74932b (+65 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2013 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.spi.project.ant;
43
44
import org.netbeans.api.annotations.common.NonNull;
45
import org.netbeans.api.project.Project;
46
import org.netbeans.spi.project.support.ant.GeneratedFilesHelper;
47
import org.openide.util.Lookup;
48
49
/**
50
 * Notifies the Project extension about build script update.
51
 * The {@link GeneratedFilesHelper} calls all the instances of the @link GeneratedFilesInterceptor}
52
 * registered in the project {@link Lookup} when a a build script file has been
53
 * updated or created.
54
 * @author Tomas Zezula
55
 * @since 1.58
56
 */
57
public interface GeneratedFilesInterceptor {
58
59
    /**
60
     * Called when the build script file has been updated or created.
61
     * @param project the project for which the build script was updated.
62
     * @param path the relative path to generated file from project directory.
63
     */
64
    void fileGenerated(@NonNull Project project, @NonNull String path);
65
}
(-)a/project.ant/src/org/netbeans/spi/project/support/ant/GeneratedFilesHelper.java (+18 lines)
Lines 67-77 Link Here
67
import javax.xml.transform.TransformerFactory;
67
import javax.xml.transform.TransformerFactory;
68
import javax.xml.transform.stream.StreamResult;
68
import javax.xml.transform.stream.StreamResult;
69
import javax.xml.transform.stream.StreamSource;
69
import javax.xml.transform.stream.StreamSource;
70
import org.netbeans.api.annotations.common.NonNull;
71
import org.netbeans.api.project.FileOwnerQuery;
72
import org.netbeans.api.project.Project;
70
import org.netbeans.api.project.ProjectManager;
73
import org.netbeans.api.project.ProjectManager;
71
import org.netbeans.api.project.ant.AntBuildExtender;
74
import org.netbeans.api.project.ant.AntBuildExtender;
72
import org.netbeans.api.project.ant.AntBuildExtender.Extension;
75
import org.netbeans.api.project.ant.AntBuildExtender.Extension;
73
import org.netbeans.modules.project.ant.AntBuildExtenderAccessor;
76
import org.netbeans.modules.project.ant.AntBuildExtenderAccessor;
74
import org.netbeans.modules.project.ant.UserQuestionHandler;
77
import org.netbeans.modules.project.ant.UserQuestionHandler;
78
import org.netbeans.spi.project.ant.GeneratedFilesInterceptor;
75
import org.openide.ErrorManager;
79
import org.openide.ErrorManager;
76
import org.openide.filesystems.FileLock;
80
import org.openide.filesystems.FileLock;
77
import org.openide.filesystems.FileObject;
81
import org.openide.filesystems.FileObject;
Lines 404-409 Link Here
404
                                    } finally {
408
                                    } finally {
405
                                        lock1.releaseLock();
409
                                        lock1.releaseLock();
406
                                    }
410
                                    }
411
                                    callInterceptors(dir, path);
407
                                }
412
                                }
408
                            };
413
                            };
409
                            try {
414
                            try {
Lines 824-829 Link Here
824
            throw (IOException)e.getException();
829
            throw (IOException)e.getException();
825
        }
830
        }
826
    }
831
    }
832
833
    private static void callInterceptors(
834
            @NonNull final FileObject dir,
835
            @NonNull final String path) {
836
        final Project prj = FileOwnerQuery.getOwner(dir);
837
        if (prj != null) {
838
            final Iterable<? extends GeneratedFilesInterceptor> interceptors =
839
                    prj.getLookup().lookupAll(GeneratedFilesInterceptor.class);
840
            for (GeneratedFilesInterceptor interceptor : interceptors) {
841
                interceptor.fileGenerated(prj, path);
842
            }
843
        }
844
    }
827
    
845
    
828
    private static boolean shouldGenerateBuildScript(int flags, boolean checkForProjectXmlModified) {
846
    private static boolean shouldGenerateBuildScript(int flags, boolean checkForProjectXmlModified) {
829
        if ((flags & GeneratedFilesHelper.FLAG_MISSING) != 0) {
847
        if ((flags & GeneratedFilesHelper.FLAG_MISSING) != 0) {

Return to bug 237155