diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2013-01-08 11:11:20 -0800 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2013-01-08 11:11:20 -0800 |
commit | b56ea2a18f232d79481e778085fd64e8ae486fc3 (patch) | |
tree | 44e1f6eb4864a45033f865b74fe783e3d784dd6a /plugins/eclipse | |
download | idea-b56ea2a18f232d79481e778085fd64e8ae486fc3.tar.gz |
Snapshot of commit d5ec1d5018ed24f1b4f32b1d09df6dbd7e2fc425
from branch master of git://git.jetbrains.org/idea/community.git
Diffstat (limited to 'plugins/eclipse')
421 files changed, 13723 insertions, 0 deletions
diff --git a/plugins/eclipse/common-eclipse-util/common-eclipse-util.iml b/plugins/eclipse/common-eclipse-util/common-eclipse-util.iml new file mode 100644 index 000000000000..a78a74e4f15f --- /dev/null +++ b/plugins/eclipse/common-eclipse-util/common-eclipse-util.iml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="org.jetbrains.idea.eclipse" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="util" /> + <orderEntry type="library" name="JDOM" level="project" /> + <orderEntry type="module" module-name="jps-model-serialization" /> + </component> +</module> + diff --git a/plugins/eclipse/common-eclipse-util/src/AbstractEclipseClasspathReader.java b/plugins/eclipse/common-eclipse-util/src/AbstractEclipseClasspathReader.java new file mode 100644 index 000000000000..e2b9662926bc --- /dev/null +++ b/plugins/eclipse/common-eclipse-util/src/AbstractEclipseClasspathReader.java @@ -0,0 +1,344 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse; + +import com.intellij.openapi.components.ExpandMacroToPathMap; +import com.intellij.openapi.util.SystemInfo; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.util.text.StringUtil; +import org.jdom.Element; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.io.*; +import java.util.*; +import java.util.jar.Manifest; +import java.util.regex.PatternSyntaxException; + +/** + * User: anna + * Date: 10/29/12 + */ +public abstract class AbstractEclipseClasspathReader<T> { + protected final String myRootPath; + @Nullable protected final List<String> myCurrentRoots; + @Nullable protected final Set<String> myModuleNames; + + public AbstractEclipseClasspathReader(final String rootPath, + @Nullable List<String> currentRoots, @Nullable Set<String> moduleNames) { + myRootPath = FileUtil.toSystemIndependentName(rootPath); + myCurrentRoots = currentRoots; + myModuleNames = moduleNames; + } + + protected abstract String prepareValidUrlInsideJar(String url); + protected abstract void addNamedLibrary(T rootModel, + Collection<String> unknownLibraries, + boolean exported, + String name, + boolean applicationLevel); + protected abstract void addInvalidModuleEntry(T rootModel, boolean exported, String moduleName); + protected abstract void setUpModuleJdk(T rootModel, + Collection<String> unknownJdks, + EclipseModuleManager eclipseModuleManager, + String jdkName); + public abstract void setupOutput(T rootModel, String path); + protected abstract void addSourceFolder(T rootModel, String srcUrl, boolean testFolder); + protected abstract void addSourceFolderToCurrentContentRoot(T rootModel, String srcUrl, boolean testFolder); + + protected abstract void addJUnitDefaultLib(T rootModel, String junitName, ExpandMacroToPathMap macroMap); + protected abstract void addModuleLibrary(T rootModel, + Element element, + boolean exported, + String libName, + String url, + String srcUrl, ExpandMacroToPathMap macroMap); + protected abstract String expandEclipsePath2Url(T rootModel, String path); + + protected abstract int rearrange(T rootModel); + + protected void readClasspathEntry(T rootModel, + final Collection<String> unknownLibraries, + Collection<String> unknownJdks, + final Set<String> usedVariables, + Set<String> refsToModules, + final String testPattern, + Element element, int idx, + final EclipseModuleManager eclipseModuleManager, + final ExpandMacroToPathMap macroMap) throws ConversionException { + String kind = element.getAttributeValue(EclipseXml.KIND_ATTR); + if (kind == null) { + throw new ConversionException("Missing classpathentry/@kind"); + } + + + String path = element.getAttributeValue(EclipseXml.PATH_ATTR); + if (path == null) { + throw new ConversionException("Missing classpathentry/@path"); + } + + final boolean exported = EclipseXml.TRUE_VALUE.equals(element.getAttributeValue(EclipseXml.EXPORTED_ATTR)); + + if (kind.equals(EclipseXml.SRC_KIND)) { + if (path.startsWith("/")) { + final String moduleName = path.substring(1); + refsToModules.add(moduleName); + addInvalidModuleEntry(rootModel, exported, moduleName); + } + else { + String srcUrl = pathToUrl(myRootPath + "/" + path); + boolean isTestFolder = false; + try { + isTestFolder = testPattern != null && testPattern.length() > 0 && path.matches(testPattern); + } + catch (PatternSyntaxException e) { + isTestFolder = false; + } + final String linked = expandLinkedResourcesPath(macroMap, usedVariables, path); + if (linked != null) { + srcUrl = prepareValidUrlInsideJar(pathToUrl(linked)); + eclipseModuleManager.registerEclipseLinkedSrcVarPath(srcUrl, path); + addSourceFolder(rootModel, srcUrl, isTestFolder); + } + else { + addSourceFolderToCurrentContentRoot(rootModel, srcUrl, isTestFolder); + } + eclipseModuleManager.setExpectedModuleSourcePlace(rearrange(rootModel)); + eclipseModuleManager.registerSrcPlace(srcUrl, idx); + } + } + + else if (kind.equals(EclipseXml.OUTPUT_KIND)) { + String output = myRootPath + "/" + path; + final String linked = expandLinkedResourcesPath(macroMap, usedVariables, path); + if (linked != null) { + output = linked; + eclipseModuleManager.registerEclipseLinkedVarPath(pathToUrl(output), path); + } + setupOutput(rootModel, output); + } + + else if (kind.equals(EclipseXml.LIB_KIND)) { + final String libName = getPresentableName(path); + + + final String linked = expandLinkedResourcesPath(macroMap, usedVariables, path); + final String url; + if (linked != null) { + url = prepareValidUrlInsideJar(pathToUrl(linked)); + eclipseModuleManager.registerEclipseLinkedVarPath(url, path); + } + else { + url = expandEclipsePath2Url(rootModel, path); + } + + eclipseModuleManager.registerEclipseLibUrl(url); + + final String sourcePath = element.getAttributeValue(EclipseXml.SOURCEPATH_ATTR); + String srcUrl = null; + if (sourcePath != null) { + final String linkedSrc = expandLinkedResourcesPath(macroMap, usedVariables, sourcePath); + if (linkedSrc != null) { + srcUrl = prepareValidUrlInsideJar(pathToUrl(linkedSrc)); + eclipseModuleManager.registerEclipseLinkedSrcVarPath(srcUrl, sourcePath); + } + else { + srcUrl = expandEclipsePath2Url(rootModel, sourcePath); + } + } + + addModuleLibrary(rootModel, element, exported, libName, url, srcUrl, macroMap); + } + else if (kind.equals(EclipseXml.VAR_KIND)) { + int slash = path.indexOf("/"); + if (slash == 0) { + throw new ConversionException("Incorrect 'classpathentry/var@path' format"); + } + + final String libName = getPresentableName(path); + + final String url = eclipseVariabledPath2Url(macroMap, usedVariables, path, 0); + eclipseModuleManager.registerEclipseVariablePath(url, path); + final String srcPathAttr = element.getAttributeValue(EclipseXml.SOURCEPATH_ATTR); + String srcUrl = null; + if (srcPathAttr != null) { + srcUrl = eclipseVariabledPath2Url(macroMap, usedVariables, srcPathAttr, srcVarStart(srcPathAttr)); + eclipseModuleManager.registerEclipseSrcVariablePath(srcUrl, srcPathAttr); + } + addModuleLibrary(rootModel, element, exported, libName, url, srcUrl, macroMap); + } + else if (kind.equals(EclipseXml.CON_KIND)) { + if (path.equals(EclipseXml.ECLIPSE_PLATFORM)) { + readRequiredBundles(rootModel, refsToModules); + addNamedLibrary(rootModel, unknownLibraries, exported, IdeaXml.ECLIPSE_LIBRARY, true); + } + else if (path.startsWith(EclipseXml.JRE_CONTAINER)) { + + final String jdkName = getLastPathComponent(path); + setUpModuleJdk(rootModel, unknownJdks, eclipseModuleManager, jdkName); + } + else if (path.startsWith(EclipseXml.USER_LIBRARY)) { + addNamedLibrary(rootModel, unknownLibraries, exported, getPresentableName(path), false); + } + else if (path.startsWith(EclipseXml.JUNIT_CONTAINER)) { + final String junitName = IdeaXml.JUNIT + getPresentableName(path); + addJUnitDefaultLib(rootModel, junitName, macroMap); + } + else if (path.equals(EclipseXml.GROOVY_DSL_CONTAINER)) { + eclipseModuleManager.addGroovySupport(EclipseXml.GROOVY_DSL_CONTAINER); + eclipseModuleManager.registerSrcPlace(EclipseXml.GROOVY_DSL_CONTAINER, idx); + } + else if (path.equals(EclipseXml.GROOVY_SUPPORT)) { + eclipseModuleManager.addGroovySupport(EclipseXml.GROOVY_SUPPORT); + eclipseModuleManager.registerSrcPlace(EclipseXml.GROOVY_SUPPORT, idx); + } + else { + eclipseModuleManager.registerUnknownCons(path); + addNamedLibrary(rootModel, new ArrayList<String>(), exported, path, true); + } + } + else { + throw new ConversionException("Unknown classpathentry/@kind: " + kind); + } + } + + protected static int srcVarStart(String srcPath) { + return srcPath.startsWith("/") ? 1 : 0; + } + + @NotNull + protected static String getPresentableName(@NotNull String path) { + final String pathComponent = getLastPathComponent(path); + return pathComponent != null ? pathComponent : path; + } + + @Nullable + public static String getLastPathComponent(final String path) { + final int idx = path.lastIndexOf('/'); + return idx < 0 || idx == path.length() - 1 ? null : path.substring(idx + 1); + } + + protected static String getVariableRelatedPath(String var, String path) { + return var == null ? null : ("$" + var + "$" + (path == null ? "" : ("/" + path))); + } + + protected static String pathToUrl(String path) { + return "file://" + path; + } + + protected static EPathVariable createEPathVariable(final Set<String> usedVariables, final String pathAttr, final int varStart) { + final EPathVariable var; + int slash = pathAttr.indexOf("/", varStart); + if (slash > 0) { + var = new EPathVariable(usedVariables, pathAttr.substring(varStart, slash), pathAttr.substring(slash + 1)); + } + else { + var = new EPathVariable(usedVariables, pathAttr.substring(varStart), null); + } + return var; + } + + protected String eclipseVariabledPath2Url(ExpandMacroToPathMap pathMap, Set<String> usedVariables, String path, int varStart) { + final EPathVariable var = createEPathVariable(usedVariables, path, varStart); + final String url = pathMap.substitute(var.toIdeaVariabledUrl(), SystemInfo.isFileSystemCaseSensitive); + + return prepareValidUrlInsideJar(url); + } + + + @Nullable + protected String expandLinkedResourcesPath(final ExpandMacroToPathMap macroMap, + final Set<String> usedVariables, + final String path) { + final EclipseProjectFinder.LinkedResource linkedResource = EclipseProjectFinder.findLinkedResource(myRootPath, path); + if (linkedResource != null) { + if (linkedResource.containsPathVariable()) { + usedVariables.add(linkedResource.getVariableName()); + } + if (linkedResource.containsPathVariable()) { + final String toPathVariableFormat = + getVariableRelatedPath(linkedResource.getVariableName(), linkedResource.getRelativeToVariablePath()); + return macroMap.substitute(toPathVariableFormat, SystemInfo.isFileSystemCaseSensitive); + } + return linkedResource.getLocation(); + } + return null; + } + + + protected void readRequiredBundles(T rootModel, Set<String> refsToModules) throws ConversionException { + if (myModuleNames == null) { + return; + } + + final File manifestFile = new File(myRootPath, "META-INF/MANIFEST.MF"); + if (!manifestFile.exists()) { + return; + } + + InputStream in = null; + try { + in = new BufferedInputStream(new FileInputStream(manifestFile)); + final Manifest manifest = new Manifest(in); + final String attributes = manifest.getMainAttributes().getValue("Require-Bundle"); + if (!StringUtil.isEmpty(attributes)) { + final StringTokenizer tokenizer = new StringTokenizer(attributes, ","); + while (tokenizer.hasMoreTokens()) { + String bundle = tokenizer.nextToken().trim(); + if (!bundle.isEmpty()) { + final int constraintIndex = bundle.indexOf(';'); + if (constraintIndex != -1) { + bundle = bundle.substring(0, constraintIndex).trim(); + } + + if (myModuleNames.contains(bundle)) { + refsToModules.add(bundle); + addInvalidModuleEntry(rootModel, false, bundle); + } + } + } + } + } + catch (IOException e) { + throw new ConversionException(e.getMessage()); + } + finally { + if (in != null) { + try { + in.close(); + } + catch (IOException ignored) { + } + } + } + } + + + protected static class EPathVariable { + private final String myVariable; + private final String myRelatedPath; + + protected EPathVariable(final Set<String> usedVariables, final String variable, final String relatedPath) { + myVariable = variable; + myRelatedPath = relatedPath; + usedVariables.add(myVariable); + } + + public String toIdeaVariabledUrl() { + return pathToUrl(getVariableRelatedPath(myVariable, myRelatedPath)); + } + } +} diff --git a/plugins/eclipse/common-eclipse-util/src/ConversionException.java b/plugins/eclipse/common-eclipse-util/src/ConversionException.java new file mode 100644 index 000000000000..ec7f15cb790b --- /dev/null +++ b/plugins/eclipse/common-eclipse-util/src/ConversionException.java @@ -0,0 +1,28 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse; + +import java.text.MessageFormat; + +public class ConversionException extends Exception { + public ConversionException(String message) { + super(message); + } + + public ConversionException(String message, Object... param) { + super(MessageFormat.format(message, param)); + } +} diff --git a/plugins/eclipse/common-eclipse-util/src/EPathCommonUtil.java b/plugins/eclipse/common-eclipse-util/src/EPathCommonUtil.java new file mode 100644 index 000000000000..cbf8a3f62457 --- /dev/null +++ b/plugins/eclipse/common-eclipse-util/src/EPathCommonUtil.java @@ -0,0 +1,72 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse; + +import com.intellij.openapi.util.Comparing; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.io.File; +import java.util.List; + +/** + * User: anna + * Date: 10/29/12 + */ +public class EPathCommonUtil { + /** + * @param path path in format /module_root/relative_path + * @return module_root + */ + @NotNull + public static String getRelativeModuleName(String path) { + int secondSlIdx = path.indexOf('/', 1); + return secondSlIdx > 1 ? path.substring(1, secondSlIdx) : path.substring(1); + } + + /** + * @param path path in format /module_root/relative_path + * @return relative_path or null if /module_root + */ + @Nullable + public static String getRelativeToModulePath(String path) { + final int secondSlIdx = path.indexOf('/', 1); + return secondSlIdx != -1 && secondSlIdx + 1 < path.length() ? path.substring(secondSlIdx + 1) : null; + } + + @Nullable + public static String expandEclipseRelative2ContentRoots(final @NotNull List<String> currentRoots, + final @NotNull String rootPath, + final @Nullable String relativeToRootPath) { + for (String currentRoot : currentRoots) { + if (currentRoot.endsWith(rootPath) + || Comparing.strEqual(rootPath, EclipseProjectFinder.findProjectName(currentRoot))) { //rootPath = content_root <=> applicable root: abs_path/content_root + if (relativeToRootPath == null) { + return pathToUrl(currentRoot); + } + final File relativeToOtherModuleFile = new File(currentRoot, relativeToRootPath); + if (relativeToOtherModuleFile.exists()) { + return pathToUrl(relativeToOtherModuleFile.getPath()); + } + } + } + return null; + } + + public static String pathToUrl(String path) { + return "file://" + path; + } +} diff --git a/plugins/eclipse/common-eclipse-util/src/EclipseModuleManager.java b/plugins/eclipse/common-eclipse-util/src/EclipseModuleManager.java new file mode 100644 index 000000000000..1aa34e21763d --- /dev/null +++ b/plugins/eclipse/common-eclipse-util/src/EclipseModuleManager.java @@ -0,0 +1,178 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse; + +import com.intellij.util.ArrayUtil; +import org.jetbrains.annotations.Nullable; + +import java.util.Set; + +/** + * User: anna + * Date: 10/29/12 + */ +public interface EclipseModuleManager { + void setInvalidJdk(String invalidJdk); + + @Nullable + String getInvalidJdk(); + + void addGroovySupport(String name); + + String[] getGroovySupport(); + + void registerEclipseVariablePath(String path, String var); + + void registerEclipseSrcVariablePath(String path, String var); + + void registerEclipseLinkedSrcVarPath(String path, String var); + + @Nullable + String getEclipseLinkedSrcVariablePath(String path); + + void registerEclipseLinkedVarPath(String path, String var); + + @Nullable + String getEclipseLinkedVarPath(String path); + + @Nullable + String getEclipseVariablePath(String path); + + @Nullable + String getEclipseSrcVariablePath(String path); + + void registerUnknownCons(String con); + + @Nullable + Set<String> getUnknownCons(); + + boolean isForceConfigureJDK(); + + void setForceConfigureJDK(); + + void registerEclipseLibUrl(String url); + + boolean isEclipseLibUrl(String url); + + void setExpectedModuleSourcePlace(int expectedModuleSourcePlace); + + boolean isExpectedModuleSourcePlace(int expectedPlace); + + void registerSrcPlace(String srcUrl, int placeIdx); + + @Nullable + Integer getSrcPlace(String srcUtl); + + EclipseModuleManager EMPTY = new EclipseModuleManager() { + @Override + public void setInvalidJdk(String invalidJdk) {} + + @Nullable + @Override + public String getInvalidJdk() { + return null; + } + + @Override + public void addGroovySupport(String name) {} + + @Override + public String[] getGroovySupport() { + return ArrayUtil.EMPTY_STRING_ARRAY; + } + + @Override + public void registerEclipseVariablePath(String path, String var) {} + + @Override + public void registerEclipseSrcVariablePath(String path, String var) {} + + @Override + public void registerEclipseLinkedSrcVarPath(String path, String var) {} + + @Nullable + @Override + public String getEclipseLinkedSrcVariablePath(String path) { + return null; + } + + @Override + public void registerEclipseLinkedVarPath(String path, String var) { + } + + @Nullable + @Override + public String getEclipseLinkedVarPath(String path) { + return null; + } + + @Nullable + @Override + public String getEclipseVariablePath(String path) { + return null; + } + + @Nullable + @Override + public String getEclipseSrcVariablePath(String path) { + return null; + } + + @Override + public void registerUnknownCons(String con) {} + + @Nullable + @Override + public Set<String> getUnknownCons() { + return null; + } + + @Override + public boolean isForceConfigureJDK() { + return false; + } + + @Override + public void setForceConfigureJDK() {} + + @Override + public void registerEclipseLibUrl(String url) {} + + @Override + public boolean isEclipseLibUrl(String url) { + return false; + } + + @Override + public void setExpectedModuleSourcePlace(int expectedModuleSourcePlace) { + } + + @Override + public boolean isExpectedModuleSourcePlace(int expectedPlace) { + return false; + } + + @Override + public void registerSrcPlace(String srcUrl, int placeIdx) { + } + + @Nullable + @Override + public Integer getSrcPlace(String srcUtl) { + return null; + } + }; +} diff --git a/plugins/eclipse/common-eclipse-util/src/EclipseProjectFinder.java b/plugins/eclipse/common-eclipse-util/src/EclipseProjectFinder.java new file mode 100644 index 000000000000..9b76c6ff7014 --- /dev/null +++ b/plugins/eclipse/common-eclipse-util/src/EclipseProjectFinder.java @@ -0,0 +1,166 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 11-Nov-2008 + */ +package org.jetbrains.idea.eclipse; + +import com.intellij.openapi.util.Comparing; +import com.intellij.openapi.util.JDOMUtil; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.util.Processor; +import org.jdom.Element; +import org.jdom.JDOMException; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.Set; + +public class EclipseProjectFinder implements EclipseXml { + public static void findModuleRoots(final List<String> paths, final String rootPath, @Nullable Processor<String> progressUpdater) { + if (progressUpdater != null) { + progressUpdater.process(rootPath); + } + + final String project = findProjectName(rootPath); + if (project != null) { + paths.add(rootPath); + } + + final File root = new File(rootPath); + if (root.isDirectory()) { + final File[] files = root.listFiles(); + if (files != null) { + for (File file : files) { + findModuleRoots(paths, file.getPath(), progressUpdater); + } + } + } + } + + @Nullable + public static String findProjectName(String rootPath) { + String name = null; + final File file = new File(rootPath, DOT_PROJECT_EXT); + if (file.isFile()) { + try { + name = JDOMUtil.loadDocument(file).getRootElement().getChildText(NAME_TAG); + } + catch (JDOMException e) { + return null; + } + catch (IOException e) { + return null; + } + } + return name; + } + + @Nullable + public static LinkedResource findLinkedResource(@NotNull String projectPath, @NotNull String relativePath) { + String independentPath = FileUtil.toSystemIndependentName(relativePath); + @NotNull String resourceName = independentPath; + final int idx = independentPath.indexOf('/'); + if (idx != -1) { + resourceName = independentPath.substring(0, idx); + } + final File file = new File(projectPath, DOT_PROJECT_EXT); + if (file.isFile()) { + try { + for (Object o : JDOMUtil.loadDocument(file).getRootElement().getChildren(LINKED_RESOURCES)) { + for (Object l : ((Element)o).getChildren(LINK)) { + if (Comparing.strEqual(((Element)l).getChildText(NAME_TAG), resourceName)) { + LinkedResource linkedResource = new LinkedResource(); + final String relativeToLinkedResourcePath = + independentPath.length() > resourceName.length() ? independentPath.substring(resourceName.length()) : ""; + + final Element locationURI = ((Element)l).getChild("locationURI"); + if (locationURI != null) { + linkedResource.setURI(FileUtil.toSystemIndependentName(locationURI.getText()) + relativeToLinkedResourcePath); + } + + final Element location = ((Element)l).getChild("location"); + if (location != null) { + linkedResource.setLocation(FileUtil.toSystemIndependentName(location.getText()) + relativeToLinkedResourcePath); + } + return linkedResource; + } + } + } + } + catch (Exception ignore) { + } + } + return null; + } + + public static void collectUnknownNatures(String path, Set<String> naturesNames) { + final File projectfile = new File(path, DOT_PROJECT_EXT); + try { + final Element natures = JDOMUtil.loadDocument(projectfile).getRootElement().getChild("natures"); + if (natures != null) { + final List naturesList = natures.getChildren("nature"); + for (Object nature : naturesList) { + final String natureName = ((Element)nature).getText(); + if (!StringUtil.isEmptyOrSpaces(natureName)) { + naturesNames.add(natureName); + } + } + } + } + catch (Exception ignore) { + } + naturesNames.remove("org.eclipse.jdt.core.javanature"); + } + + public static class LinkedResource { + private String myURI; + private String myLocation; + + public String getVariableName() { + final int idx = myURI.indexOf('/'); + return idx > -1 ? myURI.substring(0, idx) : myURI; + } + + @Nullable + public String getRelativeToVariablePath() { + final int idx = myURI.indexOf('/'); + return idx > -1 && idx + 1 < myURI.length() ? myURI.substring(idx + 1) : null; + } + + public boolean containsPathVariable() { + return myURI != null; + } + + public void setURI(String URI) { + myURI = URI; + } + + public String getLocation() { + return myLocation; + } + + public void setLocation(String location) { + myLocation = location; + } + } +}
\ No newline at end of file diff --git a/plugins/eclipse/common-eclipse-util/src/EclipseXml.java b/plugins/eclipse/common-eclipse-util/src/EclipseXml.java new file mode 100644 index 000000000000..f8a35cc63a8a --- /dev/null +++ b/plugins/eclipse/common-eclipse-util/src/EclipseXml.java @@ -0,0 +1,76 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse; + +import org.jetbrains.annotations.NonNls; + +public interface EclipseXml { + @NonNls String UNNAMED_PROJECT = "unnamed"; + @NonNls String PROJECT_EXT = "project"; + @NonNls String PROJECT_FILE = "." + PROJECT_EXT; + @NonNls String NAME_TAG = "name"; + @NonNls String CLASSPATH_EXT = "classpath"; + @NonNls String CLASSPATH_FILE = "." + CLASSPATH_EXT; + @NonNls String CLASSPATH_TAG = "classpath"; + @NonNls String CLASSPATHENTRY_TAG = "classpathentry"; + @NonNls String KIND_ATTR = "kind"; + @NonNls String PATH_ATTR = "path"; + @NonNls String EXPORTED_ATTR = "exported"; + @NonNls String TRUE_VALUE = "true"; + @NonNls String SRC_KIND = "src"; + @NonNls String COMBINEACCESSRULES_ATTR = "combineaccessrules"; + @NonNls String FALSE_VALUE = "false"; + @NonNls String LIB_KIND = "lib"; + @NonNls String SOURCEPATH_ATTR = "sourcepath"; + @NonNls String VAR_KIND = "var"; + @NonNls String CON_KIND = "con"; + @NonNls String JRE_CONTAINER = "org.eclipse.jdt.launching.JRE_CONTAINER"; + @NonNls String JRE_CONTAINER_SPECIFIC = JRE_CONTAINER + "/" + "org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"; + @NonNls String USER_LIBRARY = "org.eclipse.jdt.USER_LIBRARY"; + @NonNls String JUNIT_CONTAINER = "org.eclipse.jdt.junit.JUNIT_CONTAINER"; + @NonNls String GROOVY_DSL_CONTAINER = "GROOVY_DSL_SUPPORT"; + @NonNls String GROOVY_SUPPORT = "GROOVY_SUPPORT"; + @NonNls String JUNIT3 = JUNIT_CONTAINER + "/" + "3.8.1"; + @NonNls String JUNIT4 = JUNIT_CONTAINER + "/" + "4"; + @NonNls String ECLIPSE_PLATFORM = "org.eclipse.pde.core.requiredPlugins"; + @NonNls String OUTPUT_KIND = "output"; + @NonNls String PLUGIN_XML_FILE = "plugin.xml"; + @NonNls String ID_ATTR = "id"; + @NonNls String REQUIRES_TAG = "requires"; + @NonNls String IMPORT_TAG = "import"; + @NonNls String PLUGIN_ATTR = "plugin"; + @NonNls String EXPORT_ATTR = "export"; + @NonNls String ORG_JUNIT_PLUGIN = "org.junit"; + @NonNls String PROJECT_CONTEXT = "project"; + @NonNls String TEMPLATE_CONTEXT = "template"; + @NonNls String BIN_DIR = "bin"; + @NonNls String IDEA_SETTINGS_POSTFIX = ".eml"; + @NonNls String ECLIPSE_JAR_PREFIX = "jar:file:/"; + @NonNls String ECLIPSE_FILE_PREFIX = "file:/"; + @NonNls String ATTRIBUTES_TAG = "attributes"; + @NonNls String ATTRIBUTE_TAG = "attribute"; + @NonNls String NAME_ATTR = "name"; + @NonNls String VALUE_ATTR = "value"; + @NonNls String DOT_CLASSPATH_EXT = "." + CLASSPATH_EXT; + @NonNls String DOT_PROJECT_EXT = "." + PROJECT_EXT; + @NonNls String FILE_PROTOCOL = "file:/"; + @NonNls String PLATFORM_PROTOCOL = "platform:/"; + @NonNls String JAR_PREFIX = "jar:"; + String JAVA_SDK_TYPE = "/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"; + @NonNls String LINKED_RESOURCES = "linkedResources"; + @NonNls String LINK = "link"; + @NonNls String JAVADOC_LOCATION = "javadoc_location"; +} diff --git a/plugins/eclipse/common-eclipse-util/src/IdeaXml.java b/plugins/eclipse/common-eclipse-util/src/IdeaXml.java new file mode 100644 index 000000000000..e10c3cbdf4e5 --- /dev/null +++ b/plugins/eclipse/common-eclipse-util/src/IdeaXml.java @@ -0,0 +1,87 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse; + +import org.jetbrains.annotations.NonNls; + +public interface IdeaXml { + @NonNls String COMPONENT_TAG = "component"; + @NonNls String NAME_ATTR = "name"; + @NonNls String NEW_MODULE_ROOT_MANAGER_VALUE = "NewModuleRootManager"; + @NonNls String ORDER_ENTRY_TAG = "orderEntry"; + @NonNls String TYPE_ATTR = "type"; + @NonNls String EXPORTED_ATTR = "exported"; + @NonNls String SOURCE_FOLDER_TYPE = "sourceFolder"; + @NonNls String SOURCE_FOLDER_TAG = "sourceFolder"; + @NonNls String CONTENT_ENTRY_TAG = "contentEntry"; + @NonNls String TEST_FOLDER_TAG = "testFolder"; + @NonNls String EXCLUDE_FOLDER_TAG = "excludeFolder"; + @NonNls String FOR_TESTS_ATTR = "forTests"; + @NonNls String TRUE_VALUE = "true"; + @NonNls String FALSE_VALUE = "false"; + @NonNls String CONTENT_TAG = "content"; + @NonNls String MODULE_LIBRARY_TYPE = "module-library"; + @NonNls String LIBRARY_TAG = "library"; + @NonNls String ROOT_TAG = "root"; + @NonNls String CLASSES_TAG = "CLASSES"; + @NonNls String SOURCES_TAG = "SOURCES"; + @NonNls String JAVADOC_TAG = "JAVADOC"; + @NonNls String JAR_DIR = "jarDirectory"; + @NonNls String URL_ATTR = "url"; + @NonNls String LIBRARY_TYPE = "library"; + @NonNls String LEVEL_ATTR = "level"; + @NonNls String APPLICATION_LEVEL = "application"; + @NonNls String PROJECT_LEVEL = "project"; + @NonNls String ECLIPSE_LIBRARY = "ECLIPSE"; + @NonNls String MODULE_TYPE = "module"; + @NonNls String MODULE_NAME_ATTR = "module-name"; + @NonNls String JDK_TYPE = "jdk"; + @NonNls String INHERITED_JDK_TYPE = "inheritedJdk"; + @NonNls String JDK_NAME_ATTR = "jdkName"; + @NonNls String JDK_TYPE_ATTR = "jdkType"; + @NonNls String JAVA_SDK_TYPE = "JavaSDK"; + @NonNls String MODULE_DIR_MACRO = "$MODULE_DIR$"; + @NonNls String FILE_PREFIX = "file://"; + @NonNls String JAR_PREFIX = "jar://"; + @NonNls String JAR_SUFFIX = "!/"; + @NonNls String JAR_EXT = ".jar"; + @NonNls String ZIP_EXT = ".zip"; + @NonNls String EXCLUDE_OUTPUT_TAG = "exclude-output"; + @NonNls String LANGUAGE_LEVEL_ATTR = "LANGUAGE_LEVEL"; + @NonNls String INHERIT_COMPILER_OUTPUT_ATTR = "inherit-compiler-output"; + @NonNls String OUTPUT_TAG = "output"; + @NonNls String OUTPUT_TEST_TAG = "output-test"; + @NonNls String IS_TEST_SOURCE_ATTR = "isTestSource"; + @NonNls String ORDER_ENTRY_PROPERTIES_TAG = "orderEntryProperties"; + @NonNls String IPR_EXT = ".ipr"; + @NonNls String PROJECT_MODULE_MANAGER_VALUE = "ProjectModuleManager"; + @NonNls String MODULES_TAG = "modules"; + @NonNls String MODULE_TAG = "module"; + @NonNls String FILEURL_ATTR = "fileurl"; + @NonNls String FILEPATH_ATTR = "filepath"; + @NonNls String PROJECT_DIR_MACRO = "$PROJECT_DIR$"; + @NonNls String PROJECT_PREFIX = FILE_PREFIX + PROJECT_DIR_MACRO + "/"; + @NonNls String USED_PATH_MACROS_TAG = "UsedPathMacros"; + @NonNls String MACRO_TAG = "macro"; + @NonNls String UNNAMED_PROJECT = "unnamed"; + @NonNls String MODULE_CONTEXT = "module"; + @NonNls String PROJECT_CONTEXT = "project"; + @NonNls String CLASSPATH_CONTEXT = "classpath"; + @NonNls String TEMPLATE_CONTEXT = "template"; + @NonNls String EXCLUDE_OUTPUT = "exclude-output"; + @NonNls String IML_EXT = ".iml"; + String JUNIT = "junit"; +} diff --git a/plugins/eclipse/common-eclipse-util/src/conversion/AbstractIdeaSpecificSettings.java b/plugins/eclipse/common-eclipse-util/src/conversion/AbstractIdeaSpecificSettings.java new file mode 100644 index 000000000000..eb586af7cb6d --- /dev/null +++ b/plugins/eclipse/common-eclipse-util/src/conversion/AbstractIdeaSpecificSettings.java @@ -0,0 +1,75 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse.conversion; + +import com.intellij.openapi.util.InvalidDataException; +import org.jdom.Element; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.idea.eclipse.IdeaXml; + +import java.util.List; +import java.util.Map; + +/** + * User: anna + * Date: 11/8/12 + */ +public abstract class AbstractIdeaSpecificSettings<T, C, SdkType> { + public void readIDEASpecific(final Element root, T model, @Nullable SdkType projectSdkType, Map<String, String> levels) throws InvalidDataException { + expandElement(root, model); + + readLanguageLevel(root, model); + + setupCompilerOutputs(root, model); + + final List entriesElements = root.getChildren(IdeaXml.CONTENT_ENTRY_TAG); + if (!entriesElements.isEmpty()) { + for (Object o : entriesElements) { + readContentEntry((Element)o, createContentEntry(model, ((Element)o).getAttributeValue(IdeaXml.URL_ATTR)), model); + } + } else { + final C[] entries = getEntries(model);//todo + if (entries.length > 0) { + readContentEntry(root, entries[0], model); + } + } + + setupJdk(root, model, projectSdkType); + setupLibraryRoots(root, model); + overrideModulesScopes(root, model); + readLibraryLevels(root, levels); + } + + protected abstract void readLibraryLevels(Element root, Map<String, String> levels); + + protected abstract C[] getEntries(T model); + + protected abstract C createContentEntry(T model, String url); + + protected abstract void setupLibraryRoots(Element root, T model); + + protected abstract void setupJdk(Element root, T model, @Nullable SdkType projectSdkType); + + protected abstract void setupCompilerOutputs(Element root, T model); + + protected abstract void readLanguageLevel(Element root, T model) throws InvalidDataException; + + protected abstract void expandElement(Element root, T model); + + protected abstract void overrideModulesScopes(Element root, T model); + + public abstract void readContentEntry(Element root, C entry, T model); +} diff --git a/plugins/eclipse/eclipse.iml b/plugins/eclipse/eclipse.iml new file mode 100644 index 000000000000..30486e5f0e57 --- /dev/null +++ b/plugins/eclipse/eclipse.iml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module relativePaths="true" type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/resources" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/testSources" isTestSource="true" /> + <excludeFolder url="file://$MODULE_DIR$/standalone" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="JDOM" level="project" /> + <orderEntry type="module" module-name="openapi" /> + <orderEntry type="module" module-name="bootstrap" /> + <orderEntry type="library" scope="TEST" name="JUnit4" level="project" /> + <orderEntry type="module" module-name="testFramework-java" scope="TEST" /> + <orderEntry type="module" module-name="compiler-openapi" /> + <orderEntry type="module" module-name="idea-ui" /> + <orderEntry type="module" module-name="annotations" /> + <orderEntry type="module" module-name="java-impl" /> + <orderEntry type="module" module-name="eclipse-jps-plugin" /> + <orderEntry type="module" module-name="common-eclipse-util" /> + </component> +</module> + diff --git a/plugins/eclipse/jps-plugin/eclipse-jps-plugin.iml b/plugins/eclipse/jps-plugin/eclipse-jps-plugin.iml new file mode 100644 index 000000000000..571191e08fd8 --- /dev/null +++ b/plugins/eclipse/jps-plugin/eclipse-jps-plugin.iml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="util" /> + <orderEntry type="module" module-name="jps-model-api" /> + <orderEntry type="module" module-name="jps-model-serialization" /> + <orderEntry type="module" module-name="common-eclipse-util" /> + </component> +</module> + diff --git a/plugins/eclipse/jps-plugin/src/META-INF/services/org.jetbrains.jps.model.serialization.JpsModelSerializerExtension b/plugins/eclipse/jps-plugin/src/META-INF/services/org.jetbrains.jps.model.serialization.JpsModelSerializerExtension new file mode 100644 index 000000000000..eeebef91e18b --- /dev/null +++ b/plugins/eclipse/jps-plugin/src/META-INF/services/org.jetbrains.jps.model.serialization.JpsModelSerializerExtension @@ -0,0 +1 @@ +org.jetbrains.jps.eclipse.model.JpsEclipseModelSerializerExtension
\ No newline at end of file diff --git a/plugins/eclipse/jps-plugin/src/org/jetbrains/jps/eclipse/model/JpsEclipseClasspathReader.java b/plugins/eclipse/jps-plugin/src/org/jetbrains/jps/eclipse/model/JpsEclipseClasspathReader.java new file mode 100644 index 000000000000..b9f431645c50 --- /dev/null +++ b/plugins/eclipse/jps-plugin/src/org/jetbrains/jps/eclipse/model/JpsEclipseClasspathReader.java @@ -0,0 +1,274 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.jps.eclipse.model; + +import com.intellij.openapi.components.ExpandMacroToPathMap; +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.util.SystemInfo; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.util.containers.HashSet; +import org.jdom.Element; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.idea.eclipse.*; +import org.jetbrains.jps.model.JpsElementFactory; +import org.jetbrains.jps.model.java.*; +import org.jetbrains.jps.model.library.JpsLibrary; +import org.jetbrains.jps.model.library.JpsLibraryReference; +import org.jetbrains.jps.model.library.JpsOrderRootType; +import org.jetbrains.jps.model.module.*; +import org.jetbrains.jps.model.serialization.JpsMacroExpander; +import org.jetbrains.jps.model.serialization.library.JpsLibraryTableSerializer; +import org.jetbrains.jps.model.serialization.library.JpsSdkTableSerializer; + +import java.io.File; +import java.io.FilenameFilter; +import java.io.IOException; +import java.util.*; + +/** + * User: anna + * Date: 10/29/12 + */ +class JpsEclipseClasspathReader extends AbstractEclipseClasspathReader<JpsModule> { + private static final Logger LOG = Logger.getInstance(JpsEclipseClasspathReader.class); + private final Map<String, String> myLibLevels; + + public JpsEclipseClasspathReader(String rootPath, + @Nullable List<String> currentRoots, + @Nullable Set<String> moduleNames, + Map<String, String> levels) { + super(rootPath, currentRoots, moduleNames); + myLibLevels = levels; + } + + @Override + protected String prepareValidUrlInsideJar(String url) { + //strip path inside jar + final String jarSeparator = "!/"; + final int localPathEndIdx = url.indexOf(jarSeparator); + if (localPathEndIdx > -1) { + return url.substring(0, localPathEndIdx + jarSeparator.length()); + } + return url; + } + + @Override + protected void addNamedLibrary(JpsModule rootModel, + Collection<String> unknownLibraries, + boolean exported, + String name, + boolean applicationLevel) { + if (LOG.isDebugEnabled()) { + LOG.debug("loading " + rootModel.getName() + ": adding " + (applicationLevel ? "application" : "project") + " library '" + name + "'"); + } + JpsElementFactory factory = JpsElementFactory.getInstance(); + JpsLibraryReference libraryReference; + final String level = myLibLevels.get(name); + libraryReference = level != null ? factory.createLibraryReference(name, JpsLibraryTableSerializer.createLibraryTableReference(level)) + : factory.createLibraryReference(name, factory.createGlobalReference()); + final JpsLibraryDependency dependency = rootModel.getDependenciesList().addLibraryDependency(libraryReference); + setLibraryEntryExported(dependency, exported); + } + + @Override + protected void addInvalidModuleEntry(JpsModule rootModel, boolean exported, String moduleName) { + final JpsElementFactory elementFactory = JpsElementFactory.getInstance(); + final JpsDependenciesList dependenciesList = rootModel.getDependenciesList(); + final JpsModuleDependency dependency = dependenciesList.addModuleDependency(elementFactory.createModuleReference(moduleName)); + final JpsJavaDependencyExtension extension = getService().getOrCreateDependencyExtension(dependency); + extension.setExported(exported); + } + + @Override + protected void setUpModuleJdk(JpsModule rootModel, + Collection<String> unknownJdks, + EclipseModuleManager eclipseModuleManager, + String jdkName) { + if (LOG.isDebugEnabled()) { + LOG.debug("loading " + rootModel.getName() + ": set module jdk " + jdkName); + } + final JpsDependenciesList dependenciesList = rootModel.getDependenciesList(); + dependenciesList.addSdkDependency(JpsJavaSdkType.INSTANCE); + if (jdkName != null) { + JpsSdkTableSerializer.setSdkReference(rootModel.getSdkReferencesTable(), jdkName, JpsJavaSdkType.INSTANCE); + } + } + + @Override + protected void addSourceFolder(JpsModule rootModel, String srcUrl, boolean testFolder) { + rootModel.addSourceRoot(srcUrl, testFolder ? JavaSourceRootType.TEST_SOURCE : JavaSourceRootType.SOURCE); + } + + @Override + protected void addSourceFolderToCurrentContentRoot(JpsModule rootModel, String srcUrl, boolean testFolder) { + rootModel.addSourceRoot(srcUrl, testFolder ? JavaSourceRootType.TEST_SOURCE : JavaSourceRootType.SOURCE); + } + + @Override + protected void addJUnitDefaultLib(JpsModule rootModel, String junitName, ExpandMacroToPathMap macroMap) { + final String ideaHome = macroMap.substitute("$APPLICATION_HOME_DIR$", SystemInfo.isFileSystemCaseSensitive); + final FilenameFilter junitFilter = new FilenameFilter() { + @Override + public boolean accept(File dir, String name) { + return name.startsWith("junit"); + } + }; + File[] junitJars = new File(ideaHome, "lib").listFiles(junitFilter); + if (junitJars == null || junitJars.length == 0) { + junitJars = new File(new File(ideaHome, "community"), "lib").listFiles(junitFilter); + } + if (junitJars != null && junitJars.length > 0) { + final boolean isJUnit4 = junitName.contains("4"); + File junitJar = null; + for (File jar : junitJars) { + final boolean isCurrentJarV4 = jar.getName().contains("4"); + if (isCurrentJarV4 && isJUnit4 || !isCurrentJarV4 && !isJUnit4) { + junitJar = jar; + break; + } + } + if (junitJar != null) { + final JpsLibrary jpsLibrary = rootModel.addModuleLibrary(junitName, JpsJavaLibraryType.INSTANCE); + jpsLibrary.addRoot(pathToUrl(junitJar.getPath()), JpsOrderRootType.COMPILED); + final JpsDependenciesList dependenciesList = rootModel.getDependenciesList(); + dependenciesList.addLibraryDependency(jpsLibrary); + } + } + } + + @Override + protected void addModuleLibrary(JpsModule rootModel, + Element element, + boolean exported, + String libName, + String url, + String srcUrl, + ExpandMacroToPathMap macroMap) { + final JpsLibrary jpsLibrary = rootModel.addModuleLibrary(libName, JpsJavaLibraryType.INSTANCE); + final JpsDependenciesList dependenciesList = rootModel.getDependenciesList(); + final JpsLibraryDependency dependency = dependenciesList.addLibraryDependency(jpsLibrary); + url = StringUtil.trimStart(url, "file://"); + final String linked = expandLinkedResourcesPath(url, macroMap); + if (linked != null) { + url = pathToUrl(linked); + } + else { + url = expandEclipsePath2Url(rootModel, url); + } + LOG.debug("loading " + rootModel.getName() + ": adding module library " + libName + ": " + url); + jpsLibrary.addRoot(url, JpsOrderRootType.COMPILED); + + setLibraryEntryExported(dependency, exported); + } + + @Override + protected String expandEclipsePath2Url(JpsModule rootModel, String path) { + + String url = null; + if (new File(path).exists()) { //absolute path + url = pathToUrl(path); + } + else { + final String relativePath = new File(myRootPath, path).getPath(); //inside current project + final File file = new File(relativePath); + if (file.exists()) { + url = pathToUrl(relativePath); + } + else if (path.startsWith("/")) { //relative to other project + final String moduleName = EPathCommonUtil.getRelativeModuleName(path); + final String relativeToRootPath = EPathCommonUtil.getRelativeToModulePath(path); + url = EPathCommonUtil.expandEclipseRelative2ContentRoots(myCurrentRoots, moduleName, relativeToRootPath); + } + } + if (url == null) { + url = pathToUrl(path); + } + + return prepareValidUrlInsideJar(url); + } + + + @Override + protected int rearrange(JpsModule rootModel) { + return 0; + } + + public void readClasspath(JpsModule model, + final String testPattern, + Element classpathElement, JpsMacroExpander expander) throws IOException { + LOG.debug("start loading classpath for " + model.getName()); + for (Object o : classpathElement.getChildren(EclipseXml.CLASSPATHENTRY_TAG)) { + try { + readClasspathEntry(model, new ArrayList<String>(), new ArrayList<String>(), new HashSet<String>(), new HashSet<String>(), + testPattern, (Element)o, 0, EclipseModuleManager.EMPTY, expander.getExpandMacroMap()); + } + catch (ConversionException e) { + throw new IOException(e); + } + } + boolean foundSdkDependency = false; + JpsDependenciesList dependenciesList = model.getDependenciesList(); + for (JpsDependencyElement element : dependenciesList.getDependencies()) { + if (element instanceof JpsSdkDependency) { + foundSdkDependency = true; + break; + } + } + if (!foundSdkDependency) { + dependenciesList.addSdkDependency(JpsJavaSdkType.INSTANCE); + } + if (LOG.isDebugEnabled()) { + String name = model.getName(); + LOG.debug("finished loading classpath for " + name + " (" + dependenciesList.getDependencies().size() + " items):"); + for (JpsDependencyElement element : dependenciesList.getDependencies()) { + LOG.debug(" [" + name + "]:" + element.toString()); + } + } + } + + @Nullable + private String expandLinkedResourcesPath(final String path, ExpandMacroToPathMap expander) { + final EclipseProjectFinder.LinkedResource linkedResource = EclipseProjectFinder.findLinkedResource(myRootPath, path); + if (linkedResource != null) { + if (linkedResource.containsPathVariable()) { + final String toPathVariableFormat = + getVariableRelatedPath(linkedResource.getVariableName(), linkedResource.getRelativeToVariablePath()); + return expander.substitute(toPathVariableFormat, SystemInfo.isFileSystemCaseSensitive); + } + return linkedResource.getLocation(); + } + return null; + } + + public void setupOutput(JpsModule rootModel, final String path) { + final JpsJavaModuleExtension extension = getService().getOrCreateModuleExtension(rootModel); + String outputUrl = pathToUrl(path); + extension.setOutputUrl(outputUrl); + extension.setTestOutputUrl(outputUrl); + //extension.setInheritOutput(false); + + rootModel.getDependenciesList().addModuleSourceDependency(); + } + + private static void setLibraryEntryExported(final JpsDependencyElement dependency, boolean exported) { + final JpsJavaDependencyExtension extension = getService().getOrCreateDependencyExtension(dependency); + extension.setExported(exported); + } + + private static JpsJavaExtensionService getService() { + return JpsJavaExtensionService.getInstance(); + } +} diff --git a/plugins/eclipse/jps-plugin/src/org/jetbrains/jps/eclipse/model/JpsEclipseClasspathSerializer.java b/plugins/eclipse/jps-plugin/src/org/jetbrains/jps/eclipse/model/JpsEclipseClasspathSerializer.java new file mode 100644 index 000000000000..0da330c5437a --- /dev/null +++ b/plugins/eclipse/jps-plugin/src/org/jetbrains/jps/eclipse/model/JpsEclipseClasspathSerializer.java @@ -0,0 +1,66 @@ +package org.jetbrains.jps.eclipse.model; + +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.util.JDOMUtil; +import com.intellij.util.containers.HashSet; +import org.jdom.Document; +import org.jdom.Element; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.idea.eclipse.EclipseXml; +import org.jetbrains.jps.model.library.sdk.JpsSdkType; +import org.jetbrains.jps.model.module.JpsDependenciesList; +import org.jetbrains.jps.model.module.JpsModule; +import org.jetbrains.jps.model.serialization.JpsMacroExpander; +import org.jetbrains.jps.model.serialization.module.JpsModuleClasspathSerializer; + +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author nik + */ +public class JpsEclipseClasspathSerializer extends JpsModuleClasspathSerializer { + @NonNls public static final String CLASSPATH_STORAGE_ID = "eclipse"; + private static final Logger LOG = Logger.getInstance(JpsEclipseClasspathSerializer.class); + + public JpsEclipseClasspathSerializer() { + super(CLASSPATH_STORAGE_ID); + } + + @Override + public void loadClasspath(@NotNull JpsModule module, + @Nullable String classpathDir, + @NotNull String baseModulePath, + JpsMacroExpander expander, + List<String> paths, + JpsSdkType<?> projectSdkType) { + final JpsDependenciesList dependenciesList = module.getDependenciesList(); + dependenciesList.clear(); + try { + if (classpathDir == null) classpathDir = baseModulePath; + final File classpathFile = new File(classpathDir, EclipseXml.DOT_CLASSPATH_EXT); + if (!classpathFile.exists()) return; //no classpath file - no compilation + + final String eml = module.getName() + EclipseXml.IDEA_SETTINGS_POSTFIX; + final File emlFile = new File(baseModulePath, eml); + final Map<String, String> levels = new HashMap<String, String>(); + if (emlFile.isFile()) { + final Document emlDocument = JDOMUtil.loadDocument(emlFile); + final Element root = emlDocument.getRootElement(); + new JpsIdeaSpecificSettings(expander).readIDEASpecific(root, module, projectSdkType, levels); + } + + final Document document = JDOMUtil.loadDocument(classpathFile); + final JpsEclipseClasspathReader reader = new JpsEclipseClasspathReader(classpathDir, paths, new HashSet<String>(), levels); + reader.readClasspath(module, null, document.getRootElement(), expander);//todo + } + catch (Exception e) { + LOG.info(e); + throw new RuntimeException(e); + } + } +} diff --git a/plugins/eclipse/jps-plugin/src/org/jetbrains/jps/eclipse/model/JpsEclipseModelSerializerExtension.java b/plugins/eclipse/jps-plugin/src/org/jetbrains/jps/eclipse/model/JpsEclipseModelSerializerExtension.java new file mode 100644 index 000000000000..d42eeb35bca9 --- /dev/null +++ b/plugins/eclipse/jps-plugin/src/org/jetbrains/jps/eclipse/model/JpsEclipseModelSerializerExtension.java @@ -0,0 +1,33 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.jps.eclipse.model; + +import org.jetbrains.annotations.Nullable; +import org.jetbrains.jps.model.serialization.JpsModelSerializerExtension; +import org.jetbrains.jps.model.serialization.module.JpsModuleClasspathSerializer; + +/** + * @author nik + */ +public class JpsEclipseModelSerializerExtension extends JpsModelSerializerExtension { + private static final JpsEclipseClasspathSerializer CLASSPATH_SERIALIZER = new JpsEclipseClasspathSerializer(); + + @Nullable + @Override + public JpsModuleClasspathSerializer getClasspathSerializer() { + return CLASSPATH_SERIALIZER; + } +} diff --git a/plugins/eclipse/jps-plugin/src/org/jetbrains/jps/eclipse/model/JpsIdeaSpecificSettings.java b/plugins/eclipse/jps-plugin/src/org/jetbrains/jps/eclipse/model/JpsIdeaSpecificSettings.java new file mode 100644 index 000000000000..e1e1b8506a70 --- /dev/null +++ b/plugins/eclipse/jps-plugin/src/org/jetbrains/jps/eclipse/model/JpsIdeaSpecificSettings.java @@ -0,0 +1,152 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.jps.eclipse.model; + +import com.intellij.openapi.util.Comparing; +import com.intellij.openapi.util.InvalidDataException; +import com.intellij.openapi.util.SystemInfo; +import com.intellij.util.ArrayUtil; +import org.jdom.Element; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.idea.eclipse.IdeaXml; +import org.jetbrains.idea.eclipse.conversion.AbstractIdeaSpecificSettings; +import org.jetbrains.jps.model.java.*; +import org.jetbrains.jps.model.library.sdk.JpsSdkType; +import org.jetbrains.jps.model.module.JpsDependenciesList; +import org.jetbrains.jps.model.module.JpsModule; +import org.jetbrains.jps.model.module.JpsModuleSourceRoot; +import org.jetbrains.jps.model.serialization.JpsMacroExpander; +import org.jetbrains.jps.model.serialization.library.JpsSdkTableSerializer; + +import java.util.List; +import java.util.Map; + +/** +* User: anna +* Date: 11/8/12 +*/ +class JpsIdeaSpecificSettings extends AbstractIdeaSpecificSettings<JpsModule, String, JpsSdkType<?>> { + private JpsMacroExpander myExpander; + + JpsIdeaSpecificSettings(JpsMacroExpander expander) { + myExpander = expander; + } + + @Override + protected void readLibraryLevels(Element root, Map<String, String> levels) { + final Element levelsElement = root.getChild("levels"); + if (levelsElement != null) { + for (Object child : levelsElement.getChildren("level")) { + final Element element = (Element)child; + final String libName = element.getAttributeValue("name"); + final String libLevel = element.getAttributeValue("value"); + if (libName != null && libLevel != null) { + levels.put(libName, libLevel); + } + } + } + } + + @Override + protected String[] getEntries(JpsModule model) { + final List<String> urls = model.getContentRootsList().getUrls(); + return ArrayUtil.toStringArray(urls); + } + + @Override + protected String createContentEntry(JpsModule model, String url) { + model.getContentRootsList().addUrl(url); + return url; + } + + @Override + protected void setupLibraryRoots(Element root, JpsModule model) {} + + @Override + protected void setupJdk(Element root, JpsModule model, @Nullable JpsSdkType<?> projectSdkType) { + final String inheritJdk = root.getAttributeValue("inheritJdk"); + final JpsDependenciesList dependenciesList = model.getDependenciesList(); + if (inheritJdk != null && Boolean.parseBoolean(inheritJdk)) { + dependenciesList.addSdkDependency(projectSdkType != null ? projectSdkType : JpsJavaSdkType.INSTANCE); + } + else { + final String jdkName = root.getAttributeValue("jdk"); + if (jdkName != null) { + String jdkType = root.getAttributeValue("jdk_type"); + JpsSdkType<?> sdkType = null; + if (jdkType != null) { + sdkType = JpsSdkTableSerializer.getSdkType(jdkType); + } + if (sdkType == null) { + sdkType = JpsJavaSdkType.INSTANCE; + } + dependenciesList.addSdkDependency(sdkType); + JpsSdkTableSerializer.setSdkReference(model.getSdkReferencesTable(), jdkName, sdkType); + if (sdkType instanceof JpsJavaSdkTypeWrapper) { + dependenciesList.addSdkDependency(JpsJavaSdkType.INSTANCE); + } + } + } + } + + @Override + protected void setupCompilerOutputs(Element root, JpsModule model) { + final JpsJavaModuleExtension extension = getService().getOrCreateModuleExtension(model); + final Element testOutputElement = root.getChild(IdeaXml.OUTPUT_TEST_TAG); + if (testOutputElement != null) { + extension.setTestOutputUrl(testOutputElement.getAttributeValue(IdeaXml.URL_ATTR)); + } + + final String inheritedOutput = root.getAttributeValue(IdeaXml.INHERIT_COMPILER_OUTPUT_ATTR); + if (inheritedOutput != null && Boolean.valueOf(inheritedOutput).booleanValue()) { + extension.setInheritOutput(true); + } + extension.setExcludeOutput(root.getChild(IdeaXml.EXCLUDE_OUTPUT_TAG) != null); + } + + @Override + protected void readLanguageLevel(Element root, JpsModule model) throws InvalidDataException {} + + @Override + protected void expandElement(Element root, JpsModule model) { + myExpander.substitute(root, SystemInfo.isFileSystemCaseSensitive); + } + + @Override + protected void overrideModulesScopes(Element root, JpsModule model) {} + + @Override + public void readContentEntry(Element root, String contentUrl, JpsModule model) { + for (Object o : root.getChildren(IdeaXml.TEST_FOLDER_TAG)) { + final String url = ((Element)o).getAttributeValue(IdeaXml.URL_ATTR); + JpsModuleSourceRoot folderToBeTest = null; + for (JpsModuleSourceRoot folder : model.getSourceRoots()) { + if (Comparing.strEqual(folder.getUrl(), url)) { + folderToBeTest = folder; + break; + } + } + if (folderToBeTest != null) { + model.removeSourceRoot(folderToBeTest.getUrl(), JavaSourceRootType.SOURCE); + } + model.addSourceRoot(url, JavaSourceRootType.TEST_SOURCE); + } + } + + private static JpsJavaExtensionService getService() { + return JpsJavaExtensionService.getInstance(); + } +} diff --git a/plugins/eclipse/resources/EclipseBundle.properties b/plugins/eclipse/resources/EclipseBundle.properties new file mode 100644 index 000000000000..bbf5b559ef25 --- /dev/null +++ b/plugins/eclipse/resources/EclipseBundle.properties @@ -0,0 +1,50 @@ +eclipse.name=Eclipse +eclipse.import.operation=Import +eclipse.import.label.select.workspace=&Select Eclipse projects directory: +eclipse.import.title.select.workspace=Select Eclipse projects directory +eclipse.import.title.module.dir=Select directory for IntelliJ IDEA project and module files +eclipse.import.modules.location=Create module files in: +eclipse.import.modules.colocated=&Eclipse projects directories +eclipse.import.modules.dedicated=&Dedicated directory: +eclipse.import.link=&Link created IntelliJ IDEA modules to Eclipse project files +eclipse.import.projects.list=Eclipse projects to be imported +eclipse.import.action.skip=No action +eclipse.import.error.duplicate.name=Error: duplicate name +eclipse.import.action.convert=.iml will be created +eclipse.import.action.link=.iml will be created and linked to .classpath +eclipse.import.warning.undefinded.libraries=Imported project refers to unknown global libraries +eclipse.import.count.undefined.libraries= ({0} more...) +eclipse.import.converting=Converting Eclipse projects +eclipse.import.scanning=Scanning Eclipse projects +eclipse.export.dialog.title=Export to Eclipse +eclipse.export.operation=Export +eclipse.export.title=Exporting Eclipse projects +eclipse.export.modules.list.title=_Select modules +eclipse.export.nothing.to.do=No modules can be exported. You cannot export modules which:\n\ + 1) have no content roots\n\ + 2) have multiple content roots\n\ + 3) have been already converted to Eclipse-compatible format +eclipse.switch.modules.to.eclipse=Switch selected modules to _Eclipse-compatible format +eclipse.export.reading.modules=Reading modules data +eclipse.export.converting.projects=Converting modules to Eclipse projects +eclipse.export.saving.projects=Saving Eclipse projects +eclipse.export.nested.error=Error: nested project +eclipse.export.action.skip=No action +eclipse.export.action.redundant=Export is redundant (already linked) +eclipse.export.action.link=.classpath will be created and linked from .iml +eclipse.export.action.convert=.classpath will be created +eclipse.export.too.many.content.roots=Module {0} uses the Eclipse format which supports one content root only +eclipse.export.incompatible=incompatible (multiple or no content roots) +eclipse.classpath.storage.description=Eclipse (.classpath) +eclipse.title.modules.to.rename=Module name mismatch +eclipse.message.renamed.module=''{0}'' to ''{1}''\n +eclipse.message.modules.to.rename=Eclipse projects linked to following modules seem to be renamed:\n\n\ +{0}\nThis is likely to cause unresolved module dependencies.\nWould you like to rename IDEA modules to match Eclipse projects? +eclipse.title.rename.failed=Duplicate module names +eclipse.message.rename.failed=Following modules could not be renamed because of duplicate module names:\n\n{0} +eclipse.title.unresolved.projects=Unresolved module references +eclipse.message.unresolved.projects=Some modules contain unresolved Eclipse-style project-relative library references:\n\n{0} +eclipse.file.type.descr=Eclipse project files +eclipse.create.library.title=Locate Eclipse installation +eclipse.create.library.description=<html>Some of the projects you are importing depend on Eclipse platform.<br>\ +IntelliJ IDEA will create a global library named {0} containing Eclipse libraries.</html>
\ No newline at end of file diff --git a/plugins/eclipse/resources/META-INF/plugin.xml b/plugins/eclipse/resources/META-INF/plugin.xml new file mode 100644 index 000000000000..18b92dd21ad5 --- /dev/null +++ b/plugins/eclipse/resources/META-INF/plugin.xml @@ -0,0 +1,27 @@ +<idea-plugin> + <name>Eclipse Integration</name> + <id>org.jetbrains.idea.eclipse</id> + <description>Provides possibility to import, export and synchronize Eclipse project files</description> + <version>3.0</version> + <vendor url="http://www.jetbrains.com" logo="/general/ijLogo.png">JetBrains s.r.o.</vendor> + <extensions defaultExtensionNs="com.intellij"> + <classpathStorageProvider implementation="org.jetbrains.idea.eclipse.config.EclipseClasspathStorageProvider"/> + <compileServer.plugin classpath="eclipse-jps-plugin.jar;common-eclipse-util.jar"/> + <projectImportProvider implementation="org.jetbrains.idea.eclipse.importWizard.EclipseProjectImportProvider"/> + <projectOpenProcessor id="EclipseProjectOpenProcessor" implementation="org.jetbrains.idea.eclipse.importWizard.EclipseProjectOpenProcessor"/> + <projectImportBuilder implementation="org.jetbrains.idea.eclipse.importWizard.EclipseImportBuilder"/> + <errorHandler implementation="com.intellij.diagnostic.ITNReporter"/> + <fileTypeFactory implementation="org.jetbrains.idea.eclipse.config.EclipseFileTypeFactory"/> + <syntaxHighlighter key="Eclipse" implementationClass="com.intellij.ide.highlighter.XmlFileHighlighter"/> + </extensions> + <module-components> + <component> + <implementation-class>org.jetbrains.idea.eclipse.config.EclipseModuleManagerImpl</implementation-class> + </component> + </module-components> + <actions> + <action id="ExportToEclipse" class="org.jetbrains.idea.eclipse.export.ExportEclipseProjectsAction" text="Export to Eclipse..."> + <add-to-group group-id="ExportImportGroup" anchor="last"/> + </action> + </actions> +</idea-plugin>
\ No newline at end of file diff --git a/plugins/eclipse/resources/icons/EclipseIcons.java b/plugins/eclipse/resources/icons/EclipseIcons.java new file mode 100644 index 000000000000..d67c722ff710 --- /dev/null +++ b/plugins/eclipse/resources/icons/EclipseIcons.java @@ -0,0 +1,17 @@ +package icons; + +import com.intellij.openapi.util.IconLoader; + +import javax.swing.*; + +/** + * NOTE THIS FILE IS AUTO-GENERATED by the build/scripts/icons.gant + * Don't repeat mistakes of others ;-) + */ +public class EclipseIcons { + private static Icon load(String path) { + return IconLoader.getIcon(path, EclipseIcons.class); + } + + public static final Icon Eclipse = load("/images/eclipse.gif"); // 16x16 +} diff --git a/plugins/eclipse/resources/images/eclipse.gif b/plugins/eclipse/resources/images/eclipse.gif Binary files differnew file mode 100644 index 000000000000..eb7b90c76711 --- /dev/null +++ b/plugins/eclipse/resources/images/eclipse.gif diff --git a/plugins/eclipse/src/org/jdom/output/EclipseJDOMUtil.java b/plugins/eclipse/src/org/jdom/output/EclipseJDOMUtil.java new file mode 100644 index 000000000000..a09781b78dce --- /dev/null +++ b/plugins/eclipse/src/org/jdom/output/EclipseJDOMUtil.java @@ -0,0 +1,63 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jdom.output; + +import com.intellij.openapi.project.Project; +import com.intellij.openapi.vfs.CharsetToolkit; +import com.intellij.psi.codeStyle.CodeStyleSettingsManager; +import org.jdom.Document; +import org.jetbrains.annotations.NonNls; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.Writer; + +public class EclipseJDOMUtil { + + @NonNls private static final String ENCODING = CharsetToolkit.UTF8; + + + private EclipseJDOMUtil() { + } + + + private static EclipseXMLOutputter createOutputter(String lineSeparator) { + EclipseXMLOutputter xmlOutputter = new EclipseXMLOutputter(lineSeparator); + Format format = Format.getCompactFormat(). + setIndent("\t"). + setTextMode(Format.TextMode.NORMALIZE). + setEncoding(ENCODING). + setOmitEncoding(false). + setOmitDeclaration(false); + xmlOutputter.setFormat(format); + return xmlOutputter; + } + + public static void output(final Document doc, final File file, final Project project) throws IOException { + FileOutputStream out = new FileOutputStream(file); + try { + createOutputter(CodeStyleSettingsManager.getSettings(project).getLineSeparator()).output(doc, out); + } + finally { + out.close(); + } + } + + public static void output(final Document document, final Writer writer, Project project) throws IOException { + createOutputter(CodeStyleSettingsManager.getSettings(project).getLineSeparator()).output(document, writer); + } +} diff --git a/plugins/eclipse/src/org/jdom/output/EclipseNamespaceStack.java b/plugins/eclipse/src/org/jdom/output/EclipseNamespaceStack.java new file mode 100644 index 000000000000..f549e2e78dd5 --- /dev/null +++ b/plugins/eclipse/src/org/jdom/output/EclipseNamespaceStack.java @@ -0,0 +1,154 @@ +/*-- + + $Id: NamespaceStack.java,v 1.13 2004/02/06 09:28:32 jhunter Exp $ + + Copyright (C) 2000-2004 Jason Hunter & Brett McLaughlin. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions, and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions, and the disclaimer that follows + these conditions in the documentation and/or other materials + provided with the distribution. + + 3. The name "JDOM" must not be used to endorse or promote products + derived from this software without prior written permission. For + written permission, please contact <request_AT_jdom_DOT_org>. + + 4. Products derived from this software may not be called "JDOM", nor + may "JDOM" appear in their name, without prior written permission + from the JDOM Project Management <request_AT_jdom_DOT_org>. + + In addition, we request (but do not require) that you include in the + end-user documentation provided with the redistribution and/or in the + software itself an acknowledgement equivalent to the following: + "This product includes software developed by the + JDOM Project (http://www.jdom.org/)." + Alternatively, the acknowledgment may be graphical using the logos + available at http://www.jdom.org/images/logos. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + This software consists of voluntary contributions made by many + individuals on behalf of the JDOM Project and was originally + created by Jason Hunter <jhunter_AT_jdom_DOT_org> and + Brett McLaughlin <brett_AT_jdom_DOT_org>. For more information + on the JDOM Project, please see <http://www.jdom.org/>. + + */ +package org.jdom.output; + +import org.jdom.Namespace; + +import java.util.Stack; + +/** + * A non-public utility class used by both <code>{@link XMLOutputter}</code> and + * <code>{@link SAXOutputter}</code> to manage namespaces in a JDOM Document + * during output. + * + * @version $Revision: 1.13 $, $Date: 2004/02/06 09:28:32 $ + * @author Elliotte Rusty Harolde + * @author Fred Trimble + * @author Brett McLaughlin + */ +public class EclipseNamespaceStack { + + private static final String CVS_ID = + "@(#) $RCSfile: NamespaceStack.java,v $ $Revision: 1.13 $ $Date: 2004/02/06 09:28:32 $ $Name: jdom_1_0 $"; + + /** The prefixes available */ + private final Stack prefixes; + + /** The URIs available */ + private final Stack uris; + + /** + * This creates the needed storage. + */ + EclipseNamespaceStack() { + prefixes = new Stack(); + uris = new Stack(); + } + + /** + * This will add a new <code>{@link Namespace}</code> + * to those currently available. + * + * @param ns <code>Namespace</code> to add. + */ + public void push(Namespace ns) { + prefixes.push(ns.getPrefix()); + uris.push(ns.getURI()); + } + + /** + * This will remove the topmost (most recently added) + * <code>{@link Namespace}</code>, and return its prefix. + * + * @return <code>String</code> - the popped namespace prefix. + */ + public String pop() { + String prefix = (String)prefixes.pop(); + uris.pop(); + + return prefix; + } + + /** + * This returns the number of available namespaces. + * + * @return <code>int</code> - size of the namespace stack. + */ + public int size() { + return prefixes.size(); + } + + /** + * Given a prefix, this will return the namespace URI most + * rencently (topmost) associated with that prefix. + * + * @param prefix <code>String</code> namespace prefix. + * @return <code>String</code> - the namespace URI for that prefix. + */ + public String getURI(String prefix) { + int index = prefixes.lastIndexOf(prefix); + if (index == -1) { + return null; + } + String uri = (String)uris.elementAt(index); + return uri; + } + + /** + * This will print out the size and current stack, from the + * most recently added <code>{@link Namespace}</code> to + * the "oldest," all to <code>System.out</code>. + */ + public String toString() { + StringBuffer buf = new StringBuffer(); + String sep = System.getProperty("line.separator"); + buf.append("Stack: " + prefixes.size() + sep); + for (int i = 0; i < prefixes.size(); i++) { + buf.append(prefixes.elementAt(i) + "&" + uris.elementAt(i) + sep); + } + return buf.toString(); + } +} diff --git a/plugins/eclipse/src/org/jdom/output/EclipseXMLOutputter.java b/plugins/eclipse/src/org/jdom/output/EclipseXMLOutputter.java new file mode 100644 index 000000000000..be141be27cc3 --- /dev/null +++ b/plugins/eclipse/src/org/jdom/output/EclipseXMLOutputter.java @@ -0,0 +1,1583 @@ +/*-- + + $Id: XMLOutputter.java,v 1.112 2004/09/01 06:08:18 jhunter Exp $ + + Copyright (C) 2000-2004 Jason Hunter & Brett McLaughlin. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions, and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions, and the disclaimer that follows + these conditions in the documentation and/or other materials + provided with the distribution. + + 3. The name "JDOM" must not be used to endorse or promote products + derived from this software without prior written permission. For + written permission, please contact <request_AT_jdom_DOT_org>. + + 4. Products derived from this software may not be called "JDOM", nor + may "JDOM" appear in their name, without prior written permission + from the JDOM Project Management <request_AT_jdom_DOT_org>. + + In addition, we request (but do not require) that you include in the + end-user documentation provided with the redistribution and/or in the + software itself an acknowledgement equivalent to the following: + "This product includes software developed by the + JDOM Project (http://www.jdom.org/)." + Alternatively, the acknowledgment may be graphical using the logos + available at http://www.jdom.org/images/logos. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + This software consists of voluntary contributions made by many + individuals on behalf of the JDOM Project and was originally + created by Jason Hunter <jhunter_AT_jdom_DOT_org> and + Brett McLaughlin <brett_AT_jdom_DOT_org>. For more information + on the JDOM Project, please see <http://www.jdom.org/>. + + */ + +package org.jdom.output; + +import com.intellij.openapi.vfs.CharsetToolkit; +import org.jdom.*; + +import javax.xml.transform.Result; +import java.io.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; + +/** + * Outputs a JDOM document as a stream of bytes. The outputter can manage many + * styles of document formatting, from untouched to pretty printed. The default + * is to output the document content exactly as created, but this can be changed + * by setting a new Format object. For pretty-print output, use + * <code>{@link Format#getPrettyFormat()}</code>. For whitespace-normalized + * output, use <code>{@link Format#getCompactFormat()}</code>. + * <p> + * There are <code>{@link #output output(...)}</code> methods to print any of + * the standard JDOM classes, including Document and Element, to either a Writer + * or an OutputStream. <b>Warning</b>: When outputting to a Writer, make sure + * the writer's encoding matches the encoding setting in the Format object. This + * ensures the encoding in which the content is written (controlled by the + * Writer configuration) matches the encoding placed in the document's XML + * declaration (controlled by the XMLOutputter). Because a Writer cannot be + * queried for its encoding, the information must be passed to the Format + * manually in its constructor or via the + * <code>{@link Format#setEncoding}</code> method. The default encoding is + * UTF-8. + * <p> + * The methods <code>{@link #outputString outputString(...)}</code> are for + * convenience only; for top performance you should call one of the <code>{@link + * #output output(...)}</code> methods and pass in your own Writer or + * OutputStream if possible. + * <p> + * XML declarations are always printed on their own line followed by a line + * seperator (this doesn't change the semantics of the document). To omit + * printing of the declaration use + * <code>{@link Format#setOmitDeclaration}</code>. To omit printing of the + * encoding in the declaration use <code>{@link Format#setOmitEncoding}</code>. + * Unfortunatly there is currently no way to know the original encoding of the + * document. + * <p> + * Empty elements are by default printed as <empty/>, but this can be + * configured with <code>{@link Format#setExpandEmptyElements}</code> to cause + * them to be expanded to <empty></empty>. + * + * @version $Revision: 1.112 $, $Date: 2004/09/01 06:08:18 $ + * @author Brett McLaughlin + * @author Jason Hunter + * @author Jason Reid + * @author Wolfgang Werner + * @author Elliotte Rusty Harold + * @author David & Will (from Post Tool Design) + * @author Dan Schaffer + * @author Alex Chaffee + * @author Bradley S. Huffman + */ + +public class EclipseXMLOutputter implements Cloneable { + + private static final String CVS_ID = + "@(#) $RCSfile: XMLOutputter.java,v $ $Revision: 1.112 $ $Date: 2004/09/01 06:08:18 $ $Name: jdom_1_0 $"; + + // For normal output + private Format userFormat = Format.getRawFormat(); + + // For xml:space="preserve" + protected static final Format preserveFormat = Format.getRawFormat(); + + // What's currently in use + protected Format currentFormat = userFormat; + + /** Whether output escaping is enabled for the being processed + * Element - default is <code>true</code> */ + private boolean escapeOutput = true; + private final String lineSeparator; + + // * * * * * * * * * * Constructors * * * * * * * * * * + // * * * * * * * * * * Constructors * * * * * * * * * * + + /** + * This will create an <code>XMLOutputter</code> with the default + * {@link Format} matching {@link Format#getRawFormat}. + */ + public EclipseXMLOutputter(String lineSeparator) { + this.lineSeparator = lineSeparator; + } + + + // * * * * * * * * * * Set parameters methods * * * * * * * * * * + // * * * * * * * * * * Set parameters methods * * * * * * * * * * + + /** + * Sets the new format logic for the outputter. Note the Format + * object is cloned internally before use. + * + * @param newFormat the format to use for output + */ + public void setFormat(Format newFormat) { + this.userFormat = newFormat; + this.currentFormat = userFormat; + } + + /** + * Returns the current format in use by the outputter. Note the + * Format object returned is a clone of the one used internally. + */ + public Format getFormat() { + return (Format) userFormat; + } + + // * * * * * * * * * * Output to a OutputStream * * * * * * * * * * + // * * * * * * * * * * Output to a OutputStream * * * * * * * * * * + + /** + * This will print the <code>Document</code> to the given output stream. + * The characters are printed using the encoding specified in the + * constructor, or a default of UTF-8. + * + * @param doc <code>Document</code> to format. + * @param out <code>OutputStream</code> to use. + * @throws IOException - if there's any problem writing. + */ + public void output(Document doc, OutputStream out) + throws IOException { + Writer writer = makeWriter(out); + output(doc, writer); // output() flushes + } + + /** + * Print out the <code>{@link DocType}</code>. + * + * @param doctype <code>DocType</code> to output. + * @param out <code>OutputStream</code> to use. + */ + public void output(DocType doctype, OutputStream out) throws IOException { + Writer writer = makeWriter(out); + output(doctype, writer); // output() flushes + } + + /** + * Print out an <code>{@link Element}</code>, including + * its <code>{@link Attribute}</code>s, and all + * contained (child) elements, etc. + * + * @param element <code>Element</code> to output. + * @param out <code>Writer</code> to use. + */ + public void output(Element element, OutputStream out) throws IOException { + Writer writer = makeWriter(out); + output(element, writer); // output() flushes + } + + /** + * This will handle printing out an <code>{@link + * Element}</code>'s content only, not including its tag, and + * attributes. This can be useful for printing the content of an + * element that contains HTML, like "<description>JDOM is + * <b>fun>!</description>". + * + * @param element <code>Element</code> to output. + * @param out <code>OutputStream</code> to use. + */ + public void outputElementContent(Element element, OutputStream out) + throws IOException { + Writer writer = makeWriter(out); + outputElementContent(element, writer); // output() flushes + } + + /** + * This will handle printing out a list of nodes. + * This can be useful for printing the content of an element that + * contains HTML, like "<description>JDOM is + * <b>fun>!</description>". + * + * @param list <code>List</code> of nodes. + * @param out <code>OutputStream</code> to use. + */ + public void output(List list, OutputStream out) + throws IOException { + Writer writer = makeWriter(out); + output(list, writer); // output() flushes + } + + /** + * Print out a <code>{@link CDATA}</code> node. + * + * @param cdata <code>CDATA</code> to output. + * @param out <code>OutputStream</code> to use. + */ + public void output(CDATA cdata, OutputStream out) throws IOException { + Writer writer = makeWriter(out); + output(cdata, writer); // output() flushes + } + + /** + * Print out a <code>{@link Text}</code> node. Perfoms + * the necessary entity escaping and whitespace stripping. + * + * @param text <code>Text</code> to output. + * @param out <code>OutputStream</code> to use. + */ + public void output(Text text, OutputStream out) throws IOException { + Writer writer = makeWriter(out); + output(text, writer); // output() flushes + } + + /** + * Print out a <code>{@link Comment}</code>. + * + * @param comment <code>Comment</code> to output. + * @param out <code>OutputStream</code> to use. + */ + public void output(Comment comment, OutputStream out) throws IOException { + Writer writer = makeWriter(out); + output(comment, writer); // output() flushes + } + + /** + * Print out a <code>{@link ProcessingInstruction}</code>. + * + * @param pi <code>ProcessingInstruction</code> to output. + * @param out <code>OutputStream</code> to use. + */ + public void output(ProcessingInstruction pi, OutputStream out) + throws IOException { + Writer writer = makeWriter(out); + output(pi, writer); // output() flushes + } + + /** + * Print out a <code>{@link EntityRef}</code>. + * + * @param entity <code>EntityRef</code> to output. + * @param out <code>OutputStream</code> to use. + */ + public void output(EntityRef entity, OutputStream out) throws IOException { + Writer writer = makeWriter(out); + output(entity, writer); // output() flushes + } + + /** + * Get an OutputStreamWriter, using prefered encoding + * (see {@link Format#setEncoding}). + */ + private Writer makeWriter(OutputStream out) + throws java.io.UnsupportedEncodingException { + return makeWriter(out, CharsetToolkit.UTF8); + } + + /** + * Get an OutputStreamWriter, use specified encoding. + */ + private static Writer makeWriter(OutputStream out, String enc) + throws java.io.UnsupportedEncodingException { + // "UTF-8" is not recognized before JDK 1.1.6, so we'll translate + // into "UTF8" which works with all JDKs. + if ("UTF-8".equals(enc)) { + enc = "UTF8"; + } + + Writer writer = new BufferedWriter( + (new OutputStreamWriter( + new BufferedOutputStream(out), enc) + )); + return writer; + } + + // * * * * * * * * * * Output to a Writer * * * * * * * * * * + // * * * * * * * * * * Output to a Writer * * * * * * * * * * + + /** + * This will print the <code>Document</code> to the given Writer. + * + * <p> + * Warning: using your own Writer may cause the outputter's + * preferred character encoding to be ignored. If you use + * encodings other than UTF-8, we recommend using the method that + * takes an OutputStream instead. + * </p> + * + * @param doc <code>Document</code> to format. + * @param out <code>Writer</code> to use. + * @throws IOException - if there's any problem writing. + */ + public void output(Document doc, Writer out) throws IOException { + + printDeclaration(out, doc, CharsetToolkit.UTF8); + + // Print out root element, as well as any root level + // comments and processing instructions, + // starting with no indentation + List content = doc.getContent(); + int size = content.size(); + for (int i = 0; i < size; i++) { + Object obj = content.get(i); + + if (obj instanceof Element) { + printElement(out, doc.getRootElement(), 0, + createNamespaceStack()); + } + else if (obj instanceof Comment) { + printComment(out, (Comment) obj); + } + else if (obj instanceof ProcessingInstruction) { + printProcessingInstruction(out, (ProcessingInstruction) obj); + } + else if (obj instanceof DocType) { + printDocType(out, doc.getDocType()); + // Always print line separator after declaration, helps the + // output look better and is semantically inconsequential + out.write(lineSeparator); + } + else { + // XXX if we get here then we have a illegal content, for + // now we'll just ignore it + } + + newline(out); + indent(out, 0); + } + + out.flush(); + } + + /** + * Print out the <code>{@link DocType}</code>. + * + * @param doctype <code>DocType</code> to output. + * @param out <code>Writer</code> to use. + */ + public void output(DocType doctype, Writer out) throws IOException { + printDocType(out, doctype); + out.flush(); + } + + /** + * Print out an <code>{@link Element}</code>, including + * its <code>{@link Attribute}</code>s, and all + * contained (child) elements, etc. + * + * @param element <code>Element</code> to output. + * @param out <code>Writer</code> to use. + */ + public void output(Element element, Writer out) throws IOException { + // If this is the root element we could pre-initialize the + // namespace stack with the namespaces + printElement(out, element, 0, createNamespaceStack()); + out.flush(); + } + + /** + * This will handle printing out an <code>{@link + * Element}</code>'s content only, not including its tag, and + * attributes. This can be useful for printing the content of an + * element that contains HTML, like "<description>JDOM is + * <b>fun>!</description>". + * + * @param element <code>Element</code> to output. + * @param out <code>Writer</code> to use. + */ + public void outputElementContent(Element element, Writer out) + throws IOException { + List content = element.getContent(); + printContentRange(out, content, 0, content.size(), + 0, createNamespaceStack()); + out.flush(); + } + + /** + * This will handle printing out a list of nodes. + * This can be useful for printing the content of an element that + * contains HTML, like "<description>JDOM is + * <b>fun>!</description>". + * + * @param list <code>List</code> of nodes. + * @param out <code>Writer</code> to use. + */ + public void output(List list, Writer out) + throws IOException { + printContentRange(out, list, 0, list.size(), + 0, createNamespaceStack()); + out.flush(); + } + + /** + * Print out a <code>{@link CDATA}</code> node. + * + * @param cdata <code>CDATA</code> to output. + * @param out <code>Writer</code> to use. + */ + public void output(CDATA cdata, Writer out) throws IOException { + printCDATA(out, cdata); + out.flush(); + } + + /** + * Print out a <code>{@link Text}</code> node. Perfoms + * the necessary entity escaping and whitespace stripping. + * + * @param text <code>Text</code> to output. + * @param out <code>Writer</code> to use. + */ + public void output(Text text, Writer out) throws IOException { + printText(out, text); + out.flush(); + } + + /** + * Print out a <code>{@link Comment}</code>. + * + * @param comment <code>Comment</code> to output. + * @param out <code>Writer</code> to use. + */ + public void output(Comment comment, Writer out) throws IOException { + printComment(out, comment); + out.flush(); + } + + /** + * Print out a <code>{@link ProcessingInstruction}</code>. + * + * @param pi <code>ProcessingInstruction</code> to output. + * @param out <code>Writer</code> to use. + */ + public void output(ProcessingInstruction pi, Writer out) + throws IOException { + boolean currentEscapingPolicy = false;//currentFormat.ignoreTrAXEscapingPIs; + + // Output PI verbatim, disregarding TrAX escaping PIs. + currentFormat.setIgnoreTrAXEscapingPIs(true); + printProcessingInstruction(out, pi); + currentFormat.setIgnoreTrAXEscapingPIs(currentEscapingPolicy); + + out.flush(); + } + + /** + * Print out a <code>{@link EntityRef}</code>. + * + * @param entity <code>EntityRef</code> to output. + * @param out <code>Writer</code> to use. + */ + public void output(EntityRef entity, Writer out) throws IOException { + printEntityRef(out, entity); + out.flush(); + } + + // * * * * * * * * * * Output to a String * * * * * * * * * * + // * * * * * * * * * * Output to a String * * * * * * * * * * + + /** + * Return a string representing a document. Uses an internal + * StringWriter. Warning: a String is Unicode, which may not match + * the outputter's specified encoding. + * + * @param doc <code>Document</code> to format. + */ + public String outputString(Document doc) { + StringWriter out = new StringWriter(); + try { + output(doc, out); // output() flushes + } catch (IOException e) { } + return out.toString(); + } + + /** + * Return a string representing a DocType. Warning: a String is + * Unicode, which may not match the outputter's specified + * encoding. + * + * @param doctype <code>DocType</code> to format. + */ + public String outputString(DocType doctype) { + StringWriter out = new StringWriter(); + try { + output(doctype, out); // output() flushes + } catch (IOException e) { } + return out.toString(); + } + + /** + * Return a string representing an element. Warning: a String is + * Unicode, which may not match the outputter's specified + * encoding. + * + * @param element <code>Element</code> to format. + */ + public String outputString(Element element) { + StringWriter out = new StringWriter(); + try { + output(element, out); // output() flushes + } catch (IOException e) { } + return out.toString(); + } + + /** + * Return a string representing a list of nodes. The list is + * assumed to contain legal JDOM nodes. + * + * @param list <code>List</code> to format. + */ + public String outputString(List list) { + StringWriter out = new StringWriter(); + try { + output(list, out); // output() flushes + } catch (IOException e) { } + return out.toString(); + } + + /** + * Return a string representing a CDATA node. Warning: a String is + * Unicode, which may not match the outputter's specified + * encoding. + * + * @param cdata <code>CDATA</code> to format. + */ + public String outputString(CDATA cdata) { + StringWriter out = new StringWriter(); + try { + output(cdata, out); // output() flushes + } catch (IOException e) { } + return out.toString(); + } + + /** + * Return a string representing a Text node. Warning: a String is + * Unicode, which may not match the outputter's specified + * encoding. + * + * @param text <code>Text</code> to format. + */ + public String outputString(Text text) { + StringWriter out = new StringWriter(); + try { + output(text, out); // output() flushes + } catch (IOException e) { } + return out.toString(); + } + + + /** + * Return a string representing a comment. Warning: a String is + * Unicode, which may not match the outputter's specified + * encoding. + * + * @param comment <code>Comment</code> to format. + */ + public String outputString(Comment comment) { + StringWriter out = new StringWriter(); + try { + output(comment, out); // output() flushes + } catch (IOException e) { } + return out.toString(); + } + + /** + * Return a string representing a PI. Warning: a String is + * Unicode, which may not match the outputter's specified + * encoding. + * + * @param pi <code>ProcessingInstruction</code> to format. + */ + public String outputString(ProcessingInstruction pi) { + StringWriter out = new StringWriter(); + try { + output(pi, out); // output() flushes + } catch (IOException e) { } + return out.toString(); + } + + /** + * Return a string representing an entity. Warning: a String is + * Unicode, which may not match the outputter's specified + * encoding. + * + * @param entity <code>EntityRef</code> to format. + */ + public String outputString(EntityRef entity) { + StringWriter out = new StringWriter(); + try { + output(entity, out); // output() flushes + } catch (IOException e) { } + return out.toString(); + } + + // * * * * * * * * * * Internal printing methods * * * * * * * * * * + // * * * * * * * * * * Internal printing methods * * * * * * * * * * + + /** + * This will handle printing of the declaration. + * Assumes XML version 1.0 since we don't directly know. + * + * @param doc <code>Document</code> whose declaration to write. + * @param out <code>Writer</code> to use. + * @param encoding The encoding to add to the declaration + */ + protected void printDeclaration(Writer out, Document doc, + String encoding) throws IOException { + + // Only print the declaration if it's not being omitted + // Assume 1.0 version + out.write("<?xml version=\"1.0\""); + out.write(" encoding=\"" + encoding + "\""); + out.write("?>"); + + // Print new line after decl always, even if no other new lines + // Helps the output look better and is semantically + // inconsequential + out.write(lineSeparator); + } + + /** + * This handle printing the DOCTYPE declaration if one exists. + * + * @param docType <code>Document</code> whose declaration to write. + * @param out <code>Writer</code> to use. + */ + protected void printDocType(Writer out, DocType docType) + throws IOException { + + String publicID = docType.getPublicID(); + String systemID = docType.getSystemID(); + String internalSubset = docType.getInternalSubset(); + boolean hasPublic = false; + + out.write("<!DOCTYPE "); + out.write(docType.getElementName()); + if (publicID != null) { + out.write(" PUBLIC \""); + out.write(publicID); + out.write("\""); + hasPublic = true; + } + if (systemID != null) { + if (!hasPublic) { + out.write(" SYSTEM"); + } + out.write(" \""); + out.write(systemID); + out.write("\""); + } + if ((internalSubset != null) && (!internalSubset.equals(""))) { + out.write(" ["); + out.write(lineSeparator); + out.write(docType.getInternalSubset()); + out.write("]"); + } + out.write(">"); + } + + /** + * This will handle printing of comments. + * + * @param comment <code>Comment</code> to write. + * @param out <code>Writer</code> to use. + */ + protected void printComment(Writer out, Comment comment) + throws IOException { + out.write("<!--"); + out.write(comment.getText()); + out.write("-->"); + } + + /** + * This will handle printing of processing instructions. + * + * @param pi <code>ProcessingInstruction</code> to write. + * @param out <code>Writer</code> to use. + */ + protected void printProcessingInstruction(Writer out, ProcessingInstruction pi + ) throws IOException { + String target = pi.getTarget(); + boolean piProcessed = false; + + //if (currentFormat.ignoreTrAXEscapingPIs == false) { + if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING)) { + escapeOutput = false; + piProcessed = true; + } + else if (target.equals(Result.PI_ENABLE_OUTPUT_ESCAPING)) { + escapeOutput = true; + piProcessed = true; + } + //} + if (piProcessed == false) { + String rawData = pi.getData(); + + // Write <?target data?> or if no data then just <?target?> + if (!"".equals(rawData)) { + out.write("<?"); + out.write(target); + out.write(" "); + out.write(rawData); + out.write("?>"); + } + else { + out.write("<?"); + out.write(target); + out.write("?>"); + } + } + } + + /** + * This will handle printing a <code>{@link EntityRef}</code>. + * Only the entity reference such as <code>&entity;</code> + * will be printed. However, subclasses are free to override + * this method to print the contents of the entity instead. + * + * @param entity <code>EntityRef</code> to output. + * @param out <code>Writer</code> to use. */ + protected void printEntityRef(Writer out, EntityRef entity) + throws IOException { + out.write("&"); + out.write(entity.getName()); + out.write(";"); + } + + /** + * This will handle printing of <code>{@link CDATA}</code> text. + * + * @param cdata <code>CDATA</code> to output. + * @param out <code>Writer</code> to use. + */ + protected void printCDATA(Writer out, CDATA cdata) throws IOException { + String str = //(currentFormat.mode == Format.TextMode.NORMALIZE) ? + cdata.getTextNormalize(); + //: ((currentFormat.mode == Format.TextMode.TRIM) ? + //cdata.getText().trim() : cdata.getText()); + out.write("<![CDATA["); + out.write(str); + out.write("]]>"); + } + + /** + * This will handle printing of <code>{@link Text}</code> strings. + * + * @param text <code>Text</code> to write. + * @param out <code>Writer</code> to use. + */ + protected void printText(Writer out, Text text) throws IOException { + String str = //(currentFormat.mode == Format.TextMode.NORMALIZE) ? + text.getTextNormalize(); + //: ((currentFormat.mode == Format.TextMode.TRIM) ? + // text.getText().trim() : text.getText()); + out.write(escapeElementEntities(str)); + } + + /** + * This will handle printing a string. Escapes the element entities, + * trims interior whitespace, etc. if necessary. + */ + private void printString(Writer out, String str) throws IOException { + //if (currentFormat.mode == Format.TextMode.NORMALIZE) { + str = Text.normalizeString(str); + //} + //else if (currentFormat.mode == Format.TextMode.TRIM) { + str = str.trim(); + //} + out.write(escapeElementEntities(str)); + } + + /** + * This will handle printing of a <code>{@link Element}</code>, + * its <code>{@link Attribute}</code>s, and all contained (child) + * elements, etc. + * + * @param element <code>Element</code> to output. + * @param out <code>Writer</code> to use. + * @param level <code>int</code> level of indention. + * @param namespaces <code>List</code> stack of Namespaces in scope. + */ + protected void printElement(Writer out, Element element, + int level, EclipseNamespaceStack namespaces) + throws IOException { + + List attributes = element.getAttributes(); + List content = element.getContent(); + + // Check for xml:space and adjust format settings + String space = null; + if (attributes != null) { + space = element.getAttributeValue("space", + Namespace.XML_NAMESPACE); + } + + Format previousFormat = currentFormat; + + if ("default".equals(space)) { + currentFormat = userFormat; + } + else if ("preserve".equals(space)) { + currentFormat = preserveFormat; + } + + // Print the beginning of the tag plus attributes and any + // necessary namespace declarations + out.write("<"); + printQualifiedName(out, element); + + // Mark our namespace starting point + int previouslyDeclaredNamespaces = namespaces.size(); + + // Print the element's namespace, if appropriate + printElementNamespace(out, element, namespaces); + + // Print out additional namespace declarations + printAdditionalNamespaces(out, element, namespaces); + + // Print out attributes + if (attributes != null) + printAttributes(out, attributes, element, namespaces); + + // Depending on the settings (newlines, textNormalize, etc), we may + // or may not want to print all of the content, so determine the + // index of the start of the content we're interested + // in based on the current settings. + + int start = skipLeadingWhite(content, 0); + int size = content.size(); + if (start >= size) { + // Case content is empty or all insignificant whitespace + //if (currentFormat.expandEmptyElements) { + // out.write("></"); + // printQualifiedName(out, element); + // out.write(">"); + //} + //else { + out.write("/>"); + //} + } + else { + out.write(">"); + + // For a special case where the content is only CDATA + // or Text we don't want to indent after the start or + // before the end tag. + + if (nextNonText(content, start) < size) { + // Case Mixed Content - normal indentation + newline(out); + printContentRange(out, content, start, size, + level + 1, namespaces); + newline(out); + indent(out, level); + } + else { + // Case all CDATA or Text - no indentation + printTextRange(out, content, start, size); + } + out.write("</"); + printQualifiedName(out, element); + out.write(">"); + } + + // remove declared namespaces from stack + while (namespaces.size() > previouslyDeclaredNamespaces) { + namespaces.pop(); + } + + // Restore our format settings + currentFormat = previousFormat; + } + + /** + * This will handle printing of content within a given range. + * The range to print is specified in typical Java fashion; the + * starting index is inclusive, while the ending index is + * exclusive. + * + * @param content <code>List</code> of content to output + * @param start index of first content node (inclusive. + * @param end index of last content node (exclusive). + * @param out <code>Writer</code> to use. + * @param level <code>int</code> level of indentation. + * @param namespaces <code>List</code> stack of Namespaces in scope. + */ + private void printContentRange(Writer out, List content, + int start, int end, int level, + EclipseNamespaceStack namespaces) + throws IOException { + boolean firstNode; // Flag for 1st node in content + Object next; // Node we're about to print + int first, index; // Indexes into the list of content + + index = start; + while (index < end) { + firstNode = (index == start) ? true : false; + next = content.get(index); + + // + // Handle consecutive CDATA, Text, and EntityRef nodes all at once + // + if ((next instanceof Text) || (next instanceof EntityRef)) { + first = skipLeadingWhite(content, index); + // Set index to next node for loop + index = nextNonText(content, first); + + // If it's not all whitespace - print it! + if (first < index) { + if (!firstNode) + newline(out); + indent(out, level); + printTextRange(out, content, first, index); + } + continue; + } + + // + // Handle other nodes + // + if (!firstNode) { + newline(out); + } + + indent(out, level); + + if (next instanceof Comment) { + printComment(out, (Comment)next); + } + else if (next instanceof Element) { + printElement(out, (Element)next, level, namespaces); + } + else if (next instanceof ProcessingInstruction) { + printProcessingInstruction(out, (ProcessingInstruction)next); + } + else { + // XXX if we get here then we have a illegal content, for + // now we'll just ignore it (probably should throw + // a exception) + } + + index++; + } /* while */ + } + + /** + * This will handle printing of a sequence of <code>{@link CDATA}</code> + * or <code>{@link Text}</code> nodes. It is an error to have any other + * pass this method any other type of node. + * + * @param content <code>List</code> of content to output + * @param start index of first content node (inclusive). + * @param end index of last content node (exclusive). + * @param out <code>Writer</code> to use. + */ + private void printTextRange(Writer out, List content, int start, int end + ) throws IOException { + String previous; // Previous text printed + Object node; // Next node to print + String next; // Next text to print + + previous = null; + + // Remove leading whitespace-only nodes + start = skipLeadingWhite(content, start); + + int size = content.size(); + if (start < size) { + // And remove trialing whitespace-only nodes + end = skipTrailingWhite(content, end); + + for (int i = start; i < end; i++) { + node = content.get(i); + + // Get the unmangled version of the text + // we are about to print + if (node instanceof Text) { + next = ((Text) node).getText(); + } + else if (node instanceof EntityRef) { + next = "&" + ((EntityRef) node).getValue() + ";"; + } + else { + throw new IllegalStateException("Should see only " + + "CDATA, Text, or EntityRef"); + } + + // This may save a little time + if (next == null || "".equals(next)) { + continue; + } + + // Determine if we need to pad the output (padding is + // only need in trim or normalizing mode) + if (previous != null) { // Not 1st node + //if (currentFormat.mode == Format.TextMode.NORMALIZE || + // currentFormat.mode == Format.TextMode.TRIM) { + if ((endsWithWhite(previous)) || + (startsWithWhite(next))) { + out.write(" "); + } + //} + } + + // Print the node + if (node instanceof CDATA) { + printCDATA(out, (CDATA) node); + } + else if (node instanceof EntityRef) { + printEntityRef(out, (EntityRef) node); + } + else { + printString(out, next); + } + + previous = next; + } + } + } + + /** + * This will handle printing of any needed <code>{@link Namespace}</code> + * declarations. + * + * @param ns <code>Namespace</code> to print definition of + * @param out <code>Writer</code> to use. + */ + private void printNamespace(Writer out, Namespace ns, + EclipseNamespaceStack namespaces) + throws IOException { + String prefix = ns.getPrefix(); + String uri = ns.getURI(); + + // Already printed namespace decl? + if (uri.equals(namespaces.getURI(prefix))) { + return; + } + + out.write(" xmlns"); + if (!prefix.equals("")) { + out.write(":"); + out.write(prefix); + } + out.write("=\""); + out.write(uri); + out.write("\""); + namespaces.push(ns); + } + + /** + * This will handle printing of a <code>{@link Attribute}</code> list. + * + * @param attributes <code>List</code> of Attribute objcts + * @param out <code>Writer</code> to use + */ + protected void printAttributes(Writer out, List attributes, Element parent, + EclipseNamespaceStack namespaces) + throws IOException { + + // I do not yet handle the case where the same prefix maps to + // two different URIs. For attributes on the same element + // this is illegal; but as yet we don't throw an exception + // if someone tries to do this + // Set prefixes = new HashSet(); + List<Attribute> atts = new ArrayList<Attribute>(); + for (Object attribute : attributes) { + atts.add((Attribute)((Attribute)attribute).clone()); + } + Collections.sort(atts, new Comparator<Attribute>() { + public int compare(Attribute o1, Attribute o2) { + return o1.getName().compareTo(o2.getName()); + } + }); + for (int i = 0; i < atts.size(); i++) { + Attribute attribute = (Attribute) atts.get(i); + Namespace ns = attribute.getNamespace(); + if ((ns != Namespace.NO_NAMESPACE) && + (ns != Namespace.XML_NAMESPACE)) { + printNamespace(out, ns, namespaces); + } + + out.write(" "); + printQualifiedName(out, attribute); + out.write("="); + + out.write("\""); + out.write(escapeAttributeEntities(attribute.getValue())); + out.write("\""); + } + } + + private void printElementNamespace(Writer out, Element element, + EclipseNamespaceStack namespaces) + throws IOException { + // Add namespace decl only if it's not the XML namespace and it's + // not the NO_NAMESPACE with the prefix "" not yet mapped + // (we do output xmlns="" if the "" prefix was already used and we + // need to reclaim it for the NO_NAMESPACE) + Namespace ns = element.getNamespace(); + if (ns == Namespace.XML_NAMESPACE) { + return; + } + if ( !((ns == Namespace.NO_NAMESPACE) && + (namespaces.getURI("") == null))) { + printNamespace(out, ns, namespaces); + } + } + + private void printAdditionalNamespaces(Writer out, Element element, + EclipseNamespaceStack namespaces) + throws IOException { + List list = element.getAdditionalNamespaces(); + if (list != null) { + for (int i = 0; i < list.size(); i++) { + Namespace additional = (Namespace)list.get(i); + printNamespace(out, additional, namespaces); + } + } + } + + // * * * * * * * * * * Support methods * * * * * * * * * * + // * * * * * * * * * * Support methods * * * * * * * * * * + + /** + * This will print a new line only if the newlines flag was set to + * true. + * + * @param out <code>Writer</code> to use + */ + private void newline(Writer out) throws IOException { + //if (currentFormat.indent != null) { + out.write(lineSeparator); + //} + } + + /** + * This will print indents (only if the newlines flag was + * set to <code>true</code>, and indent is non-null). + * + * @param out <code>Writer</code> to use + * @param level current indent level (number of tabs) + */ + private void indent(Writer out, int level) throws IOException { + //if (currentFormat.indent == null || + // currentFormat.indent.equals("")) { + // return; + //} + + for (int i = 0; i < level; i++) { + out.write("\t"); + } + } + + // Returns the index of the first non-all-whitespace CDATA or Text, + // index = content.size() is returned if content contains + // all whitespace. + // @param start index to begin search (inclusive) + private int skipLeadingWhite(List content, int start) { + if (start < 0) { + start = 0; + } + + int index = start; + int size = content.size(); + //if (currentFormat.mode == Format.TextMode.TRIM_FULL_WHITE + // || currentFormat.mode == Format.TextMode.NORMALIZE + // || currentFormat.mode == Format.TextMode.TRIM) { + while (index < size) { + if (!isAllWhitespace(content.get(index))) { + return index; + } + index++; + } + //} + return index; + } + + // Return the index + 1 of the last non-all-whitespace CDATA or + // Text node, index < 0 is returned + // if content contains all whitespace. + // @param start index to begin search (exclusive) + private int skipTrailingWhite(List content, int start) { + int size = content.size(); + if (start > size) { + start = size; + } + + int index = start; + //if (currentFormat.mode == Format.TextMode.TRIM_FULL_WHITE + // || currentFormat.mode == Format.TextMode.NORMALIZE + // || currentFormat.mode == Format.TextMode.TRIM) { + while (index >= 0) { + if (!isAllWhitespace(content.get(index - 1))) + break; + --index; + } + //} + return index; + } + + // Return the next non-CDATA, non-Text, or non-EntityRef node, + // index = content.size() is returned if there is no more non-CDATA, + // non-Text, or non-EntiryRef nodes + // @param start index to begin search (inclusive) + private static int nextNonText(List content, int start) { + if (start < 0) { + start = 0; + } + + int index = start; + int size = content.size(); + while (index < size) { + Object node = content.get(index); + if (!((node instanceof Text) || (node instanceof EntityRef))) { + return index; + } + index++; + } + return size; + } + + // Determine if a Object is all whitespace + private boolean isAllWhitespace(Object obj) { + String str = null; + + if (obj instanceof String) { + str = (String) obj; + } + else if (obj instanceof Text) { + str = ((Text) obj).getText(); + } + else if (obj instanceof EntityRef) { + return false; + } + else { + return false; + } + + for (int i = 0; i < str.length(); i++) { + if (!isWhitespace(str.charAt(i))) + return false; + } + return true; + } + + // Determine if a string starts with a XML whitespace. + private boolean startsWithWhite(String str) { + if ((str != null) && + (str.length() > 0) && + isWhitespace(str.charAt(0))) { + return true; + } + return false; + } + + // Determine if a string ends with a XML whitespace. + private boolean endsWithWhite(String str) { + if ((str != null) && + (str.length() > 0) && + isWhitespace(str.charAt(str.length() - 1))) { + return true; + } + return false; + } + + // Determine if a character is a XML whitespace. + // XXX should this method be in Verifier + private static boolean isWhitespace(char c) { + if (c==' ' || c=='\n' || c=='\t' || c=='\r' ){ + return true; + } + return false; + } + + /** + * This will take the pre-defined entities in XML 1.0 and + * convert their character representation to the appropriate + * entity reference, suitable for XML attributes. It does not convert + * the single quote (') because it's not necessary as the outputter + * writes attributes surrounded by double-quotes. + * + * @param str <code>String</code> input to escape. + * @return <code>String</code> with escaped content. + */ + public String escapeAttributeEntities(String str) { + StringBuffer buffer; + char ch; + String entity; + //EscapeStrategy strategy = currentFormat.escapeStrategy; + + buffer = null; + for (int i = 0; i < str.length(); i++) { + ch = str.charAt(i); + switch(ch) { + case '<' : + entity = "<"; + break; + case '>' : + entity = ">"; + break; +/* + case '\'' : + entity = "'"; + break; +*/ + case '\"' : + entity = """; + break; + case '&' : + entity = "&"; + break; + case '\r' : + entity = "
"; + break; + case '\t' : + entity = "	"; + break; + case '\n' : + entity = "
"; + break; + default : + //if (strategy.shouldEscape(ch)) { + // entity = "&#x" + Integer.toHexString(ch) + ";"; + //} + //else { + entity = null; + //} + break; + } + if (buffer == null) { + if (entity != null) { + // An entity occurred, so we'll have to use StringBuffer + // (allocate room for it plus a few more entities). + buffer = new StringBuffer(str.length() + 20); + // Copy previous skipped characters and fall through + // to pickup current character + buffer.append(str.substring(0, i)); + buffer.append(entity); + } + } + else { + if (entity == null) { + buffer.append(ch); + } + else { + buffer.append(entity); + } + } + } + + // If there were any entities, return the escaped characters + // that we put in the StringBuffer. Otherwise, just return + // the unmodified input string. + return (buffer == null) ? str : buffer.toString(); + } + + + /** + * This will take the three pre-defined entities in XML 1.0 + * (used specifically in XML elements) and convert their character + * representation to the appropriate entity reference, suitable for + * XML element content. + * + * @param str <code>String</code> input to escape. + * @return <code>String</code> with escaped content. + */ + public String escapeElementEntities(String str) { + if (escapeOutput == false) return str; + + StringBuffer buffer; + char ch; + String entity; + //EscapeStrategy strategy = currentFormat.escapeStrategy; + + buffer = null; + for (int i = 0; i < str.length(); i++) { + ch = str.charAt(i); + switch(ch) { + case '<' : + entity = "<"; + break; + case '>' : + entity = ">"; + break; + case '&' : + entity = "&"; + break; + case '\r' : + entity = "
"; + break; + case '\n' : + entity = lineSeparator; + break; + default : + //if (strategy.shouldEscape(ch)) { + // entity = "&#x" + Integer.toHexString(ch) + ";"; + //} + //else { + entity = null; + //} + break; + } + if (buffer == null) { + if (entity != null) { + // An entity occurred, so we'll have to use StringBuffer + // (allocate room for it plus a few more entities). + buffer = new StringBuffer(str.length() + 20); + // Copy previous skipped characters and fall through + // to pickup current character + buffer.append(str.substring(0, i)); + buffer.append(entity); + } + } + else { + if (entity == null) { + buffer.append(ch); + } + else { + buffer.append(entity); + } + } + } + + // If there were any entities, return the escaped characters + // that we put in the StringBuffer. Otherwise, just return + // the unmodified input string. + return (buffer == null) ? str : buffer.toString(); + } + + /** + * Returns a copy of this XMLOutputter. + */ + public Object clone() { + // Implementation notes: Since all state of an XMLOutputter is + // embodied in simple private instance variables, Object.clone + // can be used. Note that since Object.clone is totally + // broken, we must catch an exception that will never be + // thrown. + try { + return super.clone(); + } + catch (java.lang.CloneNotSupportedException e) { + // even though this should never ever happen, it's still + // possible to fool Java into throwing a + // CloneNotSupportedException. If that happens, we + // shouldn't swallow it. + throw new RuntimeException(e.toString()); + } + } + + /** + * Return a string listing of the settings for this + * XMLOutputter instance. + * + * @return a string listing the settings for this XMLOutputter instance + */ + public String toString() { + StringBuffer buffer = new StringBuffer(); + for (int i = 0; i < userFormat.lineSeparator.length(); i++) { + char ch = userFormat.lineSeparator.charAt(i); + switch (ch) { + case '\r': buffer.append("\\r"); + break; + case '\n': buffer.append("\\n"); + break; + case '\t': buffer.append("\\t"); + break; + default: buffer.append("[" + ((int)ch) + "]"); + break; + } + } + + return ( + "XMLOutputter[omitDeclaration = " + false + ", " + + "encoding = " + CharsetToolkit.UTF8 + ", " + + "omitEncoding = " + false + ", " + + "indent = '" + "\t" + "'" + ", " + + "expandEmptyElements = " + userFormat.expandEmptyElements + ", " + + "lineSeparator = '" + buffer.toString() + "', " + + "textMode = " + userFormat.mode + "]" + ); + } + + /** + * Factory for making new NamespaceStack objects. The NamespaceStack + * created is actually an inner class extending the package protected + * NamespaceStack, as a way to make NamespaceStack "friendly" toward + * subclassers. + */ + private EclipseNamespaceStack createNamespaceStack() { + // actually returns a XMLOutputter.NamespaceStack (see below) + return new EclipseNamespaceStack(); + } + + + // Support method to print a name without using elt.getQualifiedName() + // and thus avoiding a StringBuffer creation and memory churn + private void printQualifiedName(Writer out, Element e) throws IOException { + if (e.getNamespace().getPrefix().length() == 0) { + out.write(e.getName()); + } + else { + out.write(e.getNamespace().getPrefix()); + out.write(':'); + out.write(e.getName()); + } + } + + // Support method to print a name without using att.getQualifiedName() + // and thus avoiding a StringBuffer creation and memory churn + private void printQualifiedName(Writer out, Attribute a) throws IOException { + String prefix = a.getNamespace().getPrefix(); + if ((prefix != null) && (!prefix.equals(""))) { + out.write(prefix); + out.write(':'); + out.write(a.getName()); + } + else { + out.write(a.getName()); + } + } + + // * * * * * * * * * * Deprecated methods * * * * * * * * * * + + /* The methods below here are deprecations of protected methods. We + * don't usually deprecate protected methods, so they're commented out. + * They're left here in case this mass deprecation causes people trouble. + * Since we're getting close to 1.0 it's actually better for people to + * raise issues early though. + */ + +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/EclipseBundle.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/EclipseBundle.java new file mode 100644 index 000000000000..d3c9174d2f4f --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/EclipseBundle.java @@ -0,0 +1,48 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse; + +import com.intellij.CommonBundle; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.PropertyKey; + +import java.lang.ref.Reference; +import java.lang.ref.SoftReference; +import java.util.ResourceBundle; + +public class EclipseBundle { + private static Reference<ResourceBundle> ourBundle; + + @NonNls + private static final String BUNDLE = "EclipseBundle"; + + private EclipseBundle() { + } + + public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static ResourceBundle getBundle() { + ResourceBundle bundle = null; + if (ourBundle != null) bundle = ourBundle.get(); + if (bundle == null) { + bundle = ResourceBundle.getBundle(BUNDLE); + ourBundle = new SoftReference<ResourceBundle>(bundle); + } + return bundle; + } +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/CachedXmlDocumentSet.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/CachedXmlDocumentSet.java new file mode 100644 index 000000000000..548d19048989 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/CachedXmlDocumentSet.java @@ -0,0 +1,251 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse.config; + +import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.impl.storage.FileSet; +import com.intellij.openapi.util.Computable; +import com.intellij.openapi.util.JDOMUtil; +import com.intellij.openapi.vfs.LocalFileSystem; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.util.containers.HashMap; +import com.intellij.util.io.fs.IFile; +import org.jdom.Document; +import org.jdom.JDOMException; +import org.jdom.output.EclipseJDOMUtil; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.io.*; +import java.util.*; + +public class CachedXmlDocumentSet implements FileSet { + protected final Map<String, String> nameToDir = new HashMap<String, String>(); + protected final Map<String, Document> savedContent = new HashMap<String, Document>(); + protected final Map<String, Document> modifiedContent = new HashMap<String, Document>(); + protected final Set<String> deletedContent = new HashSet<String>(); + private final Project project; + + public CachedXmlDocumentSet(Project project) { + this.project = project; + } + + public Document read (final String name) throws IOException, JDOMException { + return (Document)load(name).clone(); + } + + public void write(Document document, String name) throws IOException { + update((Document)document.clone(), name); + } + + public String getParent(final String name) { + return nameToDir.get(name); + } + + public void register(final String name, final String path) { + nameToDir.put(name, path); + } + + protected void assertKnownName(final String name) { + assert nameToDir.containsKey(name) : name; + } + + public boolean exists(String name) { + assertKnownName(name); + return !deletedContent.contains(name) && getVFile(name) != null; + } + + @Nullable + protected VirtualFile getVFile(final String name) { + final VirtualFile file = LocalFileSystem.getInstance().findFileByIoFile(new File(getParent(name), name)); + if (file != null) { + file.refresh(false, true); + if (!file.isValid()) return null; + } + return file; + } + + @NotNull + private VirtualFile getOrCreateVFile(final String name) throws IOException { + final VirtualFile vFile = getVFile(name); + if (vFile != null) { + return vFile; + } + else { + final VirtualFile vDir = LocalFileSystem.getInstance().findFileByIoFile(new File(getParent(name))); + if (vDir == null) { + throw new IOException(name + ": file not found"); + } + final IOException[] ex = new IOException[1]; + final VirtualFile file = ApplicationManager.getApplication().runWriteAction(new Computable<VirtualFile>() { + public VirtualFile compute() { + try { + return vDir.createChildData(this, name); + } + catch (IOException e) { + ex[0] = e; + return null; + } + } + }); + if (ex[0] != null) throw ex[0]; + return file; + } + } + + protected Document load(final String name) throws IOException, JDOMException { + assertKnownName(name); + final Document logical = modifiedContent.get(name); + if (logical != null) { + return logical; + } + + Document physical = savedContent.get(name); + if (physical == null) { + final VirtualFile vFile = deletedContent.contains(name) ? null : getVFile(name); + if (vFile == null) { + throw new IOException(name + ": file does not exist"); + } + final InputStream is = vFile.getInputStream(); + try { + physical = JDOMUtil.loadDocument(is); + } + finally { + is.close(); + } + savedContent.put(name, physical); + } + return physical; + + } + + public void preload() { + for (String key : nameToDir.keySet()) { + try { + load(key); + } + catch (IOException ignore) { + } + catch (JDOMException ignore) { + } + } + } + + public void update(Document content, final String name) { + assertKnownName(name); + modifiedContent.put(name, content); + deletedContent.remove(name); + } + + public void delete(String name) { + modifiedContent.remove(name); + savedContent.remove(name); + deletedContent.add(name); + //nameToDir.remove(name); + } + + public void listFiles(final List<VirtualFile> list) { + Set<String> existingFiles = new HashSet<String>(savedContent.keySet()); + existingFiles.addAll(modifiedContent.keySet()); + for (String key : existingFiles) { + try { + if(getVFile(key)==null) { + savedContent.remove(key); // deleted on disk + } + list.add(getOrCreateVFile(key)); + } + catch (IOException ignore) { + } + } + Set<String> newFiles = new HashSet<String>(nameToDir.keySet()); + newFiles.removeAll(existingFiles); + for (String name : newFiles) { + VirtualFile vFile = getVFile(name); + if (vFile != null) { + list.add(vFile); + } + } + } + + @Override + public void listModifiedFiles(List<VirtualFile> list) { + for (String key : modifiedContent.keySet()) { + try { + if (hasChanged(key)) { + list.add(getOrCreateVFile(key)); + } + } + catch (IOException ignore) { + } + } + } + + public boolean hasChanged() { + for (String key : modifiedContent.keySet()) { + if (hasChanged(key)) { + return true; + } + } + return !deletedContent.isEmpty(); + } + + private boolean hasChanged(final String key) { + final Document content = modifiedContent.get(key); + final Document physical1 = content == null ? null : content; + final Document physical2 = savedContent.get(key); + if (physical1 != null && physical2 != null) { + return !JDOMUtil.areDocumentsEqual(physical1, physical2); + } + return physical1 != physical2; + } + + public void commit() throws IOException { + for (String key : modifiedContent.keySet()) { + if (hasChanged(key)) { + final Document content = modifiedContent.get(key); + if (content != null) { + final Writer writer = new OutputStreamWriter(getOrCreateVFile(key).getOutputStream(this), "UTF-8"); + try { + EclipseJDOMUtil.output(content, writer, project); + } + finally { + writer.close(); + } + savedContent.put(key, content); + } + } + } + + ApplicationManager.getApplication().runWriteAction(new Runnable() { + public void run() { + for (String deleted : deletedContent) { + VirtualFile file = getVFile(deleted); + if (file != null) { + try { + file.delete(this); + } + catch (IOException ignore) { + } + } + } + deletedContent.clear(); + } + }); + } + + +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseClasspathStorageProvider.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseClasspathStorageProvider.java new file mode 100644 index 000000000000..e458970c8823 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseClasspathStorageProvider.java @@ -0,0 +1,268 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse.config; + +import com.intellij.openapi.components.PathMacroManager; +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.options.ConfigurationException; +import com.intellij.openapi.roots.*; +import com.intellij.openapi.roots.impl.RootModelImpl; +import com.intellij.openapi.roots.impl.storage.ClasspathStorage; +import com.intellij.openapi.roots.impl.storage.ClasspathStorageProvider; +import com.intellij.openapi.roots.libraries.Library; +import com.intellij.openapi.util.InvalidDataException; +import com.intellij.openapi.util.WriteExternalException; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.openapi.vfs.LocalFileSystem; +import com.intellij.openapi.vfs.VfsUtil; +import com.intellij.openapi.vfs.VirtualFile; +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.JDOMException; +import org.jetbrains.annotations.Nls; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.idea.eclipse.ConversionException; +import org.jetbrains.idea.eclipse.EclipseBundle; +import org.jetbrains.idea.eclipse.EclipseXml; +import org.jetbrains.idea.eclipse.IdeaXml; +import org.jetbrains.idea.eclipse.conversion.*; +import org.jetbrains.jps.eclipse.model.JpsEclipseClasspathSerializer; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Set; + +/** + * @author Vladislav.Kaznacheev + */ +public class EclipseClasspathStorageProvider implements ClasspathStorageProvider { + public static final String DESCR = EclipseBundle.message("eclipse.classpath.storage.description"); + + @NonNls + public String getID() { + return JpsEclipseClasspathSerializer.CLASSPATH_STORAGE_ID; + } + + @Nls + public String getDescription() { + return DESCR; + } + + public void assertCompatible(final ModuleRootModel model) throws ConfigurationException { + final String moduleName = model.getModule().getName(); + for (OrderEntry entry : model.getOrderEntries()) { + if (entry instanceof LibraryOrderEntry) { + final LibraryOrderEntry libraryEntry = (LibraryOrderEntry)entry; + if (libraryEntry.isModuleLevel()) { + final Library library = libraryEntry.getLibrary(); + if (library == null || + libraryEntry.getRootUrls(OrderRootType.CLASSES).length != 1 || + library.isJarDirectory(library.getUrls(OrderRootType.CLASSES)[0])) { + throw new ConfigurationException( + "Library \'" + + entry.getPresentableName() + + "\' from module \'" + + moduleName + + "\' dependencies is incompatible with eclipse format which supports only one library content root"); + } + } + } + } + if (model.getContentRoots().length == 0) { + throw new ConfigurationException("Module \'" + moduleName + "\' has no content roots thus is not compatible with eclipse format"); + } + final String output = model.getModuleExtension(CompilerModuleExtension.class).getCompilerOutputUrl(); + final String contentRoot = getContentRoot(model); + if (output == null || + !StringUtil.startsWith(VfsUtil.urlToPath(output), contentRoot) && + PathMacroManager.getInstance(model.getModule()).collapsePath(output).equals(output)) { + throw new ConfigurationException("Module \'" + + moduleName + + "\' output path is incompatible with eclipse format which supports output under content root only.\nPlease make sure that \"Inherit project compile output path\" is not selected"); + } + } + + public void detach(Module module) { + EclipseModuleManagerImpl.getInstance(module).setDocumentSet(null); + } + + public ClasspathConverter createConverter(Module module) { + return new EclipseClasspathConverter(module); + } + + public String getContentRoot(ModuleRootModel model) { + final VirtualFile contentRoot = EPathUtil.getContentRoot(model); + if (contentRoot != null) return contentRoot.getPath(); + return model.getContentRoots()[0].getPath(); + } + + @Override + public void modulePathChanged(Module module, String path) { + final EclipseModuleManagerImpl moduleManager = EclipseModuleManagerImpl.getInstance(module); + if (moduleManager != null) { + moduleManager.setDocumentSet(null); + } + } + + public static void registerFiles(final CachedXmlDocumentSet fileCache, + final Module module, + final String moduleRoot, + final String storageRoot) { + fileCache.register(EclipseXml.CLASSPATH_FILE, storageRoot); + fileCache.register(EclipseXml.PROJECT_FILE, storageRoot); + fileCache.register(EclipseXml.PLUGIN_XML_FILE, storageRoot); + fileCache.register(module.getName() + EclipseXml.IDEA_SETTINGS_POSTFIX, moduleRoot); + } + + static CachedXmlDocumentSet getFileCache(final Module module) { + final EclipseModuleManagerImpl moduleManager = EclipseModuleManagerImpl.getInstance(module); + CachedXmlDocumentSet fileCache = moduleManager != null ? moduleManager.getDocumentSet() : null; + if (fileCache == null) { + fileCache = new CachedXmlDocumentSet(module.getProject()); + if (moduleManager != null) { + moduleManager.setDocumentSet(fileCache); + } + registerFiles(fileCache, module, ClasspathStorage.getModuleDir(module), ClasspathStorage.getStorageRootFromOptions(module)); + fileCache.preload(); + } + return fileCache; + } + + public void moduleRenamed(final Module module, String newName) { + if (ClasspathStorage.getStorageType(module).equals(JpsEclipseClasspathSerializer.CLASSPATH_STORAGE_ID)) { + try { + final CachedXmlDocumentSet documentSet = getFileCache(module); + + + final String oldEmlName = module.getName() + EclipseXml.IDEA_SETTINGS_POSTFIX; + + final String root = documentSet.getParent(oldEmlName); + final File source = new File(root, oldEmlName); + if (source.exists()) { + final File target = new File(root, newName + EclipseXml.IDEA_SETTINGS_POSTFIX); + FileUtil.rename(source, target); + LocalFileSystem.getInstance().refreshAndFindFileByIoFile(target); + } + final CachedXmlDocumentSet fileCache = getFileCache(module); + DotProjectFileHelper.saveDotProjectFile(module, fileCache.getParent(EclipseXml.PROJECT_FILE)); + fileCache.delete(oldEmlName); + fileCache.register(newName + EclipseXml.IDEA_SETTINGS_POSTFIX, ClasspathStorage.getModuleDir(module)); + fileCache.load(newName + EclipseXml.IDEA_SETTINGS_POSTFIX); + } + catch (IOException ignore) { + } + catch (JDOMException e) { + + } + } + } + + + public static class EclipseClasspathConverter implements ClasspathConverter { + + private final Module module; + private static final Logger LOG = Logger.getInstance("#" + EclipseClasspathConverter.class.getName()); + + public EclipseClasspathConverter(final Module module) { + this.module = module; + } + + public CachedXmlDocumentSet getFileSet() { + return getFileCache(module); + } + + public Set<String> getClasspath(ModifiableRootModel model, final Element element) throws IOException, InvalidDataException { + try { + final HashSet<String> usedVariables = new HashSet<String>(); + final CachedXmlDocumentSet documentSet = getFileSet(); + final String path = documentSet.getParent(EclipseXml.PROJECT_FILE); + LOG.assertTrue(documentSet.exists(EclipseXml.PROJECT_FILE)); + final EclipseClasspathReader classpathReader = new EclipseClasspathReader(path, module.getProject(), null); + classpathReader.init(model); + if (documentSet.exists(EclipseXml.CLASSPATH_FILE)) { + classpathReader.readClasspath(model, new ArrayList<String>(), new ArrayList<String>(), usedVariables, new HashSet<String>(), null, + documentSet.read(EclipseXml.CLASSPATH_FILE).getRootElement()); + } + else { + EclipseClasspathReader.setOutputUrl(model, path + "/bin"); + } + final String eml = model.getModule().getName() + EclipseXml.IDEA_SETTINGS_POSTFIX; + if (documentSet.exists(eml)) { + IdeaSpecificSettings.readIDEASpecific(model, documentSet, eml); + } + else { + model.getModuleExtension(CompilerModuleExtension.class).setExcludeOutput(false); + } + + ((RootModelImpl)model).writeExternal(element); + return usedVariables; + } + catch (ConversionException e) { + throw new InvalidDataException(e); + } + catch (WriteExternalException e) { + throw new InvalidDataException(e); + } + catch (JDOMException e) { + throw new InvalidDataException(e); + } + } + + public void setClasspath(final ModuleRootModel model) throws IOException, WriteExternalException { + try { + final Element classpathElement = new Element(EclipseXml.CLASSPATH_TAG); + final EclipseClasspathWriter classpathWriter = new EclipseClasspathWriter(model); + final CachedXmlDocumentSet fileSet = getFileSet(); + + Element element; + try { + element = fileSet.read(EclipseXml.CLASSPATH_FILE).getRootElement(); + } + catch (Exception e) { + element = null; + } + + if (element != null || model.getSourceRoots().length > 0 || model.getOrderEntries().length > 2) { + classpathWriter.writeClasspath(classpathElement, element); + fileSet.write(new Document(classpathElement), EclipseXml.CLASSPATH_FILE); + } + + try { + fileSet.read(EclipseXml.PROJECT_FILE); + } + catch (Exception e) { + DotProjectFileHelper.saveDotProjectFile(module, fileSet.getParent(EclipseXml.PROJECT_FILE)); + } + + final Element ideaSpecific = new Element(IdeaXml.COMPONENT_TAG); + final String emlFilename = model.getModule().getName() + EclipseXml.IDEA_SETTINGS_POSTFIX; + if (IdeaSpecificSettings.writeIDEASpecificClasspath(ideaSpecific, model)) { + fileSet.write(new Document(ideaSpecific), emlFilename); + } + else { + fileSet.delete(emlFilename); + } + } + catch (ConversionException e) { + throw new WriteExternalException(e.getMessage()); + } + } + } +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseFileType.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseFileType.java new file mode 100644 index 000000000000..2cdc36904dbc --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseFileType.java @@ -0,0 +1,67 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse.config; + +import com.intellij.openapi.fileTypes.FileType; +import com.intellij.openapi.vfs.CharsetToolkit; +import com.intellij.openapi.vfs.VirtualFile; +import icons.EclipseIcons; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.idea.eclipse.EclipseBundle; +import org.jetbrains.idea.eclipse.EclipseXml; + +import javax.swing.*; + +/** + * Author: Vladislav.Kaznacheev + */ +public class EclipseFileType implements FileType { + @NotNull + @NonNls + public String getName() { + return "Eclipse"; + } + + @NotNull + public String getDescription() { + return EclipseBundle.message("eclipse.file.type.descr"); + } + + @NotNull + @NonNls + public String getDefaultExtension() { + return EclipseXml.CLASSPATH_EXT; + } + + @Nullable + public Icon getIcon() { + return EclipseIcons.Eclipse; + } + + public boolean isBinary() { + return false; + } + + public boolean isReadOnly() { + return false; + } + + public String getCharset(@NotNull final VirtualFile file, final byte[] content) { + return CharsetToolkit.UTF8; + } +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseFileTypeFactory.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseFileTypeFactory.java new file mode 100644 index 000000000000..77e64e6dc3b5 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseFileTypeFactory.java @@ -0,0 +1,33 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse.config; + +import com.intellij.openapi.fileTypes.FileType; +import com.intellij.openapi.fileTypes.FileTypeConsumer; +import com.intellij.openapi.fileTypes.FileTypeFactory; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.idea.eclipse.EclipseXml; + +/** + * Author: Vladislav.Kaznacheev + */ +public class EclipseFileTypeFactory extends FileTypeFactory { + private final static FileType fileType = new EclipseFileType(); + + public void createFileTypes(final @NotNull FileTypeConsumer consumer) { + consumer.consume(fileType, EclipseXml.CLASSPATH_EXT + ";" + EclipseXml.PROJECT_EXT); + } +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseModuleManagerImpl.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseModuleManagerImpl.java new file mode 100644 index 000000000000..8ac2a9d1c500 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseModuleManagerImpl.java @@ -0,0 +1,285 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.idea.eclipse.config; + +import com.intellij.openapi.components.PersistentStateComponent; +import com.intellij.openapi.components.State; +import com.intellij.openapi.components.Storage; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleServiceManager; +import com.intellij.openapi.roots.impl.storage.ClasspathStorage; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.util.ArrayUtil; +import org.jdom.Element; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.idea.eclipse.EclipseModuleManager; +import org.jetbrains.jps.eclipse.model.JpsEclipseClasspathSerializer; + +import java.util.*; + +@State( + name = "EclipseModuleManager", + storages = { + @Storage( + file = "$MODULE_FILE$" + ) + } +) +public class EclipseModuleManagerImpl implements EclipseModuleManager, PersistentStateComponent<Element> { + @NonNls private static final String VALUE_ATTR = "value"; + @NonNls private static final String VARELEMENT = "varelement"; + @NonNls private static final String VAR_ATTRIBUTE = "var"; + @NonNls private static final String CONELEMENT = "conelement"; + @NonNls private static final String FORCED_JDK = "forced_jdk"; + @NonNls private static final String SRC_DESCRIPTION = "src_description"; + @NonNls private static final String EXPECTED_POSITION = "expected_position"; + @NonNls private static final String SRC_FOLDER = "src_folder"; + private CachedXmlDocumentSet myDocumentSet; + private final Map<String, String> myEclipseVariablePaths = new LinkedHashMap<String, String>(); + private final Set<String> myEclipseUrls = new LinkedHashSet<String>(); + private final Set<String> myUnknownCons = new LinkedHashSet<String>(); + private boolean myForceConfigureJDK = false; + @NonNls private static final String SRC_PREFIX = "src:"; + @NonNls private static final String SRC_LINK_PREFIX = "linksrc:"; + @NonNls private static final String LINK_PREFIX = "link:"; + @NonNls private static final String PREFIX_ATTR = "kind"; + private final Module myModule; + @NonNls private static final String LIBELEMENT = "libelement"; + private int myExpectedModuleSourcePlace; + private Map<String, Integer> mySrcPlace = new LinkedHashMap<String, Integer>(); + private String myInvalidJdk; + + private Set<String> myGroovyDslSupport = new LinkedHashSet<String>(); + + public EclipseModuleManagerImpl(Module module) { + myModule = module; + } + + @Override + public void setInvalidJdk(String invalidJdk) { + myInvalidJdk = invalidJdk; + } + + @Override + public String getInvalidJdk() { + return myInvalidJdk; + } + + @Override + public void addGroovySupport(String name) { + myGroovyDslSupport.add(name); + } + + @Override + public String[] getGroovySupport() { + return ArrayUtil.toStringArray(myGroovyDslSupport); + } + + public static EclipseModuleManagerImpl getInstance(Module module) { + return ModuleServiceManager.getService(module, EclipseModuleManagerImpl.class); + } + + public CachedXmlDocumentSet getDocumentSet() { + return myDocumentSet; + } + + public void setDocumentSet(final CachedXmlDocumentSet documentSet) { + myDocumentSet = documentSet; + } + + @Override + public void registerEclipseVariablePath(String path, String var) { + myEclipseVariablePaths.put(path, var); + } + + @Override + public void registerEclipseSrcVariablePath(String path, String var) { + myEclipseVariablePaths.put(SRC_PREFIX + path, var); + } + + @Override + public void registerEclipseLinkedSrcVarPath(String path, String var) { + myEclipseVariablePaths.put(SRC_LINK_PREFIX + path, var); + } + + @Override + public String getEclipseLinkedSrcVariablePath(String path) { + return myEclipseVariablePaths.get(SRC_LINK_PREFIX + path); + } + + @Override + public void registerEclipseLinkedVarPath(String path, String var) { + myEclipseVariablePaths.put(LINK_PREFIX + path, var); + } + + @Override + public String getEclipseLinkedVarPath(String path) { + return myEclipseVariablePaths.get(LINK_PREFIX + path); + } + + @Override + public String getEclipseVariablePath(String path) { + return myEclipseVariablePaths.get(path); + } + + @Override + public String getEclipseSrcVariablePath(String path) { + return myEclipseVariablePaths.get(SRC_PREFIX + path); + } + + @Override + public void registerUnknownCons(String con) { + myUnknownCons.add(con); + } + + @Override + public Set<String> getUnknownCons() { + return myUnknownCons; + } + + @Override + public boolean isForceConfigureJDK() { + return myForceConfigureJDK; + } + + @Override + public void setForceConfigureJDK() { + myForceConfigureJDK = true; + myExpectedModuleSourcePlace++; + } + + @Override + public void registerEclipseLibUrl(String url) { + myEclipseUrls.add(url); + } + + @Override + public boolean isEclipseLibUrl(String url) { + return myEclipseUrls.contains(url); + } + + @Override + public Element getState() { + if (!ClasspathStorage.getStorageType(myModule).equals(JpsEclipseClasspathSerializer.CLASSPATH_STORAGE_ID)) { + if (!myEclipseUrls.isEmpty() || !myEclipseVariablePaths.isEmpty() || myForceConfigureJDK || !myUnknownCons.isEmpty()) { + Element root = new Element("EclipseModuleSettings"); + for (String eclipseUrl : myEclipseUrls) { + final Element libElement = new Element(LIBELEMENT); + libElement.setAttribute(VALUE_ATTR, eclipseUrl); + root.addContent(libElement); + } + for (String var : myEclipseVariablePaths.keySet()) { + Element varElement = new Element(VARELEMENT); + if (var.startsWith(SRC_PREFIX)) { + varElement.setAttribute(VAR_ATTRIBUTE, StringUtil.trimStart(var, SRC_PREFIX)); + varElement.setAttribute(PREFIX_ATTR, SRC_PREFIX); + } else if (var.startsWith(SRC_LINK_PREFIX)) { + varElement.setAttribute(VAR_ATTRIBUTE, StringUtil.trimStart(var, SRC_LINK_PREFIX)); + varElement.setAttribute(PREFIX_ATTR, SRC_LINK_PREFIX); + } else if (var.startsWith(LINK_PREFIX)) { + varElement.setAttribute(VAR_ATTRIBUTE, StringUtil.trimStart(var, LINK_PREFIX)); + varElement.setAttribute(PREFIX_ATTR, LINK_PREFIX); + } + else { + varElement.setAttribute(VAR_ATTRIBUTE, var); + } + varElement.setAttribute(VALUE_ATTR, myEclipseVariablePaths.get(var)); + root.addContent(varElement); + } + for (String unknownCon : myUnknownCons) { + Element conElement = new Element(CONELEMENT); + conElement.setAttribute(VALUE_ATTR, unknownCon); + root.addContent(conElement); + } + + if (myForceConfigureJDK) { + root.setAttribute(FORCED_JDK, String.valueOf(true)); + } + + final Element srcDescriptionElement = new Element(SRC_DESCRIPTION); + srcDescriptionElement.setAttribute(EXPECTED_POSITION, String.valueOf(myExpectedModuleSourcePlace)); + for (String srcUrl : mySrcPlace.keySet()) { + final Element srcFolder = new Element(SRC_FOLDER); + srcFolder.setAttribute(VALUE_ATTR, srcUrl); + srcFolder.setAttribute(EXPECTED_POSITION, mySrcPlace.get(srcUrl).toString()); + srcDescriptionElement.addContent(srcFolder); + } + root.addContent(srcDescriptionElement); + + return root; + } + } + return null; + } + + @Override + public void loadState(Element state) { + clear(); + + for (Object o : state.getChildren(LIBELEMENT)) { + myEclipseUrls.add(((Element)o).getAttributeValue(VALUE_ATTR)); + } + + for (Object o : state.getChildren(VARELEMENT)) { + final String prefix = ((Element)o).getAttributeValue(PREFIX_ATTR); + myEclipseVariablePaths.put(((Element)o).getAttributeValue(VAR_ATTRIBUTE), (prefix != null ? prefix : "") + ((Element)o).getAttributeValue(VALUE_ATTR)); + } + + for (Object o : state.getChildren(CONELEMENT)) { + myUnknownCons.add(((Element)o).getAttributeValue(VALUE_ATTR)); + } + + final String forcedJdk = state.getAttributeValue(FORCED_JDK); + myForceConfigureJDK = forcedJdk != null && Boolean.parseBoolean(forcedJdk); + + final Element srcDescriptionElement = state.getChild(SRC_DESCRIPTION); + if (srcDescriptionElement != null) { + myExpectedModuleSourcePlace = Integer.parseInt(srcDescriptionElement.getAttributeValue(EXPECTED_POSITION)); + for (Object o : srcDescriptionElement.getChildren(SRC_FOLDER)) { + mySrcPlace.put(((Element)o).getAttributeValue(VALUE_ATTR), Integer.parseInt(((Element)o).getAttributeValue(EXPECTED_POSITION))); + } + } + } + + private void clear() { + myEclipseUrls.clear(); + myEclipseVariablePaths.clear(); + myUnknownCons.clear(); + mySrcPlace.clear(); + myGroovyDslSupport.clear(); + } + + @Override + public void setExpectedModuleSourcePlace(int expectedModuleSourcePlace) { + myExpectedModuleSourcePlace = expectedModuleSourcePlace; + } + + @Override + public boolean isExpectedModuleSourcePlace(int expectedPlace) { + return myExpectedModuleSourcePlace == expectedPlace; + } + + @Override + public void registerSrcPlace(String srcUrl, int placeIdx) { + mySrcPlace.put(srcUrl, placeIdx); + } + + @Override + public Integer getSrcPlace(String srcUtl) { + return mySrcPlace.get(srcUtl); + } +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/DotProjectFileHelper.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/DotProjectFileHelper.java new file mode 100644 index 000000000000..20644e9d1f3b --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/DotProjectFileHelper.java @@ -0,0 +1,71 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 16-Mar-2009 + */ +package org.jetbrains.idea.eclipse.conversion; + +import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.module.JavaModuleType; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleType; +import com.intellij.openapi.util.JDOMUtil; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.vfs.LocalFileSystem; +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.JDOMException; +import org.jdom.output.EclipseJDOMUtil; +import org.jetbrains.idea.eclipse.EclipseXml; + +import java.io.File; +import java.io.IOException; + +public class DotProjectFileHelper { + private static final Logger LOG = Logger.getInstance("#" + DotProjectFileHelper.class.getName()); + + private DotProjectFileHelper() { + } + + public static void saveDotProjectFile(Module module, String storageRoot) throws IOException { + try { + final Document doc; + if (ModuleType.get(module) instanceof JavaModuleType) { + doc = JDOMUtil.loadDocument(DotProjectFileHelper.class.getResource("template.project.xml")); + } else { + doc = JDOMUtil.loadDocument(DotProjectFileHelper.class.getResource("template.empty.project.xml")); + } + + final Element nameElement = doc.getRootElement().getChild(EclipseXml.NAME_TAG); + nameElement.setText(module.getName()); + + final File projectFile = new File(storageRoot, EclipseXml.PROJECT_FILE); + if (!FileUtil.createIfDoesntExist(projectFile)) return; + EclipseJDOMUtil.output(doc, projectFile, module.getProject()); + ApplicationManager.getApplication().runWriteAction(new Runnable() { + public void run() { + LocalFileSystem.getInstance().refreshAndFindFileByPath(FileUtil.toSystemIndependentName(projectFile.getPath())); + } + }); + } + catch (JDOMException e) { + LOG.error(e); + } + } +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EJavadocUtil.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EJavadocUtil.java new file mode 100644 index 000000000000..eed7b67e7c3b --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EJavadocUtil.java @@ -0,0 +1,239 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 25-Mar-2010 + */ +package org.jetbrains.idea.eclipse.conversion; + +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleManager; +import com.intellij.openapi.module.ModuleUtil; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.JavadocOrderRootType; +import com.intellij.openapi.roots.LibraryOrderEntry; +import com.intellij.openapi.roots.ModuleRootManager; +import com.intellij.openapi.roots.ModuleRootModel; +import com.intellij.openapi.roots.libraries.Library; +import com.intellij.openapi.util.Comparing; +import com.intellij.openapi.util.SystemInfo; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.openapi.vfs.*; +import com.intellij.openapi.vfs.ex.http.HttpFileSystem; +import org.jdom.Element; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.idea.eclipse.EPathCommonUtil; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import static org.jetbrains.idea.eclipse.EclipseXml.*; +import static org.jetbrains.idea.eclipse.conversion.EPathUtil.*; + +/** + * Eclipse javadoc format: + * <ul> + * <li>jar:platform:/resource/project_name/relative_path_to_zip|jar!/path_inside - current or another + * <li>jar:file:/absolute_path_to_zip|jar!/path_inside + * <li>file:/absolute_path + * <li>http://www.javadoc.url + * </ul> + */ +public class EJavadocUtil { + private EJavadocUtil() { + } + + static void appendJavadocRoots(Element element, + ModuleRootModel model, + final List<String> currentRoots, + Library.ModifiableModel modifiableModel) { + final Element attributes = element.getChild("attributes"); + if (attributes == null) { + return; + } + for (Object o : attributes.getChildren("attribute")) { + if (Comparing.strEqual(((Element)o).getAttributeValue("name"), JAVADOC_LOCATION)) { + Element attribute = (Element)o; + String javadocPath = attribute.getAttributeValue("value"); + if (!SystemInfo.isWindows) { + javadocPath = javadocPath.replaceFirst(FILE_PROTOCOL, FILE_PROTOCOL + "/"); + } + modifiableModel.addRoot(toIdeaJavadocUrl(model, javadocPath, currentRoots), JavadocOrderRootType.getInstance()); + } + } + } + + private static String toIdeaJavadocUrl(ModuleRootModel model, String javadocPath, List<String> currentRoots) { + if (javadocPath.startsWith(FILE_PROTOCOL)) { + if (new File(javadocPath.substring(FILE_PROTOCOL.length())).exists()) { + return VfsUtil.pathToUrl(javadocPath.substring(FILE_PROTOCOL.length())); + } + } + else { + final String protocol = VirtualFileManager.extractProtocol(javadocPath); + if (Comparing.strEqual(protocol, HttpFileSystem.getInstance().getProtocol())) { + return javadocPath; + } + else if (javadocPath.startsWith(JAR_PREFIX)) { + final String jarJavadocPath = javadocPath.substring(JAR_PREFIX.length()); + if (jarJavadocPath.startsWith(PLATFORM_PROTOCOL)) { + final String relativeToPlatform = jarJavadocPath.substring(PLATFORM_PROTOCOL.length() + "resource".length()); // starts with leading / + final VirtualFile currentRoot = getContentRoot(model); + final String currentModulePath = (currentRoot != null ? currentRoot.getParent().getPath() : model.getModule().getProject().getBaseDir().getPath()) + relativeToPlatform; + if (isJarFileExist(currentModulePath)) { + return VirtualFileManager.constructUrl(JarFileSystem.PROTOCOL, currentModulePath); + } + else { + final String moduleName = EPathCommonUtil.getRelativeModuleName(relativeToPlatform); + final String relativeToModulePathWithJarSuffix = EPathCommonUtil.getRelativeToModulePath(relativeToPlatform); + final String relativeToModulePath = stripPathInsideJar(relativeToModulePathWithJarSuffix); + final Module otherModule = ModuleManager.getInstance(model.getModule().getProject()).findModuleByName(moduleName); + String url = null; + if (otherModule != null && otherModule != model.getModule()) { + url = expandEclipseRelative2OtherModule(otherModule, relativeToModulePath); + } + else if (currentRoots != null) { + url = EPathCommonUtil.expandEclipseRelative2ContentRoots(currentRoots, moduleName, relativeToModulePath); + } + + if (url != null) { + assert relativeToModulePathWithJarSuffix != null; + assert relativeToModulePath != null; + if (relativeToModulePath.length() < relativeToModulePathWithJarSuffix.length()) { + url += relativeToModulePathWithJarSuffix.substring(relativeToModulePath.length()); + } + return VirtualFileManager.constructUrl(JarFileSystem.PROTOCOL, VfsUtil.urlToPath(url)); + } + } + } + else if (jarJavadocPath.startsWith(FILE_PROTOCOL)) { + final String localFile = jarJavadocPath.substring(FILE_PROTOCOL.length()); + if (isJarFileExist(localFile)) { + return VirtualFileManager.constructUrl(JarFileSystem.PROTOCOL, localFile); + } + } + } + } + return javadocPath; + } + + @Nullable + private static String stripPathInsideJar(@Nullable String relativeToModulePathWithJarSuffix) { + String relativeToModulePath = relativeToModulePathWithJarSuffix; + if (relativeToModulePath != null) { + int jarSufIdx = relativeToModulePathWithJarSuffix.indexOf(JarFileSystem.JAR_SEPARATOR); + if (jarSufIdx != -1) { + relativeToModulePath = relativeToModulePath.substring(0, jarSufIdx); + } + } + return relativeToModulePath; + } + + static boolean isJarFileExist(String path) { + final int jarSufIdx = path.indexOf(JarFileSystem.JAR_SEPARATOR); + if (jarSufIdx != -1) { + path = path.substring(0, jarSufIdx); + } + return new File(path).exists(); + } + + private static String toEclipseJavadocPath(ModuleRootModel model, String javadocPath) { + final String protocol = VirtualFileManager.extractProtocol(javadocPath); + if (!Comparing.strEqual(protocol, HttpFileSystem.getInstance().getProtocol())) { + final String path = VfsUtil.urlToPath(javadocPath); + final VirtualFile contentRoot = getContentRoot(model); + final Project project = model.getModule().getProject(); + final VirtualFile baseDir = contentRoot != null ? contentRoot.getParent() : project.getBaseDir(); + if (Comparing.strEqual(protocol, JarFileSystem.getInstance().getProtocol())) { + final VirtualFile javadocFile = + JarFileSystem.getInstance().getVirtualFileForJar(VirtualFileManager.getInstance().findFileByUrl(javadocPath)); + if (javadocFile != null) { + final String relativeUrl; + if (contentRoot != null && VfsUtilCore.isAncestor(contentRoot, javadocFile, false)) { + relativeUrl = "/" + VfsUtilCore.getRelativePath(javadocFile, baseDir, '/'); + } else { + relativeUrl = collapse2eclipseRelative2OtherModule(project, javadocFile); + } + if (relativeUrl != null) { + if (!javadocPath.contains(JarFileSystem.JAR_SEPARATOR)) { + javadocPath = StringUtil.trimEnd(javadocPath, "/") + JarFileSystem.JAR_SEPARATOR; + } + javadocPath = JAR_PREFIX + + PLATFORM_PROTOCOL + + "resource" + + relativeUrl + + javadocPath.substring(javadocFile.getUrl().length() - 1); + } + else { + LOG.info("Javadoc path: " + javadocPath); + final Module module = ModuleUtil.findModuleForFile(javadocFile, project); + LOG.info("Module: " + (module != null ? module.getName() : "not found")); + if (module != null) { + LOG.info("Content roots: " + Arrays.toString(ModuleRootManager.getInstance(module).getContentRoots())); + } + javadocPath = JAR_PREFIX + FILE_PROTOCOL + StringUtil.trimStart(path, "/"); + } + } + else { + javadocPath = JAR_PREFIX + FILE_PROTOCOL + StringUtil.trimStart(path, "/"); + } + } + else if (new File(path).exists()) { + javadocPath = FILE_PROTOCOL + StringUtil.trimStart(path, "/"); + } + } + return javadocPath; + } + + static void setupJavadocAttributes(Element orderEntry, LibraryOrderEntry libraryOrderEntry, final ModuleRootModel model) { + final List<String> eclipseUrls = new ArrayList<String>(); + final String[] docUrls = libraryOrderEntry.getRootUrls(JavadocOrderRootType.getInstance()); + if (docUrls.length > 0) { + eclipseUrls.add(toEclipseJavadocPath(model, docUrls[0])); + } + + final List children = new ArrayList(orderEntry.getChildren(ATTRIBUTES_TAG)); + for (Object o : children) { + final Element attsElement = (Element)o; + final ArrayList attTags = new ArrayList(attsElement.getChildren(ATTRIBUTE_TAG)); + for (Object a : attTags) { + Element attElement = (Element)a; + if (Comparing.strEqual(attElement.getAttributeValue("name"), JAVADOC_LOCATION)) { + final String javadocPath = attElement.getAttributeValue("value"); + if (!eclipseUrls.remove(javadocPath)) { + attElement.detach(); + } + } + } + } + + for (final String docUrl : eclipseUrls) { + Element child = orderEntry.getChild(ATTRIBUTES_TAG); + if (child == null) { + child = new Element(ATTRIBUTES_TAG); + orderEntry.addContent(child); + } + + final Element attrElement = new Element(ATTRIBUTE_TAG); + child.addContent(attrElement); + attrElement.setAttribute("name", JAVADOC_LOCATION); + attrElement.setAttribute("value", docUrl); + } + } +}
\ No newline at end of file diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EPathUtil.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EPathUtil.java new file mode 100644 index 000000000000..9dcbeede2a30 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EPathUtil.java @@ -0,0 +1,257 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 25-Mar-2010 + */ +package org.jetbrains.idea.eclipse.conversion; + +import com.intellij.openapi.application.PathMacros; +import com.intellij.openapi.components.PathMacroManager; +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleManager; +import com.intellij.openapi.module.ModuleUtilCore; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.*; +import com.intellij.openapi.roots.impl.ProjectRootManagerImpl; +import com.intellij.openapi.util.Comparing; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.vfs.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.idea.eclipse.EPathCommonUtil; +import org.jetbrains.idea.eclipse.EclipseXml; +import org.jetbrains.idea.eclipse.EclipseProjectFinder; + +import java.io.File; +import java.util.List; +import java.util.Set; + +public class EPathUtil { + static final Logger LOG = Logger.getInstance("#" + EPathUtil.class.getName()); + + private EPathUtil() { + } + + public static boolean areUrlsPointTheSame(String ideaUrl, String eclipseUrl) { + final String path = VfsUtilCore.urlToPath(eclipseUrl); + if (ideaUrl.contains(path)) { + return true; + } + else { + final String relativeToModulePath = EPathCommonUtil.getRelativeToModulePath(path); + final int relativeIdx = ideaUrl.indexOf(relativeToModulePath); + if (relativeIdx != -1) { + final String pathToProjectFile = VfsUtilCore.urlToPath(ideaUrl.substring(0, relativeIdx)); + if (Comparing.strEqual(EPathCommonUtil.getRelativeModuleName(path), + EclipseProjectFinder.findProjectName(pathToProjectFile))) { + return true; + } + } + } + return false; + } + + /** + * @param otherModule check file relative to module content root + * @param relativeToOtherModule local path (paths inside jars are rejected) + * @return url + */ + @Nullable + static String expandEclipseRelative2OtherModule(final @NotNull Module otherModule, final @Nullable String relativeToOtherModule) { + final VirtualFile[] contentRoots = ModuleRootManager.getInstance(otherModule).getContentRoots(); + for (VirtualFile contentRoot : contentRoots) { + if (relativeToOtherModule == null) { + return contentRoot.getUrl(); + } + final VirtualFile fileUnderModuleContentRoot = contentRoot.findFileByRelativePath(relativeToOtherModule); + if (fileUnderModuleContentRoot != null) { + return fileUnderModuleContentRoot.getUrl(); + } + } + return null; + } + + /** + * @return url + */ + static String expandEclipsePath2Url(final String path, ModifiableRootModel model, final List<String> currentRoots) { + final VirtualFile contentRoot = getContentRoot(model); + LOG.assertTrue(contentRoot != null); + final String rootPath = contentRoot.getPath(); + String url = null; + if (new File(path).exists()) { //absolute path + url = EPathCommonUtil.pathToUrl(path); + } + else { + final String relativePath = new File(rootPath, path).getPath(); //inside current project + final File file = new File(relativePath); + if (file.exists()) { + url = EPathCommonUtil.pathToUrl(relativePath); + } else if (path.startsWith("/")) { //relative to other project + final String moduleName = EPathCommonUtil.getRelativeModuleName(path); + final String relativeToRootPath = EPathCommonUtil.getRelativeToModulePath(path); + + final Module otherModule = ModuleManager.getInstance(model.getModule().getProject()).findModuleByName(moduleName); + if (otherModule != null && otherModule != model.getModule()) { + url = expandEclipseRelative2OtherModule(otherModule, relativeToRootPath); + } + else if (currentRoots != null) { + url = EPathCommonUtil.expandEclipseRelative2ContentRoots(currentRoots, moduleName, relativeToRootPath); + } + } + } + if (url == null) { + url = EPathCommonUtil.pathToUrl(path); + } + + final VirtualFile localFile = VirtualFileManager.getInstance().findFileByUrl(url); + if (localFile != null) { + final VirtualFile jarFile = JarFileSystem.getInstance().getJarRootForLocalFile(localFile); + if (jarFile != null) { + url = jarFile.getUrl(); + } + } + return url; + } + + @Nullable + public static String collapse2eclipseRelative2OtherModule(final @NotNull Project project, final @NotNull VirtualFile file) { + final Module module = ModuleUtilCore.findModuleForFile(file, project); + if (module != null) { + return collapse2eclipsePathRelative2Module(file, module); + } else { //should check all modules then + final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex(); + if (fileIndex.isIgnored(file) || fileIndex.isInLibraryClasses(file)) { + for (Module aModule : ModuleManager.getInstance(project).getModules()) { + final String path = collapse2eclipsePathRelative2Module(file, aModule); + if (path != null) { + return path; + } + } + } + } + return null; + } + + @Nullable + private static String collapse2eclipsePathRelative2Module(VirtualFile file, Module module) { + final VirtualFile[] contentRoots = ModuleRootManager.getInstance(module).getContentRoots(); + for (VirtualFile otherRoot : contentRoots) { + if (VfsUtilCore.isAncestor(otherRoot, file, false)) { + return "/" + module.getName() + "/" + VfsUtilCore.getRelativePath(file, otherRoot, '/'); + } + } + return null; + } + + @Nullable + public static VirtualFile getContentRoot(final ModuleRootModel model) { + final VirtualFile[] contentRoots = model.getContentRoots(); + for (VirtualFile virtualFile : contentRoots) { + if (virtualFile.findChild(EclipseXml.PROJECT_FILE) != null) { + return virtualFile; + } + } + return null; + } + + static String collapse2EclipsePath(final String url, final ModuleRootModel model) { + final Project project = model.getModule().getProject(); + final VirtualFile contentRoot = getContentRoot(model); + VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(url); + if (file != null) { + LOG.assertTrue(file.isValid()); + if (file.getFileSystem() instanceof JarFileSystem) { + final VirtualFile jarFile = JarFileSystem.getInstance().getVirtualFileForJar(file); + if (jarFile == null) { + LOG.assertTrue(false, "Url: \'" + url + "\'; file: " + file); + return ProjectRootManagerImpl.extractLocalPath(url); + } + file = jarFile; + } + if (contentRoot != null && VfsUtilCore.isAncestor(contentRoot, file, false)) { //inside current project + return VfsUtilCore.getRelativePath(file, contentRoot, '/'); + } else { + final String path = collapse2eclipseRelative2OtherModule(project, file); //relative to other project + if (path != null) { + return path; + } + } + return ProjectRootManagerImpl.extractLocalPath(url); //absolute path + } + else { //try to avoid absolute path for deleted file + if (contentRoot != null) { + final String rootUrl = contentRoot.getUrl(); + if (url.startsWith(rootUrl) && url.length() > rootUrl.length()) { + return url.substring(rootUrl.length() + 1); //without leading / + } + } + final VirtualFile projectBaseDir = contentRoot != null ? contentRoot.getParent() : project.getBaseDir(); + assert projectBaseDir != null; + final String projectUrl = projectBaseDir.getUrl(); + if (url.startsWith(projectUrl)) { + return url.substring(projectUrl.length()); //leading / + } + + return ProjectRootManagerImpl.extractLocalPath(url); + } + } + + @Nullable + static String collapse2EclipseVariabledPath(final LibraryOrderEntry libraryOrderEntry, OrderRootType type) { + final VirtualFile[] virtualFiles = libraryOrderEntry.getRootFiles(type); + if (virtualFiles.length > 0) { + VirtualFile jarFile = virtualFiles[0]; + if (jarFile.getFileSystem() instanceof JarFileSystem) { + jarFile = JarFileSystem.getInstance().getVirtualFileForJar(jarFile); + } + if (jarFile == null) { + return null; + } + final Project project = libraryOrderEntry.getOwnerModule().getProject(); + final VirtualFile baseDir = project.getBaseDir(); + final String filePath = jarFile.getPath(); + if (baseDir != null && !VfsUtilCore.isAncestor(baseDir, jarFile, false)) { + final String ideaCollapsed = PathMacroManager.getInstance(project).collapsePath(filePath); + if (ideaCollapsed.contains("..")) return null; + final int index = ideaCollapsed.indexOf('$'); + if (index < 0) return null; + return ideaCollapsed.substring(index).replace("$", ""); + } + } + for (String url : libraryOrderEntry.getRootUrls(type)) { + //check if existing eclipse variable points inside project or doesn't exist + String filePath = VirtualFileManager.extractPath(url); + final int jarSeparatorIdx = filePath.indexOf(JarFileSystem.JAR_SEPARATOR); + if (jarSeparatorIdx > -1) { + filePath = filePath.substring(0, jarSeparatorIdx); + } + final PathMacros pathMacros = PathMacros.getInstance(); + final Set<String> names = pathMacros.getUserMacroNames(); + for (String name : names) { + final String path = FileUtil.toSystemIndependentName(pathMacros.getValue(name)); + if (filePath.startsWith(path + "/")) { + final String substr = filePath.substring(path.length()); + return name + (substr.startsWith("/") || substr.length() == 0 ? substr : "/" + substr); + } + } + } + return null; + } +}
\ No newline at end of file diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseClasspathReader.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseClasspathReader.java new file mode 100644 index 000000000000..422d6f8ff607 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseClasspathReader.java @@ -0,0 +1,287 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 11-Nov-2008 + */ +package org.jetbrains.idea.eclipse.conversion; + +import com.intellij.openapi.components.ExpandMacroToPathMap; +import com.intellij.openapi.components.PathMacroManager; +import com.intellij.openapi.components.impl.BasePathMacroManager; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.projectRoots.ProjectJdkTable; +import com.intellij.openapi.projectRoots.Sdk; +import com.intellij.openapi.projectRoots.ex.JavaSdkUtil; +import com.intellij.openapi.roots.*; +import com.intellij.openapi.roots.libraries.Library; +import com.intellij.openapi.roots.libraries.LibraryTable; +import com.intellij.openapi.roots.libraries.LibraryTablesRegistrar; +import com.intellij.openapi.util.Comparing; +import com.intellij.openapi.vfs.JarFileSystem; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.openapi.vfs.VirtualFileManager; +import com.intellij.util.ArrayUtil; +import org.jdom.Element; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.idea.eclipse.*; +import org.jetbrains.idea.eclipse.config.EclipseModuleManagerImpl; +import org.jetbrains.idea.eclipse.util.ErrorLog; + +import java.io.IOException; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +public class EclipseClasspathReader extends AbstractEclipseClasspathReader<ModifiableRootModel> { + private final Project myProject; + private ContentEntry myContentEntry; + + public EclipseClasspathReader(final String rootPath, final Project project, @Nullable List<String> currentRoots) { + this(rootPath, project, currentRoots, null); + } + + public EclipseClasspathReader(final String rootPath, final Project project, @Nullable List<String> currentRoots, @Nullable Set<String> moduleNames) { + super(rootPath, currentRoots, moduleNames); + myProject = project; + } + + public void init(ModifiableRootModel model) { + myContentEntry = model.addContentEntry(pathToUrl(myRootPath)); + } + + public static void collectVariables(Set<String> usedVariables, Element classpathElement, final String rootPath) { + for (Object o : classpathElement.getChildren(EclipseXml.CLASSPATHENTRY_TAG)) { + final Element element = (Element)o; + String path = element.getAttributeValue(EclipseXml.PATH_ATTR); + if (path == null) continue; + final String kind = element.getAttributeValue(EclipseXml.KIND_ATTR); + if (Comparing.strEqual(kind, EclipseXml.VAR_KIND)) { + createEPathVariable(usedVariables, path, 0); + final String srcPath = element.getAttributeValue(EclipseXml.SOURCEPATH_ATTR); + if (srcPath != null) { + createEPathVariable(usedVariables, srcPath, srcVarStart(srcPath)); + } + } else if (Comparing.strEqual(kind, EclipseXml.SRC_KIND) || Comparing.strEqual(kind, EclipseXml.OUTPUT_KIND)) { + final EclipseProjectFinder.LinkedResource linkedResource = EclipseProjectFinder.findLinkedResource(rootPath, path); + if (linkedResource != null && linkedResource.containsPathVariable()) { + usedVariables.add(linkedResource.getVariableName()); + } + } + } + } + + public void readClasspath(ModifiableRootModel model, + final Collection<String> unknownLibraries, + Collection<String> unknownJdks, + final Set<String> usedVariables, + Set<String> refsToModules, + final String testPattern, + Element classpathElement) throws IOException, ConversionException { + for (OrderEntry orderEntry : model.getOrderEntries()) { + if (!(orderEntry instanceof ModuleSourceOrderEntry)) { + model.removeOrderEntry(orderEntry); + } + } + int idx = 0; + final EclipseModuleManagerImpl eclipseModuleManager = EclipseModuleManagerImpl.getInstance(model.getModule()); + for (Object o : classpathElement.getChildren(EclipseXml.CLASSPATHENTRY_TAG)) { + try { + readClasspathEntry(model, unknownLibraries, unknownJdks, usedVariables, refsToModules, testPattern, (Element)o, idx++, + eclipseModuleManager, + ((BasePathMacroManager)PathMacroManager.getInstance(model.getModule())).getExpandMacroMap()); + } + catch (ConversionException e) { + ErrorLog.rethrow(ErrorLog.Level.Warning, null, EclipseXml.CLASSPATH_FILE, e); + } + } + if (!model.isSdkInherited() && model.getSdkName() == null) { + eclipseModuleManager.setForceConfigureJDK(); + model.inheritSdk(); + } + } + + @Override + protected int rearrange(ModifiableRootModel rootModel) { + return rearrangeOrderEntryOfType(rootModel, ModuleSourceOrderEntry.class); + } + + @Override + protected String expandEclipsePath2Url(ModifiableRootModel rootModel, String path) { + return EPathUtil.expandEclipsePath2Url(path, rootModel, myCurrentRoots); + } + + @Override + protected void addModuleLibrary(ModifiableRootModel rootModel, + Element element, + boolean exported, + String libName, + String url, + String srcUrl, ExpandMacroToPathMap macroMap) { + final Library library = rootModel.getModuleLibraryTable().getModifiableModel().createLibrary(libName); + final Library.ModifiableModel modifiableModel = library.getModifiableModel(); + modifiableModel.addRoot(url, OrderRootType.CLASSES); + if (srcUrl != null) { + modifiableModel.addRoot(srcUrl, OrderRootType.SOURCES); + } + EJavadocUtil.appendJavadocRoots(element, rootModel, myCurrentRoots, modifiableModel); + modifiableModel.commit(); + + setLibraryEntryExported(rootModel, exported, library); + } + + @Override + protected void addJUnitDefaultLib(ModifiableRootModel rootModel, String junitName, ExpandMacroToPathMap macroMap) { + final Library library = rootModel.getModuleLibraryTable().getModifiableModel().createLibrary(junitName); + final Library.ModifiableModel modifiableModel = library.getModifiableModel(); + modifiableModel.addRoot(getJunitClsUrl(junitName.contains("4")), OrderRootType.CLASSES); + modifiableModel.commit(); + } + + @Override + protected void addSourceFolderToCurrentContentRoot(ModifiableRootModel rootModel, + String srcUrl, + boolean testFolder) { + myContentEntry.addSourceFolder(srcUrl, testFolder); + } + + @Override + protected void addSourceFolder(ModifiableRootModel rootModel, String srcUrl, boolean testFolder) { + rootModel.addContentEntry(srcUrl).addSourceFolder(srcUrl, testFolder); + } + + @Override + protected void setUpModuleJdk(ModifiableRootModel rootModel, + Collection<String> unknownJdks, + EclipseModuleManager eclipseModuleManager, + String jdkName) { + if (jdkName == null) { + rootModel.inheritSdk(); + } + else { + final Sdk moduleJdk = ProjectJdkTable.getInstance().findJdk(jdkName); + if (moduleJdk != null) { + rootModel.setSdk(moduleJdk); + } + else { + rootModel.setInvalidSdk(jdkName, IdeaXml.JAVA_SDK_TYPE); + eclipseModuleManager.setInvalidJdk(jdkName); + unknownJdks.add(jdkName); + } + } + rearrangeOrderEntryOfType(rootModel, JdkOrderEntry.class); + } + + @Override + protected void addInvalidModuleEntry(ModifiableRootModel rootModel, boolean exported, String moduleName) { + rootModel.addInvalidModuleEntry(moduleName).setExported(exported); + } + + private static int rearrangeOrderEntryOfType(ModifiableRootModel rootModel, Class<? extends OrderEntry> orderEntryClass) { + OrderEntry[] orderEntries = rootModel.getOrderEntries(); + int moduleSourcesIdx = 0; + for (OrderEntry orderEntry : orderEntries) { + if (orderEntryClass.isAssignableFrom(orderEntry.getClass())) { + break; + } + moduleSourcesIdx++; + } + orderEntries = ArrayUtil.append(orderEntries, orderEntries[moduleSourcesIdx]); + orderEntries = ArrayUtil.remove(orderEntries, moduleSourcesIdx); + rootModel.rearrangeOrderEntries(orderEntries); + return orderEntries.length - 1; + } + + @Override + public void setupOutput(ModifiableRootModel rootModel, final String path) { + setOutputUrl(rootModel, path); + } + + public static void setOutputUrl(ModifiableRootModel rootModel, String path) { + final CompilerModuleExtension compilerModuleExtension = rootModel.getModuleExtension(CompilerModuleExtension.class); + compilerModuleExtension.setCompilerOutputPath(pathToUrl(path)); + compilerModuleExtension.inheritCompilerOutputPath(false); + } + + private static void setLibraryEntryExported(ModifiableRootModel rootModel, boolean exported, Library library) { + for (OrderEntry orderEntry : rootModel.getOrderEntries()) { + if (orderEntry instanceof LibraryOrderEntry && + ((LibraryOrderEntry)orderEntry).isModuleLevel() && + Comparing.equal(((LibraryOrderEntry)orderEntry).getLibrary(), library)) { + ((LibraryOrderEntry)orderEntry).setExported(exported); + break; + } + } + } + + @Override + protected void addNamedLibrary(final ModifiableRootModel rootModel, + final Collection<String> unknownLibraries, + final boolean exported, + final String name, + final boolean applicationLevel) { + Library lib = findLibraryByName(myProject, name); + if (lib != null) { + rootModel.addLibraryEntry(lib).setExported(exported); + } + else { + unknownLibraries.add(name); + rootModel.addInvalidLibrary(name, applicationLevel ? LibraryTablesRegistrar.APPLICATION_LEVEL : LibraryTablesRegistrar.PROJECT_LEVEL).setExported(exported); + } + } + + public static Library findLibraryByName(Project project, String name) { + final LibraryTablesRegistrar tablesRegistrar = LibraryTablesRegistrar.getInstance(); + Library lib = tablesRegistrar.getLibraryTable().getLibraryByName(name); + if (lib == null) { + lib = tablesRegistrar.getLibraryTable(project).getLibraryByName(name); + } + if (lib == null) { + for (LibraryTable table : tablesRegistrar.getCustomLibraryTables()) { + lib = table.getLibraryByName(name); + if (lib != null) { + break; + } + } + } + return lib; + } + + static String getJunitClsUrl(final boolean version4) { + String url = version4 ? JavaSdkUtil.getJunit4JarPath() : JavaSdkUtil.getJunit3JarPath(); + final VirtualFile localFile = VirtualFileManager.getInstance().findFileByUrl(pathToUrl(url)); + if (localFile != null) { + final VirtualFile jarFile = JarFileSystem.getInstance().getJarRootForLocalFile(localFile); + url = jarFile != null ? jarFile.getUrl() : localFile.getUrl(); + } + + return url; + } + + + protected String prepareValidUrlInsideJar(String url) { + final VirtualFile localFile = VirtualFileManager.getInstance().findFileByUrl(url); + if (localFile != null) { + final VirtualFile jarFile = JarFileSystem.getInstance().getJarRootForLocalFile(localFile); + if (jarFile != null) { + return jarFile.getUrl(); + } + } + + return url; + } +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseClasspathWriter.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseClasspathWriter.java new file mode 100644 index 000000000000..4234301c7661 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseClasspathWriter.java @@ -0,0 +1,286 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 11-Nov-2008 + */ +package org.jetbrains.idea.eclipse.conversion; + +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.projectRoots.JavaSdkType; +import com.intellij.openapi.projectRoots.Sdk; +import com.intellij.openapi.roots.*; +import com.intellij.openapi.util.Comparing; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.openapi.vfs.VfsUtil; +import com.intellij.openapi.vfs.VirtualFile; +import org.jdom.Element; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.idea.eclipse.ConversionException; +import org.jetbrains.idea.eclipse.EclipseXml; +import org.jetbrains.idea.eclipse.IdeaXml; +import org.jetbrains.idea.eclipse.EclipseModuleManager; +import org.jetbrains.idea.eclipse.config.EclipseModuleManagerImpl; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +public class EclipseClasspathWriter { + private static final Logger LOG = Logger.getInstance("#" + EclipseClasspathWriter.class.getName()); + private final ModuleRootModel myModel; + private final Map<String, Element> myOldEntries = new HashMap<String, Element>(); + + public EclipseClasspathWriter(final ModuleRootModel model) { + myModel = model; + } + + public void writeClasspath(Element classpathElement, @Nullable Element oldRoot) throws ConversionException { + if (oldRoot != null) { + for (Object o : oldRoot.getChildren(EclipseXml.CLASSPATHENTRY_TAG)) { + final Element oldChild = (Element)o; + final String oldKind = oldChild.getAttributeValue(EclipseXml.KIND_ATTR); + final String oldPath = oldChild.getAttributeValue(EclipseXml.PATH_ATTR); + myOldEntries.put(oldKind + getJREKey(oldPath), oldChild); + } + } + + for (OrderEntry orderEntry : myModel.getOrderEntries()) { + createClasspathEntry(orderEntry, classpathElement); + } + + @NonNls String outputPath = "bin"; + final String compilerOutputUrl = myModel.getModuleExtension(CompilerModuleExtension.class).getCompilerOutputUrl(); + final EclipseModuleManager eclipseModuleManager = EclipseModuleManagerImpl.getInstance(myModel.getModule()); + final String linkedPath = eclipseModuleManager.getEclipseLinkedVarPath(compilerOutputUrl); + if (linkedPath != null) { + outputPath = linkedPath; + } else { + final VirtualFile contentRoot = EPathUtil.getContentRoot(myModel); + final VirtualFile output = myModel.getModuleExtension(CompilerModuleExtension.class).getCompilerOutputPath(); + if (contentRoot != null && output != null && VfsUtil.isAncestor(contentRoot, output, false)) { + outputPath = EPathUtil.collapse2EclipsePath(output.getUrl(), myModel); + } + else if (output == null && compilerOutputUrl != null) { + outputPath = EPathUtil.collapse2EclipsePath(compilerOutputUrl, myModel); + } + } + for (String support : eclipseModuleManager.getGroovySupport()) { + final Integer place = eclipseModuleManager.getSrcPlace(support); + addOrderEntry(EclipseXml.CON_KIND, support, classpathElement, place != null ? place.intValue() : -1); + } + final Element orderEntry = addOrderEntry(EclipseXml.OUTPUT_KIND, outputPath, classpathElement); + setAttributeIfAbsent(orderEntry, EclipseXml.PATH_ATTR, EclipseXml.BIN_DIR); + } + + private void createClasspathEntry(OrderEntry entry, Element classpathRoot) throws ConversionException { + final EclipseModuleManager eclipseModuleManager = EclipseModuleManagerImpl.getInstance(entry.getOwnerModule()); + if (entry instanceof ModuleSourceOrderEntry) { + final boolean shouldPlaceSeparately = + eclipseModuleManager.isExpectedModuleSourcePlace(Arrays.binarySearch(myModel.getOrderEntries(), entry)); + final ContentEntry[] entries = myModel.getContentEntries(); + for (final ContentEntry contentEntry : entries) { + final VirtualFile contentRoot = contentEntry.getFile(); + for (SourceFolder sourceFolder : contentEntry.getSourceFolders()) { + final String srcUrl = sourceFolder.getUrl(); + String relativePath = EPathUtil.collapse2EclipsePath(srcUrl, myModel); + if (!Comparing.equal(contentRoot, EPathUtil.getContentRoot(myModel))) { + final String linkedPath = EclipseModuleManagerImpl.getInstance(entry.getOwnerModule()).getEclipseLinkedSrcVariablePath(srcUrl); + if (linkedPath != null) { + relativePath = linkedPath; + } + } + final Integer idx = eclipseModuleManager.getSrcPlace(srcUrl); + addOrderEntry(EclipseXml.SRC_KIND, relativePath, classpathRoot, shouldPlaceSeparately && idx != null ? idx.intValue() : -1); + } + } + } + else if (entry instanceof ModuleOrderEntry) { + Element orderEntry = addOrderEntry(EclipseXml.SRC_KIND, "/" + ((ModuleOrderEntry)entry).getModuleName(), classpathRoot); + setAttributeIfAbsent(orderEntry, EclipseXml.COMBINEACCESSRULES_ATTR, EclipseXml.FALSE_VALUE); + setExported(orderEntry, ((ExportableOrderEntry)entry)); + } + else if (entry instanceof LibraryOrderEntry) { + final LibraryOrderEntry libraryOrderEntry = (LibraryOrderEntry)entry; + final String libraryName = libraryOrderEntry.getLibraryName(); + if (libraryOrderEntry.isModuleLevel()) { + final String[] files = libraryOrderEntry.getRootUrls(OrderRootType.CLASSES); + if (files.length > 0) { + if (libraryName != null && + libraryName.contains(IdeaXml.JUNIT) && + Comparing.strEqual(files[0], EclipseClasspathReader.getJunitClsUrl(libraryName.contains("4")))) { + final Element orderEntry = + addOrderEntry(EclipseXml.CON_KIND, EclipseXml.JUNIT_CONTAINER + "/" + libraryName.substring(IdeaXml.JUNIT.length()), + classpathRoot); + setExported(orderEntry, libraryOrderEntry); + } + else { + boolean newVarLibrary = false; + + boolean link = false; + String eclipseVariablePath = eclipseModuleManager.getEclipseVariablePath(files[0]); + if (eclipseVariablePath == null) { + eclipseVariablePath = eclipseModuleManager.getEclipseLinkedVarPath(files[0]); + link = eclipseVariablePath != null; + } + + if (eclipseVariablePath == null && !eclipseModuleManager.isEclipseLibUrl(files[0])) { //new library was added + newVarLibrary = true; + eclipseVariablePath = EPathUtil.collapse2EclipseVariabledPath(libraryOrderEntry, OrderRootType.CLASSES); + } + Element orderEntry; + if (eclipseVariablePath != null) { + orderEntry = addOrderEntry(link ? EclipseXml.LIB_KIND : EclipseXml.VAR_KIND, eclipseVariablePath, classpathRoot); + } + else { + LOG.assertTrue(!StringUtil.isEmptyOrSpaces(files[0]), "Library: " + libraryName); + orderEntry = addOrderEntry(EclipseXml.LIB_KIND, EPathUtil.collapse2EclipsePath(files[0], myModel), classpathRoot); + } + + final String srcRelativePath; + String eclipseSrcVariablePath = null; + + boolean addSrcRoots = true; + final String[] srcFiles = libraryOrderEntry.getRootUrls(OrderRootType.SOURCES); + if (srcFiles.length == 0) { + srcRelativePath = null; + } + else { + final String srcFile = srcFiles[0]; + srcRelativePath = EPathUtil.collapse2EclipsePath(srcFile, myModel); + if (eclipseVariablePath != null) { + eclipseSrcVariablePath = eclipseModuleManager.getEclipseSrcVariablePath(srcFile); + if (eclipseSrcVariablePath == null) { + eclipseSrcVariablePath = eclipseModuleManager.getEclipseLinkedSrcVariablePath(srcFile); + } + if (eclipseSrcVariablePath == null) { + eclipseSrcVariablePath = EPathUtil.collapse2EclipseVariabledPath(libraryOrderEntry, OrderRootType.SOURCES); + if (eclipseSrcVariablePath != null) { + eclipseSrcVariablePath = "/" + eclipseSrcVariablePath; + } else { + if (newVarLibrary) { //new library which cannot be replaced with vars + orderEntry.detach(); + orderEntry = addOrderEntry(EclipseXml.LIB_KIND, EPathUtil.collapse2EclipsePath(files[0], myModel), classpathRoot); + } + else { + LOG.info("Added root " + srcRelativePath + " (in existing var library) can't be replaced with any variable; src roots placed in .eml only"); + addSrcRoots = false; + } + } + } + } + } + setOrRemoveAttribute(orderEntry, EclipseXml.SOURCEPATH_ATTR, addSrcRoots ? (eclipseSrcVariablePath != null ? eclipseSrcVariablePath : srcRelativePath) : null); + + EJavadocUtil.setupJavadocAttributes(orderEntry, libraryOrderEntry, myModel); + setExported(orderEntry, libraryOrderEntry); + } + } + } + else { + final Element orderEntry; + if (eclipseModuleManager.getUnknownCons().contains(libraryName)) { + orderEntry = addOrderEntry(EclipseXml.CON_KIND, libraryName, classpathRoot); + } else if (Comparing.strEqual(libraryName, IdeaXml.ECLIPSE_LIBRARY)) { + orderEntry = addOrderEntry(EclipseXml.CON_KIND, EclipseXml.ECLIPSE_PLATFORM, classpathRoot); + } + else { + orderEntry = addOrderEntry(EclipseXml.CON_KIND, EclipseXml.USER_LIBRARY + "/" + libraryName, classpathRoot); + } + setExported(orderEntry, libraryOrderEntry); + } + } + else if (entry instanceof JdkOrderEntry) { + if (entry instanceof InheritedJdkOrderEntry) { + if (!EclipseModuleManagerImpl.getInstance(entry.getOwnerModule()).isForceConfigureJDK()) { + addOrderEntry(EclipseXml.CON_KIND, EclipseXml.JRE_CONTAINER, classpathRoot); + } + } + else { + final Sdk jdk = ((JdkOrderEntry)entry).getJdk(); + String jdkLink; + if (jdk == null) { + jdkLink = EclipseXml.JRE_CONTAINER; + } + else { + jdkLink = EclipseXml.JRE_CONTAINER; + if (jdk.getSdkType() instanceof JavaSdkType) { + jdkLink += EclipseXml.JAVA_SDK_TYPE; + } + jdkLink += "/" + jdk.getName(); + } + addOrderEntry(EclipseXml.CON_KIND, jdkLink, classpathRoot); + } + } + else { + throw new ConversionException("Unknown EclipseProjectModel.ClasspathEntry: " + entry.getClass()); + } + } + + private Element addOrderEntry(String kind, String path, Element classpathRoot) { + return addOrderEntry(kind, path, classpathRoot, -1); + } + + private Element addOrderEntry(String kind, String path, Element classpathRoot, int idx) { + final Element element = myOldEntries.get(kind + getJREKey(path)); + if (element != null){ + final Element clonedElement = (Element)element.clone(); + if (idx == -1 || idx >= classpathRoot.getContentSize()) { + classpathRoot.addContent(clonedElement); + } else { + classpathRoot.addContent(idx, clonedElement); + } + return clonedElement; + } + Element orderEntry = new Element(EclipseXml.CLASSPATHENTRY_TAG); + orderEntry.setAttribute(EclipseXml.KIND_ATTR, kind); + if (path != null) { + orderEntry.setAttribute(EclipseXml.PATH_ATTR, path); + } + if (idx == -1) { + classpathRoot.addContent(orderEntry); + } else { + classpathRoot.addContent(idx, orderEntry); + } + return orderEntry; + } + + private static String getJREKey(String path) { + return path.startsWith(EclipseXml.JRE_CONTAINER) ? EclipseXml.JRE_CONTAINER : path; + } + + private static void setExported(Element orderEntry, ExportableOrderEntry dependency) { + setOrRemoveAttribute(orderEntry, EclipseXml.EXPORTED_ATTR, dependency.isExported() ? EclipseXml.TRUE_VALUE : null); + } + + private static void setOrRemoveAttribute(Element element, String name, String value) { + if (value != null) { + element.setAttribute(name, value); + } + else { + element.removeAttribute(name); + } + } + + private static void setAttributeIfAbsent(Element element, String name, String value) { + if (element.getAttribute(name) == null) { + element.setAttribute(name, value); + } + } + +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseUserLibrariesHelper.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseUserLibrariesHelper.java new file mode 100644 index 000000000000..7922ad7d903f --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseUserLibrariesHelper.java @@ -0,0 +1,127 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 11-Mar-2009 + */ +package org.jetbrains.idea.eclipse.conversion; + +import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.OrderRootType; +import com.intellij.openapi.roots.impl.libraries.ProjectLibraryTable; +import com.intellij.openapi.roots.libraries.Library; +import com.intellij.openapi.roots.libraries.LibraryTable; +import com.intellij.openapi.roots.libraries.LibraryTablesRegistrar; +import com.intellij.openapi.util.JDOMUtil; +import com.intellij.openapi.vfs.JarFileSystem; +import com.intellij.openapi.vfs.VfsUtil; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.openapi.vfs.VirtualFileManager; +import com.intellij.util.containers.ContainerUtil; +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.JDOMException; +import org.jetbrains.annotations.Nullable; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; + +public class EclipseUserLibrariesHelper { + //private static final String ORG_ECLIPSE_JDT_CORE_PREFS = "org.eclipse.jdt.core.prefs"; + //private static final String ORG_ECLIPSE_JDT_CORE_USER_LIBRARY = "org.eclipse.jdt.core.userLibrary."; + + private EclipseUserLibrariesHelper() { + } + + private static void writeUserLibrary(final Library library, final Element libElement) { + final VirtualFile[] files = library.getFiles(OrderRootType.CLASSES); + for (VirtualFile file : files) { + Element archElement = new Element("archive"); + if (file.getFileSystem() instanceof JarFileSystem) { + final VirtualFile localFile = JarFileSystem.getInstance().getVirtualFileForJar(file); + if (localFile != null) { + file = localFile; + } + } + archElement.setAttribute("path", file.getPath()); + libElement.addContent(archElement); + } + } + + public static void appendProjectLibraries(final Project project, @Nullable final File userLibrariesFile) throws IOException { + if (userLibrariesFile == null) return; + if (userLibrariesFile.exists() && !userLibrariesFile.isFile()) return; + final File parentFile = userLibrariesFile.getParentFile(); + if (parentFile == null) return; + if (!parentFile.isDirectory()) { + if (!parentFile.mkdir()) return; + } + final Element userLibsElement = new Element("eclipse-userlibraries"); + final List<Library> libraries = new ArrayList<Library>(Arrays.asList(ProjectLibraryTable.getInstance(project).getLibraries())); + ContainerUtil.addAll(libraries, LibraryTablesRegistrar.getInstance().getLibraryTable().getLibraries()); + for (Library library : libraries) { + Element libElement = new Element("library"); + libElement.setAttribute("name", library.getName()); + writeUserLibrary(library, libElement); + userLibsElement.addContent(libElement); + } + JDOMUtil.writeDocument(new Document(userLibsElement), userLibrariesFile, "\n"); + } + + + public static void readProjectLibrariesContent(File exportedFile, Project project, Collection<String> unknownLibraries) + throws IOException, JDOMException { + if (exportedFile.exists()) { + final LibraryTable libraryTable = ProjectLibraryTable.getInstance(project); + final Element rootElement = JDOMUtil.loadDocument(exportedFile).getRootElement(); + for (Object o : rootElement.getChildren("library")) { + final Element libElement = (Element)o; + final String libName = libElement.getAttributeValue("name"); + Library libraryByName = libraryTable.getLibraryByName(libName); + if (libraryByName == null) { + final LibraryTable.ModifiableModel model = libraryTable.getModifiableModel(); + libraryByName = model.createLibrary(libName); + model.commit(); + } + if (libraryByName != null) { + final Library.ModifiableModel model = libraryByName.getModifiableModel(); + for (Object a : libElement.getChildren("archive")) { + String rootPath = ((Element)a).getAttributeValue("path"); + if (rootPath.startsWith("/")) { //relative to workspace root + rootPath = project.getBaseDir().getPath() + rootPath; + } + String url = VfsUtil.pathToUrl(rootPath); + final VirtualFile localFile = VirtualFileManager.getInstance().findFileByUrl(url); + if (localFile != null) { + final VirtualFile jarFile = JarFileSystem.getInstance().getJarRootForLocalFile(localFile); + if (jarFile != null) { + url = jarFile.getUrl(); + } + } + model.addRoot(url, OrderRootType.CLASSES); + } + model.commit(); + } + unknownLibraries.remove(libName); //ignore finally found libraries + } + } + } +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/IdeaSpecificSettings.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/IdeaSpecificSettings.java new file mode 100644 index 000000000000..904e7ee4f97f --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/IdeaSpecificSettings.java @@ -0,0 +1,459 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 18-Dec-2009 + */ +package org.jetbrains.idea.eclipse.conversion; + +import com.intellij.openapi.components.PathMacroManager; +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.extensions.Extensions; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleManager; +import com.intellij.openapi.module.ModuleUtil; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.projectRoots.JavaSdk; +import com.intellij.openapi.projectRoots.ProjectJdkTable; +import com.intellij.openapi.projectRoots.Sdk; +import com.intellij.openapi.roots.*; +import com.intellij.openapi.roots.impl.DirectoryIndexExcludePolicy; +import com.intellij.openapi.roots.libraries.Library; +import com.intellij.openapi.roots.libraries.LibraryTablesRegistrar; +import com.intellij.openapi.util.Comparing; +import com.intellij.openapi.util.InvalidDataException; +import com.intellij.openapi.util.WriteExternalException; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.vfs.JarFileSystem; +import com.intellij.openapi.vfs.VfsUtil; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.openapi.vfs.VirtualFileManager; +import com.intellij.openapi.vfs.pointers.VirtualFilePointer; +import com.intellij.pom.java.LanguageLevel; +import org.jdom.Element; +import org.jdom.JDOMException; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.idea.eclipse.IdeaXml; +import org.jetbrains.idea.eclipse.config.CachedXmlDocumentSet; +import org.jetbrains.idea.eclipse.config.EclipseModuleManagerImpl; + +import java.io.File; +import java.io.IOException; +import java.util.*; + +import static org.jetbrains.idea.eclipse.conversion.EPathUtil.areUrlsPointTheSame; + +/** + * Read/write .eml + */ +public class IdeaSpecificSettings extends AbstractIdeaSpecificSettings<ModifiableRootModel, ContentEntry, Sdk> { + @NonNls private static final String RELATIVE_MODULE_SRC = "relative-module-src"; + @NonNls private static final String RELATIVE_MODULE_CLS = "relative-module-cls"; + @NonNls private static final String RELATIVE_MODULE_JAVADOC = "relative-module-javadoc"; + @NonNls private static final String PROJECT_RELATED = "project-related"; + + @NonNls private static final String SRCROOT_ATTR = "srcroot"; + @NonNls private static final String SRCROOT_BIND_ATTR = "bind"; + private static final Logger LOG = Logger.getInstance("#" + IdeaSpecificSettings.class.getName()); + @NonNls private static final String JAVADOCROOT_ATTR = "javadocroot_attr"; + public static final String INHERIT_JDK = "inheritJdk"; + + private IdeaSpecificSettings() { + } + + public static void readIDEASpecific(ModifiableRootModel model, CachedXmlDocumentSet documentSet, String eml) throws InvalidDataException, IOException, JDOMException { + new IdeaSpecificSettings().readIDEASpecific(documentSet.read(eml).getRootElement(), model, null, new HashMap<String, String>()); + } + + @Override + protected void readLibraryLevels(Element root, Map<String, String> levels) { + } + + @Override + protected ContentEntry[] getEntries(ModifiableRootModel model) { + return model.getContentEntries(); + } + + @Override + protected ContentEntry createContentEntry(ModifiableRootModel model, final String url) { + return model.addContentEntry(url); + } + + @Override + protected void setupLibraryRoots(Element root, ModifiableRootModel model) { + for (Object o : root.getChildren("lib")) { + Element libElement = (Element)o; + final String libName = libElement.getAttributeValue("name"); + Library libraryByName = model.getModuleLibraryTable().getLibraryByName(libName); + if (libraryByName != null) { + appendLibraryScope(model, libElement, libraryByName); + final Library.ModifiableModel modifiableModel = libraryByName.getModifiableModel(); + replaceCollapsedByEclipseSourceRoots(libElement, modifiableModel); + for (Object r : libElement.getChildren(JAVADOCROOT_ATTR)) { + final String url = ((Element)r).getAttributeValue("url"); + modifiableModel.addRoot(url, JavadocOrderRootType.getInstance()); + } + replaceModuleRelatedRoots(model.getProject(), modifiableModel, libElement, OrderRootType.SOURCES, RELATIVE_MODULE_SRC); + replaceModuleRelatedRoots(model.getProject(), modifiableModel, libElement, OrderRootType.CLASSES, RELATIVE_MODULE_CLS); + replaceModuleRelatedRoots(model.getProject(), modifiableModel, libElement, JavadocOrderRootType.getInstance(), RELATIVE_MODULE_JAVADOC); + modifiableModel.commit(); + } else { + final Library library = EclipseClasspathReader.findLibraryByName(model.getProject(), libName); + if (library != null) { + appendLibraryScope(model, libElement, library); + } + } + } + } + + @Override + protected void setupJdk(Element root, ModifiableRootModel model, @Nullable Sdk sdk) { + final String inheritJdk = root.getAttributeValue(INHERIT_JDK); + if (inheritJdk != null && Boolean.parseBoolean(inheritJdk)) { + model.inheritSdk(); + } else { + final String jdkName = root.getAttributeValue("jdk"); + if (jdkName != null) { + final Sdk jdkByName = ProjectJdkTable.getInstance().findJdk(jdkName); + if (jdkByName != null) { + model.setSdk(jdkByName); + } + } + } + } + + @Override + protected void setupCompilerOutputs(Element root, ModifiableRootModel model) { + final CompilerModuleExtension compilerModuleExtension = model.getModuleExtension(CompilerModuleExtension.class); + final Element testOutputElement = root.getChild(IdeaXml.OUTPUT_TEST_TAG); + if (testOutputElement != null) { + compilerModuleExtension.setCompilerOutputPathForTests(testOutputElement.getAttributeValue(IdeaXml.URL_ATTR)); + } + + final String inheritedOutput = root.getAttributeValue(IdeaXml.INHERIT_COMPILER_OUTPUT_ATTR); + if (inheritedOutput != null && Boolean.valueOf(inheritedOutput).booleanValue()) { + compilerModuleExtension.inheritCompilerOutputPath(true); + } + + compilerModuleExtension.setExcludeOutput(root.getChild(IdeaXml.EXCLUDE_OUTPUT_TAG) != null); + } + + @Override + protected void readLanguageLevel(Element root, ModifiableRootModel model) throws InvalidDataException { + model.getModuleExtension(LanguageLevelModuleExtension.class).readExternal(root); + } + + @Override + protected void expandElement(Element root, ModifiableRootModel model) { + PathMacroManager.getInstance(model.getModule()).expandPaths(root); + } + + @Override + protected void overrideModulesScopes(Element root, ModifiableRootModel model) { + for (Object o : root.getChildren("module")) { + final String moduleName = ((Element)o).getAttributeValue("name"); + final String scope = ((Element)o).getAttributeValue("scope"); + if (scope != null) { + for (OrderEntry entry : model.getOrderEntries()) { + if (entry instanceof ModuleOrderEntry && Comparing.strEqual(((ModuleOrderEntry)entry).getModuleName(), moduleName)) { + ((ModuleOrderEntry)entry).setScope(DependencyScope.valueOf(scope)); + break; + } + } + } + } + } + + private static void appendLibraryScope(ModifiableRootModel model, Element libElement, Library libraryByName) { + final LibraryOrderEntry libraryOrderEntry = model.findLibraryOrderEntry(libraryByName); + if (libraryOrderEntry != null) { + final String scopeAttribute = libElement.getAttributeValue("scope"); + libraryOrderEntry.setScope(scopeAttribute == null ? DependencyScope.COMPILE : DependencyScope.valueOf(scopeAttribute)); + } + } + + /** + * Eclipse detect sources inside zip automatically while IDEA doesn't. + * So .eml contains expanded roots which should replace zip root read from .classpath + */ + private static void replaceCollapsedByEclipseSourceRoots(Element libElement, Library.ModifiableModel modifiableModel) { + String[] srcUrlsFromClasspath = modifiableModel.getUrls(OrderRootType.SOURCES); + LOG.assertTrue(srcUrlsFromClasspath.length <= 1); + final String eclipseUrl = srcUrlsFromClasspath.length > 0 ? srcUrlsFromClasspath[0] : null; + for (Object r : libElement.getChildren(SRCROOT_ATTR)) { + final String url = ((Element)r).getAttributeValue("url"); + final String bindAttr = ((Element)r).getAttributeValue(SRCROOT_BIND_ATTR); + boolean notBind = bindAttr != null && !Boolean.parseBoolean(bindAttr); + if (notBind) { + modifiableModel.addRoot(url, OrderRootType.SOURCES); + } + else if (eclipseUrl != null && areUrlsPointTheSame(url, eclipseUrl) && !Comparing.strEqual(url, eclipseUrl)) { //todo lost already configured additional src roots + modifiableModel.addRoot(url, OrderRootType.SOURCES); + if (srcUrlsFromClasspath != null && srcUrlsFromClasspath.length == 1) { //remove compound root + modifiableModel.removeRoot(eclipseUrl, OrderRootType.SOURCES); + srcUrlsFromClasspath = null; + } + } + } + } + + + @Override + public void readContentEntry(Element root, ContentEntry entry, ModifiableRootModel model) { + for (Object o : root.getChildren(IdeaXml.TEST_FOLDER_TAG)) { + final String url = ((Element)o).getAttributeValue(IdeaXml.URL_ATTR); + SourceFolder folderToBeTest = null; + for (SourceFolder folder : entry.getSourceFolders()) { + if (Comparing.strEqual(folder.getUrl(), url)) { + folderToBeTest = folder; + break; + } + } + if (folderToBeTest != null) { + entry.removeSourceFolder(folderToBeTest); + } + entry.addSourceFolder(url, true); + } + + final String url = entry.getUrl(); + for (Object o : root.getChildren(IdeaXml.EXCLUDE_FOLDER_TAG)) { + final String excludeUrl = ((Element)o).getAttributeValue(IdeaXml.URL_ATTR); + if (FileUtil.isAncestor(new File(url), new File(excludeUrl), false)) { //check if it is excluded manually + entry.addExcludeFolder(excludeUrl); + } + } + } + + public static boolean writeIDEASpecificClasspath(final Element root, ModuleRootModel model) throws WriteExternalException { + + boolean isModified = false; + + final CompilerModuleExtension compilerModuleExtension = model.getModuleExtension(CompilerModuleExtension.class); + + if (compilerModuleExtension.getCompilerOutputUrlForTests() != null) { + final Element pathElement = new Element(IdeaXml.OUTPUT_TEST_TAG); + pathElement.setAttribute(IdeaXml.URL_ATTR, compilerModuleExtension.getCompilerOutputUrlForTests()); + root.addContent(pathElement); + isModified = true; + } + if (compilerModuleExtension.isCompilerOutputPathInherited()) { + root.setAttribute(IdeaXml.INHERIT_COMPILER_OUTPUT_ATTR, String.valueOf(true)); + isModified = true; + } + if (compilerModuleExtension.isExcludeOutput()) { + root.addContent(new Element(IdeaXml.EXCLUDE_OUTPUT_TAG)); + isModified = true; + } + + final LanguageLevelModuleExtension languageLevelModuleExtension = model.getModuleExtension(LanguageLevelModuleExtension.class); + final LanguageLevel languageLevel = languageLevelModuleExtension.getLanguageLevel(); + if (languageLevel != null) { + languageLevelModuleExtension.writeExternal(root); + isModified = true; + } + + for (ContentEntry entry : model.getContentEntries()) { + final Element contentEntryElement = new Element(IdeaXml.CONTENT_ENTRY_TAG); + contentEntryElement.setAttribute(IdeaXml.URL_ATTR, entry.getUrl()); + root.addContent(contentEntryElement); + for (SourceFolder sourceFolder : entry.getSourceFolders()) { + if (sourceFolder.isTestSource()) { + Element element = new Element(IdeaXml.TEST_FOLDER_TAG); + contentEntryElement.addContent(element); + element.setAttribute(IdeaXml.URL_ATTR, sourceFolder.getUrl()); + isModified = true; + } + } + + final VirtualFile entryFile = entry.getFile(); + exclude: for (ExcludeFolder excludeFolder : entry.getExcludeFolders()) { + final String exludeFolderUrl = excludeFolder.getUrl(); + final VirtualFile excludeFile = excludeFolder.getFile(); + for (DirectoryIndexExcludePolicy excludePolicy : Extensions.getExtensions(DirectoryIndexExcludePolicy.EP_NAME, model.getModule().getProject())) { + final VirtualFilePointer[] excludeRootsForModule = excludePolicy.getExcludeRootsForModule(model); + for (VirtualFilePointer pointer : excludeRootsForModule) { + if (Comparing.strEqual(pointer.getUrl(), exludeFolderUrl)) { + continue exclude; + } + } + } + if (entryFile == null || excludeFile == null || VfsUtil.isAncestor(entryFile, excludeFile, false)) { + Element element = new Element(IdeaXml.EXCLUDE_FOLDER_TAG); + contentEntryElement.addContent(element); + element.setAttribute(IdeaXml.URL_ATTR, exludeFolderUrl); + isModified = true; + } + } + } + + final Map<String, String> libLevels = new LinkedHashMap<String, String>(); + for (OrderEntry entry : model.getOrderEntries()) { + if (entry instanceof ModuleOrderEntry) { + final DependencyScope scope = ((ModuleOrderEntry)entry).getScope(); + if (!scope.equals(DependencyScope.COMPILE)) { + Element element = new Element("module"); + element.setAttribute("name", ((ModuleOrderEntry)entry).getModuleName()); + element.setAttribute("scope", scope.name()); + root.addContent(element); + isModified = true; + } + } + if (entry instanceof JdkOrderEntry) { + final Sdk jdk = ((JdkOrderEntry)entry).getJdk(); + if (EclipseModuleManagerImpl.getInstance(entry.getOwnerModule()).getInvalidJdk() != null || + (jdk != null && !(jdk.getSdkType() instanceof JavaSdk))) { + if (entry instanceof InheritedJdkOrderEntry) { + root.setAttribute(INHERIT_JDK, "true"); + } else { + root.setAttribute("jdk", ((JdkOrderEntry)entry).getJdkName()); + if (jdk != null) { + root.setAttribute("jdk_type", jdk.getSdkType().getName()); + } + } + isModified = true; + } + } + if (!(entry instanceof LibraryOrderEntry)) continue; + + final Element element = new Element("lib"); + element.setAttribute("name", entry.getPresentableName()); + final LibraryOrderEntry libraryEntry = (LibraryOrderEntry)entry; + final DependencyScope scope = libraryEntry.getScope(); + element.setAttribute("scope", scope.name()); + if (libraryEntry.isModuleLevel()) { + final String[] urls = libraryEntry.getRootUrls(OrderRootType.SOURCES); + String eclipseUrl = null; + if (urls.length > 0) { + eclipseUrl = urls[0]; + final int jarSeparatorIdx = urls[0].indexOf(JarFileSystem.JAR_SEPARATOR); + if (jarSeparatorIdx > -1) { + eclipseUrl = eclipseUrl.substring(0, jarSeparatorIdx); + } + } + for (String url : urls) { + Element srcElement = new Element(SRCROOT_ATTR); + srcElement.setAttribute("url", url); + if (!areUrlsPointTheSame(url, eclipseUrl)) { + srcElement.setAttribute(SRCROOT_BIND_ATTR, String.valueOf(false)); + } + element.addContent(srcElement); + } + + final String[] javadocUrls = libraryEntry.getRootUrls(JavadocOrderRootType.getInstance()); + for (int i = 1; i < javadocUrls.length; i++) { + Element javadocElement = new Element(JAVADOCROOT_ATTR); + javadocElement.setAttribute("url", javadocUrls[i]); + element.addContent(javadocElement); + } + + for (String srcUrl : libraryEntry.getRootUrls(OrderRootType.SOURCES)) { + appendModuleRelatedRoot(element, srcUrl, RELATIVE_MODULE_SRC, model); + } + + for (String classesUrl : libraryEntry.getRootUrls(OrderRootType.CLASSES)) { + appendModuleRelatedRoot(element, classesUrl, RELATIVE_MODULE_CLS, model); + } + + for (String javadocUrl : libraryEntry.getRootUrls(JavadocOrderRootType.getInstance())) { + appendModuleRelatedRoot(element, javadocUrl, RELATIVE_MODULE_JAVADOC, model); + } + + if (!element.getChildren().isEmpty()) { + root.addContent(element); + isModified = true; + continue; + } + } else { + final String libraryLevel = libraryEntry.getLibraryLevel(); + if (!LibraryTablesRegistrar.APPLICATION_LEVEL.equals(libraryLevel)) { + libLevels.put(libraryEntry.getLibraryName(), libraryLevel); + } + } + if (!scope.equals(DependencyScope.COMPILE)) { + root.addContent(element); + isModified = true; + } + } + + if (!libLevels.isEmpty()) { + final Element libLevelsElement = new Element("levels"); + for (String libName : libLevels.keySet()) { + final Element libElement = new Element("level"); + libElement.setAttribute("name", libName); + libElement.setAttribute("value", libLevels.get(libName)); + libLevelsElement.addContent(libElement); + } + root.addContent(libLevelsElement); + } + + PathMacroManager.getInstance(model.getModule()).collapsePaths(root); + + return isModified; + } + + public static void replaceModuleRelatedRoots(final Project project, + final Library.ModifiableModel modifiableModel, final Element libElement, + final OrderRootType orderRootType, final String relativeModuleName) { + final List<String> urls = new ArrayList<String>(Arrays.asList(modifiableModel.getUrls(orderRootType))); + for (Object r : libElement.getChildren(relativeModuleName)) { + final String root = PathMacroManager.getInstance(project).expandPath(((Element)r).getAttributeValue(PROJECT_RELATED)); + for (Iterator<String> iterator = urls.iterator(); iterator.hasNext();) { + final String url = iterator.next(); + if (areUrlsPointTheSame(root, url)) { + iterator.remove(); + modifiableModel.removeRoot(url, orderRootType); + modifiableModel.addRoot(root, orderRootType); + break; + } + } + } + } + + public static boolean appendModuleRelatedRoot(Element element, String classesUrl, final String rootName, ModuleRootModel model) { + VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(classesUrl); + if (file != null) { + if (file.getFileSystem() instanceof JarFileSystem) { + file = JarFileSystem.getInstance().getVirtualFileForJar(file); + assert file != null; + } + final Project project = model.getModule().getProject(); + final Module module = ModuleUtil.findModuleForFile(file, project); + if (module != null) { + return appendRelatedToModule(element, classesUrl, rootName, file, module); + } else if (ProjectRootManager.getInstance(project).getFileIndex().isIgnored(file)) { + for (Module aModule : ModuleManager.getInstance(project).getModules()) { + if (appendRelatedToModule(element, classesUrl, rootName, file, aModule)) return true; + } + } + } + return false; + } + + private static boolean appendRelatedToModule(Element element, String classesUrl, String rootName, VirtualFile file, Module module) { + final VirtualFile[] contentRoots = ModuleRootManager.getInstance(module).getContentRoots(); + for (VirtualFile contentRoot : contentRoots) { + if (VfsUtil.isAncestor(contentRoot, file, false)) { + final Element clsElement = new Element(rootName); + clsElement.setAttribute(PROJECT_RELATED, PathMacroManager.getInstance(module.getProject()).collapsePath(classesUrl)); + element.addContent(clsElement); + return true; + } + } + return false; + } +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/template.empty.project.xml b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/template.empty.project.xml new file mode 100644 index 000000000000..5ffa66e7c3d5 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/template.empty.project.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>unnamed</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + </buildSpec> + <natures> + </natures> +</projectDescription>
\ No newline at end of file diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/template.project.xml b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/template.project.xml new file mode 100644 index 000000000000..74494a348d2c --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/template.project.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>unnamed</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/export/ExportEclipseProjectsAction.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/export/ExportEclipseProjectsAction.java new file mode 100644 index 000000000000..b17cb1243dfa --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/export/ExportEclipseProjectsAction.java @@ -0,0 +1,151 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse.export; + +import com.intellij.openapi.actionSystem.AnAction; +import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.openapi.actionSystem.PlatformDataKeys; +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleManager; +import com.intellij.openapi.options.ConfigurationException; +import com.intellij.openapi.project.DumbAware; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.ModuleRootManager; +import com.intellij.openapi.roots.ModuleRootModel; +import com.intellij.openapi.roots.impl.storage.ClasspathStorage; +import com.intellij.openapi.ui.DialogWrapper; +import com.intellij.openapi.ui.Messages; +import com.intellij.openapi.util.WriteExternalException; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.util.Function; +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.output.EclipseJDOMUtil; +import org.jetbrains.idea.eclipse.ConversionException; +import org.jetbrains.idea.eclipse.EclipseBundle; +import org.jetbrains.idea.eclipse.EclipseXml; +import org.jetbrains.idea.eclipse.IdeaXml; +import org.jetbrains.idea.eclipse.conversion.*; +import org.jetbrains.jps.eclipse.model.JpsEclipseClasspathSerializer; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +public class ExportEclipseProjectsAction extends AnAction implements DumbAware { + private static final Logger LOG = Logger.getInstance("#" + ExportEclipseProjectsAction.class.getName()); + + public void update(final AnActionEvent e) { + final Project project = e.getData(PlatformDataKeys.PROJECT); + e.getPresentation().setEnabled(project != null); + } + + public void actionPerformed(AnActionEvent e) { + final Project project = e.getData(PlatformDataKeys.PROJECT); + if (project == null) return; + project.save(); // to flush iml files + + final List<Module> modules = new ArrayList<Module>(); + final List<Module> incompatibleModules = new ArrayList<Module>(); + for (Module module : ModuleManager.getInstance(project).getModules()) { + if (!JpsEclipseClasspathSerializer.CLASSPATH_STORAGE_ID.equals(ClasspathStorage.getStorageType(module))) { + try { + ClasspathStorage.getProvider(JpsEclipseClasspathSerializer.CLASSPATH_STORAGE_ID).assertCompatible(ModuleRootManager.getInstance(module)); + modules.add(module); + } + catch (ConfigurationException e1) { + incompatibleModules.add(module); + } + } + } + + //todo suggest smth with hierarchy modules + if (!incompatibleModules.isEmpty()) { + if (Messages.showOkCancelDialog(project, "<html><body>Eclipse incompatible modules found:<ul><br><li>" + + StringUtil.join(incompatibleModules, new Function<Module, String>() { + public String fun(Module module) { + return module.getName(); + } + }, "<br><li>") + + "</ul><br>Would you like to proceed and possibly lose your configurations?</body></html>", + "Eclipse Incompatible Modules Found", Messages.getWarningIcon()) != DialogWrapper.OK_EXIT_CODE) { + return; + } + } + else if (modules.isEmpty()) { + Messages.showInfoMessage(project, EclipseBundle.message("eclipse.export.nothing.to.do"), + EclipseBundle.message("eclipse.export.dialog.title")); + return; + } + + modules.addAll(incompatibleModules); + final ExportEclipseProjectsDialog dialog = new ExportEclipseProjectsDialog(project, modules); + dialog.show(); + if (dialog.isOK()) { + if (dialog.isLink()) { + for (Module module : dialog.getSelectedModules()) { + ClasspathStorage.setStorageType(ModuleRootManager.getInstance(module), JpsEclipseClasspathSerializer.CLASSPATH_STORAGE_ID); + } + } + else { + for (Module module : dialog.getSelectedModules()) { + final ModuleRootModel model = ModuleRootManager.getInstance(module); + final VirtualFile[] contentRoots = model.getContentRoots(); //todo + final String storageRoot = + contentRoots.length == 1 ? contentRoots[0].getPath() : ClasspathStorage.getStorageRootFromOptions(module); + try { + final Element classpathEleemnt = new Element(EclipseXml.CLASSPATH_TAG); + + final EclipseClasspathWriter classpathWriter = new EclipseClasspathWriter(model); + classpathWriter.writeClasspath(classpathEleemnt, null); + final File classpathFile = new File(storageRoot, EclipseXml.CLASSPATH_FILE); + if (!FileUtil.createIfDoesntExist(classpathFile)) continue; + EclipseJDOMUtil.output(new Document(classpathEleemnt), classpathFile, project); + + final Element ideaSpecific = new Element(IdeaXml.COMPONENT_TAG); + if (IdeaSpecificSettings.writeIDEASpecificClasspath(ideaSpecific, model)) { + final File emlFile = new File(storageRoot, module.getName() + EclipseXml.IDEA_SETTINGS_POSTFIX); + if (!FileUtil.createIfDoesntExist(emlFile)) continue; + EclipseJDOMUtil.output(new Document(ideaSpecific), emlFile, project); + } + + DotProjectFileHelper.saveDotProjectFile(module, storageRoot); + } + catch (ConversionException e1) { + LOG.error(e1); + } + catch (IOException e1) { + LOG.error(e1); + } + catch (WriteExternalException e1) { + LOG.error(e1); + } + } + } + try { + EclipseUserLibrariesHelper.appendProjectLibraries(project, dialog.getUserLibrariesFile()); + } + catch (IOException e1) { + LOG.error(e1); + } + project.save(); + } + } +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/export/ExportEclipseProjectsDialog.form b/plugins/eclipse/src/org/jetbrains/idea/eclipse/export/ExportEclipseProjectsDialog.form new file mode 100644 index 000000000000..1693705a1130 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/export/ExportEclipseProjectsDialog.form @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.jetbrains.idea.eclipse.export.ExportEclipseProjectsDialog"> + <grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> + <margin top="4" left="4" bottom="4" right="4"/> + <constraints> + <xy x="48" y="54" width="436" height="297"/> + </constraints> + <properties/> + <border type="none"> + <font/> + </border> + <children> + <grid id="e3588" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> + <margin top="0" left="0" bottom="0" right="0"/> + <constraints> + <grid row="0" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/> + </constraints> + <properties/> + <clientProperties> + <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithoutIndent"/> + </clientProperties> + <border type="none" title="Modules to export"> + <font/> + </border> + <children> + <component id="f14ba" class="com.intellij.ide.util.ElementsChooser" binding="moduleChooser" custom-create="true"> + <constraints> + <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> + </constraints> + <properties/> + </component> + </children> + </grid> + <component id="3054e" class="javax.swing.JCheckBox" binding="linkCheckBox"> + <constraints> + <grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/> + </constraints> + <properties> + <text value="Switch selected modules to &Eclipse-compatible format"/> + </properties> + </component> + <component id="285cc" class="javax.swing.JLabel" binding="myPathToUserLibsLabel"> + <constraints> + <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/> + </constraints> + <properties> + <labelFor value="c860d"/> + <text value="&Path to resulting .userlibraries"/> + </properties> + </component> + <component id="c860d" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myUserLibrariesTF"> + <constraints> + <grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/> + </constraints> + <properties/> + </component> + <component id="1e3e0" class="javax.swing.JCheckBox" binding="myExportProjectLibrariesCb" default-binding="true"> + <constraints> + <grid row="2" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/> + </constraints> + <properties> + <text value="E&xport non-module libraries"/> + </properties> + </component> + </children> + </grid> +</form> diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/export/ExportEclipseProjectsDialog.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/export/ExportEclipseProjectsDialog.java new file mode 100644 index 000000000000..d402e08f98b5 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/export/ExportEclipseProjectsDialog.java @@ -0,0 +1,83 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse.export; + +import com.intellij.ide.util.ElementsChooser; +import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.ui.DialogWrapper; +import com.intellij.openapi.ui.TextFieldWithBrowseButton; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.idea.eclipse.EclipseBundle; + +import javax.swing.*; +import java.io.File; +import java.util.List; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; + +public class ExportEclipseProjectsDialog extends DialogWrapper { + private JPanel contentPane; + private ElementsChooser<Module> moduleChooser; + private JCheckBox linkCheckBox; + private TextFieldWithBrowseButton myUserLibrariesTF; + private JCheckBox myExportProjectLibrariesCb; + private JLabel myPathToUserLibsLabel; + + public ExportEclipseProjectsDialog(final Project project, List<Module> modules) { + super(project, false); + moduleChooser.setElements(modules, true); + setTitle(EclipseBundle.message("eclipse.export.dialog.title")); + init(); + myUserLibrariesTF.setText(project.getBaseDir().getPath() + File.separator + project.getName() + ".userlibraries"); + myUserLibrariesTF.addBrowseFolderListener("Locate .userlibraries", "Locate .userlibraries file where project libraries would be exported", project, FileChooserDescriptorFactory.createSingleLocalFileDescriptor()); + myExportProjectLibrariesCb.setSelected(true); + myExportProjectLibrariesCb.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + myUserLibrariesTF.setEnabled(myExportProjectLibrariesCb.isSelected()); + myPathToUserLibsLabel.setEnabled(myExportProjectLibrariesCb.isSelected()); + } + }); + } + + @Nullable + protected JComponent createCenterPanel() { + return contentPane; + } + + private void createUIComponents() { + moduleChooser = new ElementsChooser<Module>(true) { + protected String getItemText(@NotNull final Module module) { + return module.getName(); + } + }; + } + + public boolean isLink() { + return linkCheckBox.isSelected(); + } + + public List<Module> getSelectedModules() { + return moduleChooser.getMarkedElements(); + } + + @Nullable + public File getUserLibrariesFile() { + return myExportProjectLibrariesCb.isSelected() ? new File(myUserLibrariesTF.getText()) : null; + } +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseImportBuilder.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseImportBuilder.java new file mode 100644 index 000000000000..c25a9429e8f3 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseImportBuilder.java @@ -0,0 +1,455 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse.importWizard; + +import com.intellij.notification.Notification; +import com.intellij.notification.NotificationType; +import com.intellij.notification.Notifications; +import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.application.ModalityState; +import com.intellij.openapi.application.ex.ApplicationInfoEx; +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.fileChooser.FileChooser; +import com.intellij.openapi.fileChooser.FileChooserDescriptor; +import com.intellij.openapi.module.ModifiableModuleModel; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleManager; +import com.intellij.openapi.module.StdModuleTypes; +import com.intellij.openapi.progress.ProgressIndicator; +import com.intellij.openapi.progress.ProgressManager; +import com.intellij.openapi.progress.Task; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.project.impl.ProjectMacrosUtil; +import com.intellij.openapi.roots.ModifiableRootModel; +import com.intellij.openapi.roots.ModuleRootManager; +import com.intellij.openapi.roots.impl.ModifiableModelCommitter; +import com.intellij.openapi.roots.impl.storage.ClasspathStorage; +import com.intellij.openapi.roots.libraries.Library; +import com.intellij.openapi.roots.libraries.LibraryTable; +import com.intellij.openapi.roots.libraries.LibraryTablesRegistrar; +import com.intellij.openapi.roots.ui.configuration.ModulesProvider; +import com.intellij.openapi.ui.DialogWrapper; +import com.intellij.openapi.ui.Messages; +import com.intellij.openapi.util.Comparing; +import com.intellij.openapi.util.JDOMUtil; +import com.intellij.openapi.util.Ref; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.openapi.vfs.LocalFileSystem; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.packaging.artifacts.ModifiableArtifactModel; +import com.intellij.projectImport.ProjectImportBuilder; +import com.intellij.util.Function; +import com.intellij.util.Processor; +import gnu.trove.THashSet; +import icons.EclipseIcons; +import org.jdom.Element; +import org.jdom.JDOMException; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.idea.eclipse.EclipseBundle; +import org.jetbrains.idea.eclipse.EclipseProjectFinder; +import org.jetbrains.idea.eclipse.EclipseXml; +import org.jetbrains.idea.eclipse.IdeaXml; +import org.jetbrains.idea.eclipse.conversion.EclipseClasspathReader; +import org.jetbrains.idea.eclipse.conversion.EclipseUserLibrariesHelper; +import org.jetbrains.jps.eclipse.model.JpsEclipseClasspathSerializer; + +import javax.swing.*; +import java.io.File; +import java.io.IOException; +import java.util.*; + +public class EclipseImportBuilder extends ProjectImportBuilder<String> implements EclipseProjectWizardContext { + private static final Logger LOG = Logger.getInstance("#" + EclipseImportBuilder.class.getName()); + + public static class Parameters { + public String root; + public List<String> workspace; + public boolean linkConverted; + public List<String> projectsToConvert = new ArrayList<String>(); + public boolean openModuleSettings; + public Options converterOptions = new Options(); + public Set<String> existingModuleNames; + } + + private Parameters parameters; + + + @NotNull + public String getName() { + return EclipseBundle.message("eclipse.name"); + } + + public Icon getIcon() { + return EclipseIcons.Eclipse; + } + + @Nullable + public String getRootDirectory() { + return getParameters().root; + } + + public boolean setRootDirectory(final String path) { + ProgressManager.getInstance().run(new Task.Modal(getCurrentProject(), EclipseBundle.message("eclipse.import.scanning"), true) { + public void run(@NotNull ProgressIndicator indicator) { + final ArrayList<String> roots = new ArrayList<String>(); + EclipseProjectFinder.findModuleRoots(roots, path, new Processor<String>() { + @Override + public boolean process(String path) { + final ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator(); + if (progressIndicator != null) { + if (progressIndicator.isCanceled()) return false; + progressIndicator.setText2(path); + } + return true; + } + }); + Collections.sort(roots, new Comparator<String>() { + @Override + public int compare(String path1, String path2) { + final String projectName1 = EclipseProjectFinder.findProjectName(path1); + final String projectName2 = EclipseProjectFinder.findProjectName(path2); + return projectName1 != null && projectName2 != null ? projectName1.compareToIgnoreCase(projectName2) : 0; + } + }); + getParameters().workspace = roots; + getParameters().root = path; + } + + public void onCancel() { + getParameters().workspace = null; + getParameters().root = null; + } + }); + + setFileToImport(path); + return getParameters().workspace != null; + } + + public List<String> getList() { + return getParameters().workspace; + } + + public boolean isMarked(final String element) { + if (getParameters().projectsToConvert != null) { + return getParameters().projectsToConvert.contains(element); + } + return !getParameters().existingModuleNames.contains(EclipseProjectFinder.findProjectName(element)); + } + + public void setList(List<String> list) { + getParameters().projectsToConvert = list; + } + + public boolean isOpenProjectSettingsAfter() { + return getParameters().openModuleSettings; + } + + public void setOpenProjectSettingsAfter(boolean on) { + getParameters().openModuleSettings = on; + } + + public void cleanup() { + super.cleanup(); + parameters = null; + } + + public boolean validate(final Project currentProject, final Project dstProject) { + final Ref<Exception> refEx = new Ref<Exception>(); + final HashSet<String> variables = new HashSet<String>(); + final Set<String> naturesNames = new HashSet<String>(); + ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() { + public void run() { + try { + for (String path : getParameters().projectsToConvert) { + final File classpathfile = new File(path, EclipseXml.DOT_CLASSPATH_EXT); + if (classpathfile.exists()) { + final Element classpathElement = JDOMUtil.loadDocument(classpathfile).getRootElement(); + EclipseClasspathReader.collectVariables(variables, classpathElement, path); + } + EclipseProjectFinder.collectUnknownNatures(path, naturesNames); + } + } + catch (IOException e) { + refEx.set(e); + } + catch (JDOMException e) { + refEx.set(e); + } + } + }, EclipseBundle.message("eclipse.import.converting"), false, currentProject); + + if (!refEx.isNull()) { + Messages.showErrorDialog(dstProject, refEx.get().getMessage(), getTitle()); + return false; + } + + if (!ProjectMacrosUtil.checkNonIgnoredMacros(dstProject, variables)) { + return false; + } + + final Runnable runnable = new Runnable() { + public void run() { + if (!naturesNames.isEmpty()) { + final String title = "Unknown Natures Detected"; + Notifications.Bus.notify(new Notification(title, title, "Imported projects contain unknown natures:<br>" + StringUtil.join(naturesNames, "<br>")+ "<br>" + + "Some settings may be lost after import.", NotificationType.WARNING)); + } + } + }; + ApplicationManager.getApplication().invokeLater(runnable, ModalityState.NON_MODAL); + + return true; + } + + @Override + public List<Module> commit(final Project project, ModifiableModuleModel model, ModulesProvider modulesProvider, + ModifiableArtifactModel artifactModel) { + + final Collection<String> unknownLibraries = new TreeSet<String>(); + final Collection<String> unknownJdks = new TreeSet<String>(); + final Set<String> refsToModules = new HashSet<String>(); + final List<Module> result = new ArrayList<Module>(); + + try { + final ModifiableModuleModel moduleModel = model != null ? model : ModuleManager.getInstance(project).getModifiableModel(); + final ModifiableRootModel[] rootModels = new ModifiableRootModel[getParameters().projectsToConvert.size()]; + final Set<File> files = new HashSet<File>(); + final Set<String> moduleNames = new THashSet<String>(getParameters().projectsToConvert.size()); + for (String path : getParameters().projectsToConvert) { + String modulesDirectory = getParameters().converterOptions.commonModulesDirectory; + if (modulesDirectory == null) { + modulesDirectory = path; + } + final String moduleName = EclipseProjectFinder.findProjectName(path); + moduleNames.add(moduleName); + final File imlFile = new File(modulesDirectory + File.separator + moduleName + IdeaXml.IML_EXT); + if (imlFile.isFile()) { + files.add(imlFile); + } + final File emlFile = new File(modulesDirectory + File.separator + moduleName + EclipseXml.IDEA_SETTINGS_POSTFIX); + if (emlFile.isFile()) { + files.add(emlFile); + } + } + if (!files.isEmpty()) { + final int resultCode = Messages.showYesNoCancelDialog(ApplicationInfoEx.getInstanceEx().getFullApplicationName() + + " module files found:\n" + + StringUtil.join(files,new Function<File, String>() { + public String fun(File file) { + return file.getPath(); + } + }, "\n") + + ".\n Would you like to reuse them?", "Module files found", + Messages.getQuestionIcon()); + if (resultCode != DialogWrapper.OK_EXIT_CODE) { + if (resultCode == DialogWrapper.CANCEL_EXIT_CODE) { + final LocalFileSystem localFileSystem = LocalFileSystem.getInstance(); + for (File file : files) { + final VirtualFile virtualFile = localFileSystem.findFileByIoFile(file); + if (virtualFile != null) { + final IOException[] ex = new IOException[1]; + ApplicationManager.getApplication().runWriteAction(new Runnable() { + public void run() { + try { + virtualFile.delete(this); + } + catch (IOException e) { + ex[0] = e; + } + } + }); + if (ex[0] != null) { + throw ex[0]; + } + } + else { + FileUtil.delete(file); + } + } + } else { + return result; + } + } + } + int idx = 0; + final Set<String> usedVariables = new HashSet<String>(); + for (String path : getParameters().projectsToConvert) { + String modulesDirectory = getParameters().converterOptions.commonModulesDirectory; + if (modulesDirectory == null) { + modulesDirectory = path; + } + final Module module = moduleModel.newModule(modulesDirectory + "/" + EclipseProjectFinder.findProjectName(path) + IdeaXml.IML_EXT, + StdModuleTypes.JAVA.getId()); + result.add(module); + final ModifiableRootModel rootModel = ModuleRootManager.getInstance(module).getModifiableModel(); + rootModels[idx++] = rootModel; + + final File classpathFile = new File(path, EclipseXml.DOT_CLASSPATH_EXT); + final EclipseClasspathReader classpathReader = new EclipseClasspathReader(path, project, getParameters().projectsToConvert, moduleNames); + classpathReader.init(rootModel); + if (classpathFile.exists()) { + final Element classpathElement = JDOMUtil.loadDocument(classpathFile).getRootElement(); + classpathReader.readClasspath(rootModel, unknownLibraries, unknownJdks, usedVariables, refsToModules, + getParameters().converterOptions.testPattern, classpathElement); + } else { + EclipseClasspathReader.setOutputUrl(rootModel, path + "/bin"); + } + ClasspathStorage.setStorageType(rootModel, + getParameters().linkConverted ? JpsEclipseClasspathSerializer.CLASSPATH_STORAGE_ID : ClasspathStorage.DEFAULT_STORAGE); + if (model != null) { + ApplicationManager.getApplication().runWriteAction(new Runnable() { + public void run() { + rootModel.commit(); + } + }); + } + } + if (model == null) { + ApplicationManager.getApplication().runWriteAction(new Runnable() { + public void run(){ + ModifiableModelCommitter.multiCommit(rootModels, moduleModel); + } + }); + } + } + catch (Exception e) { + LOG.error(e); + } + + createEclipseLibrary(project, unknownLibraries, IdeaXml.ECLIPSE_LIBRARY); + + StringBuffer message = new StringBuffer(); + refsToModules.removeAll(getParameters().existingModuleNames); + for (String path : getParameters().projectsToConvert) { + final String projectName = EclipseProjectFinder.findProjectName(path); + if (projectName != null) { + refsToModules.remove(projectName); + getParameters().existingModuleNames.add(projectName); + } + } + if (!refsToModules.isEmpty()) { + + message.append("Unknown modules detected"); + for (String module : refsToModules) { + message.append("\n").append(module); + } + } + if (!unknownJdks.isEmpty()) { + if (message.length() > 0){ + message.append("\nand jdks"); + } else { + message.append("Imported project refers to unknown jdks"); + } + for (String unknownJdk : unknownJdks) { + message.append("\n").append(unknownJdk); + } + } + if (!unknownLibraries.isEmpty()) { + final StringBuffer buf = new StringBuffer(); + buf.append("<html><body>"); + buf.append(EclipseBundle.message("eclipse.import.warning.undefinded.libraries")); + for (String name : unknownLibraries) { + buf.append("<br>").append(name); + } + if (model == null) { + buf.append("<br><b>Please export Eclipse user libraries and import them now from resulted .userlibraries file</b>"); + buf.append("</body></html>"); + final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, false, false, false, false, false) { + @Override + public boolean isFileSelectable(VirtualFile file) { + return super.isFileSelectable(file) && Comparing.strEqual(file.getExtension(), "userlibraries"); + } + }; + descriptor.setDescription(buf.toString()); + descriptor.setTitle(getTitle()); + final VirtualFile selectedFile = FileChooser.chooseFile(descriptor, project, project.getBaseDir()); + if (selectedFile != null) { + ApplicationManager.getApplication().runWriteAction(new Runnable() { + public void run() { + try { + EclipseUserLibrariesHelper.readProjectLibrariesContent(new File(selectedFile.getPath()), project, unknownLibraries); + } + catch (Exception e) { + LOG.error(e); + } + } + }); + } + } + } + + if (message.length() > 0) { + Messages.showErrorDialog(project, message.toString(), getTitle()); + } + + return result; + } + + private static void createEclipseLibrary(final Project project, final Collection<String> libraries, final String libraryName) { + if (libraries.contains(libraryName)) { + final FileChooserDescriptor fileChooserDescriptor = new FileChooserDescriptor(false, true, false, false, false, false) { + + public Icon getIcon(final VirtualFile file) { + return looksLikeEclipse(file) ? dressIcon(file, EclipseIcons.Eclipse) : super.getIcon(file); + } + + private boolean looksLikeEclipse(final VirtualFile file) { + return file.findChild(".eclipseproduct") != null; + } + }; + fileChooserDescriptor.setTitle(EclipseBundle.message("eclipse.create.library.title")); + fileChooserDescriptor.setDescription(EclipseBundle.message("eclipse.create.library.description", libraryName)); + final VirtualFile file = FileChooser.chooseFile(fileChooserDescriptor, project, null); + if (file != null) { + final VirtualFile pluginsDir = file.findChild("plugins"); + if (pluginsDir != null) { + ApplicationManager.getApplication().runWriteAction(new Runnable() { + public void run() { + final LibraryTable table = + LibraryTablesRegistrar.getInstance().getLibraryTableByLevel(LibraryTablesRegistrar.APPLICATION_LEVEL, project); + assert table != null; + final LibraryTable.ModifiableModel tableModel = table.getModifiableModel(); + final Library library = tableModel.createLibrary(libraryName); + final Library.ModifiableModel libraryModel = library.getModifiableModel(); + libraryModel.addJarDirectory(pluginsDir, true); + libraryModel.commit(); + tableModel.commit(); + } + }); + libraries.remove(libraryName); + } + } + } + } + + public Parameters getParameters() { + if (parameters == null) { + parameters = new Parameters(); + parameters.existingModuleNames = new HashSet<String>(); + if (isUpdate()) { + final Project project = getCurrentProject(); + if (project != null) { + for (Module module : ModuleManager.getInstance(project).getModules()) { + parameters.existingModuleNames.add(module.getName()); + } + } + } + } + return parameters; + } +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseProjectImportProvider.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseProjectImportProvider.java new file mode 100644 index 000000000000..b83e6c1a36fe --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseProjectImportProvider.java @@ -0,0 +1,55 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 12-Jul-2007 + */ +package org.jetbrains.idea.eclipse.importWizard; + +import com.intellij.ide.util.projectWizard.ModuleWizardStep; +import com.intellij.ide.util.projectWizard.ProjectWizardStepFactory; +import com.intellij.ide.util.projectWizard.WizardContext; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.projectImport.ProjectImportProvider; +import org.jetbrains.annotations.Nullable; + +public class EclipseProjectImportProvider extends ProjectImportProvider { + + private final EclipseProjectOpenProcessor myProcessor; + + public EclipseProjectImportProvider(final EclipseImportBuilder builder) { + super(builder); + myProcessor = new EclipseProjectOpenProcessor(builder); + } + + public ModuleWizardStep[] createSteps(WizardContext context) { + final ProjectWizardStepFactory stepFactory = ProjectWizardStepFactory.getInstance(); + return new ModuleWizardStep[]{new EclipseWorkspaceRootStep(context), new SelectEclipseImportedProjectsStep(context), + stepFactory.createProjectJdkStep(context)/*, stepFactory.createNameAndLocationStep(context)*/}; + } + + @Override + protected boolean canImportFromFile(VirtualFile file) { + return myProcessor.canOpenProject(file); + } + + @Nullable + @Override + public String getFileSample() { + return "<b>Eclipse</b> project (.project) or classpath (.classpath) file"; + } +}
\ No newline at end of file diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseProjectOpenProcessor.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseProjectOpenProcessor.java new file mode 100644 index 000000000000..09e4ac5317bf --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseProjectOpenProcessor.java @@ -0,0 +1,54 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 12-Jul-2007 + */ +package org.jetbrains.idea.eclipse.importWizard; + +import com.intellij.ide.util.projectWizard.WizardContext; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.projectImport.ProjectOpenProcessorBase; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.idea.eclipse.EclipseProjectFinder; +import org.jetbrains.idea.eclipse.EclipseXml; + +import java.util.List; + +public class EclipseProjectOpenProcessor extends ProjectOpenProcessorBase<EclipseImportBuilder> { + public EclipseProjectOpenProcessor(@NotNull final EclipseImportBuilder builder) { + super(builder); + } + + @Nullable + public String[] getSupportedExtensions() { + return new String[] {EclipseXml.CLASSPATH_FILE, EclipseXml.PROJECT_FILE}; + } + + public boolean doQuickImport(VirtualFile file, final WizardContext wizardContext) { + getBuilder().setRootDirectory(file.getParent().getPath()); + + final List<String> projects = getBuilder().getList(); + if (projects == null || projects.size() != 1) { + return false; + } + getBuilder().setList(projects); + wizardContext.setProjectName(EclipseProjectFinder.findProjectName(projects.get(0))); + return true; + } +}
\ No newline at end of file diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseProjectWizardContext.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseProjectWizardContext.java new file mode 100644 index 000000000000..4baf8651251e --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseProjectWizardContext.java @@ -0,0 +1,28 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse.importWizard; + +import org.jetbrains.annotations.Nullable; + +/** + * @author Vladislav.Kaznacheev +*/ +interface EclipseProjectWizardContext { + @Nullable + String getRootDirectory(); + + boolean setRootDirectory(String path); +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseWorkspaceRootStep.form b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseWorkspaceRootStep.form new file mode 100644 index 000000000000..62cbc596e177 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseWorkspaceRootStep.form @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="UTF-8"?> +<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.jetbrains.idea.eclipse.importWizard.EclipseWorkspaceRootStep"> + <grid id="27dc6" binding="myPanel" layout-manager="GridLayoutManager" row-count="6" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> + <margin top="4" left="4" bottom="4" right="4"/> + <constraints> + <xy x="20" y="20" width="500" height="400"/> + </constraints> + <properties/> + <border type="none"/> + <children> + <component id="73fab" class="javax.swing.JCheckBox" binding="myLinkCheckBox"> + <constraints> + <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/> + </constraints> + <properties> + <text value="&Link created IntelliJ IDEA modules to Eclipse project files"/> + </properties> + </component> + <vspacer id="26af9"> + <constraints> + <grid row="5" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/> + </constraints> + </vspacer> + <grid id="fa65a" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> + <margin top="0" left="0" bottom="0" right="0"/> + <constraints> + <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> + </constraints> + <properties/> + <clientProperties> + <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/> + </clientProperties> + <border type="none" title="IntelliJ IDEA project and module files location"/> + <children> + <component id="7a680" class="javax.swing.JRadioButton" binding="rbModulesColocated"> + <constraints> + <grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/> + </constraints> + <properties> + <text value="Create module files near .classpath files"/> + </properties> + </component> + <component id="681ea" class="javax.swing.JRadioButton" binding="rbModulesDedicated"> + <constraints> + <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/> + </constraints> + <properties> + <text value="Keep project and module files in"/> + </properties> + </component> + <component id="8242e" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myDirComponent"> + <constraints> + <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="0" fill="1" indent="0" use-parent-layout="false"/> + </constraints> + <properties/> + </component> + <grid id="d8fb5" binding="myFormatPanel" layout-manager="BorderLayout" hgap="0" vgap="0"> + <constraints> + <grid row="2" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> + </constraints> + <properties/> + <border type="none"/> + <children/> + </grid> + </children> + </grid> + <component id="7ccdd" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myWorkspaceRootComponent"> + <constraints> + <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/> + </constraints> + <properties/> + </component> + <component id="8bc80" class="javax.swing.JLabel"> + <constraints> + <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> + </constraints> + <properties> + <font style="1"/> + <text resource-bundle="EclipseBundle" key="eclipse.import.label.select.workspace"/> + </properties> + </component> + <grid id="11e0a" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> + <margin top="4" left="0" bottom="0" right="0"/> + <constraints> + <grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> + </constraints> + <properties/> + <border type="none"/> + <children> + <component id="25448" class="javax.swing.JLabel"> + <constraints> + <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> + </constraints> + <properties> + <labelFor value="4533f"/> + <text value="Detect &test sources (comma-separated path masks, '*' and '?' wildcards allowed):"/> + </properties> + </component> + <component id="4533f" class="javax.swing.JTextField" binding="myTestSourcesMask"> + <constraints> + <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"> + <preferred-size width="150" height="-1"/> + </grid> + </constraints> + <properties/> + </component> + </children> + </grid> + </children> + </grid> + <buttonGroups> + <group name="buttonGroup1"> + <member id="7a680"/> + <member id="681ea"/> + </group> + </buttonGroups> +</form> diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseWorkspaceRootStep.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseWorkspaceRootStep.java new file mode 100644 index 000000000000..0d8d63413ef8 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseWorkspaceRootStep.java @@ -0,0 +1,174 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse.importWizard; + +import com.intellij.ide.util.PropertiesComponent; +import com.intellij.ide.util.projectWizard.WizardContext; +import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; +import com.intellij.openapi.options.ConfigurationException; +import com.intellij.openapi.ui.TextFieldWithBrowseButton; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.projectImport.ProjectFormatPanel; +import com.intellij.projectImport.ProjectImportWizardStep; +import org.jetbrains.idea.eclipse.EclipseBundle; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; + +public class EclipseWorkspaceRootStep extends ProjectImportWizardStep { + private static final String _ECLIPSE_PROJECT_DIR = "eclipse.project.dir"; + + private JPanel myPanel; + private JCheckBox myLinkCheckBox; + private JRadioButton rbModulesColocated; + private JRadioButton rbModulesDedicated; + private JTextField myTestSourcesMask; + private TextFieldWithBrowseButton myDirComponent; + private TextFieldWithBrowseButton myWorkspaceRootComponent; + private ProjectFormatPanel myProjectFormatPanel; + private JPanel myFormatPanel; + + private EclipseImportBuilder.Parameters myParameters; + + + public EclipseWorkspaceRootStep(final WizardContext context) { + super(context); + myWorkspaceRootComponent.addBrowseFolderListener(EclipseBundle.message("eclipse.import.title.select.workspace"), "", null, + FileChooserDescriptorFactory.createSingleFolderDescriptor()); + + myDirComponent.addBrowseFolderListener(EclipseBundle.message("eclipse.import.title.module.dir"), "", null, + FileChooserDescriptorFactory.createSingleFolderDescriptor()); + + ActionListener listener = new ActionListener() { + public void actionPerformed(final ActionEvent e) { + final boolean dedicated = rbModulesDedicated.isSelected(); + myDirComponent.setEnabled(dedicated); + if (dedicated && myDirComponent.getText().length() == 0) { + final String remoteStorage = Options.getProjectStorageDir(context.getProject()); + myDirComponent.setText(remoteStorage != null ? remoteStorage : FileUtil.toSystemDependentName(myWorkspaceRootComponent.getText())); + } + } + }; + + rbModulesColocated.addActionListener(listener); + rbModulesDedicated.addActionListener(listener); + + if (context.isCreatingNewProject()) { + myProjectFormatPanel = new ProjectFormatPanel(); + myFormatPanel.add(myProjectFormatPanel.getPanel(), BorderLayout.WEST); + } + } + + public JComponent getComponent() { + return myPanel; + } + + public boolean validate() throws ConfigurationException { + return super.validate() && getContext().setRootDirectory(myWorkspaceRootComponent.getText()); + } + + @Override + public String getName() { + return "Eclipse Projects Root"; + } + + public void updateDataModel() { + final String projectFilesDir; + if (myDirComponent.isEnabled()) { + projectFilesDir = myDirComponent.getText(); + } + else { + projectFilesDir = null; + } + suggestProjectNameAndPath(projectFilesDir, myWorkspaceRootComponent.getText()); + getParameters().converterOptions.commonModulesDirectory = projectFilesDir; + getParameters().converterOptions.testPattern = wildcardToRegexp(myTestSourcesMask.getText()); + getParameters().linkConverted = myLinkCheckBox.isSelected(); + getParameters().projectsToConvert = null; + if (getWizardContext().isCreatingNewProject()) { + myProjectFormatPanel.updateData(getWizardContext()); + } + PropertiesComponent.getInstance().setValue(_ECLIPSE_PROJECT_DIR, myWorkspaceRootComponent.getText()); + Options.saveProjectStorageDir(getParameters().converterOptions.commonModulesDirectory); + } + + public void updateStep() { + String path = getBuilder().getFileToImport(); + if (path == null) { + if (getWizardContext().isProjectFileDirectorySet() || !PropertiesComponent.getInstance().isValueSet(_ECLIPSE_PROJECT_DIR)) { + path = getWizardContext().getProjectFileDirectory(); + } + else { + path = PropertiesComponent.getInstance().getValue(_ECLIPSE_PROJECT_DIR); + } + } + myWorkspaceRootComponent.setText(path.replace('/', File.separatorChar)); + myWorkspaceRootComponent.getTextField().selectAll(); + + final String storageDir = Options.getProjectStorageDir(getWizardContext().getProject()); + final boolean colocated = StringUtil.isEmptyOrSpaces(getParameters().converterOptions.commonModulesDirectory) && StringUtil.isEmptyOrSpaces(storageDir); + rbModulesColocated.setSelected(colocated); + rbModulesDedicated.setSelected(!colocated); + myDirComponent.setEnabled(!colocated); + if (StringUtil.isEmptyOrSpaces(getParameters().converterOptions.commonModulesDirectory)) { + myDirComponent.setText(storageDir); + } + else { + myDirComponent.setText(getParameters().converterOptions.commonModulesDirectory); + } + + myTestSourcesMask.setText(regexpToWildcard(getParameters().converterOptions.testPattern)); + + myLinkCheckBox.setSelected(getParameters().linkConverted); + } + + private static String wildcardToRegexp(String string) { + return string == null ? null : string.replaceAll("\\.", "\\.") // "." -> "\." + .replaceAll("\\*", ".*") // "*" -> ".*" + .replaceAll("\\?", ".") // "?" -> "." + .replaceAll(",\\s*", "|"); // "," possible followed by whitespace -> "|" + } + + private static String regexpToWildcard(String string) { + return string == null ? null : string.replaceAll("\\.\\*", "*") // ".*" -> "*" + .replaceAll("\\.", "?") // "." -> "?" + .replaceAll("\\\\\\?", ".") // "\?" -> "." + .replaceAll("\\|", ", "); // "|" -> ","; + } + + public JComponent getPreferredFocusedComponent() { + return myWorkspaceRootComponent.getTextField(); + } + + public String getHelpId() { + return "reference.dialogs.new.project.import.eclipse.page1"; + } + + public EclipseProjectWizardContext getContext() { + return (EclipseProjectWizardContext)getBuilder(); + } + + public EclipseImportBuilder.Parameters getParameters() { + if (myParameters == null) { + myParameters = ((EclipseImportBuilder)getBuilder()).getParameters(); + } + return myParameters; + } +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/Options.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/Options.java new file mode 100644 index 000000000000..fab8295bbe93 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/Options.java @@ -0,0 +1,45 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 11-Nov-2008 + */ +package org.jetbrains.idea.eclipse.importWizard; + +import com.intellij.ide.util.PropertiesComponent; +import com.intellij.openapi.project.Project; +import org.jetbrains.annotations.NonNls; + +public class Options { + @NonNls + public String commonModulesDirectory; + @NonNls + public String testPattern; + public boolean reuseOutputPaths = false; + + public static Options defValue = new Options(); + + + public static final String ECLIPSE_REMOTE_PROJECT_STORAGE = "eclipse.remote.project.storage"; + public static String getProjectStorageDir(Project project){ + return PropertiesComponent.getInstance().getValue(ECLIPSE_REMOTE_PROJECT_STORAGE); + } + + public static void saveProjectStorageDir(String dir) { + PropertiesComponent.getInstance().setValue(ECLIPSE_REMOTE_PROJECT_STORAGE, dir); + } +}
\ No newline at end of file diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/SelectEclipseImportedProjectsStep.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/SelectEclipseImportedProjectsStep.java new file mode 100644 index 000000000000..0b3ac28519da --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/SelectEclipseImportedProjectsStep.java @@ -0,0 +1,109 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 12-Jul-2007 + */ +package org.jetbrains.idea.eclipse.importWizard; + +import com.intellij.icons.AllIcons; +import com.intellij.ide.util.ElementsChooser; +import com.intellij.ide.util.projectWizard.WizardContext; +import com.intellij.openapi.options.ConfigurationException; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.projectImport.SelectImportedProjectsStep; +import com.intellij.util.ArrayUtil; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.idea.eclipse.EclipseProjectFinder; +import org.jetbrains.idea.eclipse.util.PathUtil; + +import javax.swing.*; +import java.util.HashSet; +import java.util.Set; + +class SelectEclipseImportedProjectsStep extends SelectImportedProjectsStep<String> { + + Set<String> duplicateNames; + + public SelectEclipseImportedProjectsStep(WizardContext context) { + super(context); + fileChooser.addElementsMarkListener(new ElementsChooser.ElementsMarkListener<String>() { + public void elementMarkChanged(final String element, final boolean isMarked) { + duplicateNames = null; + fileChooser.repaint(); + } + }); + } + + private boolean isInConflict(final String item) { + calcDuplicates(); + return fileChooser.getMarkedElements().contains(item) && duplicateNames.contains(EclipseProjectFinder.findProjectName(item)); + } + + private void calcDuplicates() { + if (duplicateNames == null) { + duplicateNames = new HashSet<String>(); + Set<String> usedNames = new HashSet<String>(); + for (String model : fileChooser.getMarkedElements()) { + final String projectName = EclipseProjectFinder.findProjectName(model); + if (!usedNames.add(projectName)) { + duplicateNames.add(projectName); + } + } + } + } + + protected String getElementText(final String item) { + StringBuilder stringBuilder = new StringBuilder(); + final String projectName = EclipseProjectFinder.findProjectName(item); + stringBuilder.append(projectName); + String relPath = PathUtil.getRelative(((EclipseImportBuilder)getBuilder()).getParameters().root, item); + if (!relPath.equals(".") && !relPath.equals(projectName)) { + stringBuilder.append(" (").append(relPath).append(")"); + } + return stringBuilder.toString(); + } + + @Nullable + protected Icon getElementIcon(final String item) { + return isInConflict(item) ? AllIcons.Actions.Cancel : null; + } + + public void updateStep() { + super.updateStep(); + duplicateNames = null; + } + + public boolean validate() throws ConfigurationException { + calcDuplicates(); + if (!duplicateNames.isEmpty()) { + throw new ConfigurationException("Duplicate names found:" + StringUtil.join(ArrayUtil.toStringArray(duplicateNames), ","), "Unable to proceed"); + } + return super.validate(); + } + + @Override + public String getName() { + return "Eclipse Projects to Import"; + } + + @NonNls + public String getHelpId() { + return "reference.dialogs.new.project.import.eclipse.page2"; + } +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/util/ErrorLog.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/util/ErrorLog.java new file mode 100644 index 000000000000..d2f16e590ae7 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/util/ErrorLog.java @@ -0,0 +1,64 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse.util; + +import com.intellij.openapi.util.io.FileUtil; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.idea.eclipse.ConversionException; + +import java.io.IOException; + +public class ErrorLog { + public static boolean failFast = true; + + public enum Level { + Warning, Error, Fatal + } + + public interface Impl { + void report(Level level, @NonNls String module, @NonNls String context, @NonNls String message); + } + + public static Impl defaultImpl; + + public static void release() { + defaultImpl = null; + } + + public static void report(Level level, @NonNls String module, @NonNls String context, @NonNls String message) { + if (defaultImpl != null) { + defaultImpl.report(level, module, context, message); + } + } + + public static void rethrow(Level level, @NonNls String module, @NonNls String context, Exception e) throws IOException, ConversionException { + report(level, module, context, e); + if ( failFast ) { + if ( e instanceof IOException) { + throw (IOException) e; + } else + if ( e instanceof ConversionException) { + throw (ConversionException) e; + } else + throw new ConversionException ( e.getMessage() ); + } + } + + public static void report(Level level, @NonNls String module, @NonNls String context, Exception e) { + String message = e.getMessage(); + report(level, module, context, message == null ? e.getClass().toString() : FileUtil.toSystemIndependentName(message)); + } +} diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/util/PathUtil.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/util/PathUtil.java new file mode 100644 index 000000000000..0bb72341006a --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/util/PathUtil.java @@ -0,0 +1,115 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse.util; + +import com.intellij.openapi.util.io.FileUtil; + +import java.io.File; + +public class PathUtil { + + public static final String UNRESOLVED_PREFIX = "?"; + public static final String HTTP_PREFIX = "http://"; + public static final String HTTPS_PREFIX = "https://"; + + public static String normalize(String path) { + path = FileUtil.toSystemIndependentName(path); + if (path.endsWith("/")) { + path = path.substring(0, path.length() - 1); + } + while (path.contains("/./")) { + path = path.replace("/./", "/"); + } + if (path.startsWith("./")) { + path = path.substring(2); + } + if (path.endsWith("/.")) { + path = path.substring(0, path.length() - 2); + } + + while ( true ) { + int index = path.indexOf("/.."); + if ( index < 0 ) break; + int slashIndex = path.substring(0,index).lastIndexOf("/"); + if ( slashIndex < 0 ) break; + path = path.substring(0, slashIndex ) + path.substring(index+3); + } + + return path; + } + + public static String getRelative(String baseRoot, String path) { + baseRoot = normalize(baseRoot); + path = normalize(path); + + int prefix = findCommonPathPrefixLength(baseRoot, path); + + if (prefix != 0) { + baseRoot = baseRoot.substring(prefix); + path = path.substring(prefix); + if (baseRoot.length() != 0) { + return normalize(revertRelativePath(baseRoot.substring(1)) + path); + } + else if (path.length() != 0) { + return path.substring(1); + } + else { + return "."; + } + } + else if (FileUtil.isAbsolute(path)) { + return path; + } + else { + return normalize(revertRelativePath(baseRoot) + "/" + path); + } + } + + public static int findCommonPathPrefixLength(String path1, String path2) { + int end = -1; + do { + int beg = end + 1; + int new_end = endOfToken(path1, beg); + if (new_end != endOfToken(path2, beg) || !path1.substring(beg, new_end).equals(path2.substring(beg, new_end))) { + break; + } + end = new_end; + } + while (end != path1.length()); + return end < 0 ? 0 : end; + } + + private static int endOfToken(String s, int index) { + index = s.indexOf("/", index); + return (index == -1) ? s.length() : index; + } + + private static String revertRelativePath(String path) { + if (path.equals(".")) { + return path; + } + else { + StringBuffer sb = new StringBuffer(); + sb.append(".."); + int count = normalize(path).split("/").length; + while (--count > 0) { + sb.append("/.."); + } + return sb.toString(); + } + } + +} diff --git a/plugins/eclipse/standalone/eclipse-plugin.iml b/plugins/eclipse/standalone/eclipse-plugin.iml new file mode 100644 index 000000000000..03f49550a097 --- /dev/null +++ b/plugins/eclipse/standalone/eclipse-plugin.iml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module relativePaths="true" type="PLUGIN_MODULE" version="4"> + <component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/../resources/META-INF/plugin.xml" /> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$/.."> + <sourceFolder url="file://$MODULE_DIR$/../resources" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/../src" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/../test" isTestSource="true" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntryProperties /> + </component> +</module> + diff --git a/plugins/eclipse/standalone/eclipse-plugin.ipr b/plugins/eclipse/standalone/eclipse-plugin.ipr new file mode 100644 index 000000000000..63cef37e0fdc --- /dev/null +++ b/plugins/eclipse/standalone/eclipse-plugin.ipr @@ -0,0 +1,488 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project relativePaths="false" version="4"> + <component name="AntConfiguration"> + <defaultAnt bundledAnt="true" /> + <buildFile url="file://$PROJECT_DIR$/cmdline/build.xml"> + <additionalClassPath /> + <antReference projectDefault="true" /> + <customJdkName value="" /> + <maximumHeapSize value="128" /> + <properties /> + </buildFile> + </component> + <component name="BuildJarProjectSettings"> + <option name="BUILD_JARS_ON_MAKE" value="false" /> + </component> + <component name="CodeStyleProjectProfileManger"> + <option name="PROJECT_PROFILE" /> + <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" /> + </component> + <component name="CodeStyleSettingsManager"> + <option name="PER_PROJECT_SETTINGS" /> + <option name="USE_PER_PROJECT_SETTINGS" value="false" /> + </component> + <component name="CompilerConfiguration"> + <option name="DEFAULT_COMPILER" value="Javac" /> + <option name="DEPLOY_AFTER_MAKE" value="0" /> + <resourceExtensions> + <entry name=".+\.(properties|xml|html|dtd|tld)" /> + <entry name=".+\.(gif|png|jpeg|jpg)" /> + </resourceExtensions> + <wildcardResourcePatterns> + <entry name="?*.properties" /> + <entry name="?*.xml" /> + <entry name="?*.gif" /> + <entry name="?*.png" /> + <entry name="?*.jpeg" /> + <entry name="?*.jpg" /> + <entry name="?*.html" /> + <entry name="?*.dtd" /> + <entry name="?*.tld" /> + </wildcardResourcePatterns> + </component> + <component name="CompilerWorkspaceConfiguration"> + <option name="COMPILE_IN_BACKGROUND" value="false" /> + <option name="AUTO_SHOW_ERRORS_IN_EDITOR" value="true" /> + <option name="CLOSE_MESSAGE_VIEW_IF_SUCCESS" value="true" /> + <option name="COMPILE_DEPENDENT_FILES" value="false" /> + <option name="CLEAR_OUTPUT_DIRECTORY" value="false" /> + <option name="ASSERT_NOT_NULL" value="true" /> + </component> + <component name="Cvs2Configuration"> + <option name="PRUNE_EMPTY_DIRECTORIES" value="true" /> + <option name="MERGING_MODE" value="0" /> + <option name="MERGE_WITH_BRANCH1_NAME" value="HEAD" /> + <option name="MERGE_WITH_BRANCH2_NAME" value="HEAD" /> + <option name="RESET_STICKY" value="false" /> + <option name="CREATE_NEW_DIRECTORIES" value="true" /> + <option name="DEFAULT_TEXT_FILE_SUBSTITUTION" value="kv" /> + <option name="PROCESS_UNKNOWN_FILES" value="false" /> + <option name="PROCESS_DELETED_FILES" value="false" /> + <option name="PROCESS_IGNORED_FILES" value="false" /> + <option name="RESERVED_EDIT" value="false" /> + <option name="CHECKOUT_DATE_OR_REVISION_SETTINGS"> + <value> + <option name="BRANCH" value="" /> + <option name="DATE" value="" /> + <option name="USE_BRANCH" value="false" /> + <option name="USE_DATE" value="false" /> + </value> + </option> + <option name="UPDATE_DATE_OR_REVISION_SETTINGS"> + <value> + <option name="BRANCH" value="" /> + <option name="DATE" value="" /> + <option name="USE_BRANCH" value="false" /> + <option name="USE_DATE" value="false" /> + </value> + </option> + <option name="SHOW_CHANGES_REVISION_SETTINGS"> + <value> + <option name="BRANCH" value="" /> + <option name="DATE" value="" /> + <option name="USE_BRANCH" value="false" /> + <option name="USE_DATE" value="false" /> + </value> + </option> + <option name="SHOW_OUTPUT" value="false" /> + <option name="ADD_WATCH_INDEX" value="0" /> + <option name="REMOVE_WATCH_INDEX" value="0" /> + <option name="UPDATE_KEYWORD_SUBSTITUTION" /> + <option name="MAKE_NEW_FILES_READONLY" value="false" /> + <option name="SHOW_CORRUPTED_PROJECT_FILES" value="0" /> + <option name="TAG_AFTER_PROJECT_COMMIT" value="false" /> + <option name="OVERRIDE_EXISTING_TAG_FOR_PROJECT" value="true" /> + <option name="TAG_AFTER_PROJECT_COMMIT_NAME" value="" /> + <option name="CLEAN_COPY" value="false" /> + </component> + <component name="DependenciesAnalyzeManager"> + <option name="myForwardDirection" value="false" /> + </component> + <component name="DependencyValidationManager"> + <option name="SKIP_IMPORT_STATEMENTS" value="false" /> + </component> + <component name="EclipseCompilerSettings"> + <option name="DEBUGGING_INFO" value="true" /> + <option name="GENERATE_NO_WARNINGS" value="true" /> + <option name="DEPRECATION" value="false" /> + <option name="ADDITIONAL_OPTIONS_STRING" value="" /> + <option name="MAXIMUM_HEAP_SIZE" value="128" /> + </component> + <component name="EclipseEmbeddedCompilerSettings"> + <option name="DEBUGGING_INFO" value="true" /> + <option name="GENERATE_NO_WARNINGS" value="true" /> + <option name="DEPRECATION" value="false" /> + <option name="ADDITIONAL_OPTIONS_STRING" value="" /> + <option name="MAXIMUM_HEAP_SIZE" value="128" /> + </component> + <component name="EntryPointsManager"> + <entry_points version="2.0" /> + </component> + <component name="ErrorOptionsConfigurable.UI"> + <option name="proportions"> + <SplitterProportionsDataImpl /> + </option> + </component> + <component name="ExportToHTMLSettings"> + <option name="PRINT_LINE_NUMBERS" value="false" /> + <option name="OPEN_IN_BROWSER" value="false" /> + <option name="OUTPUT_DIRECTORY" /> + </component> + <component name="GlobalLibrariesConfigurable.UI"> + <option name="proportions"> + <SplitterProportionsDataImpl /> + </option> + </component> + <component name="IdProvider" IDEtalkID="E29F77E9C7CF6F5FB954046FBC54ADC2" /> + <component name="InspectionProjectProfileManager"> + <option name="PROJECT_PROFILE" value="Project Default" /> + <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" /> + <scopes /> + <profiles> + <profile version="1.0" is_locked="false"> + <option name="myName" value="Project Default" /> + <option name="myLocal" value="false" /> + <used_levels> + <error> + <option name="myName" value="ERROR" /> + <option name="myVal" value="300" /> + </error> + <warning> + <option name="myName" value="WARNING" /> + <option name="myVal" value="200" /> + </warning> + <information> + <option name="myName" value="INFO" /> + <option name="myVal" value="100" /> + </information> + <server> + <option name="myName" value="SERVER PROBLEM" /> + <option name="myVal" value="100" /> + </server> + </used_levels> + <inspection_tool class="HardCodedStringLiteral" level="WARNING" enabled="true"> + <option name="ignoreForAssertStatements" value="true" /> + <option name="ignoreForExceptionConstructors" value="true" /> + <option name="ignoreForSpecifiedExceptionConstructors" value="" /> + <option name="ignoreForJUnitAsserts" value="true" /> + <option name="ignoreForClassReferences" value="true" /> + <option name="ignoreForPropertyKeyReferences" value="true" /> + <option name="ignoreForNonAlpha" value="true" /> + <option name="ignoreAssignedToConstants" value="false" /> + <option name="ignoreToString" value="false" /> + <option name="nonNlsCommentPattern" value="NON-NLS" /> + </inspection_tool> + </profile> + </profiles> + </component> + <component name="JavacSettings"> + <option name="DEBUGGING_INFO" value="true" /> + <option name="GENERATE_NO_WARNINGS" value="false" /> + <option name="DEPRECATION" value="true" /> + <option name="ADDITIONAL_OPTIONS_STRING" value="" /> + <option name="MAXIMUM_HEAP_SIZE" value="128" /> + </component> + <component name="JavadocGenerationManager"> + <option name="OUTPUT_DIRECTORY" /> + <option name="OPTION_SCOPE" value="protected" /> + <option name="OPTION_HIERARCHY" value="true" /> + <option name="OPTION_NAVIGATOR" value="true" /> + <option name="OPTION_INDEX" value="true" /> + <option name="OPTION_SEPARATE_INDEX" value="true" /> + <option name="OPTION_DOCUMENT_TAG_USE" value="false" /> + <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" /> + <option name="OPTION_DOCUMENT_TAG_VERSION" value="false" /> + <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" /> + <option name="OPTION_DEPRECATED_LIST" value="true" /> + <option name="OTHER_OPTIONS" value="" /> + <option name="HEAP_SIZE" /> + <option name="LOCALE" /> + <option name="OPEN_IN_BROWSER" value="true" /> + </component> + <component name="JdkListConfigurable.UI"> + <option name="proportions"> + <SplitterProportionsDataImpl /> + </option> + </component> + <component name="JikesSettings"> + <option name="JIKES_PATH" value="" /> + <option name="DEBUGGING_INFO" value="true" /> + <option name="DEPRECATION" value="true" /> + <option name="GENERATE_NO_WARNINGS" value="false" /> + <option name="IS_EMACS_ERRORS_MODE" value="true" /> + <option name="ADDITIONAL_OPTIONS_STRING" value="" /> + </component> + <component name="LogConsolePreferences"> + <option name="FILTER_ERRORS" value="false" /> + <option name="FILTER_WARNINGS" value="false" /> + <option name="FILTER_INFO" value="true" /> + <option name="CUSTOM_FILTER" /> + </component> + <component name="ModuleStructureConfigurable.UI"> + <option name="proportions"> + <SplitterProportionsDataImpl /> + </option> + </component> + <component name="Palette2"> + <group name="Swing"> + <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> + </item> + <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> + </item> + <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> + </item> + <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true"> + <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> + </item> + <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> + <initial-values> + <property name="text" value="Button" /> + </initial-values> + </item> + <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> + <initial-values> + <property name="text" value="RadioButton" /> + </initial-values> + </item> + <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> + <initial-values> + <property name="text" value="CheckBox" /> + </initial-values> + </item> + <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> + <initial-values> + <property name="text" value="Label" /> + </initial-values> + </item> + <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> + <preferred-size width="150" height="-1" /> + </default-constraints> + </item> + <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> + <preferred-size width="150" height="-1" /> + </default-constraints> + </item> + <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> + <preferred-size width="150" height="-1" /> + </default-constraints> + </item> + <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> + </item> + <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> + <preferred-size width="200" height="200" /> + </default-constraints> + </item> + <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> + <preferred-size width="200" height="200" /> + </default-constraints> + </item> + <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> + </item> + <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> + </item> + <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> + </item> + <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> + </item> + <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> + <preferred-size width="-1" height="20" /> + </default-constraints> + </item> + <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> + </item> + <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> + </item> + </group> + </component> + <component name="PerforceDirect.Settings"> + <option name="useP4CONFIG" value="true" /> + <option name="port" value="<perforce_server>:1666" /> + <option name="client" value="" /> + <option name="user" value="" /> + <option name="passwd" value="" /> + <option name="showCmds" value="false" /> + <option name="useNativeApi" value="true" /> + <option name="pathToExec" value="p4" /> + <option name="useCustomPathToExec" value="false" /> + <option name="SYNC_FORCE" value="false" /> + <option name="SYNC_RUN_RESOLVE" value="true" /> + <option name="REVERT_UNCHANGED_FILES" value="true" /> + <option name="CHARSET" value="none" /> + <option name="SHOW_BRANCHES_HISTORY" value="true" /> + <option name="ENABLED" value="true" /> + <option name="USE_LOGIN" value="false" /> + <option name="LOGIN_SILENTLY" value="false" /> + <option name="INTEGRATE_RUN_RESOLVE" value="true" /> + <option name="INTEGRATE_REVERT_UNCHANGED" value="true" /> + <option name="SERVER_TIMEOUT" value="20000" /> + </component> + <component name="ProjectFileVersion" converted="true" /> + <component name="ProjectLibrariesConfigurable.UI"> + <option name="proportions"> + <SplitterProportionsDataImpl /> + </option> + </component> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/cmdline/cmdline.iml" filepath="$PROJECT_DIR$/cmdline/cmdline.iml" /> + <module fileurl="file://$PROJECT_DIR$/eclipse-plugin.iml" filepath="$PROJECT_DIR$/eclipse-plugin.iml" /> + </modules> + </component> + <component name="ProjectRootConfigurable.UI"> + <option name="proportions"> + <SplitterProportionsDataImpl> + <option name="proportions"> + <collection> + <option value="0.16666667" /> + </collection> + </option> + </SplitterProportionsDataImpl> + </option> + <option name="lastEditedConfigurable" value="Project 'Default (Template) Project'" /> + </component> + <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="true" project-jdk-name="DevKit" project-jdk-type="IDEA JDK"> + <output url="file://$PROJECT_DIR$/classes" /> + </component> + <component name="ReadonlyStatusHandler"> + <option name="SHOW_DIALOG" value="true" /> + </component> + <component name="ResourceManagerContainer"> + <option name="myResourceBundles"> + <value> + <list size="0" /> + </value> + </option> + </component> + <component name="RmicSettings"> + <option name="IS_EANABLED" value="false" /> + <option name="DEBUGGING_INFO" value="true" /> + <option name="GENERATE_NO_WARNINGS" value="false" /> + <option name="GENERATE_IIOP_STUBS" value="false" /> + <option name="ADDITIONAL_OPTIONS_STRING" value="" /> + </component> + <component name="ScopeChooserConfigurable.UI"> + <option name="proportions"> + <SplitterProportionsDataImpl /> + </option> + </component> + <component name="SvnChangesBrowserSettings"> + <option name="LOCATION" value="" /> + <option name="USE_PROJECT_SETTINGS" value="true" /> + <option name="USE_ALTERNATE_LOCATION" value="false" /> + </component> + <component name="TeamCityRootDirectoryHolder"> + <option name="myRelativeRootDirectory" /> + </component> + <component name="TransparentConfiguration"> + <option name="implementation" value="net.sourceforge.transparent.CommandLineClearCase" /> + <option name="clearcaseRoot" value="" /> + <option name="checkoutReserved" value="false" /> + <option name="markExternalChangeAsUpToDate" value="true" /> + <option name="checkInUseHijack" value="true" /> + <option name="offline" value="false" /> + <option name="lastScr" value="" /> + <option name="scrTextFileName" value="" /> + </component> + <component name="VCS.FileViewConfiguration"> + <option name="SELECTED_STATUSES" value="DEFAULT" /> + <option name="SELECTED_COLUMNS" value="DEFAULT" /> + <option name="SHOW_FILTERS" value="true" /> + <option name="CUSTOMIZE_VIEW" value="true" /> + <option name="SHOW_FILE_HISTORY_AS_TREE" value="true" /> + </component> + <component name="VcsDirectoryMappings"> + <mapping directory="" vcs="svn" /> + </component> + <component name="VcsManagerConfiguration"> + <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" /> + <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" /> + <option name="PERFORM_UPDATE_IN_BACKGROUND" value="false" /> + <option name="PERFORM_COMMIT_IN_BACKGROUND" value="false" /> + <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" /> + <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" /> + <option name="FORCE_NON_EMPTY_COMMENT" value="false" /> + <option name="LAST_COMMIT_MESSAGE" /> + <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" /> + <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" /> + <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" /> + <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" /> + <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" /> + <option name="ERROR_OCCURED" value="false" /> + <option name="ACTIVE_VCS_NAME" /> + <option name="UPDATE_GROUP_BY_PACKAGES" value="false" /> + <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" /> + <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" /> + <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" /> + </component> + <component name="antWorkspaceConfiguration"> + <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" /> + <option name="FILTER_TARGETS" value="false" /> + </component> + <component name="com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable" proportions="" version="1"> + <option name="myLastEditedConfigurable" /> + </component> + <component name="com.intellij.jsf.UserDefinedFacesConfigs"> + <option name="USER_DEFINED_CONFIGS"> + <value> + <list size="0" /> + </value> + </option> + </component> + <component name="com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectRootMasterDetailsConfigurable" proportions="" version="1"> + <option name="myLastEditedConfigurable" /> + </component> + <component name="com.intellij.profile.ui.ErrorOptionsConfigurable" proportions="" version="1"> + <option name="myLastEditedConfigurable" /> + </component> +</project> + diff --git a/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/anotherPath/.project b/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/anotherPath/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/anotherPath/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/anotherPath/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip b/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/anotherPath/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip Binary files differnew file mode 100644 index 000000000000..7ac0b0c0cafd --- /dev/null +++ b/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/anotherPath/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip diff --git a/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/sourceRootPaths/.classpath b/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/sourceRootPaths/.classpath new file mode 100644 index 000000000000..ccae0d4b9300 --- /dev/null +++ b/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/sourceRootPaths/.classpath @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src/main"/> + <classpathentry kind="src" output="build/tests/classes" path="src/test"/> + <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"> + <attributes> + <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> + </attributes> + </classpathentry> + <classpathentry kind="lib" path="/ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3.jar" sourcepath="/ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-bin.zip!/ant-contrib/docs/api"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="build/classes"/> +</classpath> diff --git a/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/sourceRootPaths/.project b/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/sourceRootPaths/.project new file mode 100644 index 000000000000..26c656303ab6 --- /dev/null +++ b/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/sourceRootPaths/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>sourceRootPaths</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/sourceRootPaths/lib/jar-all-5.zip b/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/sourceRootPaths/lib/jar-all-5.zip Binary files differnew file mode 100644 index 000000000000..1c4f645ac0c7 --- /dev/null +++ b/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/sourceRootPaths/lib/jar-all-5.zip diff --git a/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/sourceRootPaths/sourceRootPaths.eml b/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/sourceRootPaths/sourceRootPaths.eml new file mode 100644 index 000000000000..e6557a2c0aa3 --- /dev/null +++ b/plugins/eclipse/testData/eml/anotherSourceRootPaths/srcPath/sourceRootPaths/sourceRootPaths.eml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$"> + <excludeFolder url="file://$MODULE_DIR$/bin" /> + </contentEntry> + <lib name="ant-contrib-1.0b3.jar" scope="COMPILE"> + <srcroot url="jar://$MODULE_DIR$/../anotherPath/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/src" /> + <srcroot url="jar://$MODULE_DIR$/../anotherPath/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/src/java" /> + <srcroot url="jar://$MODULE_DIR$/../anotherPath/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/walls/testB" /> + <srcroot url="jar://$MODULE_DIR$/../anotherPath/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/design/src" /> + <srcroot url="jar://$MODULE_DIR$/../anotherPath/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/walls/testC" /> + <srcroot url="jar://$MODULE_DIR$/../anotherPath/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/walls/testA" /> + <relative-module-src project-related="jar://$PROJECT_DIR$/srcPath/anotherPath/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/src" /> + <relative-module-src project-related="jar://$PROJECT_DIR$/srcPath/anotherPath/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/src/java" /> + <relative-module-src project-related="jar://$PROJECT_DIR$/srcPath/anotherPath/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/walls/testB" /> + <relative-module-src project-related="jar://$PROJECT_DIR$/srcPath/anotherPath/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/design/src" /> + <relative-module-src project-related="jar://$PROJECT_DIR$/srcPath/anotherPath/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/walls/testC" /> + <relative-module-src project-related="jar://$PROJECT_DIR$/srcPath/anotherPath/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/walls/testA" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/eml/preserveInheritedInvalidJdk/test/.classpath b/plugins/eclipse/testData/eml/preserveInheritedInvalidJdk/test/.classpath new file mode 100644 index 000000000000..8778ddd58a36 --- /dev/null +++ b/plugins/eclipse/testData/eml/preserveInheritedInvalidJdk/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/eml/preserveInheritedInvalidJdk/test/.project b/plugins/eclipse/testData/eml/preserveInheritedInvalidJdk/test/.project new file mode 100644 index 000000000000..d7dbd1431746 --- /dev/null +++ b/plugins/eclipse/testData/eml/preserveInheritedInvalidJdk/test/.project @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>preserveInheritedInvalidJdk</name> + <comment /> + <projects /> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments /> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> + diff --git a/plugins/eclipse/testData/eml/preserveInheritedInvalidJdk/test/expected/preserveInheritedInvalidJdk.eml b/plugins/eclipse/testData/eml/preserveInheritedInvalidJdk/test/expected/preserveInheritedInvalidJdk.eml new file mode 100644 index 000000000000..62b6377af0f3 --- /dev/null +++ b/plugins/eclipse/testData/eml/preserveInheritedInvalidJdk/test/expected/preserveInheritedInvalidJdk.eml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component inheritJdk="true"> + <contentEntry url="file://$MODULE_DIR$" /> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/sourceRootPaths/.classpath b/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/sourceRootPaths/.classpath new file mode 100644 index 000000000000..ccae0d4b9300 --- /dev/null +++ b/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/sourceRootPaths/.classpath @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src/main"/> + <classpathentry kind="src" output="build/tests/classes" path="src/test"/> + <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"> + <attributes> + <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> + </attributes> + </classpathentry> + <classpathentry kind="lib" path="/ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3.jar" sourcepath="/ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-bin.zip!/ant-contrib/docs/api"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="build/classes"/> +</classpath> diff --git a/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/sourceRootPaths/.project b/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/sourceRootPaths/.project new file mode 100644 index 000000000000..26c656303ab6 --- /dev/null +++ b/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/sourceRootPaths/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>sourceRootPaths</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/sourceRootPaths/lib/jar-all-5.zip b/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/sourceRootPaths/lib/jar-all-5.zip Binary files differnew file mode 100644 index 000000000000..1c4f645ac0c7 --- /dev/null +++ b/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/sourceRootPaths/lib/jar-all-5.zip diff --git a/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/sourceRootPaths/sourceRootPaths.eml b/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/sourceRootPaths/sourceRootPaths.eml new file mode 100644 index 000000000000..dca242cc70d6 --- /dev/null +++ b/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/sourceRootPaths/sourceRootPaths.eml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$"> + <excludeFolder url="file://$MODULE_DIR$/bin" /> + </contentEntry> + <lib name="ant-contrib-1.0b3.jar" scope="COMPILE"> + <srcroot url="jar://$MODULE_DIR$/../ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/src" /> + <srcroot url="jar://$MODULE_DIR$/../ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/src/java" /> + <srcroot url="jar://$MODULE_DIR$/../ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/walls/testB" /> + <srcroot url="jar://$MODULE_DIR$/../ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/design/src" /> + <srcroot url="jar://$MODULE_DIR$/../ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/walls/testC" /> + <srcroot url="jar://$MODULE_DIR$/../ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/walls/testA" /> + <relative-module-src project-related="jar://$PROJECT_DIR$/srcPath/ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/src" /> + <relative-module-src project-related="jar://$PROJECT_DIR$/srcPath/ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/src/java" /> + <relative-module-src project-related="jar://$PROJECT_DIR$/srcPath/ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/walls/testB" /> + <relative-module-src project-related="jar://$PROJECT_DIR$/srcPath/ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/design/src" /> + <relative-module-src project-related="jar://$PROJECT_DIR$/srcPath/ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/walls/testC" /> + <relative-module-src project-related="jar://$PROJECT_DIR$/srcPath/ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip!/ant-contrib/test/resources/walls/testA" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/ws-internals/.project b/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/ws-internals/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/ws-internals/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip b/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip Binary files differnew file mode 100644 index 000000000000..7ac0b0c0cafd --- /dev/null +++ b/plugins/eclipse/testData/eml/sourceRootPaths/srcPath/ws-internals/lib/ant-contrib-1.0/ant-contrib-1.0b3-src.zip diff --git a/plugins/eclipse/testData/eml/srcInZip/test/.classpath b/plugins/eclipse/testData/eml/srcInZip/test/.classpath new file mode 100644 index 000000000000..16eccad452ec --- /dev/null +++ b/plugins/eclipse/testData/eml/srcInZip/test/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="lib" path="lib/jar-all-5.zip" sourcepath="lib/jar-all-5.zip"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/eml/srcInZip/test/.project b/plugins/eclipse/testData/eml/srcInZip/test/.project new file mode 100644 index 000000000000..ffcb70792087 --- /dev/null +++ b/plugins/eclipse/testData/eml/srcInZip/test/.project @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>srcInZip</name> + <comment /> + <projects /> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments /> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> + diff --git a/plugins/eclipse/testData/eml/srcInZip/test/lib/jar-all-5.zip b/plugins/eclipse/testData/eml/srcInZip/test/lib/jar-all-5.zip Binary files differnew file mode 100644 index 000000000000..1c4f645ac0c7 --- /dev/null +++ b/plugins/eclipse/testData/eml/srcInZip/test/lib/jar-all-5.zip diff --git a/plugins/eclipse/testData/eml/srcInZip/test/srcInZip.eml b/plugins/eclipse/testData/eml/srcInZip/test/srcInZip.eml new file mode 100644 index 000000000000..418b83538ae0 --- /dev/null +++ b/plugins/eclipse/testData/eml/srcInZip/test/srcInZip.eml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$" /> + <lib name="jar-all-5.zip" scope="COMPILE"> + <srcroot url="jar://$MODULE_DIR$/lib/jar-all-5.zip!/doc/api" /> + <relative-module-src project-related="jar://$PROJECT_DIR$/test/lib/jar-all-5.zip!/doc/api" /> + <relative-module-cls project-related="jar://$PROJECT_DIR$/test/lib/jar-all-5.zip!/" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-3/copy-every/src/eclipseLib/SourceThree.java b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-3/copy-every/src/eclipseLib/SourceThree.java new file mode 100644 index 000000000000..836b2205ab3a --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-3/copy-every/src/eclipseLib/SourceThree.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package eclipseLib; + +/** + * Created in IntelliJ IDEA. + * By: Alexander.Chernikov + * When: 19.02.2009, 20:55:48 + * Русский текст. + */ +public class SourceThree { + public static final String ELIB_CONST = "value 3"; + + public void elibMethod() { + } +} diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-6/jar-all-6.zip b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-6/jar-all-6.zip Binary files differnew file mode 100644 index 000000000000..657790348b97 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-6/jar-all-6.zip diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-6/jar-every/lib-6.jar b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-6/jar-every/lib-6.jar Binary files differnew file mode 100644 index 000000000000..904f286f8f35 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-6/jar-every/lib-6.jar diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-6/jar-every/src.zip b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-6/jar-every/src.zip Binary files differnew file mode 100644 index 000000000000..b5b74597564d --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-6/jar-every/src.zip diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-8.userlibraries b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-8.userlibraries new file mode 100644 index 000000000000..e4c73cd5ced7 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-8.userlibraries @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<eclipse-userlibraries version="2"> + <library name="lib-8" systemlibrary="false"> + <archive javadoc="jar:file:/C:/uf/Alexander.Chernikov/work/eclipse-externals/lib-8/jar-every/apidoc.zip!/" path="C:/uf/Alexander.Chernikov/work/eclipse-externals/lib-8/jar-every/lib-8.jar" source="C:/uf/Alexander.Chernikov/work/eclipse-externals/lib-8/jar-every/src.zip"/> + </library> +</eclipse-userlibraries> diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-8/jar-every/apidoc.zip b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-8/jar-every/apidoc.zip Binary files differnew file mode 100644 index 000000000000..b8dd71cfdc4a --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-8/jar-every/apidoc.zip diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-8/jar-every/lib-8.jar b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-8/jar-every/lib-8.jar Binary files differnew file mode 100644 index 000000000000..5fbb13d9dadd --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-8/jar-every/lib-8.jar diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-8/jar-every/src.zip b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-8/jar-every/src.zip Binary files differnew file mode 100644 index 000000000000..4e43084ef985 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-externals/lib-8/jar-every/src.zip diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-7/copy-every/src/eclipseLib/SourceSeven.java b/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-7/copy-every/src/eclipseLib/SourceSeven.java new file mode 100644 index 000000000000..440e48891acc --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-7/copy-every/src/eclipseLib/SourceSeven.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package eclipseLib; + +/** + * Created in IntelliJ IDEA. + * By: Alexander.Chernikov + * When: 19.02.2009, 20:55:48 + * Русский текст. + */ +public class SourceSeven { + public static final String ELIB_CONST = "value 7"; + + public void elibMethod() { + } +} diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-7/jar-all-7.zip b/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-7/jar-all-7.zip Binary files differnew file mode 100644 index 000000000000..cca9a3abd511 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-7/jar-all-7.zip diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-7/jar-every/lib-7.jar b/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-7/jar-every/lib-7.jar Binary files differnew file mode 100644 index 000000000000..60d122eabfb0 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-7/jar-every/lib-7.jar diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-9/copy-every/src/eclipseLib/SourceNine.java b/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-9/copy-every/src/eclipseLib/SourceNine.java new file mode 100644 index 000000000000..0006403cba63 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-9/copy-every/src/eclipseLib/SourceNine.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package eclipseLib; + +/** + * Created in IntelliJ IDEA. + * By: Alexander.Chernikov + * When: 19.02.2009, 20:55:48 + * Русский текст. + */ +public class SourceNine { + public static final String ELIB_CONST = "value 9"; + + public void elibMethod() { + } +} diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-a/jar-every/lib-a.jar b/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-a/jar-every/lib-a.jar Binary files differnew file mode 100644 index 000000000000..8ae21e2ec155 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-a/jar-every/lib-a.jar diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-a/jar-every/src.zip b/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-a/jar-every/src.zip Binary files differnew file mode 100644 index 000000000000..137d3e870304 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-vars/lib-a/jar-every/src.zip diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/.classpath b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/.classpath new file mode 100644 index 000000000000..3688cde12a05 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/.classpath @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"> + <attributes> + <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="all-props/native"/> + </attributes> + </classpathentry> + <classpathentry excluding="excl/" including="incl/" kind="src" path="src-props-1"> + <attributes> + <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="ws-internals/native"/> + </attributes> + </classpathentry> + <classpathentry kind="src" output="bin-props-2" path="src-props-2"> + <attributes> + <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="$ROOT$/eclipse-externals/native"/> + </attributes> + </classpathentry> + <classpathentry kind="src" path="test"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry exported="true" kind="lib" path="lib-1/copy-every/lib-1" sourcepath="lib-1/copy-every/src"> + <attributes> + <attribute name="javadoc_location" value="file:/$ROOT$/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="lib" path="/ws-internals/lib-2/copy-every/lib-2" sourcepath="/ws-internals/lib-2/copy-every/src"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/ws-internals/lib-2/jar-all-2.zip!/"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="lib" path="$ROOT$/eclipse-externals/lib-3/copy-every/lib-3" sourcepath="$ROOT$/eclipse-externals/lib-3/copy-every/src"> + <attributes> + <attribute name="javadoc_location" value="http://open-space.org"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="lib" path="lib-4/jar-every/lib-4.jar" sourcepath="lib-4/jar-every/src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/all-props/lib-4/jar-every/apidoc.zip!/"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="lib" path="/ws-internals/lib-5/jar-every/lib-5.jar" sourcepath="/ws-internals/lib-5/jar-every/src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/ws-internals/lib-5/jar-all-5.zip!/doc/api"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="lib" path="$ROOT$/eclipse-externals/lib-6/jar-every/lib-6.jar" sourcepath="$ROOT$/eclipse-externals/lib-6/jar-every/src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:file:/$ROOT$/eclipse-externals/lib-6/jar-all-6.zip!/doc/api"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib-8"/> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/.project b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/.project new file mode 100644 index 000000000000..a9ce169bbd14 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>all-props</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/allclasses-frame.html b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/allclasses-frame.html new file mode 100644 index 000000000000..bec533a40478 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/allclasses-frame.html @@ -0,0 +1,31 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0_10-beta) on Thu Feb 19 20:58:54 MSK 2009 --> +<TITLE> +All Classes +</TITLE> + +<META NAME="date" CONTENT="2009-02-19"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + + +</HEAD> + +<BODY BGCOLOR="white"> +<FONT size="+1" CLASS="FrameHeadingFont"> +<B>All Classes</B></FONT> +<BR> + +<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> +<TR> +<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="eclipseLib/SourceOne.html" title="class in eclipseLib" target="classFrame">SourceOne</A> +<BR> +</FONT></TD> +</TR> +</TABLE> + +</BODY> +</HTML> diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/allclasses-noframe.html b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/allclasses-noframe.html new file mode 100644 index 000000000000..bffd0b196448 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/allclasses-noframe.html @@ -0,0 +1,31 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0_10-beta) on Thu Feb 19 20:58:54 MSK 2009 --> +<TITLE> +All Classes +</TITLE> + +<META NAME="date" CONTENT="2009-02-19"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + + +</HEAD> + +<BODY BGCOLOR="white"> +<FONT size="+1" CLASS="FrameHeadingFont"> +<B>All Classes</B></FONT> +<BR> + +<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> +<TR> +<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="eclipseLib/SourceOne.html" title="class in eclipseLib">SourceOne</A> +<BR> +</FONT></TD> +</TR> +</TABLE> + +</BODY> +</HTML> diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/eclipseLib/SourceOne.html b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/eclipseLib/SourceOne.html new file mode 100644 index 000000000000..ba8f3a747263 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/eclipseLib/SourceOne.html @@ -0,0 +1,293 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0_10-beta) on Thu Feb 19 20:58:54 MSK 2009 --> +<TITLE> +SourceOne +</TITLE> + +<META NAME="date" CONTENT="2009-02-19"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="SourceOne"; + } +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> +<HR> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../eclipseLib/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SourceOne.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV CLASS + NEXT CLASS</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../index.html?eclipseLib/SourceOne.html" target="_top"><B>FRAMES</B></A> + <A HREF="SourceOne.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<!-- ======== START OF CLASS DATA ======== --> +<H2> +<FONT SIZE="-1"> +eclipseLib</FONT> +<BR> +Class SourceOne</H2> +<PRE> +java.lang.Object + <IMG SRC="../resources/inherit.gif" ALT="extended by "><B>eclipseLib.SourceOne</B> +</PRE> +<HR> +<DL> +<DT><PRE>public class <B>SourceOne</B><DT>extends java.lang.Object</DL> +</PRE> + +<P> +Created in IntelliJ IDEA. + By: Alexander.Chernikov + When: 19.02.2009, 20:55:48 + Русский текст. +<P> + +<P> +<HR> + +<P> +<!-- =========== FIELD SUMMARY =========== --> + +<A NAME="field_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Field Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE>static java.lang.String</CODE></FONT></TD> +<TD><CODE><B><A HREF="../eclipseLib/SourceOne.html#ELIB_CONST">ELIB_CONST</A></B></CODE> + +<BR> + </TD> +</TR> +</TABLE> + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> + +<A NAME="constructor_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Constructor Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD><CODE><B><A HREF="../eclipseLib/SourceOne.html#SourceOne()">SourceOne</A></B>()</CODE> + +<BR> + </TD> +</TR> +</TABLE> + +<!-- ========== METHOD SUMMARY =========== --> + +<A NAME="method_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Method Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../eclipseLib/SourceOne.html#elibMethod()">elibMethod</A></B>()</CODE> + +<BR> + </TD> +</TR> +</TABLE> + <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> +<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> +</TR> +</TABLE> + +<P> + +<!-- ============ FIELD DETAIL =========== --> + +<A NAME="field_detail"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> +<B>Field Detail</B></FONT></TH> +</TR> +</TABLE> + +<A NAME="ELIB_CONST"><!-- --></A><H3> +ELIB_CONST</H3> +<PRE> +public static final java.lang.String <B>ELIB_CONST</B></PRE> +<DL> +<DL> +<DT><B>See Also:</B><DD><A HREF="../constant-values.html#eclipseLib.SourceOne.ELIB_CONST">Constant Field Values</A></DL> +</DL> + +<!-- ========= CONSTRUCTOR DETAIL ======== --> + +<A NAME="constructor_detail"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> +<B>Constructor Detail</B></FONT></TH> +</TR> +</TABLE> + +<A NAME="SourceOne()"><!-- --></A><H3> +SourceOne</H3> +<PRE> +public <B>SourceOne</B>()</PRE> +<DL> +</DL> + +<!-- ============ METHOD DETAIL ========== --> + +<A NAME="method_detail"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> +<B>Method Detail</B></FONT></TH> +</TR> +</TABLE> + +<A NAME="elibMethod()"><!-- --></A><H3> +elibMethod</H3> +<PRE> +public void <B>elibMethod</B>()</PRE> +<DL> +<DD><DL> +</DL> +</DD> +</DL> +<!-- ========= END OF CLASS DATA ========= --> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../eclipseLib/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SourceOne.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV CLASS + NEXT CLASS</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../index.html?eclipseLib/SourceOne.html" target="_top"><B>FRAMES</B></A> + <A HREF="SourceOne.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/index.html b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/index.html new file mode 100644 index 000000000000..ff86a5330e0b --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/index.html @@ -0,0 +1,36 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc on Thu Feb 19 20:58:54 MSK 2009--> +<TITLE> +Generated Documentation (Untitled) +</TITLE> +<SCRIPT type="text/javascript"> + targetPage = "" + window.location.search; + if (targetPage != "" && targetPage != "undefined") + targetPage = targetPage.substring(1); + if (targetPage.indexOf(":") != -1) + targetPage = "undefined"; + function loadFrames() { + if (targetPage != "" && targetPage != "undefined") + top.classFrame.location = top.targetPage; + } +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> +</HEAD> +<FRAMESET cols="20%,80%" title="" onLoad="top.loadFrames()"> +<FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)"> +<FRAME src="eclipseLib/package-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes"> +<NOFRAMES> +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="eclipseLib/package-summary.html">Non-frame version.</A> +</NOFRAMES> +</FRAMESET> +</HTML> diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/overview-tree.html b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/overview-tree.html new file mode 100644 index 000000000000..d8361c936af0 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/overview-tree.html @@ -0,0 +1,150 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0_10-beta) on Thu Feb 19 20:58:54 MSK 2009 --> +<TITLE> +Class Hierarchy +</TITLE> + +<META NAME="date" CONTENT="2009-02-19"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Class Hierarchy"; + } +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> +<HR> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="eclipseLib/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A> + <A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<CENTER> +<H2> +Hierarchy For All Packages</H2> +</CENTER> +<DL> +<DT><B>Package Hierarchies:</B><DD><A HREF="eclipseLib/package-tree.html">eclipseLib</A></DL> +<HR> +<H2> +Class Hierarchy +</H2> +<UL> +<LI TYPE="circle">java.lang.Object<UL> +<LI TYPE="circle">eclipseLib.<A HREF="eclipseLib/SourceOne.html" title="class in eclipseLib"><B>SourceOne</B></A></UL> +</UL> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="eclipseLib/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A> + <A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/package-list b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/package-list new file mode 100644 index 000000000000..3fab146dde28 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/package-list @@ -0,0 +1 @@ +eclipseLib diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/stylesheet.css b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/stylesheet.css new file mode 100644 index 000000000000..6ea9e5161615 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/stylesheet.css @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF; color:#000000 } + +/* Headings */ +h1 { font-size: 145% } + +/* Table colors */ +.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ +.TableRowColor { background: #FFFFFF; color:#000000 } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} + diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/lib-1/eclipseLib/temp.txt b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/lib-1/eclipseLib/temp.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/lib-1/eclipseLib/temp.txt diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/src/eclipseLib/SourceOne.java b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/src/eclipseLib/SourceOne.java new file mode 100644 index 000000000000..4fe80727fd45 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/src/eclipseLib/SourceOne.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package eclipseLib; + +/** + * Created in IntelliJ IDEA. + * By: Alexander.Chernikov + * When: 19.02.2009, 20:55:48 + * Русский текст. + */ +public class SourceOne { + public static final String ELIB_CONST = "value 1"; + + public void elibMethod() { + } +} diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/apidoc.zip b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/apidoc.zip Binary files differnew file mode 100644 index 000000000000..4676ac65d256 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/apidoc.zip diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/lib-4.jar b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/lib-4.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/lib-4.jar diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/src.zip b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/src.zip Binary files differnew file mode 100644 index 000000000000..9c278f149bbc --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/src.zip diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/src/pkg/Resident.java b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/src/pkg/Resident.java new file mode 100644 index 000000000000..6588d13dfdd4 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/all-props/src/pkg/Resident.java @@ -0,0 +1,48 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package pkg; + +import eclipseLib.SourceOne; +import eclipseLib.SourceTwo; +import eclipseLib.SourceThree; +import eclipseLib.SourceFour; +import eclipseLib.SourceFive; +import eclipseLib.SourceSix; +import eclipseLib.SourceSeven; +import eclipseLib.SourceEight; +import eclipseLib.SourceNine; +import eclipseLib.SourceAlpha; + +/** + * Created in IntelliJ IDEA. + * By: Alexander.Chernikov + * When: 03.03.2009, 20:21:57 + * Русский текст. + */ +public class Resident { + public static void context() { + SourceOne one = new SourceOne(); + SourceTwo two = new SourceTwo(); + SourceThree three = new SourceThree(); + SourceFour four = new SourceFour(); + SourceFive five = new SourceFive(); + SourceSix six = new SourceSix(); + SourceSeven seven = new SourceSeven(); + SourceEight eight = new SourceEight(); + SourceNine nine = new SourceNine(); + SourceAlpha alpha = new SourceAlpha(); + } +} diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/.project b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/.project new file mode 100644 index 000000000000..fa532615eed3 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/.project @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + </buildSpec> + <natures> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/copy-every/lib-2/eclipseLib/temp.txt b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/copy-every/lib-2/eclipseLib/temp.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/copy-every/lib-2/eclipseLib/temp.txt diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/copy-every/src/eclipseLib/SourceTwo.java b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/copy-every/src/eclipseLib/SourceTwo.java new file mode 100644 index 000000000000..c2e367dd9532 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/copy-every/src/eclipseLib/SourceTwo.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package eclipseLib; + +/** + * Created in IntelliJ IDEA. + * By: Alexander.Chernikov + * When: 19.02.2009, 20:55:48 + * Русский текст. + */ +public class SourceTwo { + public static final String ELIB_CONST = "value 2"; + + public void elibMethod() { + } +} diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/jar-all-2.zip b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/jar-all-2.zip Binary files differnew file mode 100644 index 000000000000..56635526133d --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/jar-all-2.zip diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-all-5.zip b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-all-5.zip Binary files differnew file mode 100644 index 000000000000..1c4f645ac0c7 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-all-5.zip diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-every/lib-5.jar b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-every/lib-5.jar Binary files differnew file mode 100644 index 000000000000..0e0dc04dfbaa --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-every/lib-5.jar diff --git a/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-every/src.zip b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-every/src.zip Binary files differnew file mode 100644 index 000000000000..beb499cbcda5 --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-every/src.zip diff --git a/plugins/eclipse/testData/iml/allProps/expected/expected.iml b/plugins/eclipse/testData/iml/allProps/expected/expected.iml new file mode 100644 index 000000000000..73bb462498fa --- /dev/null +++ b/plugins/eclipse/testData/iml/allProps/expected/expected.iml @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> +<root inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/bin" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src-props-1" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src-props-2" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="false" /> + </content> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="inheritedJdk" /> + <orderEntry type="module-library" exported=""> + <library name="lib-1"> + <CLASSES> + <root url="file://$MODULE_DIR$/lib-1/copy-every/lib-1" /> + </CLASSES> + <JAVADOC> + <root url="file://$MODULE_DIR$/lib-1/copy-every/doc/api" /> + </JAVADOC> + <SOURCES> + <root url="file://$MODULE_DIR$/lib-1/copy-every/src" /> + </SOURCES> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="lib-2"> + <CLASSES> + <root url="file://$MODULE_DIR$/../ws-internals/lib-2/copy-every/lib-2" /> + </CLASSES> + <JAVADOC> + <root url="jar://$MODULE_DIR$/../ws-internals/lib-2/jar-all-2.zip!/" /> + </JAVADOC> + <SOURCES> + <root url="file://$MODULE_DIR$/../ws-internals/lib-2/copy-every/src" /> + </SOURCES> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="lib-3"> + <CLASSES> + <root url="file://$MODULE_DIR$/../../eclipse-externals/lib-3/copy-every/lib-3" /> + </CLASSES> + <JAVADOC> + <root url="http://open-space.org" /> + </JAVADOC> + <SOURCES> + <root url="file://$MODULE_DIR$/../../eclipse-externals/lib-3/copy-every/src" /> + </SOURCES> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="lib-4.jar"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib-4/jar-every/lib-4.jar!/" /> + </CLASSES> + <JAVADOC> + <root url="jar://$MODULE_DIR$/lib-4/jar-every/apidoc.zip!/" /> + </JAVADOC> + <SOURCES> + <root url="jar://$MODULE_DIR$/lib-4/jar-every/src.zip!/" /> + </SOURCES> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="lib-5.jar"> + <CLASSES> + <root url="jar://$MODULE_DIR$/../ws-internals/lib-5/jar-every/lib-5.jar!/" /> + </CLASSES> + <JAVADOC> + <root url="jar://$MODULE_DIR$/../ws-internals/lib-5/jar-all-5.zip!/doc/api" /> + </JAVADOC> + <SOURCES> + <root url="jar://$MODULE_DIR$/../ws-internals/lib-5/jar-every/src.zip!/" /> + </SOURCES> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="lib-6.jar"> + <CLASSES> + <root url="jar://$MODULE_DIR$/../../eclipse-externals/lib-6/jar-every/lib-6.jar!/" /> + </CLASSES> + <JAVADOC> + <root url="jar://$MODULE_DIR$/../../eclipse-externals/lib-6/jar-all-6.zip!/doc/api" /> + </JAVADOC> + <SOURCES> + <root url="jar://$MODULE_DIR$/../../eclipse-externals/lib-6/jar-every/src.zip!/" /> + </SOURCES> + </library> + </orderEntry> + <orderEntry type="library" exported="" name="lib-8" level="project" /> + <orderEntry type="module-library"> + <library name="junit3"> + <CLASSES> + <root url="jar://$JUNIT$/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library name="junit4"> + <CLASSES> + <root url="jar://$JUNIT$/lib/junit-4.10.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> +</root> + diff --git a/plugins/eclipse/testData/iml/empty/expected/expected.iml b/plugins/eclipse/testData/iml/empty/expected/expected.iml new file mode 100644 index 000000000000..a2f6d644701f --- /dev/null +++ b/plugins/eclipse/testData/iml/empty/expected/expected.iml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<root inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/out/production/testProject" /> + <exclude-output /> + <content url="file://$MODULE_DIR$" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="inheritedJdk" /> +</root>
\ No newline at end of file diff --git a/plugins/eclipse/testData/iml/empty/test/.classpath b/plugins/eclipse/testData/iml/empty/test/.classpath new file mode 100644 index 000000000000..3ea4b61c77db --- /dev/null +++ b/plugins/eclipse/testData/iml/empty/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" /> + <classpathentry kind="output" path="out/production/testProject" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/iml/empty/test/.project b/plugins/eclipse/testData/iml/empty/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/iml/empty/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/iml/emptySrc/expected/expected.iml b/plugins/eclipse/testData/iml/emptySrc/expected/expected.iml new file mode 100644 index 000000000000..739c0f9ea674 --- /dev/null +++ b/plugins/eclipse/testData/iml/emptySrc/expected/expected.iml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<root inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/out/production/testProject" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + </content> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="inheritedJdk" /> + <orderEntry type="module-library"> + <library name="test.jar"> + <CLASSES> + <root url="jar://$MODULE_DIR$/test.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES> + <root url="file://$MODULE_DIR$" /> + </SOURCES> + </library> + </orderEntry> +</root>
\ No newline at end of file diff --git a/plugins/eclipse/testData/iml/emptySrc/test/.classpath b/plugins/eclipse/testData/iml/emptySrc/test/.classpath new file mode 100644 index 000000000000..1d228f9aef51 --- /dev/null +++ b/plugins/eclipse/testData/iml/emptySrc/test/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry including="**" kind="src" path="src" /> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" /> + <classpathentry kind="lib" path="test.jar" sourcepath=""/> + <classpathentry kind="output" path="out/production/testProject" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/iml/emptySrc/test/.project b/plugins/eclipse/testData/iml/emptySrc/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/iml/emptySrc/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/iml/emptySrc/test/test.jar b/plugins/eclipse/testData/iml/emptySrc/test/test.jar new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/iml/emptySrc/test/test.jar diff --git a/plugins/eclipse/testData/iml/relativePaths/expected/expected.iml b/plugins/eclipse/testData/iml/relativePaths/expected/expected.iml new file mode 100644 index 000000000000..6e006e747e6a --- /dev/null +++ b/plugins/eclipse/testData/iml/relativePaths/expected/expected.iml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<root inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" /> + </content> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="inheritedJdk" /> + <orderEntry type="module" module-name="frst" /> + <orderEntry type="module-library"> + <library name="jar-all-4.zip"> + <CLASSES> + <root url="jar://$MODULE_DIR$/../ws-internals/lib/jar-all-4.zip!/" /> + </CLASSES> + <JAVADOC> + <root url="jar://$MODULE_DIR$/jar-all-4-javadoc.zip!/doc/api" /> + </JAVADOC> + <SOURCES> + <root url="jar://$MODULE_DIR$/jar-all-4-src.zip!/" /> + </SOURCES> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library name="jar-all-4.zip"> + <CLASSES> + <root url="jar://$MODULE_DIR$/jar-all-4.zip!/" /> + </CLASSES> + <JAVADOC> + <root url="jar://$MODULE_DIR$/../ws-internals/lib/src/jar-all-4-javadoc.zip!/doc/api" /> + </JAVADOC> + <SOURCES> + <root url="jar://$MODULE_DIR$/../ws-internals/lib/src/jar-all-4-src.zip!/" /> + </SOURCES> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library name="unknown.zip"> + <CLASSES> + <root url="file://unknown.zip" /> + </CLASSES> + <JAVADOC> + <root url="jar:platform:/resource/ws-internals/lib/src/unknown-javadoc.zip!/doc/api" /> + </JAVADOC> + <SOURCES> + <root url="file:///ws-internals/lib/src/unknown-src.zip" /> + </SOURCES> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library name="unknown.zip"> + <CLASSES> + <root url="file:///ws-internals/lib/unknown.zip" /> + </CLASSES> + <JAVADOC> + <root url="jar:platform:/resource/unimported_module/src/lib/src/jar-all-4-javadoc.zip!/doc/api" /> + </JAVADOC> + <SOURCES> + <root url="file://unknown-src.zip" /> + </SOURCES> + </library> + </orderEntry> +</root> diff --git a/plugins/eclipse/testData/iml/relativePaths/relPaths/scnd/.classpath b/plugins/eclipse/testData/iml/relativePaths/relPaths/scnd/.classpath new file mode 100644 index 000000000000..62d6323aefcb --- /dev/null +++ b/plugins/eclipse/testData/iml/relativePaths/relPaths/scnd/.classpath @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path=""/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry combineaccessrules="false" kind="src" path="/frst"/> + <classpathentry kind="lib" path="/ws-internals/lib/jar-all-4.zip" sourcepath="jar-all-4-src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/scnd/jar-all-4-javadoc.zip!/doc/api"/> + </attributes> + </classpathentry> + <classpathentry kind="lib" path="jar-all-4.zip" sourcepath="/ws-internals/lib/src/jar-all-4-src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/ws-internals/lib/src/jar-all-4-javadoc.zip!/doc/api"/> + </attributes> + </classpathentry> + <classpathentry kind="lib" path="unknown.zip" sourcepath="/ws-internals/lib/src/unknown-src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/ws-internals/lib/src/unknown-javadoc.zip!/doc/api"/> + </attributes> + </classpathentry> + <classpathentry kind="lib" path="/ws-internals/lib/unknown.zip" sourcepath="unknown-src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/unimported_module/src/lib/src/jar-all-4-javadoc.zip!/doc/api"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path=""/> +</classpath> diff --git a/plugins/eclipse/testData/iml/relativePaths/relPaths/scnd/.project b/plugins/eclipse/testData/iml/relativePaths/relPaths/scnd/.project new file mode 100644 index 000000000000..00d5e53d3d85 --- /dev/null +++ b/plugins/eclipse/testData/iml/relativePaths/relPaths/scnd/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>scnd</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/iml/relativePaths/relPaths/scnd/jar-all-4-javadoc.zip b/plugins/eclipse/testData/iml/relativePaths/relPaths/scnd/jar-all-4-javadoc.zip Binary files differnew file mode 100644 index 000000000000..f54817bea7cc --- /dev/null +++ b/plugins/eclipse/testData/iml/relativePaths/relPaths/scnd/jar-all-4-javadoc.zip diff --git a/plugins/eclipse/testData/iml/relativePaths/relPaths/scnd/jar-all-4-src.zip b/plugins/eclipse/testData/iml/relativePaths/relPaths/scnd/jar-all-4-src.zip Binary files differnew file mode 100644 index 000000000000..f54817bea7cc --- /dev/null +++ b/plugins/eclipse/testData/iml/relativePaths/relPaths/scnd/jar-all-4-src.zip diff --git a/plugins/eclipse/testData/iml/relativePaths/relPaths/scnd/jar-all-4.zip b/plugins/eclipse/testData/iml/relativePaths/relPaths/scnd/jar-all-4.zip Binary files differnew file mode 100644 index 000000000000..f54817bea7cc --- /dev/null +++ b/plugins/eclipse/testData/iml/relativePaths/relPaths/scnd/jar-all-4.zip diff --git a/plugins/eclipse/testData/iml/relativePaths/relPaths/ws-internals/.classpath b/plugins/eclipse/testData/iml/relativePaths/relPaths/ws-internals/.classpath new file mode 100644 index 000000000000..ac37fb2e4bca --- /dev/null +++ b/plugins/eclipse/testData/iml/relativePaths/relPaths/ws-internals/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/iml/relativePaths/relPaths/ws-internals/.project b/plugins/eclipse/testData/iml/relativePaths/relPaths/ws-internals/.project new file mode 100644 index 000000000000..4c148da5c1a6 --- /dev/null +++ b/plugins/eclipse/testData/iml/relativePaths/relPaths/ws-internals/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>frst</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/iml/relativePaths/relPaths/ws-internals/lib/jar-all-4.zip b/plugins/eclipse/testData/iml/relativePaths/relPaths/ws-internals/lib/jar-all-4.zip Binary files differnew file mode 100644 index 000000000000..f54817bea7cc --- /dev/null +++ b/plugins/eclipse/testData/iml/relativePaths/relPaths/ws-internals/lib/jar-all-4.zip diff --git a/plugins/eclipse/testData/iml/relativePaths/relPaths/ws-internals/lib/src/jar-all-4-javadoc.zip b/plugins/eclipse/testData/iml/relativePaths/relPaths/ws-internals/lib/src/jar-all-4-javadoc.zip Binary files differnew file mode 100644 index 000000000000..f54817bea7cc --- /dev/null +++ b/plugins/eclipse/testData/iml/relativePaths/relPaths/ws-internals/lib/src/jar-all-4-javadoc.zip diff --git a/plugins/eclipse/testData/iml/relativePaths/relPaths/ws-internals/lib/src/jar-all-4-src.zip b/plugins/eclipse/testData/iml/relativePaths/relPaths/ws-internals/lib/src/jar-all-4-src.zip Binary files differnew file mode 100644 index 000000000000..f54817bea7cc --- /dev/null +++ b/plugins/eclipse/testData/iml/relativePaths/relPaths/ws-internals/lib/src/jar-all-4-src.zip diff --git a/plugins/eclipse/testData/iml/resolvedVariables/expected/expected.iml b/plugins/eclipse/testData/iml/resolvedVariables/expected/expected.iml new file mode 100644 index 000000000000..0eced5ed6f50 --- /dev/null +++ b/plugins/eclipse/testData/iml/resolvedVariables/expected/expected.iml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<root inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" /> + </content> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="inheritedJdk" /> + <orderEntry type="module-library"> + <library name="empty.txt"> + <CLASSES> + <root url="file://$variable$/empty.txt" /> + </CLASSES> + <JAVADOC /> + <SOURCES> + <root url="file://$srcvariable$/empty.txt" /> + </SOURCES> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library name="variable"> + <CLASSES> + <root url="file://$variable$" /> + </CLASSES> + <JAVADOC /> + <SOURCES> + <root url="file://$srcvariable$" /> + </SOURCES> + </library> + </orderEntry> +</root>
\ No newline at end of file diff --git a/plugins/eclipse/testData/iml/resolvedVariables/srcvariableidea/empty.txt b/plugins/eclipse/testData/iml/resolvedVariables/srcvariableidea/empty.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/iml/resolvedVariables/srcvariableidea/empty.txt diff --git a/plugins/eclipse/testData/iml/resolvedVariables/test/.classpath b/plugins/eclipse/testData/iml/resolvedVariables/test/.classpath new file mode 100644 index 000000000000..3ac4e2655f49 --- /dev/null +++ b/plugins/eclipse/testData/iml/resolvedVariables/test/.classpath @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path=""/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="var" path="variable/empty.txt" sourcepath="/srcvariable/empty.txt"/> + <classpathentry kind="var" path="variable" sourcepath="/srcvariable"/> + <classpathentry kind="output" path=""/> +</classpath> diff --git a/plugins/eclipse/testData/iml/resolvedVariables/test/.project b/plugins/eclipse/testData/iml/resolvedVariables/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/iml/resolvedVariables/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/iml/resolvedVariables/variableidea/empty.txt b/plugins/eclipse/testData/iml/resolvedVariables/variableidea/empty.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/iml/resolvedVariables/variableidea/empty.txt diff --git a/plugins/eclipse/testData/iml/root/expected/expected.iml b/plugins/eclipse/testData/iml/root/expected/expected.iml new file mode 100644 index 000000000000..3bc460fbb775 --- /dev/null +++ b/plugins/eclipse/testData/iml/root/expected/expected.iml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<root inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" /> + </content> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="inheritedJdk" /> +</root>
\ No newline at end of file diff --git a/plugins/eclipse/testData/iml/root/test/.classpath b/plugins/eclipse/testData/iml/root/test/.classpath new file mode 100644 index 000000000000..233be1d2c496 --- /dev/null +++ b/plugins/eclipse/testData/iml/root/test/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path=""/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path=""/> +</classpath> diff --git a/plugins/eclipse/testData/iml/root/test/.project b/plugins/eclipse/testData/iml/root/test/.project new file mode 100644 index 000000000000..f5a6693fe6c2 --- /dev/null +++ b/plugins/eclipse/testData/iml/root/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>root</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/iml/srcBinJREProject/expected/expected.iml b/plugins/eclipse/testData/iml/srcBinJREProject/expected/expected.iml new file mode 100644 index 000000000000..b66163e1282f --- /dev/null +++ b/plugins/eclipse/testData/iml/srcBinJREProject/expected/expected.iml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<root inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/out/production/testProject" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + </content> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="inheritedJdk" /> + <orderEntry type="module" module-name="test1" /> +</root> diff --git a/plugins/eclipse/testData/iml/srcBinJREProject/test/.classpath b/plugins/eclipse/testData/iml/srcBinJREProject/test/.classpath new file mode 100644 index 000000000000..474aa653b4a4 --- /dev/null +++ b/plugins/eclipse/testData/iml/srcBinJREProject/test/.classpath @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry combineaccessrules="false" kind="src" path="/test1"> + <accessrules> + <accessrule kind="nonaccessible" pattern="*"/> + </accessrules> + </classpathentry> + <classpathentry kind="output" path="out/production/testProject"/> +</classpath> diff --git a/plugins/eclipse/testData/iml/srcBinJREProject/test/.project b/plugins/eclipse/testData/iml/srcBinJREProject/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/iml/srcBinJREProject/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/iml/workspaceOnly/expected/expected.iml b/plugins/eclipse/testData/iml/workspaceOnly/expected/expected.iml new file mode 100644 index 000000000000..e28087b791ea --- /dev/null +++ b/plugins/eclipse/testData/iml/workspaceOnly/expected/expected.iml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<root inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/bin" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + </content> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="inheritedJdk" /> + <orderEntry type="module-library"> + <library name="test.jar"> + <CLASSES> + <root url="jar://$MODULE_DIR$/test.jar!/" /> + </CLASSES> + <JAVADOC> + <root url="jar://$MODULE_DIR$/testJavadoc.jar!/a" /> + </JAVADOC> + <SOURCES> + <root url="jar://$MODULE_DIR$/testSrc.jar!/" /> + </SOURCES> + </library> + </orderEntry> +</root>
\ No newline at end of file diff --git a/plugins/eclipse/testData/iml/workspaceOnly/test/.classpath b/plugins/eclipse/testData/iml/workspaceOnly/test/.classpath new file mode 100644 index 000000000000..6b831f16e6ed --- /dev/null +++ b/plugins/eclipse/testData/iml/workspaceOnly/test/.classpath @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="lib" path="test.jar" sourcepath="testSrc.jar"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/test/testJavadoc.jar!/a"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/iml/workspaceOnly/test/.project b/plugins/eclipse/testData/iml/workspaceOnly/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/iml/workspaceOnly/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/iml/workspaceOnly/test/test.jar b/plugins/eclipse/testData/iml/workspaceOnly/test/test.jar new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/iml/workspaceOnly/test/test.jar diff --git a/plugins/eclipse/testData/iml/workspaceOnly/test/testJavadoc.jar b/plugins/eclipse/testData/iml/workspaceOnly/test/testJavadoc.jar Binary files differnew file mode 100644 index 000000000000..37226937943d --- /dev/null +++ b/plugins/eclipse/testData/iml/workspaceOnly/test/testJavadoc.jar diff --git a/plugins/eclipse/testData/iml/workspaceOnly/test/testSrc.jar b/plugins/eclipse/testData/iml/workspaceOnly/test/testSrc.jar new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/iml/workspaceOnly/test/testSrc.jar diff --git a/plugins/eclipse/testData/import/.classpath b/plugins/eclipse/testData/import/.classpath new file mode 100644 index 000000000000..233be1d2c496 --- /dev/null +++ b/plugins/eclipse/testData/import/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path=""/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path=""/> +</classpath> diff --git a/plugins/eclipse/testData/import/.project b/plugins/eclipse/testData/import/.project new file mode 100644 index 000000000000..f5a6693fe6c2 --- /dev/null +++ b/plugins/eclipse/testData/import/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>root</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/linked/resolvedVars/test/.classpath b/plugins/eclipse/testData/linked/resolvedVars/test/.classpath new file mode 100644 index 000000000000..108282d15d8d --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVars/test/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path=""/> + <classpathentry kind="src" path="variable"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path=""/> +</classpath> diff --git a/plugins/eclipse/testData/linked/resolvedVars/test/.project b/plugins/eclipse/testData/linked/resolvedVars/test/.project new file mode 100644 index 000000000000..ee05fd52e055 --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVars/test/.project @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>root</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> + <linkedResources> + <link> + <name>variable</name> + <type>2</type> + <locationURI>variable</locationURI> + </link> + </linkedResources> + +</projectDescription> diff --git a/plugins/eclipse/testData/linked/resolvedVars/variableidea/empty.txt b/plugins/eclipse/testData/linked/resolvedVars/variableidea/empty.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVars/variableidea/empty.txt diff --git a/plugins/eclipse/testData/linked/resolvedVarsInIml/expected/expected.iml b/plugins/eclipse/testData/linked/resolvedVarsInIml/expected/expected.iml new file mode 100644 index 000000000000..7599bf43d825 --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInIml/expected/expected.iml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<root inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/bin" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" /> + </content> + <content url="file://$variable$"> + <sourceFolder url="file://$variable$" isTestSource="false" /> + </content> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="inheritedJdk" /> +</root>
\ No newline at end of file diff --git a/plugins/eclipse/testData/linked/resolvedVarsInIml/test/.classpath b/plugins/eclipse/testData/linked/resolvedVarsInIml/test/.classpath new file mode 100644 index 000000000000..2ebfed444d7c --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInIml/test/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path=""/> + <classpathentry kind="src" path="variable"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/linked/resolvedVarsInIml/test/.project b/plugins/eclipse/testData/linked/resolvedVarsInIml/test/.project new file mode 100644 index 000000000000..ee05fd52e055 --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInIml/test/.project @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>root</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> + <linkedResources> + <link> + <name>variable</name> + <type>2</type> + <locationURI>variable</locationURI> + </link> + </linkedResources> + +</projectDescription> diff --git a/plugins/eclipse/testData/linked/resolvedVarsInIml/variableidea/empty.txt b/plugins/eclipse/testData/linked/resolvedVarsInIml/variableidea/empty.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInIml/variableidea/empty.txt diff --git a/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck/expected/expected.iml b/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck/expected/expected.iml new file mode 100644 index 000000000000..1026fef7b6f5 --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck/expected/expected.iml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<root inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/bin" /> + <exclude-output /> + <content url="file://$MODULE_DIR$" /> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module-library" exported=""> + <library name="3rdParty"> + <CLASSES> + <root url="file://$variable$/project1" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> +</root>
\ No newline at end of file diff --git a/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck/test/.classpath b/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck/test/.classpath new file mode 100644 index 000000000000..d28ac786b169 --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry exported="true" kind="lib" path="3rdParty"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck/test/.project b/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck/test/.project new file mode 100644 index 000000000000..af1e53c8465b --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck/test/.project @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>eclipse_project</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>net.sf.eclipsensis.installoptions.InstallOptionsBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>net.sf.eclipsensis.installoptions.InstallOptionsNature</nature> + </natures> + <linkedResources> + <link> + <name>3rdParty</name> + <type>2</type> + <locationURI>variable/project1</locationURI> + </link> + </linkedResources> +</projectDescription> diff --git a/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck/variableidea/project1/empty.txt b/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck/variableidea/project1/empty.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck/variableidea/project1/empty.txt diff --git a/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck1/test/.classpath b/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck1/test/.classpath new file mode 100644 index 000000000000..f116e23ea584 --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck1/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="3rdParty/subdir/empty.jar"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck1/test/.project b/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck1/test/.project new file mode 100644 index 000000000000..af1e53c8465b --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck1/test/.project @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>eclipse_project</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>net.sf.eclipsensis.installoptions.InstallOptionsBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>net.sf.eclipsensis.installoptions.InstallOptionsNature</nature> + </natures> + <linkedResources> + <link> + <name>3rdParty</name> + <type>2</type> + <locationURI>variable/project1</locationURI> + </link> + </linkedResources> +</projectDescription> diff --git a/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck1/variableidea/project1/subdir/empty.jar b/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck1/variableidea/project1/subdir/empty.jar new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInLibImlCheck1/variableidea/project1/subdir/empty.jar diff --git a/plugins/eclipse/testData/linked/resolvedVarsInOutput/test/.classpath b/plugins/eclipse/testData/linked/resolvedVarsInOutput/test/.classpath new file mode 100644 index 000000000000..96c3908a9d3d --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInOutput/test/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path=""/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="linked_resource_variable_alias"/> +</classpath> diff --git a/plugins/eclipse/testData/linked/resolvedVarsInOutput/test/.project b/plugins/eclipse/testData/linked/resolvedVarsInOutput/test/.project new file mode 100644 index 000000000000..55b7dd6f025e --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInOutput/test/.project @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>root</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> + <linkedResources> + <link> + <name>linked_resource_variable_alias</name> + <type>2</type> + <locationURI>variable/project1</locationURI> + </link> + </linkedResources> + +</projectDescription> diff --git a/plugins/eclipse/testData/linked/resolvedVarsInOutput/variableidea/project1/empty.txt b/plugins/eclipse/testData/linked/resolvedVarsInOutput/variableidea/project1/empty.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInOutput/variableidea/project1/empty.txt diff --git a/plugins/eclipse/testData/linked/resolvedVarsInOutputImlCheck/expected/expected.iml b/plugins/eclipse/testData/linked/resolvedVarsInOutputImlCheck/expected/expected.iml new file mode 100644 index 000000000000..d99fb199d68d --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInOutputImlCheck/expected/expected.iml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<root inherit-compiler-output="false"> + <output url="file://$variable$/project1" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" /> + </content> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="inheritedJdk" /> +</root>
\ No newline at end of file diff --git a/plugins/eclipse/testData/linked/resolvedVarsInOutputImlCheck/test/.classpath b/plugins/eclipse/testData/linked/resolvedVarsInOutputImlCheck/test/.classpath new file mode 100644 index 000000000000..96c3908a9d3d --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInOutputImlCheck/test/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path=""/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="linked_resource_variable_alias"/> +</classpath> diff --git a/plugins/eclipse/testData/linked/resolvedVarsInOutputImlCheck/test/.project b/plugins/eclipse/testData/linked/resolvedVarsInOutputImlCheck/test/.project new file mode 100644 index 000000000000..55b7dd6f025e --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInOutputImlCheck/test/.project @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>root</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> + <linkedResources> + <link> + <name>linked_resource_variable_alias</name> + <type>2</type> + <locationURI>variable/project1</locationURI> + </link> + </linkedResources> + +</projectDescription> diff --git a/plugins/eclipse/testData/linked/resolvedVarsInOutputImlCheck/variableidea/project1/empty.txt b/plugins/eclipse/testData/linked/resolvedVarsInOutputImlCheck/variableidea/project1/empty.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/linked/resolvedVarsInOutputImlCheck/variableidea/project1/empty.txt diff --git a/plugins/eclipse/testData/modification/cantReplaceWithVariables/expected/.classpath b/plugins/eclipse/testData/modification/cantReplaceWithVariables/expected/.classpath new file mode 100644 index 000000000000..af4e20310f7e --- /dev/null +++ b/plugins/eclipse/testData/modification/cantReplaceWithVariables/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/variableidea1/test.jar" sourcepath="$ROOT$/srcvariableidea/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/cantReplaceWithVariables/srcvariableidea/test.jar b/plugins/eclipse/testData/modification/cantReplaceWithVariables/srcvariableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/cantReplaceWithVariables/srcvariableidea/test.jar diff --git a/plugins/eclipse/testData/modification/cantReplaceWithVariables/test/.classpath b/plugins/eclipse/testData/modification/cantReplaceWithVariables/test/.classpath new file mode 100644 index 000000000000..bbef4220ff82 --- /dev/null +++ b/plugins/eclipse/testData/modification/cantReplaceWithVariables/test/.classpath @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/cantReplaceWithVariables/test/.project b/plugins/eclipse/testData/modification/cantReplaceWithVariables/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/cantReplaceWithVariables/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/cantReplaceWithVariables/variableidea1/test.jar b/plugins/eclipse/testData/modification/cantReplaceWithVariables/variableidea1/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/cantReplaceWithVariables/variableidea1/test.jar diff --git a/plugins/eclipse/testData/modification/libAddLibSource/expected/.classpath b/plugins/eclipse/testData/modification/libAddLibSource/expected/.classpath new file mode 100644 index 000000000000..176d6afd8455 --- /dev/null +++ b/plugins/eclipse/testData/modification/libAddLibSource/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/jars/test.jar" sourcepath="$ROOT$/jars/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libAddLibSource/expected/ws-internals.eml b/plugins/eclipse/testData/modification/libAddLibSource/expected/ws-internals.eml new file mode 100644 index 000000000000..7a601331a8cb --- /dev/null +++ b/plugins/eclipse/testData/modification/libAddLibSource/expected/ws-internals.eml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$" /> + <lib name="test.jar" scope="COMPILE"> + <srcroot url="jar://$MODULE_DIR$/../jars/test.jar!/" /> + <srcroot url="jar://$MODULE_DIR$/../jars/test-2.jar!/" bind="false" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libAddLibSource/jars/test-2.jar b/plugins/eclipse/testData/modification/libAddLibSource/jars/test-2.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libAddLibSource/jars/test-2.jar diff --git a/plugins/eclipse/testData/modification/libAddLibSource/jars/test.jar b/plugins/eclipse/testData/modification/libAddLibSource/jars/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libAddLibSource/jars/test.jar diff --git a/plugins/eclipse/testData/modification/libAddLibSource/test/.classpath b/plugins/eclipse/testData/modification/libAddLibSource/test/.classpath new file mode 100644 index 000000000000..176d6afd8455 --- /dev/null +++ b/plugins/eclipse/testData/modification/libAddLibSource/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/jars/test.jar" sourcepath="$ROOT$/jars/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libAddLibSource/test/.project b/plugins/eclipse/testData/modification/libAddLibSource/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/libAddLibSource/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/libAddVarSource/expected/.classpath b/plugins/eclipse/testData/modification/libAddVarSource/expected/.classpath new file mode 100644 index 000000000000..176d6afd8455 --- /dev/null +++ b/plugins/eclipse/testData/modification/libAddVarSource/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/jars/test.jar" sourcepath="$ROOT$/jars/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libAddVarSource/expected/ws-internals.eml b/plugins/eclipse/testData/modification/libAddVarSource/expected/ws-internals.eml new file mode 100644 index 000000000000..e5440bbb9821 --- /dev/null +++ b/plugins/eclipse/testData/modification/libAddVarSource/expected/ws-internals.eml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$" /> + <lib name="test.jar" scope="COMPILE"> + <srcroot url="jar://$MODULE_DIR$/../jars/test.jar!/" /> + <srcroot url="jar://$srcvariable$/test.jar!/" bind="false" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libAddVarSource/jars/test.jar b/plugins/eclipse/testData/modification/libAddVarSource/jars/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libAddVarSource/jars/test.jar diff --git a/plugins/eclipse/testData/modification/libAddVarSource/srcvariableidea/test.jar b/plugins/eclipse/testData/modification/libAddVarSource/srcvariableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libAddVarSource/srcvariableidea/test.jar diff --git a/plugins/eclipse/testData/modification/libAddVarSource/test/.classpath b/plugins/eclipse/testData/modification/libAddVarSource/test/.classpath new file mode 100644 index 000000000000..176d6afd8455 --- /dev/null +++ b/plugins/eclipse/testData/modification/libAddVarSource/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/jars/test.jar" sourcepath="$ROOT$/jars/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libAddVarSource/test/.project b/plugins/eclipse/testData/modification/libAddVarSource/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/libAddVarSource/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/libReplaceVarSource/expected/.classpath b/plugins/eclipse/testData/modification/libReplaceVarSource/expected/.classpath new file mode 100644 index 000000000000..adde317d0d00 --- /dev/null +++ b/plugins/eclipse/testData/modification/libReplaceVarSource/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/jars/test.jar" sourcepath="$ROOT$/srcvariableidea/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libReplaceVarSource/expected/ws-internals.eml b/plugins/eclipse/testData/modification/libReplaceVarSource/expected/ws-internals.eml new file mode 100644 index 000000000000..3f45ad1e706f --- /dev/null +++ b/plugins/eclipse/testData/modification/libReplaceVarSource/expected/ws-internals.eml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$" /> + <lib name="test.jar" scope="COMPILE"> + <srcroot url="jar://$srcvariable$/test.jar!/" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libReplaceVarSource/jars/test.jar b/plugins/eclipse/testData/modification/libReplaceVarSource/jars/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libReplaceVarSource/jars/test.jar diff --git a/plugins/eclipse/testData/modification/libReplaceVarSource/srcvariableidea/test.jar b/plugins/eclipse/testData/modification/libReplaceVarSource/srcvariableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libReplaceVarSource/srcvariableidea/test.jar diff --git a/plugins/eclipse/testData/modification/libReplaceVarSource/test/.classpath b/plugins/eclipse/testData/modification/libReplaceVarSource/test/.classpath new file mode 100644 index 000000000000..176d6afd8455 --- /dev/null +++ b/plugins/eclipse/testData/modification/libReplaceVarSource/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/jars/test.jar" sourcepath="$ROOT$/jars/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libReplaceVarSource/test/.project b/plugins/eclipse/testData/modification/libReplaceVarSource/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/libReplaceVarSource/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/libvarAddLibSource/expected/.classpath b/plugins/eclipse/testData/modification/libvarAddLibSource/expected/.classpath new file mode 100644 index 000000000000..2687bcc37a1b --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarAddLibSource/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/variableidea/test.jar" sourcepath="$ROOT$/jars/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libvarAddLibSource/expected/ws-internals.eml b/plugins/eclipse/testData/modification/libvarAddLibSource/expected/ws-internals.eml new file mode 100644 index 000000000000..4afc7514118f --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarAddLibSource/expected/ws-internals.eml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$" /> + <lib name="test.jar" scope="COMPILE"> + <srcroot url="jar://$MODULE_DIR$/../jars/test.jar!/" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libvarAddLibSource/jars/test.jar b/plugins/eclipse/testData/modification/libvarAddLibSource/jars/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarAddLibSource/jars/test.jar diff --git a/plugins/eclipse/testData/modification/libvarAddLibSource/test/.classpath b/plugins/eclipse/testData/modification/libvarAddLibSource/test/.classpath new file mode 100644 index 000000000000..64f46b654b7d --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarAddLibSource/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/variableidea/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libvarAddLibSource/test/.project b/plugins/eclipse/testData/modification/libvarAddLibSource/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarAddLibSource/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/libvarAddLibSource/variableidea/test.jar b/plugins/eclipse/testData/modification/libvarAddLibSource/variableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarAddLibSource/variableidea/test.jar diff --git a/plugins/eclipse/testData/modification/libvarAddVarSource/expected/.classpath b/plugins/eclipse/testData/modification/libvarAddVarSource/expected/.classpath new file mode 100644 index 000000000000..2687bcc37a1b --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarAddVarSource/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/variableidea/test.jar" sourcepath="$ROOT$/jars/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libvarAddVarSource/expected/ws-internals.eml b/plugins/eclipse/testData/modification/libvarAddVarSource/expected/ws-internals.eml new file mode 100644 index 000000000000..e5440bbb9821 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarAddVarSource/expected/ws-internals.eml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$" /> + <lib name="test.jar" scope="COMPILE"> + <srcroot url="jar://$MODULE_DIR$/../jars/test.jar!/" /> + <srcroot url="jar://$srcvariable$/test.jar!/" bind="false" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libvarAddVarSource/jars/test.jar b/plugins/eclipse/testData/modification/libvarAddVarSource/jars/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarAddVarSource/jars/test.jar diff --git a/plugins/eclipse/testData/modification/libvarAddVarSource/srcvariableidea/test.jar b/plugins/eclipse/testData/modification/libvarAddVarSource/srcvariableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarAddVarSource/srcvariableidea/test.jar diff --git a/plugins/eclipse/testData/modification/libvarAddVarSource/test/.classpath b/plugins/eclipse/testData/modification/libvarAddVarSource/test/.classpath new file mode 100644 index 000000000000..2687bcc37a1b --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarAddVarSource/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/variableidea/test.jar" sourcepath="$ROOT$/jars/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libvarAddVarSource/test/.project b/plugins/eclipse/testData/modification/libvarAddVarSource/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarAddVarSource/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/libvarAddVarSource/variableidea/test.jar b/plugins/eclipse/testData/modification/libvarAddVarSource/variableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarAddVarSource/variableidea/test.jar diff --git a/plugins/eclipse/testData/modification/libvarReplaceLibSource/expected/.classpath b/plugins/eclipse/testData/modification/libvarReplaceLibSource/expected/.classpath new file mode 100644 index 000000000000..2687bcc37a1b --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarReplaceLibSource/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/variableidea/test.jar" sourcepath="$ROOT$/jars/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libvarReplaceLibSource/expected/ws-internals.eml b/plugins/eclipse/testData/modification/libvarReplaceLibSource/expected/ws-internals.eml new file mode 100644 index 000000000000..4afc7514118f --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarReplaceLibSource/expected/ws-internals.eml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$" /> + <lib name="test.jar" scope="COMPILE"> + <srcroot url="jar://$MODULE_DIR$/../jars/test.jar!/" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libvarReplaceLibSource/jars/test.jar b/plugins/eclipse/testData/modification/libvarReplaceLibSource/jars/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarReplaceLibSource/jars/test.jar diff --git a/plugins/eclipse/testData/modification/libvarReplaceLibSource/srcvariableidea/test.jar b/plugins/eclipse/testData/modification/libvarReplaceLibSource/srcvariableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarReplaceLibSource/srcvariableidea/test.jar diff --git a/plugins/eclipse/testData/modification/libvarReplaceLibSource/test/.classpath b/plugins/eclipse/testData/modification/libvarReplaceLibSource/test/.classpath new file mode 100644 index 000000000000..34a71226e8fe --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarReplaceLibSource/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/variableidea/test.jar" sourcepath="$ROOT$/srcvariableidea/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libvarReplaceLibSource/test/.project b/plugins/eclipse/testData/modification/libvarReplaceLibSource/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarReplaceLibSource/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/libvarReplaceLibSource/variableidea/test.jar b/plugins/eclipse/testData/modification/libvarReplaceLibSource/variableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarReplaceLibSource/variableidea/test.jar diff --git a/plugins/eclipse/testData/modification/libvarReplaceVarSource/expected/.classpath b/plugins/eclipse/testData/modification/libvarReplaceVarSource/expected/.classpath new file mode 100644 index 000000000000..34a71226e8fe --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarReplaceVarSource/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/variableidea/test.jar" sourcepath="$ROOT$/srcvariableidea/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libvarReplaceVarSource/expected/ws-internals.eml b/plugins/eclipse/testData/modification/libvarReplaceVarSource/expected/ws-internals.eml new file mode 100644 index 000000000000..3f45ad1e706f --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarReplaceVarSource/expected/ws-internals.eml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$" /> + <lib name="test.jar" scope="COMPILE"> + <srcroot url="jar://$srcvariable$/test.jar!/" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libvarReplaceVarSource/srcvariableidea/test.jar b/plugins/eclipse/testData/modification/libvarReplaceVarSource/srcvariableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarReplaceVarSource/srcvariableidea/test.jar diff --git a/plugins/eclipse/testData/modification/libvarReplaceVarSource/test/.classpath b/plugins/eclipse/testData/modification/libvarReplaceVarSource/test/.classpath new file mode 100644 index 000000000000..c0a0001aa915 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarReplaceVarSource/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/variableidea/test.jar" sourcepath="$ROOT$/variableidea/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/libvarReplaceVarSource/test/.project b/plugins/eclipse/testData/modification/libvarReplaceVarSource/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarReplaceVarSource/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/libvarReplaceVarSource/variableidea/test.jar b/plugins/eclipse/testData/modification/libvarReplaceVarSource/variableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/libvarReplaceVarSource/variableidea/test.jar diff --git a/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/expected/.classpath b/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/expected/.classpath new file mode 100644 index 000000000000..4b571b36ea65 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/expected/.classpath @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar"> + <attributes> + <attribute name="javadoc_location" value="jar:file:/$ROOT$/srcvariableidea1/test.jar!/" /> + </attributes> + </classpathentry> + <classpathentry kind="output" path="bin" /> +</classpath> diff --git a/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/expected/ws-internals.eml b/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/expected/ws-internals.eml new file mode 100644 index 000000000000..7dfadd07d41e --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/expected/ws-internals.eml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$" /> + <lib name="test.jar" scope="COMPILE"> + <javadocroot_attr url="jar://$MODULE_DIR$/../srcvariableidea11/test.jar!/" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/srcvariableidea1/test.jar b/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/srcvariableidea1/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/srcvariableidea1/test.jar diff --git a/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/test/.classpath b/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/test/.classpath new file mode 100644 index 000000000000..f62ed8d1c84a --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar"/> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/test/.project b/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/variableidea/test.jar b/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/variableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedExistingWithMultipleJavadocs/variableidea/test.jar diff --git a/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/expected/.classpath b/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/expected/.classpath new file mode 100644 index 000000000000..8fb44aaed0aa --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/expected/ws-internals.eml b/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/expected/ws-internals.eml new file mode 100644 index 000000000000..aeb218a20352 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/expected/ws-internals.eml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$" /> + <lib name="test.jar" scope="COMPILE"> + <srcroot url="jar://$MODULE_DIR$/../srcvariableidea1/test.jar!/" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/srcvariableidea1/test.jar b/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/srcvariableidea1/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/srcvariableidea1/test.jar diff --git a/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/test/.classpath b/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/test/.classpath new file mode 100644 index 000000000000..e6552e05aca7 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar" sourcepath="/srcvariable/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/test/.project b/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/variableidea/test.jar b/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/variableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedExistingWithVariablesCantReplaceSrc/variableidea/test.jar diff --git a/plugins/eclipse/testData/modification/replacedWithVariables/expected/.classpath b/plugins/eclipse/testData/modification/replacedWithVariables/expected/.classpath new file mode 100644 index 000000000000..e6552e05aca7 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariables/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar" sourcepath="/srcvariable/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/replacedWithVariables/srcvariableidea/test.jar b/plugins/eclipse/testData/modification/replacedWithVariables/srcvariableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariables/srcvariableidea/test.jar diff --git a/plugins/eclipse/testData/modification/replacedWithVariables/test/.classpath b/plugins/eclipse/testData/modification/replacedWithVariables/test/.classpath new file mode 100644 index 000000000000..bbef4220ff82 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariables/test/.classpath @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/replacedWithVariables/test/.project b/plugins/eclipse/testData/modification/replacedWithVariables/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariables/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/replacedWithVariables/variableidea/test.jar b/plugins/eclipse/testData/modification/replacedWithVariables/variableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariables/variableidea/test.jar diff --git a/plugins/eclipse/testData/modification/replacedWithVariablesCantReplaceSrc/expected/.classpath b/plugins/eclipse/testData/modification/replacedWithVariablesCantReplaceSrc/expected/.classpath new file mode 100644 index 000000000000..69df082536f6 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariablesCantReplaceSrc/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="$ROOT$/variableidea/test.jar" sourcepath="$ROOT$/srcvariableidea1/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/replacedWithVariablesCantReplaceSrc/srcvariableidea1/test.jar b/plugins/eclipse/testData/modification/replacedWithVariablesCantReplaceSrc/srcvariableidea1/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariablesCantReplaceSrc/srcvariableidea1/test.jar diff --git a/plugins/eclipse/testData/modification/replacedWithVariablesCantReplaceSrc/test/.classpath b/plugins/eclipse/testData/modification/replacedWithVariablesCantReplaceSrc/test/.classpath new file mode 100644 index 000000000000..bbef4220ff82 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariablesCantReplaceSrc/test/.classpath @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/replacedWithVariablesCantReplaceSrc/test/.project b/plugins/eclipse/testData/modification/replacedWithVariablesCantReplaceSrc/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariablesCantReplaceSrc/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/replacedWithVariablesCantReplaceSrc/variableidea/test.jar b/plugins/eclipse/testData/modification/replacedWithVariablesCantReplaceSrc/variableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariablesCantReplaceSrc/variableidea/test.jar diff --git a/plugins/eclipse/testData/modification/replacedWithVariablesNoSources/expected/.classpath b/plugins/eclipse/testData/modification/replacedWithVariablesNoSources/expected/.classpath new file mode 100644 index 000000000000..8fb44aaed0aa --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariablesNoSources/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/replacedWithVariablesNoSources/test/.classpath b/plugins/eclipse/testData/modification/replacedWithVariablesNoSources/test/.classpath new file mode 100644 index 000000000000..bbef4220ff82 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariablesNoSources/test/.classpath @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/replacedWithVariablesNoSources/test/.project b/plugins/eclipse/testData/modification/replacedWithVariablesNoSources/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariablesNoSources/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/replacedWithVariablesNoSources/variableidea/test.jar b/plugins/eclipse/testData/modification/replacedWithVariablesNoSources/variableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariablesNoSources/variableidea/test.jar diff --git a/plugins/eclipse/testData/modification/replacedWithVariablesNoSrcExistOnDisc/expected/.classpath b/plugins/eclipse/testData/modification/replacedWithVariablesNoSrcExistOnDisc/expected/.classpath new file mode 100644 index 000000000000..e6552e05aca7 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariablesNoSrcExistOnDisc/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar" sourcepath="/srcvariable/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/replacedWithVariablesNoSrcExistOnDisc/srcvariableidea/dontdeletedir.txt b/plugins/eclipse/testData/modification/replacedWithVariablesNoSrcExistOnDisc/srcvariableidea/dontdeletedir.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariablesNoSrcExistOnDisc/srcvariableidea/dontdeletedir.txt diff --git a/plugins/eclipse/testData/modification/replacedWithVariablesNoSrcExistOnDisc/test/.classpath b/plugins/eclipse/testData/modification/replacedWithVariablesNoSrcExistOnDisc/test/.classpath new file mode 100644 index 000000000000..bbef4220ff82 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariablesNoSrcExistOnDisc/test/.classpath @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/replacedWithVariablesNoSrcExistOnDisc/test/.project b/plugins/eclipse/testData/modification/replacedWithVariablesNoSrcExistOnDisc/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariablesNoSrcExistOnDisc/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/replacedWithVariablesNoSrcExistOnDisc/variableidea/test.jar b/plugins/eclipse/testData/modification/replacedWithVariablesNoSrcExistOnDisc/variableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/replacedWithVariablesNoSrcExistOnDisc/variableidea/test.jar diff --git a/plugins/eclipse/testData/modification/varAddJavadoc/expected/.classpath b/plugins/eclipse/testData/modification/varAddJavadoc/expected/.classpath new file mode 100644 index 000000000000..f53870069b97 --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddJavadoc/expected/.classpath @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar" sourcepath="variable/test.jar"> + <attributes> + <attribute name="javadoc_location" value="jar:file:/$ROOT$/jars/test.jar!/" /> + </attributes> + </classpathentry> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/varAddJavadoc/expected/ws-internals.eml b/plugins/eclipse/testData/modification/varAddJavadoc/expected/ws-internals.eml new file mode 100644 index 000000000000..7025e8384962 --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddJavadoc/expected/ws-internals.eml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$" /> + <lib name="test.jar" scope="COMPILE"> + <srcroot url="jar://$variable$/test.jar!/" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/varAddJavadoc/jars/test.jar b/plugins/eclipse/testData/modification/varAddJavadoc/jars/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddJavadoc/jars/test.jar diff --git a/plugins/eclipse/testData/modification/varAddJavadoc/test/.classpath b/plugins/eclipse/testData/modification/varAddJavadoc/test/.classpath new file mode 100644 index 000000000000..65e495d45cd3 --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddJavadoc/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar" sourcepath="variable/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/varAddJavadoc/test/.project b/plugins/eclipse/testData/modification/varAddJavadoc/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddJavadoc/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/varAddJavadoc/variableidea/test.jar b/plugins/eclipse/testData/modification/varAddJavadoc/variableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddJavadoc/variableidea/test.jar diff --git a/plugins/eclipse/testData/modification/varAddLibSource/expected/.classpath b/plugins/eclipse/testData/modification/varAddLibSource/expected/.classpath new file mode 100644 index 000000000000..8fb44aaed0aa --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddLibSource/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/varAddLibSource/expected/ws-internals.eml b/plugins/eclipse/testData/modification/varAddLibSource/expected/ws-internals.eml new file mode 100644 index 000000000000..4afc7514118f --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddLibSource/expected/ws-internals.eml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$" /> + <lib name="test.jar" scope="COMPILE"> + <srcroot url="jar://$MODULE_DIR$/../jars/test.jar!/" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/varAddLibSource/jars/test.jar b/plugins/eclipse/testData/modification/varAddLibSource/jars/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddLibSource/jars/test.jar diff --git a/plugins/eclipse/testData/modification/varAddLibSource/test/.classpath b/plugins/eclipse/testData/modification/varAddLibSource/test/.classpath new file mode 100644 index 000000000000..8fb44aaed0aa --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddLibSource/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/varAddLibSource/test/.project b/plugins/eclipse/testData/modification/varAddLibSource/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddLibSource/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/varAddLibSource/variableidea/test.jar b/plugins/eclipse/testData/modification/varAddLibSource/variableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddLibSource/variableidea/test.jar diff --git a/plugins/eclipse/testData/modification/varAddVarSource/expected/.classpath b/plugins/eclipse/testData/modification/varAddVarSource/expected/.classpath new file mode 100644 index 000000000000..23376a72604b --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddVarSource/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar" sourcepath="/variable/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/varAddVarSource/expected/ws-internals.eml b/plugins/eclipse/testData/modification/varAddVarSource/expected/ws-internals.eml new file mode 100644 index 000000000000..9d4e01e07d67 --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddVarSource/expected/ws-internals.eml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$" /> + <lib name="test.jar" scope="COMPILE"> + <srcroot url="jar://$variable$/test.jar!/" /> + <srcroot url="jar://$srcvariable$/test.jar!/" bind="false" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/varAddVarSource/srcvariableidea/test.jar b/plugins/eclipse/testData/modification/varAddVarSource/srcvariableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddVarSource/srcvariableidea/test.jar diff --git a/plugins/eclipse/testData/modification/varAddVarSource/test/.classpath b/plugins/eclipse/testData/modification/varAddVarSource/test/.classpath new file mode 100644 index 000000000000..23376a72604b --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddVarSource/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar" sourcepath="/variable/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/varAddVarSource/test/.project b/plugins/eclipse/testData/modification/varAddVarSource/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddVarSource/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/varAddVarSource/variableidea/test.jar b/plugins/eclipse/testData/modification/varAddVarSource/variableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/varAddVarSource/variableidea/test.jar diff --git a/plugins/eclipse/testData/modification/varReplaceLibSource/expected/.classpath b/plugins/eclipse/testData/modification/varReplaceLibSource/expected/.classpath new file mode 100644 index 000000000000..8fb44aaed0aa --- /dev/null +++ b/plugins/eclipse/testData/modification/varReplaceLibSource/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/varReplaceLibSource/expected/ws-internals.eml b/plugins/eclipse/testData/modification/varReplaceLibSource/expected/ws-internals.eml new file mode 100644 index 000000000000..4afc7514118f --- /dev/null +++ b/plugins/eclipse/testData/modification/varReplaceLibSource/expected/ws-internals.eml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$" /> + <lib name="test.jar" scope="COMPILE"> + <srcroot url="jar://$MODULE_DIR$/../jars/test.jar!/" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/varReplaceLibSource/jars/test.jar b/plugins/eclipse/testData/modification/varReplaceLibSource/jars/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/varReplaceLibSource/jars/test.jar diff --git a/plugins/eclipse/testData/modification/varReplaceLibSource/test/.classpath b/plugins/eclipse/testData/modification/varReplaceLibSource/test/.classpath new file mode 100644 index 000000000000..23376a72604b --- /dev/null +++ b/plugins/eclipse/testData/modification/varReplaceLibSource/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar" sourcepath="/variable/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/varReplaceLibSource/test/.project b/plugins/eclipse/testData/modification/varReplaceLibSource/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/varReplaceLibSource/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/varReplaceLibSource/variableidea/test.jar b/plugins/eclipse/testData/modification/varReplaceLibSource/variableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/varReplaceLibSource/variableidea/test.jar diff --git a/plugins/eclipse/testData/modification/varReplaceVarSource/expected/.classpath b/plugins/eclipse/testData/modification/varReplaceVarSource/expected/.classpath new file mode 100644 index 000000000000..e6552e05aca7 --- /dev/null +++ b/plugins/eclipse/testData/modification/varReplaceVarSource/expected/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar" sourcepath="/srcvariable/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/varReplaceVarSource/expected/ws-internals.eml b/plugins/eclipse/testData/modification/varReplaceVarSource/expected/ws-internals.eml new file mode 100644 index 000000000000..3f45ad1e706f --- /dev/null +++ b/plugins/eclipse/testData/modification/varReplaceVarSource/expected/ws-internals.eml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component> + <exclude-output /> + <contentEntry url="file://$MODULE_DIR$" /> + <lib name="test.jar" scope="COMPILE"> + <srcroot url="jar://$srcvariable$/test.jar!/" /> + </lib> +</component>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/varReplaceVarSource/srcvariableidea/test.jar b/plugins/eclipse/testData/modification/varReplaceVarSource/srcvariableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/varReplaceVarSource/srcvariableidea/test.jar diff --git a/plugins/eclipse/testData/modification/varReplaceVarSource/test/.classpath b/plugins/eclipse/testData/modification/varReplaceVarSource/test/.classpath new file mode 100644 index 000000000000..23376a72604b --- /dev/null +++ b/plugins/eclipse/testData/modification/varReplaceVarSource/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="var" path="variable/test.jar" sourcepath="/variable/test.jar" /> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/modification/varReplaceVarSource/test/.project b/plugins/eclipse/testData/modification/varReplaceVarSource/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/modification/varReplaceVarSource/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/modification/varReplaceVarSource/variableidea/test.jar b/plugins/eclipse/testData/modification/varReplaceVarSource/variableidea/test.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/modification/varReplaceVarSource/variableidea/test.jar diff --git a/plugins/eclipse/testData/round/IDEA53188/multi/main/.classpath b/plugins/eclipse/testData/round/IDEA53188/multi/main/.classpath new file mode 100644 index 000000000000..4fbfd1bb22fc --- /dev/null +++ b/plugins/eclipse/testData/round/IDEA53188/multi/main/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="Source/Java"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="lib" path="/ws-internals/Jar/comms.jar"/> + <classpathentry kind="output" path="Build"/> +</classpath> diff --git a/plugins/eclipse/testData/round/IDEA53188/multi/main/.project b/plugins/eclipse/testData/round/IDEA53188/multi/main/.project new file mode 100644 index 000000000000..03d8aa35eb8e --- /dev/null +++ b/plugins/eclipse/testData/round/IDEA53188/multi/main/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>Software-Testing</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/IDEA53188/multi/ws-internals/.classpath b/plugins/eclipse/testData/round/IDEA53188/multi/ws-internals/.classpath new file mode 100644 index 000000000000..b795d73a3619 --- /dev/null +++ b/plugins/eclipse/testData/round/IDEA53188/multi/ws-internals/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="Jar"/> +</classpath> diff --git a/plugins/eclipse/testData/round/IDEA53188/multi/ws-internals/.project b/plugins/eclipse/testData/round/IDEA53188/multi/ws-internals/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/round/IDEA53188/multi/ws-internals/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/IDEA53188/multi/ws-internals/Jar/comms.jar b/plugins/eclipse/testData/round/IDEA53188/multi/ws-internals/Jar/comms.jar Binary files differnew file mode 100644 index 000000000000..0e0dc04dfbaa --- /dev/null +++ b/plugins/eclipse/testData/round/IDEA53188/multi/ws-internals/Jar/comms.jar diff --git a/plugins/eclipse/testData/round/absolutePaths/parent/parent/test/.classpath b/plugins/eclipse/testData/round/absolutePaths/parent/parent/test/.classpath new file mode 100644 index 000000000000..1933ac81d72a --- /dev/null +++ b/plugins/eclipse/testData/round/absolutePaths/parent/parent/test/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry including="**" kind="src" path="src" /> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" /> + <classpathentry kind="lib" path="$ROOT$/parent/sub/test.jar"/> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/round/absolutePaths/parent/parent/test/.project b/plugins/eclipse/testData/round/absolutePaths/parent/parent/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/round/absolutePaths/parent/parent/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/absolutePaths/parent/sub/test.jar b/plugins/eclipse/testData/round/absolutePaths/parent/sub/test.jar new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/round/absolutePaths/parent/sub/test.jar diff --git a/plugins/eclipse/testData/round/accessrulez/test/.classpath b/plugins/eclipse/testData/round/accessrulez/test/.classpath new file mode 100644 index 000000000000..adea7d0d250d --- /dev/null +++ b/plugins/eclipse/testData/round/accessrulez/test/.classpath @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry including="**" kind="src" path="src" /> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" /> + <classpathentry kind="lib" path="test.jar"> + <accessrules> + <accessrule kind="nonaccessible" pattern="*" /> + </accessrules> + </classpathentry> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/round/accessrulez/test/.project b/plugins/eclipse/testData/round/accessrulez/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/round/accessrulez/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/accessrulez/test/test.jar b/plugins/eclipse/testData/round/accessrulez/test/test.jar new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/round/accessrulez/test/test.jar diff --git a/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-3/copy-every/lib-3/eclipseLib/SourceThree.class b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-3/copy-every/lib-3/eclipseLib/SourceThree.class Binary files differnew file mode 100644 index 000000000000..c495c1a44b70 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-3/copy-every/lib-3/eclipseLib/SourceThree.class diff --git a/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-3/copy-every/src/eclipseLib/SourceThree.java b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-3/copy-every/src/eclipseLib/SourceThree.java new file mode 100644 index 000000000000..836b2205ab3a --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-3/copy-every/src/eclipseLib/SourceThree.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package eclipseLib; + +/** + * Created in IntelliJ IDEA. + * By: Alexander.Chernikov + * When: 19.02.2009, 20:55:48 + * Русский текст. + */ +public class SourceThree { + public static final String ELIB_CONST = "value 3"; + + public void elibMethod() { + } +} diff --git a/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-6/jar-all-6.zip b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-6/jar-all-6.zip Binary files differnew file mode 100644 index 000000000000..657790348b97 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-6/jar-all-6.zip diff --git a/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-6/jar-every/lib-6.jar b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-6/jar-every/lib-6.jar Binary files differnew file mode 100644 index 000000000000..904f286f8f35 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-6/jar-every/lib-6.jar diff --git a/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-6/jar-every/src.zip b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-6/jar-every/src.zip Binary files differnew file mode 100644 index 000000000000..b5b74597564d --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-6/jar-every/src.zip diff --git a/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-8.userlibraries b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-8.userlibraries new file mode 100644 index 000000000000..e4c73cd5ced7 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-8.userlibraries @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<eclipse-userlibraries version="2"> + <library name="lib-8" systemlibrary="false"> + <archive javadoc="jar:file:/C:/uf/Alexander.Chernikov/work/eclipse-externals/lib-8/jar-every/apidoc.zip!/" path="C:/uf/Alexander.Chernikov/work/eclipse-externals/lib-8/jar-every/lib-8.jar" source="C:/uf/Alexander.Chernikov/work/eclipse-externals/lib-8/jar-every/src.zip"/> + </library> +</eclipse-userlibraries> diff --git a/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-8/jar-every/apidoc.zip b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-8/jar-every/apidoc.zip Binary files differnew file mode 100644 index 000000000000..b8dd71cfdc4a --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-8/jar-every/apidoc.zip diff --git a/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-8/jar-every/lib-8.jar b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-8/jar-every/lib-8.jar Binary files differnew file mode 100644 index 000000000000..5fbb13d9dadd --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-8/jar-every/lib-8.jar diff --git a/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-8/jar-every/src.zip b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-8/jar-every/src.zip Binary files differnew file mode 100644 index 000000000000..4e43084ef985 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-externals/lib-8/jar-every/src.zip diff --git a/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-7/copy-every/src/eclipseLib/SourceSeven.java b/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-7/copy-every/src/eclipseLib/SourceSeven.java new file mode 100644 index 000000000000..440e48891acc --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-7/copy-every/src/eclipseLib/SourceSeven.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package eclipseLib; + +/** + * Created in IntelliJ IDEA. + * By: Alexander.Chernikov + * When: 19.02.2009, 20:55:48 + * Русский текст. + */ +public class SourceSeven { + public static final String ELIB_CONST = "value 7"; + + public void elibMethod() { + } +} diff --git a/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-7/jar-all-7.zip b/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-7/jar-all-7.zip Binary files differnew file mode 100644 index 000000000000..cca9a3abd511 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-7/jar-all-7.zip diff --git a/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-7/jar-every/lib-7.jar b/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-7/jar-every/lib-7.jar Binary files differnew file mode 100644 index 000000000000..60d122eabfb0 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-7/jar-every/lib-7.jar diff --git a/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-9/copy-every/lib-9/eclipseLib/SourceNine.class b/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-9/copy-every/lib-9/eclipseLib/SourceNine.class Binary files differnew file mode 100644 index 000000000000..8d3c11c98f97 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-9/copy-every/lib-9/eclipseLib/SourceNine.class diff --git a/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-9/copy-every/src/eclipseLib/SourceNine.java b/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-9/copy-every/src/eclipseLib/SourceNine.java new file mode 100644 index 000000000000..0006403cba63 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-9/copy-every/src/eclipseLib/SourceNine.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package eclipseLib; + +/** + * Created in IntelliJ IDEA. + * By: Alexander.Chernikov + * When: 19.02.2009, 20:55:48 + * Русский текст. + */ +public class SourceNine { + public static final String ELIB_CONST = "value 9"; + + public void elibMethod() { + } +} diff --git a/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-a/jar-every/lib-a.jar b/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-a/jar-every/lib-a.jar Binary files differnew file mode 100644 index 000000000000..8ae21e2ec155 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-a/jar-every/lib-a.jar diff --git a/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-a/jar-every/src.zip b/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-a/jar-every/src.zip Binary files differnew file mode 100644 index 000000000000..137d3e870304 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-vars/lib-a/jar-every/src.zip diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/.classpath b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/.classpath new file mode 100644 index 000000000000..f75da1b1fe06 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/.classpath @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"> + <attributes> + <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="all-props/native"/> + </attributes> + </classpathentry> + <classpathentry excluding="excl/" including="incl/" kind="src" path="src-props-1"> + <attributes> + <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="ws-internals/native"/> + <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/doNotDeleteUnknownAttribute"/> + </attributes> + </classpathentry> + <classpathentry kind="src" output="bin-props-2" path="src-props-2"> + <attributes> + <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="$ROOT$/eclipse-externals/native"/> + </attributes> + </classpathentry> + <classpathentry kind="src" path="test"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry exported="true" kind="lib" path="lib-1/copy-every/lib-1" sourcepath="lib-1/copy-every/src"> + <attributes> + <attribute name="javadoc_location" value="file:/$ROOT$/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="lib" path="/ws-internals/lib-2/copy-every/lib-2" sourcepath="/ws-internals/lib-2/copy-every/src"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/ws-internals/lib-2/jar-all-2.zip!/"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="lib" path="lib-1/copy-every/lib-1" sourcepath="/wrong-path"/> + <classpathentry exported="true" kind="lib" path="$ROOT$/eclipse-externals/lib-3/copy-every/lib-3" sourcepath="$ROOT$/eclipse-externals/lib-3/copy-every/src"> + <attributes> + <attribute name="javadoc_location" value="http://open-space.org"/> + <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/doNotDeleteUnknownAttribute"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="lib" path="lib-4/jar-every/lib-4.jar" sourcepath="lib-4/jar-every/src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/all-props/lib-4/jar-every/apidoc.zip!/"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="lib" path="/ws-internals/lib-5/jar-every/lib-5.jar" sourcepath="/ws-internals/lib-5/jar-every/src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/ws-internals/lib-5/jar-all-5.zip!/doc/api"/> + <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/doNotDeleteUnknownAttribute"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="lib" path="$ROOT$/eclipse-externals/lib-6/jar-every/lib-6.jar" sourcepath="$ROOT$/eclipse-externals/lib-6/jar-every/src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:file:/$ROOT$/eclipse-externals/lib-6/jar-all-6.zip!/doc/api"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="var" path="ECLIPSE_VARS/lib-7/jar-every/lib-7.jar" sourcepath="/ECLIPSE_VARS/lib-7/copy-every/src"> + <attributes> + <attribute name="javadoc_location" value="jar:file:/$ROOT$/eclipse-vars/lib-7/jar-all-7.zip!/"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="var" path="ECLIPSE_VARS/lib-7/jar-every/lib-7.jar" sourcepath="/ECLIPSE_VARS/lib-7/copy-every/src"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/ws-internals/lib-5/NotValidZip.zip!/doc/api"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib-8"/> + <classpathentry exported="true" kind="var" path="ECLIPSE_VARS_LIB_9_CLS" sourcepath="/ECLIPSE_VARS_LIB_9_SRC"/> + <classpathentry exported="true" kind="var" path="ECLIPSE_VARS_LIB_A_CLS" sourcepath="/ECLIPSE_VARS_LIB_A_SRC"/> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/.classpath.0.xml b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/.classpath.0.xml new file mode 100644 index 000000000000..874cde141a4e --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/.classpath.0.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"> + <attributes> + <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="all-props/native"/> + </attributes> + </classpathentry> + <classpathentry excluding="excl/" including="incl/" kind="src" path="src-props-1"> + <attributes> + <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="ws-internals/native"/> + </attributes> + </classpathentry> + <classpathentry kind="src" output="bin-props-2" path="src-props-2"> + <attributes> + <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="/home/alexander.chernikov/work/eclipse-externals/native"/> + </attributes> + </classpathentry> + <classpathentry kind="src" path="test"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry exported="true" kind="lib" path="lib-1/copy-every/lib-1" sourcepath="lib-1/copy-every/src"> + <attributes> + <attribute name="javadoc_location" value="file:/home/alexander.chernikov/unit-072.work/ews-b/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="lib" path="/ws-internals/lib-2/copy-every/lib-2" sourcepath="/ws-internals/lib-2/copy-every/src"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/ws-internals/lib-2/jar-all-2.zip!/"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="lib" path="/home/alexander.chernikov/unit-072.work/ews-b/eclipse-externals/lib-3/copy-every/lib-3" sourcepath="/home/alexander.chernikov/unit-072.work/ews-b/eclipse-externals/lib-3/copy-every/src"> + <attributes> + <attribute name="javadoc_location" value="http://open-space.org"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="lib" path="lib-4/jar-every/lib-4.jar" sourcepath="lib-4/jar-every/src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/all-props/lib-4/jar-every/apidoc.zip!/"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="lib" path="/ws-internals/lib-5/jar-every/lib-5.jar" sourcepath="/ws-internals/lib-5/jar-every/src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/ws-internals/lib-5/jar-all-5.zip!/doc/api"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="lib" path="/home/alexander.chernikov/unit-072.work/ews-b/eclipse-externals/lib-6/jar-every/lib-6.jar" sourcepath="/home/alexander.chernikov/unit-072.work/ews-b/eclipse-externals/lib-6/jar-every/src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:file:/home/alexander.chernikov/unit-072.work/ews-b/eclipse-externals/lib-6/jar-all-6.zip!/doc/api"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="var" path="ECLIPSE_VARS/lib-7/jar-every/lib-7.jar" sourcepath="/ECLIPSE_VARS/lib-7/copy-every/src"> + <attributes> + <attribute name="javadoc_location" value="jar:file:/home/alexander.chernikov/unit-072.work/ews-b/eclipse-vars/lib-7/jar-all-7.zip!/"/> + </attributes> + </classpathentry> + <classpathentry exported="true" kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib-8"/> + <classpathentry exported="true" kind="var" path="ECLIPSE_VARS_LIB_9_CLS" sourcepath="/ECLIPSE_VARS_LIB_9_SRC"/> + <classpathentry exported="true" kind="var" path="ECLIPSE_VARS_LIB_A_CLS" sourcepath="/ECLIPSE_VARS_LIB_A_SRC"/> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/.project b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/.project new file mode 100644 index 000000000000..a9ce169bbd14 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>all-props</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/allclasses-frame.html b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/allclasses-frame.html new file mode 100644 index 000000000000..bec533a40478 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/allclasses-frame.html @@ -0,0 +1,31 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0_10-beta) on Thu Feb 19 20:58:54 MSK 2009 --> +<TITLE> +All Classes +</TITLE> + +<META NAME="date" CONTENT="2009-02-19"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + + +</HEAD> + +<BODY BGCOLOR="white"> +<FONT size="+1" CLASS="FrameHeadingFont"> +<B>All Classes</B></FONT> +<BR> + +<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> +<TR> +<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="eclipseLib/SourceOne.html" title="class in eclipseLib" target="classFrame">SourceOne</A> +<BR> +</FONT></TD> +</TR> +</TABLE> + +</BODY> +</HTML> diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/allclasses-noframe.html b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/allclasses-noframe.html new file mode 100644 index 000000000000..bffd0b196448 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/allclasses-noframe.html @@ -0,0 +1,31 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0_10-beta) on Thu Feb 19 20:58:54 MSK 2009 --> +<TITLE> +All Classes +</TITLE> + +<META NAME="date" CONTENT="2009-02-19"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + + +</HEAD> + +<BODY BGCOLOR="white"> +<FONT size="+1" CLASS="FrameHeadingFont"> +<B>All Classes</B></FONT> +<BR> + +<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> +<TR> +<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="eclipseLib/SourceOne.html" title="class in eclipseLib">SourceOne</A> +<BR> +</FONT></TD> +</TR> +</TABLE> + +</BODY> +</HTML> diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/eclipseLib/SourceOne.html b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/eclipseLib/SourceOne.html new file mode 100644 index 000000000000..ba8f3a747263 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/eclipseLib/SourceOne.html @@ -0,0 +1,293 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0_10-beta) on Thu Feb 19 20:58:54 MSK 2009 --> +<TITLE> +SourceOne +</TITLE> + +<META NAME="date" CONTENT="2009-02-19"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="SourceOne"; + } +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> +<HR> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../eclipseLib/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SourceOne.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV CLASS + NEXT CLASS</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../index.html?eclipseLib/SourceOne.html" target="_top"><B>FRAMES</B></A> + <A HREF="SourceOne.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<!-- ======== START OF CLASS DATA ======== --> +<H2> +<FONT SIZE="-1"> +eclipseLib</FONT> +<BR> +Class SourceOne</H2> +<PRE> +java.lang.Object + <IMG SRC="../resources/inherit.gif" ALT="extended by "><B>eclipseLib.SourceOne</B> +</PRE> +<HR> +<DL> +<DT><PRE>public class <B>SourceOne</B><DT>extends java.lang.Object</DL> +</PRE> + +<P> +Created in IntelliJ IDEA. + By: Alexander.Chernikov + When: 19.02.2009, 20:55:48 + Русский текст. +<P> + +<P> +<HR> + +<P> +<!-- =========== FIELD SUMMARY =========== --> + +<A NAME="field_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Field Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE>static java.lang.String</CODE></FONT></TD> +<TD><CODE><B><A HREF="../eclipseLib/SourceOne.html#ELIB_CONST">ELIB_CONST</A></B></CODE> + +<BR> + </TD> +</TR> +</TABLE> + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> + +<A NAME="constructor_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Constructor Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD><CODE><B><A HREF="../eclipseLib/SourceOne.html#SourceOne()">SourceOne</A></B>()</CODE> + +<BR> + </TD> +</TR> +</TABLE> + +<!-- ========== METHOD SUMMARY =========== --> + +<A NAME="method_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Method Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../eclipseLib/SourceOne.html#elibMethod()">elibMethod</A></B>()</CODE> + +<BR> + </TD> +</TR> +</TABLE> + <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> +<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> +</TR> +</TABLE> + +<P> + +<!-- ============ FIELD DETAIL =========== --> + +<A NAME="field_detail"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> +<B>Field Detail</B></FONT></TH> +</TR> +</TABLE> + +<A NAME="ELIB_CONST"><!-- --></A><H3> +ELIB_CONST</H3> +<PRE> +public static final java.lang.String <B>ELIB_CONST</B></PRE> +<DL> +<DL> +<DT><B>See Also:</B><DD><A HREF="../constant-values.html#eclipseLib.SourceOne.ELIB_CONST">Constant Field Values</A></DL> +</DL> + +<!-- ========= CONSTRUCTOR DETAIL ======== --> + +<A NAME="constructor_detail"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> +<B>Constructor Detail</B></FONT></TH> +</TR> +</TABLE> + +<A NAME="SourceOne()"><!-- --></A><H3> +SourceOne</H3> +<PRE> +public <B>SourceOne</B>()</PRE> +<DL> +</DL> + +<!-- ============ METHOD DETAIL ========== --> + +<A NAME="method_detail"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> +<B>Method Detail</B></FONT></TH> +</TR> +</TABLE> + +<A NAME="elibMethod()"><!-- --></A><H3> +elibMethod</H3> +<PRE> +public void <B>elibMethod</B>()</PRE> +<DL> +<DD><DL> +</DL> +</DD> +</DL> +<!-- ========= END OF CLASS DATA ========= --> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../eclipseLib/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SourceOne.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV CLASS + NEXT CLASS</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../index.html?eclipseLib/SourceOne.html" target="_top"><B>FRAMES</B></A> + <A HREF="SourceOne.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/index.html b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/index.html new file mode 100644 index 000000000000..ff86a5330e0b --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/index.html @@ -0,0 +1,36 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc on Thu Feb 19 20:58:54 MSK 2009--> +<TITLE> +Generated Documentation (Untitled) +</TITLE> +<SCRIPT type="text/javascript"> + targetPage = "" + window.location.search; + if (targetPage != "" && targetPage != "undefined") + targetPage = targetPage.substring(1); + if (targetPage.indexOf(":") != -1) + targetPage = "undefined"; + function loadFrames() { + if (targetPage != "" && targetPage != "undefined") + top.classFrame.location = top.targetPage; + } +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> +</HEAD> +<FRAMESET cols="20%,80%" title="" onLoad="top.loadFrames()"> +<FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)"> +<FRAME src="eclipseLib/package-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes"> +<NOFRAMES> +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="eclipseLib/package-summary.html">Non-frame version.</A> +</NOFRAMES> +</FRAMESET> +</HTML> diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/overview-tree.html b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/overview-tree.html new file mode 100644 index 000000000000..d8361c936af0 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/overview-tree.html @@ -0,0 +1,150 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0_10-beta) on Thu Feb 19 20:58:54 MSK 2009 --> +<TITLE> +Class Hierarchy +</TITLE> + +<META NAME="date" CONTENT="2009-02-19"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Class Hierarchy"; + } +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> +<HR> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="eclipseLib/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A> + <A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<CENTER> +<H2> +Hierarchy For All Packages</H2> +</CENTER> +<DL> +<DT><B>Package Hierarchies:</B><DD><A HREF="eclipseLib/package-tree.html">eclipseLib</A></DL> +<HR> +<H2> +Class Hierarchy +</H2> +<UL> +<LI TYPE="circle">java.lang.Object<UL> +<LI TYPE="circle">eclipseLib.<A HREF="eclipseLib/SourceOne.html" title="class in eclipseLib"><B>SourceOne</B></A></UL> +</UL> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="eclipseLib/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A> + <A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/package-list b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/package-list new file mode 100644 index 000000000000..3fab146dde28 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/package-list @@ -0,0 +1 @@ +eclipseLib diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/stylesheet.css b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/stylesheet.css new file mode 100644 index 000000000000..6ea9e5161615 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/doc/api/stylesheet.css @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF; color:#000000 } + +/* Headings */ +h1 { font-size: 145% } + +/* Table colors */ +.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ +.TableRowColor { background: #FFFFFF; color:#000000 } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} + diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/lib-1/eclipseLib/SourceOne.class b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/lib-1/eclipseLib/SourceOne.class Binary files differnew file mode 100644 index 000000000000..27d198a1fec0 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/lib-1/eclipseLib/SourceOne.class diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/src/eclipseLib/SourceOne.java b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/src/eclipseLib/SourceOne.java new file mode 100644 index 000000000000..4fe80727fd45 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-1/copy-every/src/eclipseLib/SourceOne.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package eclipseLib; + +/** + * Created in IntelliJ IDEA. + * By: Alexander.Chernikov + * When: 19.02.2009, 20:55:48 + * Русский текст. + */ +public class SourceOne { + public static final String ELIB_CONST = "value 1"; + + public void elibMethod() { + } +} diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/apidoc.zip b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/apidoc.zip Binary files differnew file mode 100644 index 000000000000..4676ac65d256 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/apidoc.zip diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/lib-4.jar b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/lib-4.jar Binary files differnew file mode 100644 index 000000000000..69d35ecffe38 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/lib-4.jar diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/src.zip b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/src.zip Binary files differnew file mode 100644 index 000000000000..9c278f149bbc --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/lib-4/jar-every/src.zip diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/src/pkg/Resident.java b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/src/pkg/Resident.java new file mode 100644 index 000000000000..6588d13dfdd4 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/all-props/src/pkg/Resident.java @@ -0,0 +1,48 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package pkg; + +import eclipseLib.SourceOne; +import eclipseLib.SourceTwo; +import eclipseLib.SourceThree; +import eclipseLib.SourceFour; +import eclipseLib.SourceFive; +import eclipseLib.SourceSix; +import eclipseLib.SourceSeven; +import eclipseLib.SourceEight; +import eclipseLib.SourceNine; +import eclipseLib.SourceAlpha; + +/** + * Created in IntelliJ IDEA. + * By: Alexander.Chernikov + * When: 03.03.2009, 20:21:57 + * Русский текст. + */ +public class Resident { + public static void context() { + SourceOne one = new SourceOne(); + SourceTwo two = new SourceTwo(); + SourceThree three = new SourceThree(); + SourceFour four = new SourceFour(); + SourceFive five = new SourceFive(); + SourceSix six = new SourceSix(); + SourceSeven seven = new SourceSeven(); + SourceEight eight = new SourceEight(); + SourceNine nine = new SourceNine(); + SourceAlpha alpha = new SourceAlpha(); + } +} diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/.project b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/.project new file mode 100644 index 000000000000..fa532615eed3 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/.project @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + </buildSpec> + <natures> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/copy-every/lib-2/eclipseLib/SourceTwo.class b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/copy-every/lib-2/eclipseLib/SourceTwo.class Binary files differnew file mode 100644 index 000000000000..a889f5f9e705 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/copy-every/lib-2/eclipseLib/SourceTwo.class diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/copy-every/src/eclipseLib/SourceTwo.java b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/copy-every/src/eclipseLib/SourceTwo.java new file mode 100644 index 000000000000..c2e367dd9532 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/copy-every/src/eclipseLib/SourceTwo.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package eclipseLib; + +/** + * Created in IntelliJ IDEA. + * By: Alexander.Chernikov + * When: 19.02.2009, 20:55:48 + * Русский текст. + */ +public class SourceTwo { + public static final String ELIB_CONST = "value 2"; + + public void elibMethod() { + } +} diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/jar-all-2.zip b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/jar-all-2.zip Binary files differnew file mode 100644 index 000000000000..56635526133d --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-2/jar-all-2.zip diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-all-5.zip b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-all-5.zip Binary files differnew file mode 100644 index 000000000000..1c4f645ac0c7 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-all-5.zip diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-every/lib-5.jar b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-every/lib-5.jar Binary files differnew file mode 100644 index 000000000000..0e0dc04dfbaa --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-every/lib-5.jar diff --git a/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-every/src.zip b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-every/src.zip Binary files differnew file mode 100644 index 000000000000..beb499cbcda5 --- /dev/null +++ b/plugins/eclipse/testData/round/allProps/eclipse-ws-3.4.1-a/ws-internals/lib-5/jar-every/src.zip diff --git a/plugins/eclipse/testData/round/emptySrc/test/.classpath b/plugins/eclipse/testData/round/emptySrc/test/.classpath new file mode 100644 index 000000000000..c9ff39781cd0 --- /dev/null +++ b/plugins/eclipse/testData/round/emptySrc/test/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry including="**" kind="src" path="src" /> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" /> + <classpathentry kind="lib" path="test.jar" sourcepath=""/> + <classpathentry kind="output" path="bin" /> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/round/emptySrc/test/.project b/plugins/eclipse/testData/round/emptySrc/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/round/emptySrc/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/emptySrc/test/test.jar b/plugins/eclipse/testData/round/emptySrc/test/test.jar new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/round/emptySrc/test/test.jar diff --git a/plugins/eclipse/testData/round/exportedLibs/test/.classpath b/plugins/eclipse/testData/round/exportedLibs/test/.classpath new file mode 100644 index 000000000000..358655f2eb96 --- /dev/null +++ b/plugins/eclipse/testData/round/exportedLibs/test/.classpath @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry exported="true" kind="lib" path="test.jar" sourcepath="testSrc.jar"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/test/testJavadoc.jar!/a"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/exportedLibs/test/.project b/plugins/eclipse/testData/round/exportedLibs/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/round/exportedLibs/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/exportedLibs/test/test.jar b/plugins/eclipse/testData/round/exportedLibs/test/test.jar new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/round/exportedLibs/test/test.jar diff --git a/plugins/eclipse/testData/round/exportedLibs/test/testJavadoc.jar b/plugins/eclipse/testData/round/exportedLibs/test/testJavadoc.jar Binary files differnew file mode 100644 index 000000000000..37226937943d --- /dev/null +++ b/plugins/eclipse/testData/round/exportedLibs/test/testJavadoc.jar diff --git a/plugins/eclipse/testData/round/exportedLibs/test/testSrc.jar b/plugins/eclipse/testData/round/exportedLibs/test/testSrc.jar new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/round/exportedLibs/test/testSrc.jar diff --git a/plugins/eclipse/testData/round/home/home/.classpath b/plugins/eclipse/testData/round/home/home/.classpath new file mode 100644 index 000000000000..fb5011632c0a --- /dev/null +++ b/plugins/eclipse/testData/round/home/home/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/home/home/.project b/plugins/eclipse/testData/round/home/home/.project new file mode 100644 index 000000000000..425b6a35e2e7 --- /dev/null +++ b/plugins/eclipse/testData/round/home/home/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>home</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/home/home/lib-2/jar-every/lib-2.jar b/plugins/eclipse/testData/round/home/home/lib-2/jar-every/lib-2.jar Binary files differnew file mode 100644 index 000000000000..ac6b1c9e808c --- /dev/null +++ b/plugins/eclipse/testData/round/home/home/lib-2/jar-every/lib-2.jar diff --git a/plugins/eclipse/testData/round/home/test/.classpath b/plugins/eclipse/testData/round/home/test/.classpath new file mode 100644 index 000000000000..3e8d8501dda3 --- /dev/null +++ b/plugins/eclipse/testData/round/home/test/.classpath @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="lib" path="/home/lib-2/jar-every/lib-2.jar"/> + <classpathentry kind="lib" path="/ws-internals/lib-5/jar-every/lib-5.jar"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/home/test/.project b/plugins/eclipse/testData/round/home/test/.project new file mode 100644 index 000000000000..850c43d7bbc6 --- /dev/null +++ b/plugins/eclipse/testData/round/home/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>needit</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/home/ws-internals/.project b/plugins/eclipse/testData/round/home/ws-internals/.project new file mode 100644 index 000000000000..fa532615eed3 --- /dev/null +++ b/plugins/eclipse/testData/round/home/ws-internals/.project @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + </buildSpec> + <natures> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/home/ws-internals/lib-5/jar-every/lib-5.jar b/plugins/eclipse/testData/round/home/ws-internals/lib-5/jar-every/lib-5.jar Binary files differnew file mode 100644 index 000000000000..0e0dc04dfbaa --- /dev/null +++ b/plugins/eclipse/testData/round/home/ws-internals/lib-5/jar-every/lib-5.jar diff --git a/plugins/eclipse/testData/round/httpJavadoc/test/.classpath b/plugins/eclipse/testData/round/httpJavadoc/test/.classpath new file mode 100644 index 000000000000..71bd534c424d --- /dev/null +++ b/plugins/eclipse/testData/round/httpJavadoc/test/.classpath @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="lib" path="test.jar" sourcepath="testSrc.jar"> + <attributes> + <attribute name="javadoc_location" value="http://www.fake-site.org"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/httpJavadoc/test/.project b/plugins/eclipse/testData/round/httpJavadoc/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/round/httpJavadoc/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/httpJavadoc/test/test.jar b/plugins/eclipse/testData/round/httpJavadoc/test/test.jar new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/round/httpJavadoc/test/test.jar diff --git a/plugins/eclipse/testData/round/httpJavadoc/test/testJavadoc.jar b/plugins/eclipse/testData/round/httpJavadoc/test/testJavadoc.jar Binary files differnew file mode 100644 index 000000000000..37226937943d --- /dev/null +++ b/plugins/eclipse/testData/round/httpJavadoc/test/testJavadoc.jar diff --git a/plugins/eclipse/testData/round/httpJavadoc/test/testSrc.jar b/plugins/eclipse/testData/round/httpJavadoc/test/testSrc.jar new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/round/httpJavadoc/test/testSrc.jar diff --git a/plugins/eclipse/testData/round/junit/test/.classpath b/plugins/eclipse/testData/round/junit/test/.classpath new file mode 100644 index 000000000000..f10d234a8bdc --- /dev/null +++ b/plugins/eclipse/testData/round/junit/test/.classpath @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/junit/test/.project b/plugins/eclipse/testData/round/junit/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/round/junit/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/linkedSrc/test/.classpath b/plugins/eclipse/testData/round/linkedSrc/test/.classpath new file mode 100644 index 000000000000..8e4a29fc449c --- /dev/null +++ b/plugins/eclipse/testData/round/linkedSrc/test/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="Ext"/> + <classpathentry kind="src" path=""/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path=""/> +</classpath> diff --git a/plugins/eclipse/testData/round/linkedSrc/test/.project b/plugins/eclipse/testData/round/linkedSrc/test/.project new file mode 100644 index 000000000000..584dc0054a22 --- /dev/null +++ b/plugins/eclipse/testData/round/linkedSrc/test/.project @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>root</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> + <linkedResources> + <link> + <name>Ext</name> + <type>2</type> + <locationURI>Ext</locationURI> + </link> + </linkedResources> + +</projectDescription> diff --git a/plugins/eclipse/testData/round/multiModuleDependencies/multi/m1/.classpath b/plugins/eclipse/testData/round/multiModuleDependencies/multi/m1/.classpath new file mode 100644 index 000000000000..19a88b31a0fa --- /dev/null +++ b/plugins/eclipse/testData/round/multiModuleDependencies/multi/m1/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="lib" path="/ws-internals/m22/lib/commons-io-1.3.2.jar" sourcepath="/ws-internals/m22/lib/commons-io-1.3.2-sources.jar"/> + <classpathentry kind="output" path="out"/> +</classpath> diff --git a/plugins/eclipse/testData/round/multiModuleDependencies/multi/m1/.project b/plugins/eclipse/testData/round/multiModuleDependencies/multi/m1/.project new file mode 100644 index 000000000000..5d6e9f8a1ad8 --- /dev/null +++ b/plugins/eclipse/testData/round/multiModuleDependencies/multi/m1/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>m1</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/multiModuleDependencies/multi/ws-internals/.classpath b/plugins/eclipse/testData/round/multiModuleDependencies/multi/ws-internals/.classpath new file mode 100644 index 000000000000..b5455e0a3fc9 --- /dev/null +++ b/plugins/eclipse/testData/round/multiModuleDependencies/multi/ws-internals/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="out"/> +</classpath> diff --git a/plugins/eclipse/testData/round/multiModuleDependencies/multi/ws-internals/.project b/plugins/eclipse/testData/round/multiModuleDependencies/multi/ws-internals/.project new file mode 100644 index 000000000000..b5185d9e9cdc --- /dev/null +++ b/plugins/eclipse/testData/round/multiModuleDependencies/multi/ws-internals/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/multiModuleDependencies/multi/ws-internals/m22/lib/commons-io-1.3.2-sources.jar b/plugins/eclipse/testData/round/multiModuleDependencies/multi/ws-internals/m22/lib/commons-io-1.3.2-sources.jar Binary files differnew file mode 100644 index 000000000000..b383cf381921 --- /dev/null +++ b/plugins/eclipse/testData/round/multiModuleDependencies/multi/ws-internals/m22/lib/commons-io-1.3.2-sources.jar diff --git a/plugins/eclipse/testData/round/multiModuleDependencies/multi/ws-internals/m22/lib/commons-io-1.3.2.jar b/plugins/eclipse/testData/round/multiModuleDependencies/multi/ws-internals/m22/lib/commons-io-1.3.2.jar Binary files differnew file mode 100644 index 000000000000..865c9e41cee5 --- /dev/null +++ b/plugins/eclipse/testData/round/multiModuleDependencies/multi/ws-internals/m22/lib/commons-io-1.3.2.jar diff --git a/plugins/eclipse/testData/round/multipleSourceFolders/test/.classpath b/plugins/eclipse/testData/round/multipleSourceFolders/test/.classpath new file mode 100644 index 000000000000..a2f832e658eb --- /dev/null +++ b/plugins/eclipse/testData/round/multipleSourceFolders/test/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry including="**" kind="src" output="out" path="src"/> + <classpathentry including="java/util/" kind="src" output="out2" path="src2"/> + <classpathentry kind="output" path="myout"/> +</classpath> diff --git a/plugins/eclipse/testData/round/multipleSourceFolders/test/.project b/plugins/eclipse/testData/round/multipleSourceFolders/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/round/multipleSourceFolders/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/noJava/test/.project b/plugins/eclipse/testData/round/noJava/test/.project new file mode 100644 index 000000000000..08d3639ec7c1 --- /dev/null +++ b/plugins/eclipse/testData/round/noJava/test/.project @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>non-java-2</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + </buildSpec> + <natures> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/noSource/test/.classpath b/plugins/eclipse/testData/round/noSource/test/.classpath new file mode 100644 index 000000000000..ac37fb2e4bca --- /dev/null +++ b/plugins/eclipse/testData/round/noSource/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/noSource/test/.project b/plugins/eclipse/testData/round/noSource/test/.project new file mode 100644 index 000000000000..d528d311c830 --- /dev/null +++ b/plugins/eclipse/testData/round/noSource/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>no-source</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/pathVariables/test/.classpath b/plugins/eclipse/testData/round/pathVariables/test/.classpath new file mode 100644 index 000000000000..115c0d3b2e9a --- /dev/null +++ b/plugins/eclipse/testData/round/pathVariables/test/.classpath @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="var" path="variable/test.jar" sourcepath="/variable/testSrc.jar"/> + <classpathentry kind="var" path="ECLIPSE_HOME/startup.jar"/> + <classpathentry kind="var" path="LOG4J_JARS"/> + <classpathentry kind="var" path="STORE_B_PLAIN/log4j-1.2.14.jar" sourcepath="/STORE_B_PLAIN/java"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/pathVariables/test/.project b/plugins/eclipse/testData/round/pathVariables/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/round/pathVariables/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/plugin/test/.classpath b/plugins/eclipse/testData/round/plugin/test/.classpath new file mode 100644 index 000000000000..751c8f2e504c --- /dev/null +++ b/plugins/eclipse/testData/round/plugin/test/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/plugin/test/.project b/plugins/eclipse/testData/round/plugin/test/.project new file mode 100644 index 000000000000..46821d60b7c0 --- /dev/null +++ b/plugins/eclipse/testData/round/plugin/test/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>plug-me-in-eclipse-3.4</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/plugin/test/.settings/org.eclipse.jdt.core.prefs b/plugins/eclipse/testData/round/plugin/test/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000000..244340ac4e00 --- /dev/null +++ b/plugins/eclipse/testData/round/plugin/test/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +#Wed Mar 11 19:57:55 MSK 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/plugins/eclipse/testData/round/plugin/test/META-INF/MANIFEST.MF b/plugins/eclipse/testData/round/plugin/test/META-INF/MANIFEST.MF new file mode 100644 index 000000000000..72b752ce8881 --- /dev/null +++ b/plugins/eclipse/testData/round/plugin/test/META-INF/MANIFEST.MF @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: 4 Plug-in +Bundle-SymbolicName: plug_me_in_eclipse_3_4; singleton:=true +Bundle-Version: 1.0.0 +Bundle-Activator: plug_me_in_eclipse_3_4.Activator +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.ui +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/plugins/eclipse/testData/round/plugin/test/build.properties b/plugins/eclipse/testData/round/plugin/test/build.properties new file mode 100644 index 000000000000..0d3d3a745d49 --- /dev/null +++ b/plugins/eclipse/testData/round/plugin/test/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + icons/ diff --git a/plugins/eclipse/testData/round/plugin/test/icons/sample.gif b/plugins/eclipse/testData/round/plugin/test/icons/sample.gif Binary files differnew file mode 100644 index 000000000000..34fb3c9d8cb7 --- /dev/null +++ b/plugins/eclipse/testData/round/plugin/test/icons/sample.gif diff --git a/plugins/eclipse/testData/round/plugin/test/plugin.xml b/plugins/eclipse/testData/round/plugin/test/plugin.xml new file mode 100644 index 000000000000..b7080d261b42 --- /dev/null +++ b/plugins/eclipse/testData/round/plugin/test/plugin.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.2"?> +<plugin> + + <extension + point="org.eclipse.ui.actionSets"> + <actionSet + label="Sample Action Set" + visible="true" + id="plug_me_in_eclipse_3_4.actionSet"> + <menu + label="Sample &Menu" + id="sampleMenu"> + <separator + name="sampleGroup"> + </separator> + </menu> + <action + label="&Sample Action" + icon="icons/sample.gif" + class="plug_me_in_eclipse_3_4.actions.SampleAction" + tooltip="Hello, Eclipse world" + menubarPath="sampleMenu/sampleGroup" + toolbarPath="sampleGroup" + id="plug_me_in_eclipse_3_4.actions.SampleAction"> + </action> + </actionSet> + </extension> + +</plugin> diff --git a/plugins/eclipse/testData/round/plugin/test/src/plug_me_in_eclipse_3_4/Activator.java b/plugins/eclipse/testData/round/plugin/test/src/plug_me_in_eclipse_3_4/Activator.java new file mode 100644 index 000000000000..c8daf84edf82 --- /dev/null +++ b/plugins/eclipse/testData/round/plugin/test/src/plug_me_in_eclipse_3_4/Activator.java @@ -0,0 +1,76 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package plug_me_in_eclipse_3_4; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "plug_me_in_eclipse_3_4"; + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + /** + * Returns an image descriptor for the image file at the given + * plug-in relative path + * + * @param path the path + * @return the image descriptor + */ + public static ImageDescriptor getImageDescriptor(String path) { + return imageDescriptorFromPlugin(PLUGIN_ID, path); + } +} diff --git a/plugins/eclipse/testData/round/plugin/test/src/plug_me_in_eclipse_3_4/actions/SampleAction.java b/plugins/eclipse/testData/round/plugin/test/src/plug_me_in_eclipse_3_4/actions/SampleAction.java new file mode 100644 index 000000000000..d1e064b9c02f --- /dev/null +++ b/plugins/eclipse/testData/round/plugin/test/src/plug_me_in_eclipse_3_4/actions/SampleAction.java @@ -0,0 +1,79 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package plug_me_in_eclipse_3_4.actions; + +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.IWorkbenchWindowActionDelegate; +import org.eclipse.jface.dialogs.MessageDialog; + +/** + * Our sample action implements workbench action delegate. + * The action proxy will be created by the workbench and + * shown in the UI. When the user tries to use the action, + * this delegate will be created and execution will be + * delegated to it. + * @see IWorkbenchWindowActionDelegate + */ +public class SampleAction implements IWorkbenchWindowActionDelegate { + private IWorkbenchWindow window; + /** + * The constructor. + */ + public SampleAction() { + } + + /** + * The action has been activated. The argument of the + * method represents the 'real' action sitting + * in the workbench UI. + * @see IWorkbenchWindowActionDelegate#run + */ + public void run(IAction action) { + MessageDialog.openInformation( + window.getShell(), + "4 Plug-in", + "Hello, Eclipse world"); + } + + /** + * Selection in the workbench has been changed. We + * can change the state of the 'real' action here + * if we want, but this can only happen after + * the delegate has been created. + * @see IWorkbenchWindowActionDelegate#selectionChanged + */ + public void selectionChanged(IAction action, ISelection selection) { + } + + /** + * We can use this method to dispose of any system + * resources we previously allocated. + * @see IWorkbenchWindowActionDelegate#dispose + */ + public void dispose() { + } + + /** + * We will cache window object in order to + * be able to provide parent shell for the message dialog. + * @see IWorkbenchWindowActionDelegate#init + */ + public void init(IWorkbenchWindow window) { + this.window = window; + } +}
\ No newline at end of file diff --git a/plugins/eclipse/testData/round/relativePaths/relPaths/scnd/.classpath b/plugins/eclipse/testData/round/relativePaths/relPaths/scnd/.classpath new file mode 100644 index 000000000000..62d6323aefcb --- /dev/null +++ b/plugins/eclipse/testData/round/relativePaths/relPaths/scnd/.classpath @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path=""/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry combineaccessrules="false" kind="src" path="/frst"/> + <classpathentry kind="lib" path="/ws-internals/lib/jar-all-4.zip" sourcepath="jar-all-4-src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/scnd/jar-all-4-javadoc.zip!/doc/api"/> + </attributes> + </classpathentry> + <classpathentry kind="lib" path="jar-all-4.zip" sourcepath="/ws-internals/lib/src/jar-all-4-src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/ws-internals/lib/src/jar-all-4-javadoc.zip!/doc/api"/> + </attributes> + </classpathentry> + <classpathentry kind="lib" path="unknown.zip" sourcepath="/ws-internals/lib/src/unknown-src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/ws-internals/lib/src/unknown-javadoc.zip!/doc/api"/> + </attributes> + </classpathentry> + <classpathentry kind="lib" path="/ws-internals/lib/unknown.zip" sourcepath="unknown-src.zip"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/unimported_module/src/lib/src/jar-all-4-javadoc.zip!/doc/api"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path=""/> +</classpath> diff --git a/plugins/eclipse/testData/round/relativePaths/relPaths/scnd/.project b/plugins/eclipse/testData/round/relativePaths/relPaths/scnd/.project new file mode 100644 index 000000000000..00d5e53d3d85 --- /dev/null +++ b/plugins/eclipse/testData/round/relativePaths/relPaths/scnd/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>scnd</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/relativePaths/relPaths/scnd/jar-all-4-javadoc.zip b/plugins/eclipse/testData/round/relativePaths/relPaths/scnd/jar-all-4-javadoc.zip Binary files differnew file mode 100644 index 000000000000..f54817bea7cc --- /dev/null +++ b/plugins/eclipse/testData/round/relativePaths/relPaths/scnd/jar-all-4-javadoc.zip diff --git a/plugins/eclipse/testData/round/relativePaths/relPaths/scnd/jar-all-4-src.zip b/plugins/eclipse/testData/round/relativePaths/relPaths/scnd/jar-all-4-src.zip Binary files differnew file mode 100644 index 000000000000..f54817bea7cc --- /dev/null +++ b/plugins/eclipse/testData/round/relativePaths/relPaths/scnd/jar-all-4-src.zip diff --git a/plugins/eclipse/testData/round/relativePaths/relPaths/scnd/jar-all-4.zip b/plugins/eclipse/testData/round/relativePaths/relPaths/scnd/jar-all-4.zip Binary files differnew file mode 100644 index 000000000000..f54817bea7cc --- /dev/null +++ b/plugins/eclipse/testData/round/relativePaths/relPaths/scnd/jar-all-4.zip diff --git a/plugins/eclipse/testData/round/relativePaths/relPaths/ws-internals/.classpath b/plugins/eclipse/testData/round/relativePaths/relPaths/ws-internals/.classpath new file mode 100644 index 000000000000..ac37fb2e4bca --- /dev/null +++ b/plugins/eclipse/testData/round/relativePaths/relPaths/ws-internals/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/relativePaths/relPaths/ws-internals/.project b/plugins/eclipse/testData/round/relativePaths/relPaths/ws-internals/.project new file mode 100644 index 000000000000..4c148da5c1a6 --- /dev/null +++ b/plugins/eclipse/testData/round/relativePaths/relPaths/ws-internals/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>frst</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/relativePaths/relPaths/ws-internals/lib/jar-all-4.zip b/plugins/eclipse/testData/round/relativePaths/relPaths/ws-internals/lib/jar-all-4.zip Binary files differnew file mode 100644 index 000000000000..f54817bea7cc --- /dev/null +++ b/plugins/eclipse/testData/round/relativePaths/relPaths/ws-internals/lib/jar-all-4.zip diff --git a/plugins/eclipse/testData/round/relativePaths/relPaths/ws-internals/lib/src/jar-all-4-javadoc.zip b/plugins/eclipse/testData/round/relativePaths/relPaths/ws-internals/lib/src/jar-all-4-javadoc.zip Binary files differnew file mode 100644 index 000000000000..f54817bea7cc --- /dev/null +++ b/plugins/eclipse/testData/round/relativePaths/relPaths/ws-internals/lib/src/jar-all-4-javadoc.zip diff --git a/plugins/eclipse/testData/round/relativePaths/relPaths/ws-internals/lib/src/jar-all-4-src.zip b/plugins/eclipse/testData/round/relativePaths/relPaths/ws-internals/lib/src/jar-all-4-src.zip Binary files differnew file mode 100644 index 000000000000..f54817bea7cc --- /dev/null +++ b/plugins/eclipse/testData/round/relativePaths/relPaths/ws-internals/lib/src/jar-all-4-src.zip diff --git a/plugins/eclipse/testData/round/resolvedVariables/srcvariableidea/empty.txt b/plugins/eclipse/testData/round/resolvedVariables/srcvariableidea/empty.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/round/resolvedVariables/srcvariableidea/empty.txt diff --git a/plugins/eclipse/testData/round/resolvedVariables/test/.classpath b/plugins/eclipse/testData/round/resolvedVariables/test/.classpath new file mode 100644 index 000000000000..3ac4e2655f49 --- /dev/null +++ b/plugins/eclipse/testData/round/resolvedVariables/test/.classpath @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path=""/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="var" path="variable/empty.txt" sourcepath="/srcvariable/empty.txt"/> + <classpathentry kind="var" path="variable" sourcepath="/srcvariable"/> + <classpathentry kind="output" path=""/> +</classpath> diff --git a/plugins/eclipse/testData/round/resolvedVariables/test/.project b/plugins/eclipse/testData/round/resolvedVariables/test/.project new file mode 100644 index 000000000000..3c7030a86519 --- /dev/null +++ b/plugins/eclipse/testData/round/resolvedVariables/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ws-internals</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/resolvedVariables/variableidea/empty.txt b/plugins/eclipse/testData/round/resolvedVariables/variableidea/empty.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/round/resolvedVariables/variableidea/empty.txt diff --git a/plugins/eclipse/testData/round/root/test/.classpath b/plugins/eclipse/testData/round/root/test/.classpath new file mode 100644 index 000000000000..233be1d2c496 --- /dev/null +++ b/plugins/eclipse/testData/round/root/test/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path=""/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path=""/> +</classpath> diff --git a/plugins/eclipse/testData/round/root/test/.project b/plugins/eclipse/testData/round/root/test/.project new file mode 100644 index 000000000000..f5a6693fe6c2 --- /dev/null +++ b/plugins/eclipse/testData/round/root/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>root</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/sourceFolderOutput/test/.classpath b/plugins/eclipse/testData/round/sourceFolderOutput/test/.classpath new file mode 100644 index 000000000000..5d1168c8de52 --- /dev/null +++ b/plugins/eclipse/testData/round/sourceFolderOutput/test/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry including="**" kind="src" output="out" path="src"/> + <classpathentry kind="output" path="myout"/> +</classpath>
\ No newline at end of file diff --git a/plugins/eclipse/testData/round/sourceFolderOutput/test/.project b/plugins/eclipse/testData/round/sourceFolderOutput/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/round/sourceFolderOutput/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/sourcesAfterAll/test/.classpath b/plugins/eclipse/testData/round/sourcesAfterAll/test/.classpath new file mode 100644 index 000000000000..3f3893aff962 --- /dev/null +++ b/plugins/eclipse/testData/round/sourcesAfterAll/test/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="src" path=""/> + <classpathentry kind="output" path=""/> +</classpath> diff --git a/plugins/eclipse/testData/round/sourcesAfterAll/test/.project b/plugins/eclipse/testData/round/sourcesAfterAll/test/.project new file mode 100644 index 000000000000..f5a6693fe6c2 --- /dev/null +++ b/plugins/eclipse/testData/round/sourcesAfterAll/test/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>root</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/srcBinJRE/test/.classpath b/plugins/eclipse/testData/round/srcBinJRE/test/.classpath new file mode 100644 index 000000000000..fb5011632c0a --- /dev/null +++ b/plugins/eclipse/testData/round/srcBinJRE/test/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/srcBinJRE/test/.project b/plugins/eclipse/testData/round/srcBinJRE/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/round/srcBinJRE/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/srcBinJREProject/test/.classpath b/plugins/eclipse/testData/round/srcBinJREProject/test/.classpath new file mode 100644 index 000000000000..3ebee4528ecf --- /dev/null +++ b/plugins/eclipse/testData/round/srcBinJREProject/test/.classpath @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry combineaccessrules="false" kind="src" path="/test1"> + <accessrules> + <accessrule kind="nonaccessible" pattern="*"/> + </accessrules> + </classpathentry> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/srcBinJREProject/test/.project b/plugins/eclipse/testData/round/srcBinJREProject/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/round/srcBinJREProject/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/srcBinJRESpecific/test/.classpath b/plugins/eclipse/testData/round/srcBinJRESpecific/test/.classpath new file mode 100644 index 000000000000..87279173393d --- /dev/null +++ b/plugins/eclipse/testData/round/srcBinJRESpecific/test/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/srcBinJRESpecific/test/.project b/plugins/eclipse/testData/round/srcBinJRESpecific/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/round/srcBinJRESpecific/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/srcRootsOrder/test/.classpath b/plugins/eclipse/testData/round/srcRootsOrder/test/.classpath new file mode 100644 index 000000000000..2b433c0c057b --- /dev/null +++ b/plugins/eclipse/testData/round/srcRootsOrder/test/.classpath @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="lib" path="prod-resources"/> + <classpathentry kind="src" path="test"/> + <classpathentry kind="lib" path="test-resources"/> + <classpathentry kind="src" path="testng"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/srcRootsOrder/test/.project b/plugins/eclipse/testData/round/srcRootsOrder/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/round/srcRootsOrder/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/unknownCon/test/.classpath b/plugins/eclipse/testData/round/unknownCon/test/.classpath new file mode 100644 index 000000000000..609aa00ebc43 --- /dev/null +++ b/plugins/eclipse/testData/round/unknownCon/test/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="gen"/> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/unknownCon/test/.project b/plugins/eclipse/testData/round/unknownCon/test/.project new file mode 100644 index 000000000000..b908668cf4cd --- /dev/null +++ b/plugins/eclipse/testData/round/unknownCon/test/.project @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>MarketEnabler</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.ApkBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>com.android.ide.eclipse.adt.AndroidNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/workspaceOnly/test/.classpath b/plugins/eclipse/testData/round/workspaceOnly/test/.classpath new file mode 100644 index 000000000000..6b831f16e6ed --- /dev/null +++ b/plugins/eclipse/testData/round/workspaceOnly/test/.classpath @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="lib" path="test.jar" sourcepath="testSrc.jar"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/test/testJavadoc.jar!/a"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/eclipse/testData/round/workspaceOnly/test/.project b/plugins/eclipse/testData/round/workspaceOnly/test/.project new file mode 100644 index 000000000000..4766dbaa2c60 --- /dev/null +++ b/plugins/eclipse/testData/round/workspaceOnly/test/.project @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>test</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/eclipse/testData/round/workspaceOnly/test/test.jar b/plugins/eclipse/testData/round/workspaceOnly/test/test.jar new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/round/workspaceOnly/test/test.jar diff --git a/plugins/eclipse/testData/round/workspaceOnly/test/testJavadoc.jar b/plugins/eclipse/testData/round/workspaceOnly/test/testJavadoc.jar Binary files differnew file mode 100644 index 000000000000..37226937943d --- /dev/null +++ b/plugins/eclipse/testData/round/workspaceOnly/test/testJavadoc.jar diff --git a/plugins/eclipse/testData/round/workspaceOnly/test/testSrc.jar b/plugins/eclipse/testData/round/workspaceOnly/test/testSrc.jar new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/plugins/eclipse/testData/round/workspaceOnly/test/testSrc.jar diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/Eclipse2ModulesTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/Eclipse2ModulesTest.java new file mode 100644 index 000000000000..7d566178418c --- /dev/null +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/Eclipse2ModulesTest.java @@ -0,0 +1,95 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 26-Mar-2010 + */ +package org.jetbrains.idea.eclipse; + +import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.application.PluginPathManager; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.util.Computable; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.vfs.LocalFileSystem; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.testFramework.IdeaTestCase; +import com.intellij.testFramework.PsiTestUtil; +import junit.framework.Assert; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.Nullable; + +import java.io.File; +import java.io.IOException; + +public abstract class Eclipse2ModulesTest extends IdeaTestCase { + @NonNls + protected static final String DEPEND_MODULE_NAME = "ws-internals"; + private String myDependantModulePath = "ws-internals"; + + protected abstract String getTestPath(); + + @Override + protected void setUpModule() { + super.setUpModule(); + final File testRoot = new File(PluginPathManager.getPluginHomePath("eclipse") + "/testData", getTestPath()); + assertTrue(testRoot.getAbsolutePath(), testRoot.isDirectory()); + + final File currentTestRoot = new File(testRoot, getTestName(true)); + assertTrue(currentTestRoot.getAbsolutePath(), currentTestRoot.isDirectory()); + + try { + final VirtualFile baseDir = getProject().getBaseDir(); + assert baseDir != null; + FileUtil.copyDir(currentTestRoot, new File(baseDir.getPath())); + } + catch (IOException e) { + LOG.error(e); + } + } + + @Override + protected Module createMainModule() throws IOException { + return createModule(DEPEND_MODULE_NAME); + } + + protected void doTest(final String workspaceRoot, final String projectRoot) throws Exception { + final VirtualFile file = + ApplicationManager.getApplication().runWriteAction( + new Computable<VirtualFile>() { + @Override + @Nullable + public VirtualFile compute() { + final VirtualFile baseDir = getProject().getBaseDir(); + assert baseDir != null; + return LocalFileSystem.getInstance() + .refreshAndFindFileByPath(baseDir.getPath() + "/" + workspaceRoot + "/" + myDependantModulePath); + } + } + ); + if (file != null) { + PsiTestUtil.addContentRoot(getModule(), file); + } + else { + Assert.assertTrue("File not found", false); + } + } + + public void setDependantModulePath(String dependantModulePath) { + myDependantModulePath = dependantModulePath; + } +}
\ No newline at end of file diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseClasspath2ModulesTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseClasspath2ModulesTest.java new file mode 100644 index 000000000000..785380a2efbe --- /dev/null +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseClasspath2ModulesTest.java @@ -0,0 +1,50 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 28-Nov-2008 + */ +package org.jetbrains.idea.eclipse; + +public class EclipseClasspath2ModulesTest extends Eclipse2ModulesTest { + @Override + protected String getTestPath() { + return "round"; + } + + public void testAllProps() throws Exception { + doTest("eclipse-ws-3.4.1-a", "all-props"); + } + + public void testMultiModuleDependencies() throws Exception { + doTest("multi", "m1"); + } + + public void testRelativePaths() throws Exception { + doTest("relPaths", "scnd"); + } + + public void testIDEA53188() throws Exception { + doTest("multi", "main"); + } + + @Override + protected void doTest(final String workspaceRoot, final String projectRoot) throws Exception { + super.doTest(workspaceRoot, projectRoot); + EclipseClasspathTest.doTest("/" + workspaceRoot + "/" + projectRoot, getProject()); + } +}
\ No newline at end of file diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseClasspathTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseClasspathTest.java new file mode 100644 index 000000000000..9339d9e17120 --- /dev/null +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseClasspathTest.java @@ -0,0 +1,211 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 28-Nov-2008 + */ +package org.jetbrains.idea.eclipse; + +import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.application.PluginPathManager; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleManager; +import com.intellij.openapi.module.StdModuleTypes; +import com.intellij.openapi.options.ConfigurationException; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.ModifiableRootModel; +import com.intellij.openapi.roots.ModuleRootManager; +import com.intellij.openapi.roots.ModuleRootModel; +import com.intellij.openapi.util.Computable; +import com.intellij.openapi.util.JDOMUtil; +import com.intellij.openapi.util.SystemInfo; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.testFramework.IdeaTestCase; +import junit.framework.Assert; +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.JDOMException; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.idea.eclipse.config.EclipseClasspathStorageProvider; +import org.jetbrains.idea.eclipse.conversion.EclipseClasspathReader; +import org.jetbrains.idea.eclipse.conversion.EclipseClasspathWriter; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; + +public class EclipseClasspathTest extends IdeaTestCase { + @Override + protected void setUp() throws Exception { + super.setUp(); + final File testRoot = new File(PluginPathManager.getPluginHomePath("eclipse") + "/testData", "round"); + assertTrue(testRoot.getAbsolutePath(), testRoot.isDirectory()); + + final File currentTestRoot = new File(testRoot, getTestName(true)); + assertTrue(currentTestRoot.getAbsolutePath(), currentTestRoot.isDirectory()); + + FileUtil.copyDir(currentTestRoot, new File(getProject().getBaseDir().getPath())); + } + + private void doTest() throws Exception { + doTest("/test", getProject()); + } + + protected static void doTest(final String relativePath, final Project project) throws Exception { + final String path = project.getBaseDir().getPath() + relativePath; + checkModule(path, setUpModule(path, project)); + } + + static Module setUpModule(final String path, @NotNull final Project project) + throws IOException, JDOMException, ConversionException, ConfigurationException { + final File classpathFile = new File(path, EclipseXml.DOT_CLASSPATH_EXT); + String fileText = FileUtil.loadFile(classpathFile).replaceAll("\\$ROOT\\$", project.getBaseDir().getPath()); + if (!SystemInfo.isWindows) { + fileText = fileText.replaceAll(EclipseXml.FILE_PROTOCOL + "/", EclipseXml.FILE_PROTOCOL); + } + final Element classpathElement = JDOMUtil.loadDocument(fileText).getRootElement(); + final Module module = ApplicationManager.getApplication().runWriteAction(new Computable<Module>() { + @Override + public Module compute() { + return ModuleManager.getInstance(project) + .newModule(path + "/" + EclipseProjectFinder.findProjectName(path) + IdeaXml.IML_EXT, StdModuleTypes.JAVA.getId()); + } + }); + final ModifiableRootModel rootModel = ModuleRootManager.getInstance(module).getModifiableModel(); + final EclipseClasspathReader classpathReader = new EclipseClasspathReader(path, project, null); + classpathReader.init(rootModel); + classpathReader + .readClasspath(rootModel, new ArrayList<String>(), new ArrayList<String>(), new HashSet<String>(), new HashSet<String>(), null, + classpathElement); + new EclipseClasspathStorageProvider().assertCompatible(rootModel); + ApplicationManager.getApplication().runWriteAction(new Runnable() { + public void run() { + rootModel.commit(); + } + }); + return module; + } + + static void checkModule(String path, Module module) throws IOException, JDOMException, ConversionException { + final File classpathFile1 = new File(path, EclipseXml.DOT_CLASSPATH_EXT); + if (!classpathFile1.exists()) return; + String fileText1 = FileUtil.loadFile(classpathFile1).replaceAll("\\$ROOT\\$", module.getProject().getBaseDir().getPath()); + if (!SystemInfo.isWindows) { + fileText1 = fileText1.replaceAll(EclipseXml.FILE_PROTOCOL + "/", EclipseXml.FILE_PROTOCOL); + } + final Element classpathElement1 = JDOMUtil.loadDocument(fileText1).getRootElement(); + final ModuleRootModel model = ModuleRootManager.getInstance(module); + final Element resultClasspathElement = new Element(EclipseXml.CLASSPATH_TAG); + new EclipseClasspathWriter(model).writeClasspath(resultClasspathElement, classpathElement1); + + String resulted = new String(JDOMUtil.printDocument(new Document(resultClasspathElement), "\n")); + Assert.assertTrue(resulted.replaceAll(StringUtil.escapeToRegexp(module.getProject().getBaseDir().getPath()), "\\$ROOT\\$"), + JDOMUtil.areElementsEqual(classpathElement1, resultClasspathElement)); + } + + + public void testAbsolutePaths() throws Exception { + doTest("/parent/parent/test", getProject()); + } + + + public void testWorkspaceOnly() throws Exception { + doTest(); + } + + public void testExportedLibs() throws Exception { + doTest(); + } + + public void testPathVariables() throws Exception { + doTest(); + } + + public void testJunit() throws Exception { + doTest(); + } + + public void testSrcBinJRE() throws Exception { + doTest(); + } + + public void testSrcBinJRESpecific() throws Exception { + doTest(); + } + + public void testAccessrulez() throws Exception { + doTest(); + } + + public void testSrcBinJREProject() throws Exception { + doTest(); + } + + public void testSourceFolderOutput() throws Exception { + doTest(); + } + + public void testMultipleSourceFolders() throws Exception { + doTest(); + } + + public void testEmptySrc() throws Exception { + doTest(); + } + + public void testHttpJavadoc() throws Exception { + doTest(); + } + + public void testHome() throws Exception { + doTest(); + } + + //public void testNoJava() throws Exception { + // doTest(); + //} + + public void testNoSource() throws Exception { + doTest(); + } + + public void testPlugin() throws Exception { + doTest(); + } + + public void testRoot() throws Exception { + doTest(); + } + + public void testUnknownCon() throws Exception { + doTest(); + } + + public void testSourcesAfterAll() throws Exception { + doTest(); + } + + public void testLinkedSrc() throws Exception { + doTest(); + } + + public void testSrcRootsOrder() throws Exception { + doTest(); + } +} diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseClasspathVarsTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseClasspathVarsTest.java new file mode 100644 index 000000000000..579735969625 --- /dev/null +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseClasspathVarsTest.java @@ -0,0 +1,37 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 28-Nov-2008 + */ +package org.jetbrains.idea.eclipse; + +public class EclipseClasspathVarsTest extends EclipseVarsTest { + + private void doTest() throws Exception { + EclipseClasspathTest.doTest("/test", getProject()); + } + + public void testResolvedVariables() throws Exception { + doTest(); + } + + @Override + protected String getRelativeTestPath() { + return "round"; + } +}
\ No newline at end of file diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseEml2ModulesTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseEml2ModulesTest.java new file mode 100644 index 000000000000..506d66c1c1db --- /dev/null +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseEml2ModulesTest.java @@ -0,0 +1,43 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 29-Mar-2010 + */ +package org.jetbrains.idea.eclipse; + +public class EclipseEml2ModulesTest extends Eclipse2ModulesTest{ + @Override + protected String getTestPath() { + return "eml"; + } + + @Override + protected void doTest(String workspaceRoot, String projectRoot) throws Exception { + super.doTest(workspaceRoot, projectRoot); + EclipseEmlTest.doTest("/" + workspaceRoot + "/" + projectRoot, getProject()); + } + + public void testSourceRootPaths() throws Exception { + doTest("srcPath", "sourceRootPaths"); + } + + public void testAnotherSourceRootPaths() throws Exception { + setDependantModulePath("anotherPath"); + doTest("srcPath", "sourceRootPaths"); + } +}
\ No newline at end of file diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseEmlTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseEmlTest.java new file mode 100644 index 000000000000..8c80bf764d30 --- /dev/null +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseEmlTest.java @@ -0,0 +1,132 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 28-Nov-2008 + */ +package org.jetbrains.idea.eclipse; + +import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.application.PluginPathManager; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleManager; +import com.intellij.openapi.module.StdModuleTypes; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.ModifiableRootModel; +import com.intellij.openapi.roots.ModuleRootManager; +import com.intellij.openapi.roots.ModuleRootModel; +import com.intellij.openapi.roots.ModuleRootModificationUtil; +import com.intellij.openapi.util.*; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.testFramework.IdeaTestCase; +import junit.framework.Assert; +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.JDOMException; +import org.jetbrains.idea.eclipse.config.EclipseClasspathStorageProvider; +import org.jetbrains.idea.eclipse.conversion.IdeaSpecificSettings; + +import java.io.File; +import java.io.IOException; + +public class EclipseEmlTest extends IdeaTestCase { + @Override + protected void setUp() throws Exception { + super.setUp(); + final File testRoot = new File(PluginPathManager.getPluginHomePath("eclipse") + "/testData", "eml"); + assertTrue(testRoot.getAbsolutePath(), testRoot.isDirectory()); + + final File currentTestRoot = new File(testRoot, getTestName(true)); + assertTrue(currentTestRoot.getAbsolutePath(), currentTestRoot.isDirectory()); + + FileUtil.copyDir(currentTestRoot, new File(getProject().getBaseDir().getPath())); + } + + + protected static void doTest(String relativePath, final Project project) throws Exception { + final String path = project.getBaseDir().getPath() + relativePath; + final Module module = doLoadModule(path, project); + + + checkModule(path, module); + } + + private static Module doLoadModule(final String path, final Project project) throws IOException, JDOMException, InvalidDataException { + final Module module = ApplicationManager.getApplication().runWriteAction(new Computable<Module>() { + @Override + public Module compute() { + return ModuleManager.getInstance(project) + .newModule(path + "/" + EclipseProjectFinder.findProjectName(path) + IdeaXml.IML_EXT, StdModuleTypes.JAVA.getId()); + } + }); + + replaceRoot(path, EclipseXml.DOT_CLASSPATH_EXT, project); + + + final EclipseClasspathStorageProvider.EclipseClasspathConverter converter = + new EclipseClasspathStorageProvider.EclipseClasspathConverter(module); + final ModifiableRootModel rootModel = ModuleRootManager.getInstance(module).getModifiableModel(); + + final Element classpathElement = + JDOMUtil.loadDocument(FileUtil.loadFile(new File(path, EclipseXml.DOT_CLASSPATH_EXT))).getRootElement(); + converter.getClasspath(rootModel, classpathElement); + ApplicationManager.getApplication().runWriteAction(new Runnable() { + public void run() { + rootModel.commit(); + } + }); + return module; + } + + protected static void checkModule(String path, Module module) throws WriteExternalException, IOException, JDOMException { + ModuleRootModel rootModel = ModuleRootManager.getInstance(module); + final Element root = new Element("component"); + IdeaSpecificSettings.writeIDEASpecificClasspath(root, rootModel); + + final String resulted = new String(JDOMUtil.printDocument(new Document(root), "\n")); + + final File emlFile = new File(path, module.getName() + EclipseXml.IDEA_SETTINGS_POSTFIX); + Assert.assertTrue(resulted.replaceAll(StringUtil.escapeToRegexp(module.getProject().getBaseDir().getPath()), "\\$ROOT\\$"), + JDOMUtil.areElementsEqual(root, JDOMUtil.loadDocument(FileUtil.loadFile(emlFile)).getRootElement())); + } + + private static void replaceRoot(String path, final String child, final Project project) throws IOException, JDOMException { + final File emlFile = new File(path, child); + String fileText = FileUtil.loadFile(emlFile).replaceAll("\\$ROOT\\$", project.getBaseDir().getPath()); + if (!SystemInfo.isWindows) { + fileText = fileText.replaceAll(EclipseXml.FILE_PROTOCOL + "/", EclipseXml.FILE_PROTOCOL); + } + JDOMUtil.writeDocument(JDOMUtil.loadDocument(fileText), emlFile, "\n"); + } + + public void testSrcInZip() throws Exception { + doTest("/test", getProject()); + } + + public void testPreserveInheritedInvalidJdk() throws Exception { + final Project project = getProject(); + final String projectBasePath = project.getBaseDir().getPath(); + final String path = projectBasePath + "/test"; + + final Module module = doLoadModule(path, project); + + ModuleRootModificationUtil.setSdkInherited(module); + + checkModule(projectBasePath + "/test/expected", module); + } +} diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseIml2ModulesTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseIml2ModulesTest.java new file mode 100644 index 000000000000..59f56aaebf09 --- /dev/null +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseIml2ModulesTest.java @@ -0,0 +1,43 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 28-Nov-2008 + */ +package org.jetbrains.idea.eclipse; + +public class EclipseIml2ModulesTest extends Eclipse2ModulesTest { + + @Override + protected String getTestPath() { + return "iml"; + } + + public void testAllProps() throws Exception { + doTest("eclipse-ws-3.4.1-a", "all-props"); + } + + public void testRelativePaths() throws Exception { + doTest("relPaths", "scnd"); + } + + @Override + protected void doTest(final String workspaceRoot, final String projectRoot) throws Exception { + super.doTest(workspaceRoot, projectRoot); + EclipseImlTest.doTest("/" + workspaceRoot + "/" + projectRoot, getProject()); + } +}
\ No newline at end of file diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseImlTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseImlTest.java new file mode 100644 index 000000000000..7569fdd309d9 --- /dev/null +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseImlTest.java @@ -0,0 +1,138 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 28-Nov-2008 + */ +package org.jetbrains.idea.eclipse; + +import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.application.PathMacros; +import com.intellij.openapi.application.PathManager; +import com.intellij.openapi.application.PluginPathManager; +import com.intellij.openapi.components.PathMacroManager; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleManager; +import com.intellij.openapi.module.StdModuleTypes; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.ModifiableRootModel; +import com.intellij.openapi.roots.ModuleRootManager; +import com.intellij.openapi.roots.impl.ModuleRootManagerImpl; +import com.intellij.openapi.util.Computable; +import com.intellij.openapi.util.JDOMUtil; +import com.intellij.openapi.util.SystemInfo; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.testFramework.IdeaTestCase; +import junit.framework.Assert; +import org.jdom.Document; +import org.jdom.Element; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.idea.eclipse.conversion.EclipseClasspathReader; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashSet; + +public class EclipseImlTest extends IdeaTestCase { + @NonNls public static final String JUNIT = "JUNIT"; + + @Override + protected void setUp() throws Exception { + super.setUp(); + final File testRoot = new File(PluginPathManager.getPluginHomePath("eclipse") + "/testData/iml"); + assertTrue(testRoot.getAbsolutePath(), testRoot.isDirectory()); + + final File currentTestRoot = new File(testRoot, getTestName(true)); + assertTrue(currentTestRoot.getAbsolutePath(), currentTestRoot.isDirectory()); + + FileUtil.copyDir(currentTestRoot, new File(getProject().getBaseDir().getPath())); + } + + private void doTest() throws Exception { + doTest("/test", getProject()); + } + + protected static void doTest(final String relativePath, final Project project) throws Exception { + final String path = project.getBaseDir().getPath() + relativePath; + + final File classpathFile = new File(path, EclipseXml.DOT_CLASSPATH_EXT); + String fileText = FileUtil.loadFile(classpathFile).replaceAll("\\$ROOT\\$", project.getBaseDir().getPath()); + if (!SystemInfo.isWindows) { + fileText = fileText.replaceAll(EclipseXml.FILE_PROTOCOL + "/", EclipseXml.FILE_PROTOCOL); + } + String communityAppDir = PathManager.getHomePath(); + if (new File(PathManager.getHomePath(), "community").exists()) { + communityAppDir += "/community"; + } + fileText = fileText.replaceAll("\\$" + JUNIT + "\\$", communityAppDir); + final Element classpathElement = JDOMUtil.loadDocument(fileText).getRootElement(); + final Module module = ApplicationManager.getApplication().runWriteAction(new Computable<Module>() { + @Override + public Module compute() { + return ModuleManager.getInstance(project) + .newModule(new File(path) + File.separator + EclipseProjectFinder + .findProjectName(path) + IdeaXml.IML_EXT, StdModuleTypes.JAVA.getId()); + } + }); + final ModifiableRootModel rootModel = ModuleRootManager.getInstance(module).getModifiableModel(); + final EclipseClasspathReader classpathReader = new EclipseClasspathReader(path, project, null); + classpathReader.init(rootModel); + classpathReader + .readClasspath(rootModel, new ArrayList<String>(), new ArrayList<String>(), new HashSet<String>(), new HashSet<String>(), null, + classpathElement); + ApplicationManager.getApplication().runWriteAction(new Runnable() { + public void run() { + rootModel.commit(); + } + }); + + final Element actualImlElement = new Element("root"); + ((ModuleRootManagerImpl)ModuleRootManager.getInstance(module)).getState().writeExternal(actualImlElement); + + PathMacros.getInstance().setMacro(JUNIT, communityAppDir); + PathMacroManager.getInstance(module).collapsePaths(actualImlElement); + PathMacroManager.getInstance(project).collapsePaths(actualImlElement); + PathMacros.getInstance().removeMacro(JUNIT); + + final Element expectedIml = + JDOMUtil.loadDocument(new File(project.getBaseDir().getPath() + "/expected", "expected.iml")).getRootElement(); + Assert.assertTrue(new String(JDOMUtil.printDocument(new Document(actualImlElement), "\n")), + JDOMUtil.areElementsEqual(expectedIml, actualImlElement)); + } + + + public void testWorkspaceOnly() throws Exception { + doTest(); + } + + public void testSrcBinJREProject() throws Exception { + doTest(); + } + + + public void testEmptySrc() throws Exception { + doTest(); + } + + public void testEmpty() throws Exception { + doTest(); + } + + public void testRoot() throws Exception { + doTest(); + } +} diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseImlVarsTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseImlVarsTest.java new file mode 100644 index 000000000000..c0d4db43f54f --- /dev/null +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseImlVarsTest.java @@ -0,0 +1,36 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 29-Mar-2010 + */ +package org.jetbrains.idea.eclipse; + +public class EclipseImlVarsTest extends EclipseVarsTest { + private void doTest() throws Exception { + EclipseImlTest.doTest("/test", getProject()); + } + + public void testResolvedVariables() throws Exception { + doTest(); + } + + @Override + protected String getRelativeTestPath() { + return "iml"; + } +}
\ No newline at end of file diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseImportWizardTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseImportWizardTest.java new file mode 100644 index 000000000000..bbf0d4acfa67 --- /dev/null +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseImportWizardTest.java @@ -0,0 +1,72 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.eclipse; + +import com.intellij.ide.projectWizard.ProjectWizardTestCase; +import com.intellij.ide.util.projectWizard.ImportFromSourcesProvider; +import com.intellij.openapi.application.PluginPathManager; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.roots.ModuleRootManager; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.vfs.LocalFileSystem; +import com.intellij.openapi.vfs.VirtualFile; +import org.jetbrains.idea.eclipse.importWizard.EclipseImportBuilder; +import org.jetbrains.idea.eclipse.importWizard.EclipseProjectImportProvider; + +import java.io.File; +import java.io.IOException; + +/** + * @author Dmitry Avdeev + * Date: 11/7/12 + */ +public class EclipseImportWizardTest extends ProjectWizardTestCase { + + public void testImportProject() throws Exception { + Module module = doTest(".project"); + assertEquals("root", module.getName()); + } + + public void testImportClasspath() throws Exception { + Module module = doTest(".classpath"); + assertEquals("root", module.getName()); + } + + public void testImportFromDirectory() throws Exception { + Module module = doTest(""); + assertEquals("root", module.getName()); + } + + private Module doTest(final String fileName) throws IOException { + copyTestData(); + return importProjectFrom(getProject().getBaseDir().getPath() + "/" + fileName, null, + new EclipseProjectImportProvider(new EclipseImportBuilder())); + } + + private void copyTestData() throws IOException { + final File testRoot = new File(PluginPathManager.getPluginHomePath("eclipse") + "/testData", "import"); + FileUtil.copyDir(testRoot, new File(getProject().getBaseDir().getPath())); + } + + public void testImportingFromTwoProviders() throws Exception { + File file = createTempFile("Foo.java", "class Foo {}"); + Module module = importProjectFrom(file.getParent(), null, new ImportFromSourcesProvider(), + new EclipseProjectImportProvider(new EclipseImportBuilder())); + VirtualFile[] sourceRoots = ModuleRootManager.getInstance(module).getSourceRoots(); + assertEquals(1, sourceRoots.length); + assertEquals(LocalFileSystem.getInstance().findFileByIoFile(file.getParentFile()), sourceRoots[0]); + } +} diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseLibrariesModificationsTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseLibrariesModificationsTest.java new file mode 100644 index 000000000000..d7972ddbb3fc --- /dev/null +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseLibrariesModificationsTest.java @@ -0,0 +1,195 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 28-Nov-2008 + */ +package org.jetbrains.idea.eclipse; + +import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.JavadocOrderRootType; +import com.intellij.openapi.roots.ModifiableRootModel; +import com.intellij.openapi.roots.ModuleRootManager; +import com.intellij.openapi.roots.OrderRootType; +import com.intellij.openapi.roots.libraries.Library; +import com.intellij.openapi.vfs.JarFileSystem; +import com.intellij.openapi.vfs.VirtualFileManager; +import com.intellij.testFramework.PsiTestUtil; +import com.intellij.util.ArrayUtil; + +public class EclipseLibrariesModificationsTest extends EclipseVarsTest { + + private void doTestCreate(final String[] classRoots, final String[] sourceRoots) throws Exception { + final Project project = getProject(); + final String path = project.getBaseDir().getPath() + "/test"; + final Module module = EclipseClasspathTest.setUpModule(path, project); + PsiTestUtil.addLibrary(module, "created", ModuleRootManager.getInstance(module).getContentRoots()[0].getParent().getPath(), classRoots, + sourceRoots); + + EclipseClasspathTest.checkModule(project.getBaseDir().getPath() + "/expected", module); + } + + public void testReplacedWithVariables() throws Exception { + doTestCreate(new String[]{"/variableidea/test.jar!/"}, new String[]{"/srcvariableidea/test.jar!/"}); + } + + public void testCantReplaceWithVariables() throws Exception { + doTestCreate(new String[]{"/variableidea1/test.jar!/"}, new String[]{"/srcvariableidea/test.jar!/"}); + } + + public void testReplacedWithVariablesNoSrcExistOnDisc() throws Exception { + doTestCreate(new String[]{"/variableidea/test.jar!/"}, new String[]{"/srcvariableidea/test.jar!/"}); + } + + public void testReplacedWithVariablesCantReplaceSrc() throws Exception { + doTestCreate(new String[]{"/variableidea/test.jar!/"}, new String[]{"/srcvariableidea1/test.jar!/"}); + } + + public void testReplacedWithVariablesNoSources() throws Exception { + doTestCreate(new String[]{"/variableidea/test.jar!/"}, new String[]{}); + } + + public void testReplacedExistingWithVariablesCantReplaceSrc() throws Exception { + doTestExisting(new String[]{"/variableidea/test.jar!/"}, new String[]{"/srcvariableidea1/test.jar!/"}, ArrayUtil.EMPTY_STRING_ARRAY); + } + + public void testReplacedExistingWithMultipleJavadocs() throws Exception { + doTestExisting(new String[]{"/variableidea/test.jar!/"}, new String[]{}, + new String[]{"/srcvariableidea1/test.jar!/", "/srcvariableidea11/test.jar!/"}); + } + + public void testLibAddLibSource() throws Exception { + doTestExisting(new String[]{"/jars/test.jar!/"}, + new String[]{"/jars/test.jar!/", "/jars/test-2.jar!/"}, + new String[]{}); + } + + public void testLibAddVarSource() throws Exception { + doTestExisting(new String[]{"/jars/test.jar!/"}, + new String[]{"/jars/test.jar!/", "/srcvariableidea/test.jar!/"}, + new String[]{}); + } + + public void testLibReplaceVarSource() throws Exception { + doTestExisting(new String[]{"/jars/test.jar!/"}, + new String[]{"/srcvariableidea/test.jar!/"}, + new String[]{}); + } + + public void testLibvarAddLibSource() throws Exception { + doTestExisting(new String[]{"/variableidea/test.jar!/"}, + new String[]{"/jars/test.jar!/"}, + new String[]{}); + } + + public void testLibvarAddVarSource() throws Exception { + doTestExisting(new String[]{"/variableidea/test.jar!/"}, + new String[]{"/jars/test.jar!/", "/srcvariableidea/test.jar!/"}, + new String[]{}); + } + + public void testLibvarReplaceLibSource() throws Exception { + doTestExisting(new String[]{"/variableidea/test.jar!/"}, + new String[]{"/jars/test.jar!/"}, + new String[]{}); + } + + public void testLibvarReplaceVarSource() throws Exception { + doTestExisting(new String[]{"/variableidea/test.jar!/"}, + new String[]{"/srcvariableidea/test.jar!/"}, + new String[]{}); + } + + public void testVarAddLibSource() throws Exception { + doTestExisting(new String[]{"/variableidea/test.jar!/"}, + new String[]{"/jars/test.jar!/"}, + new String[]{}); + } + + public void testVarAddJavadoc() throws Exception { + doTestExisting(new String[]{"/variableidea/test.jar!/"}, + new String[]{"/variableidea/test.jar!/"}, + new String[]{"/jars/test.jar!/"}); + } + + public void testVarAddVarSource() throws Exception { + doTestExisting(new String[]{"/variableidea/test.jar!/"}, + new String[]{"/variableidea/test.jar!/", "/srcvariableidea/test.jar!/"}, + new String[]{}); + } + + public void testVarReplaceLibSource() throws Exception { + doTestExisting(new String[]{"/variableidea/test.jar!/"}, + new String[]{"/jars/test.jar!/"}, + new String[]{}); + } + + public void testVarReplaceVarSource() throws Exception { + doTestExisting(new String[]{"/variableidea/test.jar!/"}, + new String[]{"/srcvariableidea/test.jar!/"}, + new String[]{}); + } + + private void doTestExisting(final String[] classRoots, final String[] sourceRoots, final String[] javadocs) throws Exception { + final Project project = getProject(); + final String path = project.getBaseDir().getPath() + "/test"; + final Module module = EclipseClasspathTest.setUpModule(path, project); + ApplicationManager.getApplication().runWriteAction(new Runnable() { + public void run() { + final ModifiableRootModel model = ModuleRootManager.getInstance(module).getModifiableModel(); + final String parentUrl = VirtualFileManager.constructUrl(JarFileSystem.PROTOCOL, model.getContentRoots()[0].getParent().getPath()); + final Library library = model.getModuleLibraryTable().getLibraryByName("test.jar"); + final Library.ModifiableModel libModifiableModel = library.getModifiableModel(); + final String[] oldClsRoots = libModifiableModel.getUrls(OrderRootType.CLASSES); + for (String oldClsRoot : oldClsRoots) { + libModifiableModel.removeRoot(oldClsRoot, OrderRootType.CLASSES); + } + + final String[] oldSrcRoots = libModifiableModel.getUrls(OrderRootType.SOURCES); + for (String oldSrcRoot : oldSrcRoots) { + libModifiableModel.removeRoot(oldSrcRoot, OrderRootType.SOURCES); + } + + final String[] oldJdcRoots = libModifiableModel.getUrls(JavadocOrderRootType.getInstance()); + for (String oldJavadocRoot : oldJdcRoots) { + libModifiableModel.removeRoot(oldJavadocRoot, JavadocOrderRootType.getInstance()); + } + for (String classRoot : classRoots) { + libModifiableModel.addRoot(parentUrl + classRoot, OrderRootType.CLASSES); + } + for (String sourceRoot : sourceRoots) { + libModifiableModel.addRoot(parentUrl + sourceRoot, OrderRootType.SOURCES); + } + for (String javadocRoot : javadocs) { + libModifiableModel.addRoot(parentUrl + javadocRoot, JavadocOrderRootType.getInstance()); + } + libModifiableModel.commit(); + model.commit(); + } + }); + + EclipseClasspathTest.checkModule(project.getBaseDir().getPath() + "/expected", module); + EclipseEmlTest.checkModule(project.getBaseDir().getPath() + "/expected", module); + } + + @Override + protected String getRelativeTestPath() { + return "modification"; + } +} diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseLinkedResourcesTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseLinkedResourcesTest.java new file mode 100644 index 000000000000..e2dd0a76365b --- /dev/null +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseLinkedResourcesTest.java @@ -0,0 +1,52 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 29-Mar-2010 + */ +package org.jetbrains.idea.eclipse; + +public class EclipseLinkedResourcesTest extends EclipseVarsTest{ + @Override + protected String getRelativeTestPath() { + return "linked"; + } + + public void testResolvedVars() throws Exception { + EclipseClasspathTest.doTest("/test", getProject()); + } + + public void testResolvedVarsInOutput() throws Exception { + EclipseClasspathTest.doTest("/test", getProject()); + } + + public void testResolvedVarsInIml() throws Exception { + EclipseImlTest.doTest("/test", getProject()); + } + + public void testResolvedVarsInOutputImlCheck() throws Exception { + EclipseImlTest.doTest("/test", getProject()); + } + + public void testResolvedVarsInLibImlCheck() throws Exception { + EclipseImlTest.doTest("/test", getProject()); + } + + public void testResolvedVarsInLibImlCheck1() throws Exception { + EclipseClasspathTest.doTest("/test", getProject()); + } +} diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseVarsTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseVarsTest.java new file mode 100644 index 000000000000..c2b578d19766 --- /dev/null +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseVarsTest.java @@ -0,0 +1,65 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 29-Mar-2010 + */ +package org.jetbrains.idea.eclipse; + +import com.intellij.openapi.application.PathMacros; +import com.intellij.openapi.application.PluginPathManager; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.vfs.LocalFileSystem; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.testFramework.IdeaTestCase; +import org.jetbrains.annotations.NonNls; + +import java.io.File; + +public abstract class EclipseVarsTest extends IdeaTestCase { + @NonNls private static final String VARIABLE = "variable"; + @NonNls private static final String SRCVARIABLE = "srcvariable"; + + @Override + protected void setUp() throws Exception { + super.setUp(); + final File testRoot = new File(PluginPathManager.getPluginHomePath("eclipse") + "/testData", getRelativeTestPath()); + assertTrue(testRoot.getAbsolutePath(), testRoot.isDirectory()); + + final File currentTestRoot = new File(testRoot, getTestName(true)); + assertTrue(currentTestRoot.getAbsolutePath(), currentTestRoot.isDirectory()); + + final String tempPath = getProject().getBaseDir().getPath(); + final File tempDir = new File(tempPath); + FileUtil.copyDir(currentTestRoot, tempDir); + final VirtualFile virtualTestDir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(tempDir); + assertNotNull(tempDir.getAbsolutePath(), virtualTestDir); + virtualTestDir.refresh(false, true); + + PathMacros.getInstance().setMacro(VARIABLE, new File(tempPath, VARIABLE + "idea").getPath()); + PathMacros.getInstance().setMacro(SRCVARIABLE, new File(tempPath, SRCVARIABLE + "idea").getPath()); + } + + protected abstract String getRelativeTestPath(); + + @Override + protected void tearDown() throws Exception { + PathMacros.getInstance().removeMacro(VARIABLE); + PathMacros.getInstance().removeMacro(SRCVARIABLE); + super.tearDown(); + } +}
\ No newline at end of file |