Skip to content

Latest commit

 

History

History
77 lines (64 loc) · 4.29 KB

repository.adoc

File metadata and controls

77 lines (64 loc) · 4.29 KB

Repository

IDEasy supports to automatically check out and import required git repositories (with your source-code) into your IDE during project creation.

Note
Please do not mix this feature with the settings repository that contains the configuration for your IDE. Here we are talking about git repositories for development in your project that typically contain code.

To configure this you put a .properties file for each desired project into the repository sub-folder in your settings. Each .properties file describes one "project" which you would like to check out and (potentially) import:

path=myproject
workingsets=Set1,Set2
workspace=example
git_url=http://github.com/someorg/someproject
git_branch=develop
git_remote=upstream:http://github.com/someorg/someproject
build_path=.
build_cmd=mvn -DskipTests=true -Darchetype.test.skip=true clean install
link=symlink,folder/link=subfolder-in-repo
import=eclipse
active=true
Note
To clone a repository into multiple workspaces, simply provide comma-separated workspace names like workspace=main,test,feature. This will clone the repository into each specified workspace during project setup.
Table 1. Variables of repository import
Variable Value Meaning

path

e.g. myproject, will clone into ${WORKSPACE_PATH}/myproject

(required) Path into which the projects is cloned. This path is relative to the workspace.

working sets

e.g. ws1,ws2

(optional) This will create working sets (in eclipse). Each module (eclipse project) of this project will be part of all these working sets. Working sets will be automatically created if necessary.

workspace

main

Workspace(s) to use for checkout and import. Supports comma-separated values to clone the repository into multiple workspaces (e.g., main,test,feature). Default is main.

git_url

e.g. http://github.com/someorg/someproject

(required) Git URL to use for cloning the project.

git_branch

e.g. develop

(optional) Git branch to checkout. Git default branch is default.

git_remote

e.g. upstream:http://github.com/someorg/someproject

(optional) Comma separated list of name:url entries to add as additional git remotes after cloning. This allows you to configure multiple remotes (e.g., upstream and fork) for easier collaboration.

build_path

e.g. . (default)

(optional) The directory inside path where to trigger an initial build after clone or pull (if build_cmd is set). For a regular project use . to build top-level project.

build_cmd

e.g. mvn -D skip Tests=true -Darchetype.test.skip=true clean install

(optional) The IDEasy command to build the project after clone or pull. If omitted no build is triggered.

import

e.g. eclipse

(optional) Comma separated list of IDEs to import the repository into.

link

CSV of «link»[=«path»]

(optional) Comma separated list of symbolic links to link the repository into the workspace top-level folder. For a real-world use-case of this feature see AI usage.

active

true

(optional) If set to false the repository is skipped during the setup.

Variables and expressions

Every value in a repository .properties file may contain variables using the $[«VARIABLE»] syntax as well as expression functions using the @«function»(…​) syntax. They are resolved before the value is used, so they also work in properties that are validated such as path.

A typical use-case is to clone the fork of the current user instead of the upstream repository and to add the upstream as an additional remote:

path=IDEasy
git_url=https://github.com/@ask-variable("GIT_USER", "Please enter your github login:", "home", "$[USER]")/IDEasy.git
git_remote=upstream:https://github.com/devonfw/IDEasy.git
git_branch=main
import=eclipse
active=true

On the first setup the user is asked for the github login, the answer is stored as GIT_USER in ~/.ide/ide.properties (home) and reused on every following run. The default $[USER] is the login name of the current user and works on all platforms.

Note
A repository with active=false is skipped before its properties are read, so a question from @ask-variable is never asked for a repository that is not set up.