Read this if you dont know what b4x_cba is;
The latest version of b4x_cba introduces an action to push your project code to GitHub.
To get started you will need to
1. Get b4x_cba installed.
2. Create a repository on GitHub
3. Generate an API key (personal access token) on GitHub - I use a classic token
For more on GitHub access tokens see;
In your B4X project add your github config to your project attributes section. The below is from a B4J project. You only need to add; github_repository_owner, github_repository_name and github_branch (see example below)
To call the action you can use an IDE link such as this;
Or if you wish to push everytime you make a Release build
When the action is called for the first time you will be prompted for your API key. The API key is saved in same location as b4x_cba.exe in a file named "github_api_key.txt"
Notes on behaviour;
1. A .gitignore file will be created in the project folder. This will exclude folders like the Objects folder and the .meta file.
2. A .gitattributes file will be created in the project folder. This tells GitHub that your project is a B4X project (this uses @aerics format)
3. The repo must exist - you can do this on the GitHub website
4. The branch must exist - you can do this on the GitHub website
5. Only new or updated files will be uploaded
6. If there is a file on GitHub that is not in your project it will be deleted from GitHub (these are assumed to be orphans that have been removed from your project)
7. Local files are never deleted
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
The latest version of b4x_cba introduces an action to push your project code to GitHub.
To get started you will need to
1. Get b4x_cba installed.
2. Create a repository on GitHub
3. Generate an API key (personal access token) on GitHub - I use a classic token
For more on GitHub access tokens see;
Managing your personal access tokens - GitHub Docs
You can use a personal access token in place of a password when authenticating to GitHub in the command line or with the API.
docs.github.com
Authenticating to the REST API - GitHub Docs
You can authenticate to the REST API to access more endpoints and have a higher rate limit.
docs.github.com
In your B4X project add your github config to your project attributes section. The below is from a B4J project. You only need to add; github_repository_owner, github_repository_name and github_branch (see example below)
B4X:
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
'###################################################################################
' GitHub Config for b4x_cba.exe
' You will be prompted for API key on first run
' API key is stored in same location as b4x_cba.exe
' .gitignore & .gitattribute files will automatically be created in project folder
'###################################################################################
'github_repository_owner=githubusername
'github_repository_name=RepoName
'github_branch=main
To call the action you can use an IDE link such as this;
B4X:
' Ctrl + click to push to GitHub: ide://run?File=b4x_cba.exe&Args=-action&Args=githubpush
Or if you wish to push everytime you make a Release build
B4X:
#CustomBuildAction: 2, b4x_cba.exe, -action githubpush
When the action is called for the first time you will be prompted for your API key. The API key is saved in same location as b4x_cba.exe in a file named "github_api_key.txt"
Notes on behaviour;
1. A .gitignore file will be created in the project folder. This will exclude folders like the Objects folder and the .meta file.
2. A .gitattributes file will be created in the project folder. This tells GitHub that your project is a B4X project (this uses @aerics format)
3. The repo must exist - you can do this on the GitHub website
4. The branch must exist - you can do this on the GitHub website
5. Only new or updated files will be uploaded
6. If there is a file on GitHub that is not in your project it will be deleted from GitHub (these are assumed to be orphans that have been removed from your project)
7. Local files are never deleted
Last edited: