From e5c4f7134dbdb8ff76f48b4965547094b86aa408 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 6 Dec 2023 14:01:21 +0700 Subject: [PATCH] feat(developer): kmc emit hint if project file is old version Fixes #10147. --- developer/src/kmc/src/commands/buildClasses/BuildProject.ts | 5 +++++ developer/src/kmc/src/messages/infrastructureMessages.ts | 4 ++++ developer/src/kmc/test/test-project-build.ts | 1 + 3 files changed, 10 insertions(+) diff --git a/developer/src/kmc/src/commands/buildClasses/BuildProject.ts b/developer/src/kmc/src/commands/buildClasses/BuildProject.ts index 5cbd3da80ee..38dd2ae6da2 100644 --- a/developer/src/kmc/src/commands/buildClasses/BuildProject.ts +++ b/developer/src/kmc/src/commands/buildClasses/BuildProject.ts @@ -41,6 +41,11 @@ class ProjectBuilder { return false; } + // Give a hint if the project is v1.0 + if(this.project.options.version != '2.0') { + this.callbacks.reportMessage(InfrastructureMessages.Hint_ProjectIsVersion10()); + } + // Go through the various file types and build them for(let builder of buildActivities) { if(builder.sourceExtension == KeymanFileTypes.Source.Project) { diff --git a/developer/src/kmc/src/messages/infrastructureMessages.ts b/developer/src/kmc/src/messages/infrastructureMessages.ts index 50334a6fd64..18c88cf5c37 100644 --- a/developer/src/kmc/src/messages/infrastructureMessages.ts +++ b/developer/src/kmc/src/messages/infrastructureMessages.ts @@ -87,5 +87,9 @@ export class InfrastructureMessages { static Error_UnsupportedProjectVersion = (o:{version:string}) => m(this.ERROR_UnsupportedProjectVersion, `Project version ${o.version} is not supported by this version of Keyman Developer.`); static ERROR_UnsupportedProjectVersion = SevError | 0x0013; + + static Hint_ProjectIsVersion10 = () => m(this.HINT_ProjectIsVersion10, + `The project file is an older version and can be upgraded to version 17.0`); + static HINT_ProjectIsVersion10 = SevHint | 0x0014; } diff --git a/developer/src/kmc/test/test-project-build.ts b/developer/src/kmc/test/test-project-build.ts index 88563168805..c7e1c82bf58 100644 --- a/developer/src/kmc/test/test-project-build.ts +++ b/developer/src/kmc/test/test-project-build.ts @@ -19,6 +19,7 @@ describe('BuildProject', function () { logLevel: 'info', }); const messages = [ + InfrastructureMessages.HINT_ProjectIsVersion10, InfrastructureMessages.INFO_BuildingFile, // kmn InfrastructureMessages.INFO_FileBuiltSuccessfully, InfrastructureMessages.INFO_BuildingFile, // kps