Skip to main content

APEX Deployment Tool - Export APEX

E

Exporting APEX should be done often if you are APEX developer. The more often you do it, the better position you will have. I export APEX every morning to see what other team mates changes (and forgot to commit). I also export it after each change. I modify the page, I export it. With this approach you need to export it fast.


This is part of multiple ADT articles:


Export APEX

The full export is not always suitable. At least exporting just full export is something not version control friendly. And exporting just the pages is also not a great idea. That is usually done manually by teams who put everything on page, which goes against the Blueprint. You should not have logic (and queries) hardcoded on pages!

So the best approach is to export everything in an automated way.

cd ~/Documents/YOUR_PROJECT_REPO/; adt export_apex -app 100
cd ~/Documents/YOUR_PROJECT_REPO/; adt export_apex -app 100 -recent 1
cd ~/Documents/YOUR_PROJECT_REPO/; adt export_apex -app 100 -split -full -files
cd ~/Documents/YOUR_PROJECT_REPO/; adt export_apex -app 100 -all


You can choose what type of exports do you need. Full export, split export (with readable versions YAML or JSON), embedded code (needed for searching and for you to be aware what you hardcoded on pages), REST services, application and workspace files. You can pick any combination you like. All exports provides you a progress bar with estimates how long it will take. All files are exported in binary formats and the encoded ones are discarded (by default).

To speed up things, you can export just the components changed in past few days and/or by specific developer. This is the way how to commit your changes just in few seconds.

The folder structure is slightly altered. The readable versions are renamed and in the same folder as pages. Files are in the APEX application root folder or in the workspace folder. The `f#` folders are named by application number and alias. You can customize a lot of these things in `config.yaml` file.

You can explore the help to see available arguments:

cd ~/Documents/YOUR_PROJECT_REPO/; adt export_apex


Live (files) upload

When you store your JS and CSS code in files, you need a mechanism how to upload it to APEX. APEX Builder improved a lot and it also minify your files, but if you want to work with several files at the same time and also adjust the pages, it is not ideal. At that point, you are better with using dedicated editor for JS and CSS files.

This live upload thingy will monitor specified folder for changes and when file change is detected, it automatically update the file to your application or workspace files. So you made a change in your JS file, Save it and before you switch to your browser the file is minified and uploaded to APEX. Super quick, no effort and you can use any editor you like.

cd ~/Documents/YOUR_PROJECT_REPO/; adt live_upload
cd ~/Documents/YOUR_PROJECT_REPO/; adt live_upload -app 100 -folder ./apex/f100/files/


Comments