From 6ee3463534a91f1766744f1e5d8ab7d0dc3df174 Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Wed, 24 Jan 2018 18:02:14 +0100 Subject: [PATCH] CPP-11585 Add auto-detect CmakeLists.txt and suggest to Load it --- .../src/META-INF/PlatformLangPlugin.xml | 3 +++ .../PlatformProjectCheckoutListener.java | 16 +-------------- .../vcs/checkout/ProjectCheckoutListener.java | 20 ++----------------- .../checkout/ProjectDirCheckoutListener.java | 16 +-------------- .../ProjectImporterCheckoutListener.java | 16 +-------------- resources/src/idea/RichPlatformPlugin.xml | 3 --- 6 files changed, 8 insertions(+), 66 deletions(-) rename {java/idea-ui => platform/vcs-impl}/src/com/intellij/openapi/vcs/checkout/ProjectCheckoutListener.java (65%) rename {java/idea-ui => platform/vcs-impl}/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java (64%) rename {java/idea-ui => platform/vcs-impl}/src/com/intellij/openapi/vcs/checkout/ProjectImporterCheckoutListener.java (72%) diff --git a/platform/platform-resources/src/META-INF/PlatformLangPlugin.xml b/platform/platform-resources/src/META-INF/PlatformLangPlugin.xml index d42e5952043b..5a01a0c6994d 100644 --- a/platform/platform-resources/src/META-INF/PlatformLangPlugin.xml +++ b/platform/platform-resources/src/META-INF/PlatformLangPlugin.xml @@ -78,6 +78,9 @@ + + + diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/checkout/PlatformProjectCheckoutListener.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/checkout/PlatformProjectCheckoutListener.java index 21b0a9412589..41162cf60ebd 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/checkout/PlatformProjectCheckoutListener.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/checkout/PlatformProjectCheckoutListener.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2013 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. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs.checkout; import com.intellij.openapi.project.Project; diff --git a/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectCheckoutListener.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/checkout/ProjectCheckoutListener.java similarity index 65% rename from java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectCheckoutListener.java rename to platform/vcs-impl/src/com/intellij/openapi/vcs/checkout/ProjectCheckoutListener.java index 3060f271c6fa..2623c449e017 100644 --- a/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectCheckoutListener.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/checkout/ProjectCheckoutListener.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 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. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs.checkout; import com.intellij.ide.highlighter.ProjectFileType; @@ -22,10 +8,8 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vcs.VcsBundle; -import org.apache.oro.io.GlobFilenameFilter; import java.io.File; -import java.io.FilenameFilter; /** * @author yole @@ -35,7 +19,7 @@ public class ProjectCheckoutListener implements CheckoutListener { @Override public boolean processCheckedOutDirectory(Project project, File directory) { - File[] files = directory.listFiles((FilenameFilter) new GlobFilenameFilter("*" + ProjectFileType.DOT_DEFAULT_EXTENSION)); + File[] files = directory.listFiles((dir, name) -> dir.isFile() && name.endsWith(ProjectFileType.DOT_DEFAULT_EXTENSION)); if (files != null && files.length > 0) { String message = VcsBundle.message("checkout.open.project.prompt", getProductNameWithArticle(), files[0].getPath()); if (Messages.showYesNoDialog(project, message, VcsBundle.message("checkout.title"), Messages.getQuestionIcon()) == Messages.YES) { diff --git a/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java similarity index 64% rename from java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java rename to platform/vcs-impl/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java index 65ef5df2f3cc..c0df83024a99 100644 --- a/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 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. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs.checkout; import com.intellij.ide.impl.ProjectUtil; diff --git a/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectImporterCheckoutListener.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/checkout/ProjectImporterCheckoutListener.java similarity index 72% rename from java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectImporterCheckoutListener.java rename to platform/vcs-impl/src/com/intellij/openapi/vcs/checkout/ProjectImporterCheckoutListener.java index 1846bcd5a81b..874c18046936 100644 --- a/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectImporterCheckoutListener.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/checkout/ProjectImporterCheckoutListener.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2013 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. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs.checkout; import com.intellij.openapi.project.Project; diff --git a/resources/src/idea/RichPlatformPlugin.xml b/resources/src/idea/RichPlatformPlugin.xml index 5b8422c7d6b2..b9b311244644 100644 --- a/resources/src/idea/RichPlatformPlugin.xml +++ b/resources/src/idea/RichPlatformPlugin.xml @@ -281,9 +281,6 @@ - - -