Custom build not optimal

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Custom build not optimal

#1 Post by Micha_he » 14 Feb 2023, 14:35

Regarding this procedure/tip: https://www.letscontrolit.com/forum/vie ... 962#p62962, I've a new problem.

My Micha_he/espeasy-repository is autopull with espeasy original. If I change the 'define_plugin_sets.h' for my own build, this change prevents synchronization from my repository with the espeasy original. If I commit it, my repository has an additional change, because this file isn't ignored.

Is there another, better working tip for 2-3 own builds with minimal difference to predefined ones ?

Maybe someone like Userbuild1-10, based on a predefined set X, with +/- plugin/controller X, with additional config X. This file should be ignore by GIT and now I could compile my Userbuild X after pulled all new commits.

TD-er
Core team member
Posts: 8644
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Custom build not optimal

#2 Post by TD-er » 14 Feb 2023, 14:44

You can define your own build in the Custom.h file.
This one will be ignored by Git.
There is a sample version included to get you started.

If there is a file called Custom.h (mind the capital C) in the same folder where the Custom_sample.h file is located, then PlatformIO will use that file when building any PlatformIO environment with "Custom" in the name.

Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: Custom build not optimal

#3 Post by Micha_he » 14 Feb 2023, 14:59

But I can't define three different custom sets! Or is this possible?
And all changes I've done in the custom.h, are applied to all custom builds. Or?

User avatar
Ath
Normal user
Posts: 3419
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Custom build not optimal

#4 Post by Ath » 14 Feb 2023, 15:02

When working with Arduino IDE, you will need to have a #define USE_CUSTOM_H or -DUSE_CUSTOM_H so the compiler will use the Custom.h file.

You can rename them, temporarily, but you'll have to not add them in your git commit, as they won't be ignored then.
For maximum control I never enable auto-pull, and never use "Add all", or similar options, before committing.
/Ton (PayPal.me)

Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: Custom build not optimal

#5 Post by Micha_he » 14 Feb 2023, 15:20

Thats all too much for me.

I use:

ESPEasy/mega --(auto-pull with bot)--> Micha_he/mega --(manual pull)--> VSCode with GIT --> lokalFolder/mega

and sometimes back for simple code-pull-request to ESPEasy. Mostly sync your changes :-)

Local VSCode and folder for some (3-4) custom builds.

User avatar
Ath
Normal user
Posts: 3419
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Custom build not optimal

#6 Post by Ath » 14 Feb 2023, 15:37

Files that only exist in your local folder, and never added to the repository, do not cause conflicts, except when someone would add a file with the same name. For these Custom-XYZ.h files, that chance is really small, so you can just keep them local, and rename (or copy to Custom.h) as desired. Only the Custom builds will use that Custom.h file.

When choosing to have Custom-1.h .. Custom-10.h, you would also need matching Custom-N PIO environments, and that would become very complicated.

You could also add script(s) to easily switch (copy) a Custom-X.h to Custom.h and run the appropriate PIO command for a build, to make life somewhat more automated :D
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 26 guests