Pre-build steps not executing

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Pre-build steps not executing

ソリューションへジャンプ
1,771件の閲覧回数
Farnam
Contributor II

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? 

0 件の賞賛
返信
1 解決策
1,736件の閲覧回数
Julián_AragónM
NXP TechSupport
NXP TechSupport

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

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,737件の閲覧回数
Julián_AragónM
NXP TechSupport
NXP TechSupport

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

0 件の賞賛
返信
1,693件の閲覧回数
Farnam
Contributor II

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
1,681件の閲覧回数
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Farnam,

Thank you for the workaround as well!

Best regards,
Julián

0 件の賞賛
返信