1845449_en-US

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

1845449_en-US

1845449_en-US

Pre-build steps not executing

I have a python script to aggregative GIT info like commit and branch name, in the root directory of my project.
I want the script to execute as a pre-build step.

I go to Properties -> Settings -> Build Steps ... and enter the command to run the script with the `Release_FLASH` config"

cd.. python sample.py

However, the python script does not execute.
I tried creating a .bat file with the same execution instructions, but still no luck.

What am I missing here? Is there a flag I need to set somewhere? 

Re: Pre-build steps not executing

Hi @Farnam,

Thank you for the workaround as well!

Best regards,
Julián

Re: Pre-build steps not executing

Hi @Julián_AragónM ,

Thank you!!

This may well have worked, so I'll mark it as the accepted answer.
However, I ended up doing the following work-around.

  1. Go to Properties  Builders
  2. Create a new builder, click "New..."
  3. Double click program
  4. Name the new builder
  5. Enter the location of the script
  6. Enter the working directory of the script
  7. Under refresh
    1. Select "Refresh resources upon completion."
    2. Then select "The selected resource"
  8. Select "After a "Clean"" (Optional)
  9. Select "During manual builds" (Optional)
  10. Then click "OK"
  11. Now click on the new builder and press the "Up" key until it is at the top of the list
Re: Pre-build steps not executing

Hi @Farnam,

If the file (.py or .bat) is not included inside the project and by project properties, try with the whole path to the file so it can be recognized, as such:

python "C:\User\user\Downloads\hello_world.py"

Julin_AragnM_0-1712943405922.png

I did a simple test with a hello world and it printed before finishing building:

Julin_AragnM_1-1712943413548.png

If this still does not work, try to add

cmd.exe

in front of your command line, so it launches the windows shell/command prompt.

Best regards,
Julián

标记 (1)
无评分
版本历史
最后更新:
‎11-21-2025 10:51 PM
更新人: