platformio / platformio-core

Your Gateway to Embedded Software Development Excellence :alien:
https://platformio.org
Apache License 2.0
7.85k stars 789 forks source link

`pio project init --ide qtcreator` does not include test or lib files #4635

Closed j4m3s closed 7 months ago

j4m3s commented 1 year ago

What kind of issue is this?


Configuration

Operating system: Ubuntu 20.04

PlatformIO Version (platformio --version): PlatformIO Core, version 6.1.7

Description of problem

When initialising a project for qtcreator, only the contents of src are added to the platformio.files file. This means that the files in test and lib must be added manually in the IDE in order to be able to see & edit them. That's not the end of the world, but each time platformio.ini is changed, the project must be re-init'd to update the qtcreator metadata and it gets frustrating having to re-add the files each time.

Steps to Reproduce

  1. pio project init --ide qtcreator
  2. Open the project in QtCreator

Actual Results

Only the files in src are visible (though the files in lib are present in platformio.includes so autcomplete works fine.

Expected Results

The files in liband test should also be added.

Additional info

Shared code is put in lib as-per the best practice detailed in the unit testing docs - and the tests are obviously put in test :)

I believe the fix is straightforward: a modification to platformio.files.tpl to iterate and add the contents of the lib and test directories?

ivankravets commented 7 months ago

I can't reproduce this issue:

$ pio project init -d aaa --ide qtcreator -b uno
The following files/directories have been created in /private/tmp/aaa
include - Put project header files here
lib - Put project specific (private) libraries here
src - Put project source files here
platformio.ini - Project Configuration File
Resolving uno dependencies...
Already up-to-date.
Updating metadata for the qtcreator IDE...