Examples of VersionControlIgnoresPlugin


Examples of org.bndtools.api.VersionControlIgnoresPlugin

        super.close();
    }

    @Override
    public VersionControlIgnoresPlugin addingService(ServiceReference reference) {
        VersionControlIgnoresPlugin plugin = (VersionControlIgnoresPlugin) super.addingService(reference);
        NamedPlugin pluginInformation = plugin.getInformation();
        String name = pluginInformation.getName();
        synchronized (plugins) {
            plugins.put(name, reference);
            pluginsInformation.put(name, pluginInformation);
        }
View Full Code Here

Examples of org.bndtools.api.VersionControlIgnoresPlugin

        return plugin;
    }

    @Override
    public void remove(ServiceReference reference) {
        VersionControlIgnoresPlugin plugin = (VersionControlIgnoresPlugin) getService(reference);
        String name = plugin.getInformation().getName();
        synchronized (plugins) {
            pluginsInformation.remove(name);
            plugins.remove(name);
        }
        super.remove(reference);
View Full Code Here

Examples of org.bndtools.api.VersionControlIgnoresPlugin

                pluginReference = this.plugins.get(pluginName);
            }
            if (pluginReference == null) {
                continue;
            }
            VersionControlIgnoresPlugin plugin = (VersionControlIgnoresPlugin) getService(pluginReference);
            if (plugin == null) {
                continue;
            }

            try {
                plugin.addIgnores(dstDir, ignores);
            } catch (Throwable e) {
                logger.logError(String.format("Unable to add %s ignores %s to directory %s", plugin.getInformation().getName(), ignores, dstDir), e);
            }
        }
    }
View Full Code Here

Examples of org.bndtools.api.VersionControlIgnoresPlugin

            for (Map.Entry<String,ServiceReference<VersionControlIgnoresPlugin>> entry : plugins.entrySet()) {
                ServiceReference<VersionControlIgnoresPlugin> pluginReference = entry.getValue();
                if (pluginReference == null) {
                    continue;
                }
                VersionControlIgnoresPlugin plugin = (VersionControlIgnoresPlugin) getService(pluginReference);
                if (plugin == null) {
                    continue;
                }

                if (plugin.matchesRepositoryProviderId(repositoryProviderId)) {
                    matches.add(entry.getKey());
                }
            }
        }
View Full Code Here

Examples of org.bndtools.api.VersionControlIgnoresPlugin

                pluginReference = this.plugins.get(pluginName);
            }
            if (pluginReference == null) {
                continue;
            }
            VersionControlIgnoresPlugin plugin = (VersionControlIgnoresPlugin) getService(pluginReference);
            if (plugin == null) {
                continue;
            }

            Map<String,String> sourceOutputLocations = JavaProjectUtils.getSourceOutputLocations(project);
            if (sourceOutputLocations == null) {
                /* fallback to using defaults */
                sourceOutputLocations = new LinkedHashMap<String,String>();
                sourceOutputLocations.put(projectPaths.getSrc(), projectPaths.getBin());
                sourceOutputLocations.put(projectPaths.getTestSrc(), projectPaths.getTestBin());
            }

            List<String> emptyIgnores = new LinkedList<String>();
            List<String> projectIgnores = new LinkedList<String>();
            File projectDir = project.getProject().getLocation().toFile();

            for (Map.Entry<String,String> sourceOutputLocation : sourceOutputLocations.entrySet()) {
                String srcDir = sourceOutputLocation.getKey();
                String binDir = sourceOutputLocation.getValue();
                assert (srcDir != null);
                assert (binDir != null);

                File srcDirFile = new File(projectDir, srcDir);

                /*
                 * when the version control system can't store empty directories and
                 * the source directory doesn't exist or is empty, then add empty ignores
                 */
                if (!plugin.canStoreEmptyDirectories() && (!srcDirFile.exists() || (srcDirFile.list().length == 0))) {
                    try {
                        plugin.addIgnores(srcDirFile, emptyIgnores);
                    } catch (Throwable e) {
                        logger.logError(String.format("Unable to add empty %s ignores to the project in %s", plugin.getInformation().getName(), projectDir), e);
                    }
                }

                /* add the corresponding output location to the project ignores */
                projectIgnores.add(sanitiseGitIgnoreGlob(true, binDir, true));
            }

            /* add the target directory to the project ignores */
            projectIgnores.add(sanitiseGitIgnoreGlob(true, projectPaths.getTargetDir(), true));

            try {
                plugin.addIgnores(projectDir, projectIgnores);
            } catch (Throwable e) {
                logger.logError(String.format("Unable to add %s ignores %s to the project in %s", plugin.getInformation().getName(), projectIgnores, projectDir), e);
            }
        }
    }
View Full Code Here

Examples of org.bndtools.versioncontrol.ignores.manager.api.VersionControlIgnoresPlugin

        if (plugins == null || plugins.isEmpty()) {
            return;
        }

        for (String pluginName : plugins) {
            VersionControlIgnoresPlugin plugin;
            synchronized (this.plugins) {
                plugin = this.plugins.get(pluginName);
            }
            if (plugin == null) {
                continue;
            }

            try {
                plugin.addIgnores(dstDir, ignores);
            } catch (Throwable e) {
                logger.logError(String.format("Unable to add %s ignores %s to directory %s", plugin.getInformation().getName(), ignores, dstDir), e);
            }
        }
    }
View Full Code Here

Examples of org.bndtools.versioncontrol.ignores.manager.api.VersionControlIgnoresPlugin

        }

        Set<String> matches = new HashSet<String>();
        synchronized (plugins) {
            for (Map.Entry<String,VersionControlIgnoresPlugin> entry : plugins.entrySet()) {
                VersionControlIgnoresPlugin plugin = this.plugins.get(entry.getKey());
                if (plugin == null) {
                    continue;
                }

                if (plugin.matchesRepositoryProviderId(repositoryProviderId)) {
                    matches.add(entry.getKey());
                }
            }
        }
View Full Code Here

Examples of org.bndtools.versioncontrol.ignores.manager.api.VersionControlIgnoresPlugin

        if (projectDir == null || plugins == null || plugins.isEmpty()) {
            return;
        }

        for (String pluginName : plugins) {
            VersionControlIgnoresPlugin plugin;
            synchronized (this.plugins) {
                plugin = this.plugins.get(pluginName);
            }
            if (plugin == null) {
                continue;
            }

            List<String> projectIgnores = new LinkedList<String>();

            if (sourceOutputLocations != null) {
                List<String> emptyIgnores = new LinkedList<String>();
                for (Map.Entry<String,String> sourceOutputLocation : sourceOutputLocations.entrySet()) {
                    String srcDir = sourceOutputLocation.getKey();
                    String binDir = sourceOutputLocation.getValue();
                    assert (srcDir != null);
                    assert (binDir != null);

                    File srcDirFile = new File(projectDir, srcDir);

                    /*
                     * when the version control system can't store empty directories and
                     * the source directory doesn't exist or is empty, then add empty ignores
                     */
                    if (!plugin.canStoreEmptyDirectories() && (!srcDirFile.exists() || (srcDirFile.list().length == 0))) {
                        try {
                            plugin.addIgnores(srcDirFile, emptyIgnores);
                        } catch (Throwable e) {
                            logger.logError(String.format("Unable to add empty %s ignores to the project in %s", plugin.getInformation().getName(), projectDir), e);
                        }
                    }

                    /* add the corresponding output location to the project ignores */
                    projectIgnores.add(sanitiseGitIgnoreGlob(true, binDir, true));
                }
            }

            if (targetDir != null && !targetDir.isEmpty()) {
                /* add the target directory to the project ignores */
                projectIgnores.add(sanitiseGitIgnoreGlob(true, targetDir, true));
            }

            if (!projectIgnores.isEmpty()) {
                try {
                    plugin.addIgnores(projectDir, projectIgnores);
                } catch (Throwable e) {
                    logger.logError(String.format("Unable to add %s ignores %s to the project in %s", plugin.getInformation().getName(), projectIgnores, projectDir), e);
                }
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.