alias java17 = "export JAVA_HOME=`/usr/libexec/java_home -v 17`; java -version"
alias java19 = "export JAVA_HOME=`/usr/libexec/java_home -v 19`; java -version"
alias java20 = "export JAVA_HOME=`/usr/libexec/java_home -v 20`; java -version"
Development Environment
The development environment is MacOS [1].
Java JDKs
Install Java development kits. You should at least install the last released version and the last LTS version. We use the distributions of Oracle.
Tools
IntelliJ IDEA
All development activities are performed with IntelliJ IDEA IDE.
The following plugins shall be installed
-
Antlr
-
Grazie Professional
-
SonarLint
-
Statistics
Git and ssh keys
You can generate an SSH key with the following commands
ssh-keygen -t ed25519 -C "marcel.baumann@tangly.net" (1)
1 | Replace with your email address you are registered with in your GitHub or GitLab account. |
The config file stored in your ~/.ssh directory to select the key accordingly to the host.
Host bitbucket.org
HostName bitbucket.org
IdentityFile ~/.ssh/marcel-baumann-tangly (1)
Host github.com
HostName github.com
IdentityFile ~/.ssh/marcel-baumann-tangly (1)
Host gitlab.com
Hostname gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/marcel-baumann-tangly (1)
Host gitlab.switch.ch
HostName gitlab.switch.ch
IdentityFile ~/.ssh/marcel-baumann-hslu (1)
1 | Replace with the name of the file containing your ssh key. |
git config --global user.name "marcelbaumann"
git config --global user.email "marcel.baumann@tangly.net"
Static website
Install the following additional packages for asciidoctor to work without errors.
gem install asciidoctor-diagram
gem install asciidoctor-bibtex
gem install rouge
Tricks
Backup of Local Development Artifacts
Local Git repositories cannot be stored on a local cloud drive. You will get repository corruptions due to the way the could drive performs synchronization.
It would be nice to have a way to back up local changes to the cloud to avoid losses. Please, do not use your remote git repository as a backup medium.
The following approach works nicely for us:
-
create a bare git repository on a local cloud drive.
-
add a remote to your project to store changes into the local bare repository.
-
now you can just commit and push changes to your git backup repository.
-
once you have completed a feature, push the changes as usual to your regular remote git repository.
git init -bare (1)
git add remote backup /Volumes/GoogleDrive/My Drive/tangly/08-Data/git/tangly-os.git (2)
git push backup master (3)
1 | Create a bare repository |
2 | Add a remote for the backup repository to the tangly-os project |
3 | Pushes the changes to the backup repository. The cloud folder will be replicated to the cloud for backup. |
npm Troubles
-
Do not use sudo when installing node or npm.
-
Delete ~/.npm to enable updates if you once used sudo to install extensions for node.