Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back support for sketches with .pde extension and deprecate it #1157

Merged
merged 6 commits into from
Jan 29, 2021

Conversation

silvanocerza
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce?

This PR brings back the support for sketches ending with .pde extension.
Also we deprecate it.

  • What is the current behavior?

Trying to compile, upload, or archive a sketch with a .pde main file always fails.
Also examples' libraries with .pde extensions are not shown when calling lib examples.

  • What is the new behavior?

compile, upload, or archive a sketch with a .pde main file now works correctly and shows a warning message recommending the user to rename all .pde files .ino.
Examples' libraries with .pde extensions are now correctly shown when calling lib examples.

No.

  • Other information:

Each commit fixes a different command, it should be easier to review each commit separately.


See how to contribute

arduino/sketches/sketches.go Outdated Show resolved Hide resolved
test/test_upload.py Outdated Show resolved Hide resolved
test/test_upload.py Outdated Show resolved Hide resolved
Comment on lines 130 to +139
sketchPath := initSketchPath(path)

// .pde files are still supported but deprecated, this warning urges the user to rename them
if files := sketches.CheckForPdeFiles(sketchPath); len(files) > 0 {
feedback.Error("Sketches with .pde extension are deprecated, please rename the following files to .ino:")
for _, f := range files {
feedback.Error(f)
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This piece is duplicated in compile.go, upload.go and archive.go.
On compile.go and upload.go there is also initSketchPath() that is duplicated as well.
This makes me wonder two things:

  • in archive.go we are missing some cases because we miss an initSketchPath(...)
  • we must move everything (the current initSketchPath and the pde check) into a common function args.InitSketchParh(path) or something like that...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably something that we need to tackle in a systematic way and not in this PR or it would make it explode.

commands/sketch/archive.go Outdated Show resolved Hide resolved
@silvanocerza silvanocerza merged commit ffe44ea into master Jan 29, 2021
@silvanocerza silvanocerza deleted the scerza/pde-support branch January 29, 2021 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants