diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index dc3ac688d4..941e57e080 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -4,6 +4,8 @@ This file documents all notable changes to https://github.com/devonfw/IDEasy[IDE == 2025.12.001 +* https://github.com/devonfw/IDEasy/issues/1166[#1166]: Automatic project import for IntelliJ + Release with new features and bugfixes: * https://github.com/devonfw/IDEasy/issues/39[#39]: Implement ToolCommandlet for pip diff --git a/cli/src/main/java/com/devonfw/tools/ide/environment/ExtensibleEnvironmentVariables.java b/cli/src/main/java/com/devonfw/tools/ide/environment/ExtensibleEnvironmentVariables.java new file mode 100644 index 0000000000..e57927f2dc --- /dev/null +++ b/cli/src/main/java/com/devonfw/tools/ide/environment/ExtensibleEnvironmentVariables.java @@ -0,0 +1,52 @@ +package com.devonfw.tools.ide.environment; + +import java.util.HashMap; +import java.util.Map; + +import com.devonfw.tools.ide.context.IdeContext; + +/** + * Subclass of {@link EnvironmentVariablesMap} that resolves variables recursively and allows new variables to be added to the resolver. + */ +public class ExtensibleEnvironmentVariables extends EnvironmentVariablesMap { + + private final Map additionalEnvironmentVariables; + + /** + * The constructor. + * + * @param parent the parent {@link EnvironmentVariables} to inherit from. + * @param context the context to use. + */ + public ExtensibleEnvironmentVariables(AbstractEnvironmentVariables parent, IdeContext context) { + super(parent, context); + this.additionalEnvironmentVariables = new HashMap<>(); + } + + /** + * @param name the variable string to be resolved + * @param value the string the variable should be resolved into + */ + public void addVariableResolver(String name, String value) { + this.additionalEnvironmentVariables.put(name, value); + } + + @Override + protected String getValue(String name, boolean ignoreDefaultValue) { + String value = this.additionalEnvironmentVariables.get(name); + if (value != null) { + return value; + } + return super.getValue(name, ignoreDefaultValue); + } + + @Override + protected Map getVariables() { + return this.additionalEnvironmentVariables; + } + + @Override + public EnvironmentVariablesType getType() { + return EnvironmentVariablesType.TOOL; + } +} diff --git a/cli/src/main/java/com/devonfw/tools/ide/io/FileAccess.java b/cli/src/main/java/com/devonfw/tools/ide/io/FileAccess.java index 33015a9887..f8162dc9be 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/io/FileAccess.java +++ b/cli/src/main/java/com/devonfw/tools/ide/io/FileAccess.java @@ -8,6 +8,7 @@ import java.nio.file.attribute.PosixFilePermission; import java.time.Duration; import java.util.List; +import java.util.Optional; import java.util.Properties; import java.util.Set; import java.util.function.Consumer; @@ -154,8 +155,8 @@ default void copy(Path source, Path target) { /** * @param source the source {@link Path file or folder} to copy. * @param target the {@link Path} to copy {@code source} to. Unlike the Linux {@code cp} command this method will not take the filename of {@code source} - * and copy that to {@code target} in case that is an existing folder. Instead it will always be simple and stupid and just copy from {@code source} to - * {@code target}. Therefore the result is always clear and easy to predict and understand. Also you can easily rename a file to copy. While + * and copy that to {@code target} in case that is an existing folder. Instead, it will always be simple and stupid and just copy from {@code source} to + * {@code target}. Therefore, the result is always clear and easy to predict and understand. Also, you can easily rename a file to copy. While * {@code cp my-file target} may lead to a different result than {@code cp my-file target/} this method will always ensure that in the end you will find * the same content of {@code source} in {@code target}. * @param mode the {@link FileCopyMode}. @@ -168,8 +169,8 @@ default void copy(Path source, Path target, FileCopyMode mode) { /** * @param source the source {@link Path file or folder} to copy. * @param target the {@link Path} to copy {@code source} to. Unlike the Linux {@code cp} command this method will not take the filename of {@code source} - * and copy that to {@code target} in case that is an existing folder. Instead it will always be simple and stupid and just copy from {@code source} to - * {@code target}. Therefore the result is always clear and easy to predict and understand. Also you can easily rename a file to copy. While + * and copy that to {@code target} in case that is an existing folder. Instead, it will always be simple and stupid and just copy from {@code source} to + * {@code target}. Therefore, the result is always clear and easy to predict and understand. Also, you can easily rename a file to copy. While * {@code cp my-file target} may lead to a different result than {@code cp my-file target/} this method will always ensure that in the end you will find * the same content of {@code source} in {@code target}. * @param mode the {@link FileCopyMode}. @@ -331,6 +332,23 @@ default void extract(Path archiveFile, Path targetDir, Consumer postExtrac */ Path findFirst(Path dir, Predicate filter, boolean recursive); + /** + * Searches upward from the given starting path to find the nearest ancestor directory that contains a specific subfolder. The search stops before ascending + * into any parent directory whose name matches the provided stop boundary. + * + * @param start the starting {@link Path} from which to begin the upward traversal. Must not be {@code null}. + * @param folderName the name of the subfolder to look for in each ancestor directory (e.g., ".idea"). Must not be {@code null} or empty. + * @param stopBeforeParentName the name of a parent directory at which the search should stop (case-insensitive). The method will not ascend into this + * directory. For example, if this is "workspaces", the search will stop at the child of "workspaces" and will not check inside "workspaces" itself. + * @return {@link Path} of the ancestor directory that contains the specified subfolder, or {@link Optional#empty()} if no such ancestor is found before + * reaching the stop boundary. + */ + Path findAncestorWithFolder( + Path start, + String folderName, + String stopBeforeParentName + ); + /** * @param dir the {@link Path} to the directory where to list the children. * @param filter the {@link Predicate} used to {@link Predicate#test(Object) decide} which children to include (if {@code true} is returned). @@ -510,7 +528,7 @@ default void writeProperties(Properties properties, Path file) { /** * @param properties the {@link Properties} to save. * @param file the {@link Path} to the file where to save the properties. - * @param createParentDir if {@code true}, the parent directory will created if it does not already exist, {@code false} otherwise (fail if parent does + * @param createParentDir if {@code true}, the parent directory will be created if it does not already exist, {@code false} otherwise (fail if parent does * not exist). */ void writeProperties(Properties properties, Path file, boolean createParentDir); diff --git a/cli/src/main/java/com/devonfw/tools/ide/io/FileAccessImpl.java b/cli/src/main/java/com/devonfw/tools/ide/io/FileAccessImpl.java index c597ce0dbf..e01a8798ed 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/io/FileAccessImpl.java +++ b/cli/src/main/java/com/devonfw/tools/ide/io/FileAccessImpl.java @@ -1025,6 +1025,39 @@ private Path findFirstRecursive(Path dir, Predicate filter, boolean recurs return null; } + @Override + public Path findAncestorWithFolder( + Path start, + String folderName, + String stopBeforeParentName + ) { + + Path current = start.toAbsolutePath().normalize(); + + while (current != null) { + + Path candidate = current.resolve(folderName); + if (Files.isDirectory(candidate)) { + return current; + } + + Path parent = current.getParent(); + if (parent == null) { + break; + } + + Path parentName = parent.getFileName(); + if (parentName != null && + parentName.toString().equalsIgnoreCase(stopBeforeParentName)) { + break; + } + + // Ascend + current = parent; + } + return null; + } + @Override public List listChildrenMapped(Path dir, Function filter) { diff --git a/cli/src/main/java/com/devonfw/tools/ide/merge/xml/XmlMerger.java b/cli/src/main/java/com/devonfw/tools/ide/merge/xml/XmlMerger.java index d0e3c54866..547f88fd12 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/merge/xml/XmlMerger.java +++ b/cli/src/main/java/com/devonfw/tools/ide/merge/xml/XmlMerger.java @@ -112,8 +112,8 @@ protected void doMerge(Path setup, Path update, EnvironmentVariables resolver, P public Document merge(XmlMergeDocument templateDocument, XmlMergeDocument workspaceDocument, boolean workspaceFileExists) { Document resultDocument; - Path source = templateDocument.getPath(); - Path template = workspaceDocument.getPath(); + Path template = templateDocument.getPath(); + Path source = workspaceDocument.getPath(); this.context.debug("Merging {} into {} ...", template, source); Element templateRoot = templateDocument.getRoot(); QName templateQName = XmlMergeSupport.getQualifiedName(templateRoot); @@ -185,6 +185,19 @@ public XmlMergeDocument load(Path file) { } } + /** + * Creates an empty but valid xml file. + * + * @param tagName name of the tag to use for the root node. + * @param file Path of the file to create. + */ + public void createValidEmptyXmlFile(String tagName, Path file) { + Document document = DOCUMENT_BUILDER.newDocument(); + Element root = document.createElement(tagName); + document.appendChild(root); + save(new XmlMergeDocument(document, file)); + } + /** * @param document the XML {@link XmlMergeDocument} to save. */ diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/gradle/Gradle.java b/cli/src/main/java/com/devonfw/tools/ide/tool/gradle/Gradle.java index d767e52396..a20fec8c8e 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/gradle/Gradle.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/gradle/Gradle.java @@ -17,8 +17,11 @@ */ public class Gradle extends LocalToolCommandlet { - private static final String BUILD_GRADLE = "build.gradle"; - private static final String BUILD_GRADLE_KTS = "build.gradle.kts"; + /** build.gradle file name */ + public static final String BUILD_GRADLE = "build.gradle"; + + /** build.gradle.kts file name */ + public static final String BUILD_GRADLE_KTS = "build.gradle.kts"; private static final String GRADLE_WRAPPER_FILENAME = "gradlew"; /** diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/intellij/Intellij.java b/cli/src/main/java/com/devonfw/tools/ide/tool/intellij/Intellij.java index cffeabf96e..9d3821f350 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/intellij/Intellij.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/intellij/Intellij.java @@ -1,14 +1,27 @@ package com.devonfw.tools.ide.tool.intellij; +import java.io.IOException; import java.nio.file.Files; +import java.nio.file.Path; import java.util.Set; +import org.w3c.dom.Document; + import com.devonfw.tools.ide.common.Tag; import com.devonfw.tools.ide.context.IdeContext; +import com.devonfw.tools.ide.environment.AbstractEnvironmentVariables; +import com.devonfw.tools.ide.environment.EnvironmentVariables; +import com.devonfw.tools.ide.environment.ExtensibleEnvironmentVariables; +import com.devonfw.tools.ide.io.FileAccess; +import com.devonfw.tools.ide.io.FileAccessImpl; +import com.devonfw.tools.ide.merge.xml.XmlMergeDocument; +import com.devonfw.tools.ide.merge.xml.XmlMerger; import com.devonfw.tools.ide.process.EnvironmentContext; import com.devonfw.tools.ide.tool.ToolInstallation; +import com.devonfw.tools.ide.tool.gradle.Gradle; import com.devonfw.tools.ide.tool.ide.IdeToolCommandlet; import com.devonfw.tools.ide.tool.ide.IdeaBasedIdeToolCommandlet; +import com.devonfw.tools.ide.tool.mvn.Mvn; /** * {@link IdeToolCommandlet} for IntelliJ. @@ -21,6 +34,11 @@ public class Intellij extends IdeaBasedIdeToolCommandlet { private static final String IDEA_BASH_SCRIPT = IDEA + ".sh"; + private static final String TEMPLATE_LOCATION = "intellij/workspace/repository/.idea"; + private static final String GRADLE_XML = "gradle.xml"; + private static final String MISC_XML = "misc.xml"; + private static final String IDEA_PROPERTIES = "idea.properties"; + /** * The constructor. * @@ -49,9 +67,89 @@ protected String getBinaryName() { @Override public void setEnvironment(EnvironmentContext environmentContext, ToolInstallation toolInstallation, boolean additionalInstallation) { - super.setEnvironment(environmentContext, toolInstallation, additionalInstallation); - environmentContext.withEnvVar("IDEA_PROPERTIES", this.context.getWorkspacePath().resolve("idea.properties").toString()); + environmentContext.withEnvVar("IDEA_PROPERTIES", this.context.getWorkspacePath().resolve(IDEA_PROPERTIES).toString()); + } + + private EnvironmentVariables getIntellijEnvironmentVariables(Path projectPath) { + ExtensibleEnvironmentVariables environmentVariables = new ExtensibleEnvironmentVariables( + (AbstractEnvironmentVariables) this.context.getVariables().getParent(), this.context); + + environmentVariables.addVariableResolver("PROJECT_PATH", projectPath.toString()); + return environmentVariables.resolved(); + } + + private void mergeConfig(Path repositoryPath, String configName) throws IOException { + Path workspacePath = getOrCreateWorkspaceXmlFile(repositoryPath, configName); + + if (workspacePath != null) { + XmlMerger xmlMerger = new XmlMerger(context); + Path templatePath = this.context.getSettingsPath().resolve(TEMPLATE_LOCATION).resolve(configName); + + EnvironmentVariables environmentVariables = getIntellijEnvironmentVariables(repositoryPath.getFileName()); + + if (!Files.exists(workspacePath)) { + xmlMerger.createValidEmptyXmlFile("project", workspacePath); + } + XmlMergeDocument workspaceDocument = xmlMerger.load(workspacePath); + XmlMergeDocument templateDocument = xmlMerger.loadAndResolve(templatePath, environmentVariables); + + Document mergedDocument = xmlMerger.merge(templateDocument, workspaceDocument, false); + + xmlMerger.save(mergedDocument, workspacePath); + } + } + + private Path getOrCreateWorkspaceXmlFile(Path repositoryPath, String fileName) { + FileAccess fileAccess = new FileAccessImpl(context); + + Path ideaParentPath = fileAccess + .findAncestorWithFolder(repositoryPath, "." + IDEA, "workspaces"); + + if (ideaParentPath != null) { + return ideaParentPath.resolve("." + IDEA).resolve(fileName); + } + return null; + } + + private boolean importTemplatesExist() { + Path templatePath = this.context.getSettingsPath().resolve(TEMPLATE_LOCATION); + Path miscXml = templatePath.resolve(MISC_XML); + Path gradleXml = templatePath.resolve(GRADLE_XML); + return Files.exists(miscXml) && Files.exists(gradleXml); + } + + @Override + public void importRepository(Path repositoryPath) { + if (!importTemplatesExist()) { + this.context.warning("Could not automatically import repository due to missing template files."); + return; + } + // check if pom.xml exists + Path pomPath = repositoryPath.resolve(Mvn.POM_XML); + if (Files.exists(pomPath)) { + try { + mergeConfig(repositoryPath, MISC_XML); + } catch (IOException e) { + this.context.error(e); + } + + } else { + this.context.debug("no pom.xml found was found in {}", pomPath); + } + + // check if build.gradle exists + Path javaGradlePath = repositoryPath.resolve(Gradle.BUILD_GRADLE); + Path kotlinGradlePath = repositoryPath.resolve(Gradle.BUILD_GRADLE_KTS); + if (Files.exists(javaGradlePath) || Files.exists(kotlinGradlePath)) { + try { + mergeConfig(repositoryPath, GRADLE_XML); + } catch (IOException e) { + this.context.error(e); + } + } else { + this.context.debug("no build.gradle found in {} and {}", javaGradlePath, kotlinGradlePath); + } } } diff --git a/cli/src/test/java/com/devonfw/tools/ide/io/FileAccessImplTest.java b/cli/src/test/java/com/devonfw/tools/ide/io/FileAccessImplTest.java index c3a6bebf32..86bb496c5f 100644 --- a/cli/src/test/java/com/devonfw/tools/ide/io/FileAccessImplTest.java +++ b/cli/src/test/java/com/devonfw/tools/ide/io/FileAccessImplTest.java @@ -814,7 +814,7 @@ public void testIsJunctionHandlesBrokenLinks(@TempDir Path tempDir) throws IOExc @Test public void testBinPath() { - // arrage + // arrange FileAccess fileAccess = IdeTestContextMock.get().getFileAccess(); Path projects = Path.of("src/test/resources/ide-projects"); Path rootPath = projects.resolve("basic/project/software/java"); @@ -831,4 +831,108 @@ public void testBinPath() { assertThat(fileAccess.getBinParentPath(projects)).isSameAs(projects); } + /** + * Tests if {@link FileAccess#findAncestorWithFolder} finds the correct path to the parent folder of the given folder name to search for. + * + * @param tempDir the temporary directory to use. + */ + @Test + public void testFindAncestorWithFolder(@TempDir Path tempDir) { + // arrange + FileAccess fileAccess = IdeTestContextMock.get().getFileAccess(); + Path projects = tempDir.resolve("projects"); + Path workspaces = projects.resolve("workspaces"); + Path mainWorkspace = workspaces.resolve("main"); + Path testWorkspace = mainWorkspace.resolve("test"); + Path ideaPath = mainWorkspace.resolve(".idea"); + fileAccess.mkdirs(testWorkspace); + fileAccess.mkdirs(ideaPath); + + // act + Path foundPath = fileAccess.findAncestorWithFolder(testWorkspace, ".idea", "workspaces"); + + // assert + assertThat(foundPath).isEqualTo(mainWorkspace); + } + + /** + * Tests if {@link FileAccess#findAncestorWithFolder} returns the starting path if it contains the folder. + */ + @Test + public void testFindAncestorWithFolderFolderExistsAtStart(@TempDir Path tempDir) { + // arrange + FileAccess fileAccess = IdeTestContextMock.get().getFileAccess(); + Path start = tempDir.resolve("start"); + Path ideaPath = start.resolve(".idea"); + fileAccess.mkdirs(start); + fileAccess.mkdirs(ideaPath); + + // act + Path result = fileAccess.findAncestorWithFolder(start, ".idea", "workspaces"); + + // assert + assertThat(result).isEqualTo(start); + } + + /** + * Tests if {@link FileAccess#findAncestorWithFolder} returns null when starting at root and folder is not found. + */ + @Test + public void testFindAncestorWithFolderStopsAtRootPath(@TempDir Path tempDir) { + FileAccess fileAccess = IdeTestContextMock.get().getFileAccess(); + Path root = tempDir.getRoot(); + + Path result = fileAccess.findAncestorWithFolder(root, ".idea", "workspaces"); + + assertThat(result).isNull(); + } + + /** + * Tests if {@link FileAccess#findAncestorWithFolder} returns null if the folder to find is located above the stop boundary. + */ + @Test + public void testFindAncestorWithFolderAboveStopBoundary(@TempDir Path tempDir) { + // arrange + FileAccess fileAccess = IdeTestContextMock.get().getFileAccess(); + Path projects = tempDir.resolve("projects"); + Path workspaces = projects.resolve("workspaces"); + Path mainWorkspace = workspaces.resolve("main"); + Path testWorkspace = mainWorkspace.resolve("test"); + Path ideaPath = projects.resolve(".idea"); // above stop boundary + fileAccess.mkdirs(testWorkspace); + fileAccess.mkdirs(ideaPath); + + // act + Path result = fileAccess.findAncestorWithFolder(testWorkspace, ".idea", "workspaces"); + + // assert + assertThat(result).isNull(); // should not climb above workspaces + } + + + /** + * Tests if {@link FileAccess#findAncestorWithFolder} returns the nearest ancestor containing the folder when multiple exist. + */ + @Test + public void testFindAncestorWithFolderReturnsNearestAncestor(@TempDir Path tempDir) { + // arrange + FileAccess fileAccess = IdeTestContextMock.get().getFileAccess(); + Path projects = tempDir.resolve("projects"); + Path workspaces = projects.resolve("workspaces"); + Path mainWorkspace = workspaces.resolve("main"); + Path testWorkspace = mainWorkspace.resolve("test"); + Path ideaPathMain = mainWorkspace.resolve(".idea"); + Path ideaPathProjects = projects.resolve(".idea"); + fileAccess.mkdirs(testWorkspace); + fileAccess.mkdirs(ideaPathMain); + fileAccess.mkdirs(ideaPathProjects); + + // act + Path result = fileAccess.findAncestorWithFolder(testWorkspace, ".idea", "workspaces"); + + // assert + assertThat(result).isEqualTo(mainWorkspace); // nearest ancestor wins + } + + } diff --git a/cli/src/test/java/com/devonfw/tools/ide/merge/xml/XmlMergerTest.java b/cli/src/test/java/com/devonfw/tools/ide/merge/xml/XmlMergerTest.java index 8127941a43..c0f1d52a51 100644 --- a/cli/src/test/java/com/devonfw/tools/ide/merge/xml/XmlMergerTest.java +++ b/cli/src/test/java/com/devonfw/tools/ide/merge/xml/XmlMergerTest.java @@ -87,8 +87,8 @@ void testFailOnAmbiguousMerge(@TempDir Path tempDir) throws Exception { }) // assert .hasRootCauseInstanceOf(IllegalStateException.class).hasRootCauseMessage( - "2 matches found for XPath configuration[@default='true' and @type='JUnit'] in workspace XML file '" + targetPath + "' at /project[@version='4']/component[@name='RunManager' @selected='Application.IDEasy'] for template file '" + sourcePath + "'"); - ; + "2 matches found for XPath configuration[@default='true' and @type='JUnit'] in workspace XML file '" + targetPath + + "' at /project[@version='4']/component[@name='RunManager' @selected='Application.IDEasy'] for template file '" + sourcePath + "'"); } @@ -145,7 +145,7 @@ void testLegacySupportWarningWhenEnvNotSetAndNoNamespace() { // assert assertThat(context).logAtWarning().hasEntries( - "XML merge namespace not found in file " + settingsUpdatePath + "XML merge namespace not found in file " + settingsSetupPath + ". If you are working in a legacy devonfw-ide project, please set IDE_XML_MERGE_LEGACY_SUPPORT_ENABLED=true to " + "proceed correctly."); } @@ -171,7 +171,8 @@ void testWarningMessageIncludesFilePaths(@TempDir Path tempDir) throws Exception // assert - check that the warning message contains both file paths assertThat(context).logAtWarning().hasEntries( - "2 matches found for XPath configuration[@default='true' and @type='JUnit'] in workspace XML file '" + targetPath + "' at /project[@version='4']/component[@name='RunManager' @selected='Application.IDEasy'] for template file '" + sourcePath + "'"); + "2 matches found for XPath configuration[@default='true' and @type='JUnit'] in workspace XML file '" + targetPath + + "' at /project[@version='4']/component[@name='RunManager' @selected='Application.IDEasy'] for template file '" + sourcePath + "'"); } } diff --git a/cli/src/test/java/com/devonfw/tools/ide/tool/intellij/IntellijTest.java b/cli/src/test/java/com/devonfw/tools/ide/tool/intellij/IntellijTest.java index e41013eb7f..7902536e6c 100644 --- a/cli/src/test/java/com/devonfw/tools/ide/tool/intellij/IntellijTest.java +++ b/cli/src/test/java/com/devonfw/tools/ide/tool/intellij/IntellijTest.java @@ -6,6 +6,7 @@ import com.devonfw.tools.ide.context.AbstractIdeContextTest; import com.devonfw.tools.ide.context.IdeTestContext; +import com.devonfw.tools.ide.git.repository.RepositoryCommandlet; import com.devonfw.tools.ide.os.SystemInfo; import com.devonfw.tools.ide.os.SystemInfoMock; import com.github.tomakehurst.wiremock.junit5.WireMockTest; @@ -151,6 +152,23 @@ public void testCheckEditionConflictInstallation() { assertThat(commandlet.retrievePluginMarkerFilePath(commandlet.getPlugin("ActivePlugin"))).exists(); } + /** + * Tests if the repository commandlet can trigger an import of a mvn and a gradle project. + */ + @Test + public void testIntellijMvnAndGradleRepositoryImport() { + // arrange + IdeTestContext context = newContext("intellij"); + RepositoryCommandlet rc = context.getCommandletManager().getCommandlet(RepositoryCommandlet.class); + + // act + rc.run(); + + // assert + assertThat(context.getWorkspacePath().resolve(".idea").resolve("misc.xml")).exists(); + assertThat(context.getWorkspacePath().resolve(".idea").resolve("gradle.xml")).exists(); + } + private void checkInstallation(IdeTestContext context) { diff --git a/cli/src/test/resources/ide-projects/intellij/project/settings/intellij/workspace/repository/.idea/gradle.xml b/cli/src/test/resources/ide-projects/intellij/project/settings/intellij/workspace/repository/.idea/gradle.xml new file mode 100644 index 0000000000..8de20d4549 --- /dev/null +++ b/cli/src/test/resources/ide-projects/intellij/project/settings/intellij/workspace/repository/.idea/gradle.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/cli/src/test/resources/ide-projects/intellij/project/settings/intellij/workspace/repository/.idea/misc.xml b/cli/src/test/resources/ide-projects/intellij/project/settings/intellij/workspace/repository/.idea/misc.xml new file mode 100644 index 0000000000..7516c8018c --- /dev/null +++ b/cli/src/test/resources/ide-projects/intellij/project/settings/intellij/workspace/repository/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/cli/src/test/resources/ide-projects/intellij/project/settings/repositories/test_gradle.properties b/cli/src/test/resources/ide-projects/intellij/project/settings/repositories/test_gradle.properties new file mode 100644 index 0000000000..aa491c1655 --- /dev/null +++ b/cli/src/test/resources/ide-projects/intellij/project/settings/repositories/test_gradle.properties @@ -0,0 +1,5 @@ +path=test_gradle +git_url=https://github.com/devonfw/IDEasy.git +git_branch=main +import=intellij +active=true diff --git a/cli/src/test/resources/ide-projects/intellij/project/settings/repositories/test_mvn.properties b/cli/src/test/resources/ide-projects/intellij/project/settings/repositories/test_mvn.properties new file mode 100644 index 0000000000..a1ac934c89 --- /dev/null +++ b/cli/src/test/resources/ide-projects/intellij/project/settings/repositories/test_mvn.properties @@ -0,0 +1,5 @@ +path=test_mvn +git_url=https://github.com/devonfw/IDEasy.git +git_branch=main +import=intellij +active=true diff --git a/cli/src/test/resources/ide-projects/intellij/project/workspaces/main/.idea/.gitkeep b/cli/src/test/resources/ide-projects/intellij/project/workspaces/main/.idea/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/cli/src/test/resources/ide-projects/intellij/project/workspaces/main/test_gradle/build.gradle b/cli/src/test/resources/ide-projects/intellij/project/workspaces/main/test_gradle/build.gradle new file mode 100644 index 0000000000..e69de29bb2 diff --git a/cli/src/test/resources/ide-projects/intellij/project/workspaces/main/test_mvn/pom.xml b/cli/src/test/resources/ide-projects/intellij/project/workspaces/main/test_mvn/pom.xml new file mode 100644 index 0000000000..e71f8f1cd8 --- /dev/null +++ b/cli/src/test/resources/ide-projects/intellij/project/workspaces/main/test_mvn/pom.xml @@ -0,0 +1,6 @@ + + + 4.0.0 + ide +