Skip to content

Commit

Permalink
feat(developer): kmc emit hint if project file is old version
Browse files Browse the repository at this point in the history
Fixes #10147.
  • Loading branch information
mcdurdin committed Dec 6, 2023
1 parent 4c7b799 commit e5c4f71
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions developer/src/kmc/src/commands/buildClasses/BuildProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions developer/src/kmc/src/messages/infrastructureMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

1 change: 1 addition & 0 deletions developer/src/kmc/test/test-project-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e5c4f71

Please sign in to comment.