summaryrefslogtreecommitdiffstats
path: root/meta-app-framework/classes/agl-app.bbclass
blob: 491a36e02cf2cb48b4c286642827c16c999978bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#
# AGL application systemd unit installation class
#

# Systemd template unit
# * agl-app, agl-app-web, agl-app-flutter valid
AGL_APP_TEMPLATE ?= "agl-app"

# Application ID
# This is what the application will be referred to in the list
# exposed to clients by applaunchd, and generally ends up as the
# identifier used by agl-compositor for application surface
# activation.
AGL_APP_ID ?= "${BPN}"

# Application display name
AGL_APP_NAME ?= "${AGL_APP_ID}"

# Application executable
# * agl-app template only
# Use if the application ID and the executable name are both
# different from the package name and each other as well.
AGL_APP_EXEC ?= "${AGL_APP_ID}"

# Web application bundle directory (non-absolute, so directory
# name under /usr/lib/wam_apps)
# * agl-app-web template only
# Use if the web application bundle installs to a directory that
# is not the same as the package name.
AGL_APP_WAM_DIR ?= "${BPN}"

do_install:append () {
    install -d ${D}${systemd_system_unitdir}
    ln -s ${AGL_APP_TEMPLATE}\@.service \
        ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service

    # NOTE: Unit & Service changes could potentially be collected
    #       and a single override .conf created, but things will be
    #       kept simple for now.

    if [ "${AGL_APP_EXEC}" != "${AGL_APP_ID}" ]; then
        install -d ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d
        cat <<-EOF > ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d/exec.conf
	[Service]
	ExecStart=
	ExecStart=${AGL_APP_EXEC}
	EOF
    fi

    if [ "${AGL_APP_NAME}" != "${AGL_APP_ID}" ]; then
        install -d ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d
        cat <<-EOF > ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d/name.conf
	[Unit]
	Description=
	Description=${AGL_APP_NAME}
	EOF
    fi

    if [ "${AGL_APP_TEMPLATE}" = "agl-app-web" -a "${AGL_APP_ID}" != "${BPN}" ]; then
        # The application ID does not necessarily match the package name
        # used in the WAM install hierarchy, and the IDs are hard-coded in
        # some of the web apps, so if necessary create an override for the
        # environment variable used in place of directly deriving from %i
        # (which will always be the app id).
        install -d ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d
        cat <<-EOF > ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d/wam.conf
	[Service]
	Environment=AGL_APP_WAM_DIR=${AGL_APP_WAM_DIR}
	EOF
    fi

    if [ "${AGL_APP_TEMPLATE}" = "agl-app-flutter" ]; then
       # Install icon if present
       if [ -f ${S}/package/${AGL_APP_ID}.svg ]; then
          install -d ${D}${datadir}/icons/hicolor/scalable
          install -m 0644 ${S}/package/${AGL_APP_ID}.svg ${D}${datadir}/icons/hicolor/scalable/
       fi
   fi
}

FILES:${PN}:append = " ${systemd_system_unitdir} ${datadir}/icons"

RDEPENDS:${PN}:append = " applaunchd-template-${AGL_APP_TEMPLATE}"
r: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }

agl-docs (master)

Revamping and restructuring Automotive Grade Linux's documentation site under GSoD'20.

The documentation gerrit repository contains AGL documentation website template and content, rendering is visible at https://docs.automotivelinux.org/en/master/. The documentation site is hosted on readthedocs and corresponding builds are mentioned here.

Download Repository

Kindly check this and clone with commit-msg hook :

$ git clone "ssh://$USER@gerrit.automotivelinux.org:29418/AGL/documentation" && scp -p -P 29418 $USER@gerrit.automotivelinux.org:hooks/commit-msg "documentation/.git/hooks/"

Building a local site

  1. Change into the directory

    sh $ cd documentation

  2. Install MkDocs and rtd-dropdown theme

    sh $ pip install -r requirements.txt

Missing packages will be installed for the current user, in particular, scripts will be installed to $HOME/.local/bin. Ensure $HOME/.local/bin is in your PATH to be able to run mkdocs command.

  1. Serve locally (defaultly rendered at 127.0.0.1:8000/):

    sh $ mkdocs serve

Process to add new or edit existing markdown files to AGL documentation:

Directory Structure

Find existing or add new markdowns in the following directory structure.

documentation
├── docs
│   ├── 0_Getting_Started
│   │   ├── 1_Quickstart
│   │   └── 2_Building_AGL_Image
|   ├── .....
|   |
|   ├──<Chapter-Number>_<Chapter-Name>
|   |   ├──<Subchapter-Number>_<Subchapter-Name>
|   |   |   ├──<Index-Number>_<Markdown-Title>.md
|   |   |   ├── .....

Markdown Formatting

  1. Add following at the start of each markdown :

    ```sh

    title:

    ```

  2. Internal Linking :

    sh [<enter-title>](../<Chapter-Number>_<Chapter-Name>/<Subchapter-Number>_<Subchapter-Name>/<Index-Number>_<Markdown-Title>.md)

LinkChecker is a tool that allows to check all the hyperlinks in the site.

For testing hyperlinks as soon as the local site is running, do:

linkchecker http://localhost:8000

The linkchecker output will display the broken link and there location in the site.

Submitting changes

  1. Install Git Review

    ```sh

    recent version of git-review  (>=1.28.0 is required)

    sudo pip3 install git-review  ```

  2. Write commit message

    ```sh

    track all the new changes

    git add .

    Write the commit message

    git commit --signoff ```

  3. Push changes for review to Gerrit

    ```sh

    first time only

    git review -s

    then to push use

    git review ```