diff options
author | Scott Rifenbark <srifenbark@gmail.com> | 2019-04-23 15:06:30 -0700 |
---|---|---|
committer | Scott Rifenbark <srifenbark@gmail.com> | 2019-04-23 15:06:30 -0700 |
commit | c4cabee5bacd0412ee29853a7f4d51b39b90089a (patch) | |
tree | 045678743323293b0f6292693889bd0398fe515e /docs/part-1/4-2_build-first-app-cmd.md | |
parent | 268d0f7fc3b5ef9ec4c2882c9defcd7815495603 (diff) |
XDS install and create app: New files and content.
Change-Id: I8021d3096e546bb0bb77a272dd5bcb0ea4dbf209
Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Diffstat (limited to 'docs/part-1/4-2_build-first-app-cmd.md')
-rw-r--r-- | docs/part-1/4-2_build-first-app-cmd.md | 121 |
1 files changed, 0 insertions, 121 deletions
diff --git a/docs/part-1/4-2_build-first-app-cmd.md b/docs/part-1/4-2_build-first-app-cmd.md deleted file mode 100644 index c878d08..0000000 --- a/docs/part-1/4-2_build-first-app-cmd.md +++ /dev/null @@ -1,121 +0,0 @@ -# Build using command line tool - -## Declare project - -Use XDS command line tool named [xds-cli](../part-2/3_xds-cli/0_abstract.html) to declare your -project from command line and more precisely the `projects add` command -(short option: `prj add`). - -```bash -xds-cli prj add --label="Project_helloworld-native-application" --type=pm --path=/home/seb/xds-workspace/helloworld-native-application --server-path=/home/devel/xds-workspace/helloworld-native-application -``` - -> **Note:** option `--url=http://localhost:1234` may be added to `xds-cli` in -> order to set url of `xds-agent` in case of agent is not running on default -> port (for example here, 1234) - -## Build from command line - -You need to determine which is the unique id of your project. You can find -this ID in project page of XDS dashboard or you can get it from command line -using `xds-cli` tool and `projects list` command (short: `prj ls`): - -```bash -xds-cli prj ls -ID Label LocalPath -f9904f70-d441-11e7-8c59-3c970e49ad9b Project_helloworld-service /home/seb/xds-workspace/helloworld-service -4021617e-ced0-11e7-acd2-3c970e49ad9b Project_helloworld-native-application /home/seb/xds-workspace/helloworld-native-application -``` - -XDS tools, including `xds-cli` are installed by default in `/opt/AGL/bin` -directory and this path has been added into your PATH variable. - -If it is not the case, just add it manually using `export PATH=${PATH}:/opt/AGL/bin` command line. - -Now to refer your project, just use --id option or use `XDS_PROJECT_ID` -environment variable. - -<!-- section-note --> -**Note:** - -Short id notation is also supported as soon as given id value is non ambiguous. - -For example, to refer to Project_helloworld-native-application project listed -in above command, you can simply use --id 40 instead of --id 4021617e-ced0-11e7-acd2-3c970e49ad9b -<!-- end-section-note --> - -You also need to determine the ID of the cross SDK you want to use to cross build -you application. - -To list installed SDK, use the following command: - -```bash -xds-cli sdks ls -List of installed SDKs: - ID NAME - 7aa19224-b769-3463-98b1-4c029d721766 aarch64 (3.99.1+snapshot) - 41a1efc4-8443-3fb0-afe5-8313e0c96efd corei7-64 (3.99.2+snapshot) - c226821b-b5c0-386d-94fe-19f807946d03 aarch64 (3.99.3) -``` - -You are now ready to use XDS to for example cross build your project. - -Here is an example to build a project based on CMakefile: - -```bash -# First, grab your target IP address, or it's DNS name -export TARGET_ADDRESS=<target_adress> - -# Go into your project directory and create a build directory -cd $MY_PROJECT_DIR -mkdir build - -# Generate build system using cmake -# RSYNC_* variables must be set to allow deployment/populate widgets on target (see app-template doc for more info) -xds-cli exec --id=4021617e --sdkid=c226821b -- "export RSYNC_TARGET=root@${TARGET_ADDRESS} ; export RSYNC_PREFIX=/opt ; cd build && cmake .." - -# Build the project -xds-cli exec --id=4021617e --sdkid=c226821b -- "cd build && make widget" -``` - -<!-- section-note --> -**Note:** If you use `&&`, `||` or `;` statement in the executed command line, -you need to double quote the command, for example `"cd build && make`. -<!-- end-section-note --> - -To avoid to set project id, sdks id, url, ... for each command line, you can -define these settings as environment variables within an env file and just set -`--config` option or source file before executing xds-cli command. - -Note that XDS creates a file named `xds-project.conf` (only if not already exists) -when you declare a new project using XDS Dashboard (or using `xds-cli prj add...`). -Edit this file if needed and then refer it with `--config` option. - -For example, the equivalence of above command is: - -```bash -# MY_PROJECT_DIR=/home/seb/xds-workspace/helloworld-native-application -cd $MY_PROJECT_DIR - -# Edit and potentially adapt xds-project.conf file that has been created -# automatically on project declaration using XDS Dashboard -cat xds-project.conf - # XDS project settings - export XDS_AGENT_URL=localhost:8800 - export XDS_PROJECT_ID=4021617e-ced0-11e7-acd2-3c970e49ad9b - export XDS_SDK_ID=c226821b-b5c0-386d-94fe-19f807946d03 - -# Create build directory and invoke cmake and then build project -xds-cli exec --config=./xds-project.conf -- "mkdir -p build && cd build && cmake .." -cd build && xds-cli exec --config=../xds-project.conf -- "make all" - -# Or equivalent by first sourcing conf file (avoid to set --config option) -source xds-project.conf -xds-cli exec "mkdir -p build && cd build && cmake .." -cd build && xds-cli exec "make all" -``` - -<!-- section-note --> -**Note:** all parameters after a double dash (--) are considered as the command -to execute. -<!-- end-section-note --> |