From 8ddf7a5d20ac2e7d8e7901767e798468d26c80c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Aug 2023 18:39:04 +0000 Subject: [PATCH 1/7] (maint): Bump org.gradle.toolchains.foojay-resolver-convention Bumps org.gradle.toolchains.foojay-resolver-convention from 0.6.0 to 0.7.0. --- updated-dependencies: - dependency-name: org.gradle.toolchains.foojay-resolver-convention dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- src/rider/settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rider/settings.gradle.kts b/src/rider/settings.gradle.kts index 5cfd3cc4..cb48ef33 100644 --- a/src/rider/settings.gradle.kts +++ b/src/rider/settings.gradle.kts @@ -18,7 +18,7 @@ pluginManagement { } plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version "0.6.0" + id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0" } rootProject.name = "cake-rider" From c0b2678198302b5699325c2d605f51038980a843 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 18:32:55 +0000 Subject: [PATCH 2/7] (maint): Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a5a664d..44c8db4d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,7 @@ jobs: steps: - name: Checkout the requested branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Fetch all tags and branches run: git fetch --prune --unshallow From f33bdd032efc487a886b22333deeeab8231427c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 18:11:14 +0000 Subject: [PATCH 3/7] (maint): Bump org.jetbrains.grammarkit in /src/rider Bumps org.jetbrains.grammarkit from 2022.3.1 to 2022.3.2. --- updated-dependencies: - dependency-name: org.jetbrains.grammarkit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/rider/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rider/build.gradle.kts b/src/rider/build.gradle.kts index ef202f65..04bb7f54 100644 --- a/src/rider/build.gradle.kts +++ b/src/rider/build.gradle.kts @@ -20,7 +20,7 @@ plugins { // ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle id("org.jlleitschuh.gradle.ktlint") version "11.5.1" // grammarkit to generate parser & lexer (i.e. the bnf and the flex file...) - id("org.jetbrains.grammarkit") version "2022.3.1" + id("org.jetbrains.grammarkit") version "2022.3.2" } val jvmVersion = "17" From cfa025966c999e07e638b26ccb151251f736ff93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 18:56:02 +0000 Subject: [PATCH 4/7] (maint): Bump org.jlleitschuh.gradle.ktlint in /src/rider Bumps org.jlleitschuh.gradle.ktlint from 11.5.1 to 11.6.0. --- updated-dependencies: - dependency-name: org.jlleitschuh.gradle.ktlint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- src/rider/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rider/build.gradle.kts b/src/rider/build.gradle.kts index 04bb7f54..2cf2259a 100644 --- a/src/rider/build.gradle.kts +++ b/src/rider/build.gradle.kts @@ -18,7 +18,7 @@ plugins { // detekt linter - read more: https://detekt.github.io/detekt/gradle.html id("io.gitlab.arturbosch.detekt") version "1.23.1" // ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle - id("org.jlleitschuh.gradle.ktlint") version "11.5.1" + id("org.jlleitschuh.gradle.ktlint") version "11.6.0" // grammarkit to generate parser & lexer (i.e. the bnf and the flex file...) id("org.jetbrains.grammarkit") version "2022.3.2" } From 66ad7665a157e37cf86cfc61858cdc33db072291 Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Wed, 27 Sep 2023 21:15:55 +0200 Subject: [PATCH 5/7] (#371) bump rider platform to 233 --- src/rider/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rider/gradle.properties b/src/rider/gradle.properties index 068e65a0..71bf45d5 100644 --- a/src/rider/gradle.properties +++ b/src/rider/gradle.properties @@ -5,7 +5,7 @@ pluginGroup = net.cakebuild pluginName = cake-rider pluginVersion = 0.1.0-alpha.1 pluginSinceBuild = 232 -pluginUntilBuild = 232.* +pluginUntilBuild = 233.* # Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl # See https://jb.gg/intellij-platform-builds-list for available build versions. # or https://data.services.jetbrains.com/products?fields=name,releases.downloads,releases.version,releases.build,releases.type&code=RD From 929b35ef4f67f74674d1b3a9ebe1c0468c8a4324 Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Fri, 1 Sep 2023 23:52:23 +0200 Subject: [PATCH 6/7] (#365) skip multiple Cake.Frosting tasks of the same name --- .../cake-rider/CakeFrostingProjectsHost.cs | 86 ++++++++++++------- 1 file changed, 55 insertions(+), 31 deletions(-) diff --git a/src/dotnet/cake-rider/CakeFrostingProjectsHost.cs b/src/dotnet/cake-rider/CakeFrostingProjectsHost.cs index 5899941d..b33bb1d4 100644 --- a/src/dotnet/cake-rider/CakeFrostingProjectsHost.cs +++ b/src/dotnet/cake-rider/CakeFrostingProjectsHost.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; @@ -70,10 +71,9 @@ public CakeFrostingProjectsHost( public void Refresh(IProjectMark projectMark) { + _logger.Trace($"Handle change for project: {projectMark.Location}"); using (_solution.Locks.UsingReadLock()) { - _logger.Trace("Handle change for project: {0}", projectMark.Location); - // Do not dispose IProject! #pragma warning disable IDISP001 var projectByMark = _solution.GetProjectByMark(projectMark); @@ -124,23 +124,25 @@ public void ProcessTasks(ICSharpFile file, IDocument document) foreach (var classDeclaration in classDeclarations) { var declaredElement = classDeclaration.DeclaredElement; - if (declaredElement != null) + if (declaredElement == null) { - if (!declaredElement.IsCakeFrostingTask()) - { - continue; - } + continue; + } - var name = declaredElement.GetCakeFrostingTaskName(); + if (!declaredElement.IsCakeFrostingTask()) + { + continue; + } - if (!cakeFrostingProject.Tasks.Contains(name)) - { - toAdd.Add(name); - } + var name = declaredElement.GetCakeFrostingTaskName(); - currentFileTasks.Add(name); - newTasks.Add(name); + if (!cakeFrostingProject.Tasks.Contains(name)) + { + toAdd.Add(name); } + + currentFileTasks.Add(name); + newTasks.Add(name); } foreach (var currentFileTask in currentFileTasks) @@ -174,6 +176,7 @@ private void ProjectRemoved(IProjectMark projectMark) { if (_cakeFrostingProjects.TryGetValue(projectMark, out var cakeFrostingProject) && _isSolutionLoaded) { + _logger.Trace($"removing project {projectMark.Name} from loaded tasks"); _model.Projects.Remove(cakeFrostingProject); _cakeFrostingProjects.Remove(projectMark); _cakeFrostingTasks.Remove(projectMark); @@ -191,6 +194,7 @@ private void ProjectAdded(IProject project) return; } + _logger.Trace($"Project {projectMark.Name} was added."); var cakeFrostingProject = new CakeFrostingProject(); cakeFrostingProject.Name.Set(project.Name); cakeFrostingProject.ProjectFilePath.Set( @@ -198,38 +202,58 @@ private void ProjectAdded(IProject project) _model.Projects.Add(cakeFrostingProject); _cakeFrostingProjects.Add(projectMark, cakeFrostingProject); _cakeFrostingTasks.Add(projectMark, new Dictionary>()); + LoadTasksForProject(projectMark, cakeFrostingProject); } - private void LoadAllTasks() + private void LoadTasksForProject(IProjectMark projectMark, CakeFrostingProject cakeFrostingProject) { - foreach ((IProjectMark projectMark, CakeFrostingProject cakeFrostingProject) in _cakeFrostingProjects) + _logger.Trace($"loading all tasks of project:{cakeFrostingProject.Name}"); + foreach (var psiModule in _solution.GetProjectByMark(projectMark)!.GetPsiModules()) { - var fileTaskMap = _cakeFrostingTasks[projectMark]; - - foreach (var psiModule in _solution.GetProjectByMark(projectMark)!.GetPsiModules()) + _logger.Trace($"walking psiModule:{psiModule.Name}"); + using (CompilationContextCookie.OverrideOrCreate(psiModule.GetContextFromModule())) { - using (CompilationContextCookie.OverrideOrCreate(psiModule.GetContextFromModule())) + foreach (var sourceFile in psiModule.SourceFiles) { - foreach (var sourceFile in psiModule.SourceFiles) + _logger.Trace($"walking file:{sourceFile.Name}"); + foreach (var klass in _symbolCache.GetTypesAndNamespacesInFile(sourceFile).OfType()) { - var tasks = fileTaskMap[sourceFile] = new HashSet(); + _logger.Trace($"walking class:{klass.ShortName}"); + Interruption.Current.CheckAndThrow(); + + if (!klass.IsCakeFrostingTask()) + { + _logger.Trace($"{klass.ShortName} is not a Cake.Frosting task"); + continue; + } - foreach (var klass in _symbolCache.GetTypesAndNamespacesInFile(sourceFile).OfType()) + var name = klass.GetCakeFrostingTaskName(); + if (cakeFrostingProject.Tasks.Any(x => + x.Equals(name, StringComparison.OrdinalIgnoreCase))) { - Interruption.Current.CheckAndThrow(); - - if (klass.IsCakeFrostingTask()) - { - var name = klass.GetCakeFrostingTaskName(); - cakeFrostingProject.Tasks.Add(name); - tasks.Add(name); - } + // if the task was already registered, it's either an error, + // or the task was defined twice in partials (in Cake Frosting) + // either way, we can ignore it. + _logger.Trace($"Task '{name}' already added. skipping it here."); + continue; } + + _logger.Trace($"Adding Task '{name}'."); + cakeFrostingProject.Tasks.Add(name); } } } } } + + private void LoadAllTasks() + { + _logger.Trace("Intially loading all Cake.Frosting tasks"); + foreach ((IProjectMark projectMark, CakeFrostingProject cakeFrostingProject) in _cakeFrostingProjects) + { + LoadTasksForProject(projectMark, cakeFrostingProject); + } + } } public interface IDetectFrostingModules From 85013880d2a3d532df64fab24a05cdf322043f9b Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Sat, 2 Sep 2023 01:13:47 +0200 Subject: [PATCH 7/7] (#365) skip multiple Cake scripting tasks of the same name --- .../kotlin/net/cakebuild/toolwindow/CakeTasksWindow.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rider/src/main/kotlin/net/cakebuild/toolwindow/CakeTasksWindow.kt b/src/rider/src/main/kotlin/net/cakebuild/toolwindow/CakeTasksWindow.kt index 159b0662..589d44b4 100644 --- a/src/rider/src/main/kotlin/net/cakebuild/toolwindow/CakeTasksWindow.kt +++ b/src/rider/src/main/kotlin/net/cakebuild/toolwindow/CakeTasksWindow.kt @@ -175,9 +175,17 @@ class CakeTasksWindow(private val project: Project) : SimpleToolWindowPanel(true val cakeProject = CakeScriptProject(project) for (cakeFile in cakeProject.getCakeFiles()) { val fileNode = DefaultMutableTreeNode(cakeFile) + val children = mutableListOf() rootNode.add(fileNode) for (task in cakeFile.getTasks()) { + if (children.contains(task.name)) { + // this is an error and won't compile. + // we simply skip it. + continue + } + + children.add(task.name) val taskNode = DefaultMutableTreeNode(task) fileNode.add(taskNode) }