Some of you may have seen my b4x_cba (B4X Custom Build Action) tool here;
Over the holidays, I implemented a new action to push B4X project files to a GitHub repo using an ide link or custom build action.
This is all part of b4x_cba and doesn't require any git CLI/UI etc.
More about this;
1. No, it's not git
2. It uses the GitHub REST API
3. It uses an API key (not username/login or ssh)
4. The repo and branch need to exist - you can do that in GitHub
5. It pushes only, it doesn't offer merging etc - you can do that in GitHub
6. It only pushes new or changed files
My question (before I release this) is;
Should the GitHub config (repo, branch etc) be stored in the project file (ie in Main) or a separate file in the project folder?
It currently uses config in Main as per below sample. I think this is more convenient, but some people may not like having these details in the project.
NOTE the API key is not stored with the config, it is stored in the B4X install folder (this is to avoid the key being accidentally uploaded).
Small update, after reading some posts by @aeric I have moved the ignore files/folder to a .gitignore file and also created a .gitattribute file (thanks @aeric ). These files will be auto-created in the project directory the first time the push tool is run. You can adjust these after if necessary.
With a .gitattribute file GitHub will correctly interpret your code as B4X
b4x_cba (B4X Custom Build Action)
Ever since Erel introduced custom build actions I have used a collection of batch files to do certain things when I do a release build eg copy the jar to another folder, compile only etc. I've finally decided to combine these into a single console application (in C#) instead of a bunch of messy...
www.b4x.com
Over the holidays, I implemented a new action to push B4X project files to a GitHub repo using an ide link or custom build action.
This is all part of b4x_cba and doesn't require any git CLI/UI etc.
More about this;
1. No, it's not git
2. It uses the GitHub REST API
3. It uses an API key (not username/login or ssh)
4. The repo and branch need to exist - you can do that in GitHub
5. It pushes only, it doesn't offer merging etc - you can do that in GitHub
6. It only pushes new or changed files
My question (before I release this) is;
Should the GitHub config (repo, branch etc) be stored in the project file (ie in Main) or a separate file in the project folder?
It currently uses config in Main as per below sample. I think this is more convenient, but some people may not like having these details in the project.
NOTE the API key is not stored with the config, it is stored in the B4X install folder (this is to avoid the key being accidentally uploaded).
Small update, after reading some posts by @aeric I have moved the ignore files/folder to a .gitignore file and also created a .gitattribute file (thanks @aeric ). These files will be auto-created in the project directory the first time the push tool is run. You can adjust these after if necessary.
With a .gitattribute file GitHub will correctly interpret your code as B4X
Last edited: