3rd-party Variable

Is there a variable {CURRENT_PROJECT_PATH} ?

from C:\work\Arduino\HelloWorld\HelloWorld.ino

I need this: *C:\work\Arduino\HelloWorld*

The FILE macro will contain the string C:\work\Arduino\HelloWorld\HelloWorld.ino. You can then use string utility functions to extract the sketch folder path from that string.

Note that this won't work as you are expecting if the sketch was modified and not saved because in that case the actual file is stored in a temporary folder.

I don't ask about source code .... about platform.txt

I need to copy a file from project folder to build folder....

OK, then you are looking for {sketch_path}.

YES :) but {sketch_path} not exist as variable...

It certainly does. For example, here you can see it's used in ATTinyCore: https://github.com/SpenceKonde/ATTinyCore/blob/master/avr/platform.txt#L89-L97

The tricky thing is that not all properties are defined for all recipes/patterns in platform.txt. To investigate this, I created a dummy hardware package which attempts to use all known properties in every recipe/pattern. You can determine where each property is and is not defined as well as how the property override system works by examining the verbose compilation output after compiling for the dummy board provided by that package: https://github.com/per1234/InoPlatformPropertiesTest

I don`t know why {sketch_path} not work for me :frowning:

I get other solution
{build.path}/build.options.json <<<< there is variable ‘sketchLocation’