Merge "Enable installing nimble siblings"

This commit is contained in:
Zuul 2021-01-13 07:13:30 +00:00 committed by Gerrit Code Review
commit 6f6e244cf0
8 changed files with 50 additions and 2 deletions

View File

@ -10,7 +10,22 @@ Run nimble command in a source directory. Assumes the appropriate version of nim
.. zuul:rolevar:: nim_path .. zuul:rolevar:: nim_path
Path where nim and nimble are installed. Path to a directory where nim and nimble are installed.
.. zuul:rolevar:: nimble_use_siblings
:type: bool
:default: true
Whether to configure nimble to build with siblings or not.
.. zuul:rolevar:: nimble_siblings
:type: list
List of paths to directories containing nim projects to
configure nimble with ``nimble develop``. The projects
have to be managed by nimble and contain a ``.nimble``
file. By default this role will try to configure any
repos made available with ``job.required-projects``.
.. zuul:rolevar:: zuul_work_dir .. zuul:rolevar:: zuul_work_dir
:default: {{ zuul.project.src_dir }} :default: {{ zuul.project.src_dir }}

View File

@ -1,2 +1,5 @@
nimble_command: build nimble_command: build
nimble_use_siblings: true
nimble_siblings: "{{ zuul.projects.values() | selectattr('required') | map(attribute='src_dir') | list }}"
zuul_work_dir: "{{ zuul.project.src_dir }}" zuul_work_dir: "{{ zuul.project.src_dir }}"

View File

@ -1,3 +1,14 @@
- name: Configure siblings
when: nimble_use_siblings
command: nimble develop
environment:
PATH: "{{ nim_path }}:{{ ansible_env.PATH }}"
args:
chdir: "{{ zj_nimble_siblings }}"
loop: "{{ nimble_siblings }}"
loop_control:
loop_var: zj_nimble_siblings
- name: Run nimble - name: Run nimble
command: "nimble {{ nimble_command }} --accept" command: "nimble {{ nimble_command }} --accept"
args: args:

View File

@ -0,0 +1,12 @@
# Package
version = "0.1.0"
author = "Albin Vass"
description = "A new awesome nimble package"
license = "MIT"
srcDir = "src"
# Dependencies
requires "nim >= 1.4.2"

View File

@ -0,0 +1,2 @@
proc helloWorld*() =
echo "Hello world!"

View File

@ -1 +1,3 @@
echo "Hello world!" import sibling
helloWorld()

View File

@ -11,3 +11,4 @@ bin = @["test"]
# Dependencies # Dependencies
requires "nim >= 1.4.0" requires "nim >= 1.4.0"
requires "sibling"

View File

@ -10,6 +10,8 @@
- test-playbooks/nimble - test-playbooks/nimble
vars: vars:
zuul_work_dir: '{{ zuul.project.src_dir }}/test-playbooks/nimble' zuul_work_dir: '{{ zuul.project.src_dir }}/test-playbooks/nimble'
nimble_siblings:
- '{{ zuul.project.src_dir }}/test-playbooks/nimble/sibling'
- job: - job:
name: zuul-jobs-test-nimble-centos-7 name: zuul-jobs-test-nimble-centos-7