Skip to content

Commit

Permalink
simply down to 1 manifest; add proj group
Browse files Browse the repository at this point in the history
  • Loading branch information
kbroch-rivosinc committed Nov 6, 2024
1 parent 747ec77 commit 607bbc2
Show file tree
Hide file tree
Showing 22 changed files with 368 additions and 749 deletions.
1 change: 0 additions & 1 deletion _common.xml

This file was deleted.

1 change: 0 additions & 1 deletion all-rvi-orgs.xml

This file was deleted.

2 changes: 1 addition & 1 deletion default.xml
11 changes: 3 additions & 8 deletions projects/rvi-repo-manifest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,24 @@ ORGS := \

TOOL := ./generate-manifests.sh
BUILD_DIR := generated
ALL_ORGS_XML := all-rvi-orgs.xml
ALL_ORGS_XML := default.xml

ORGS_XML := $(addsuffix .xml, $(ORGS))

.PHONY: build-xml build-all-rvi-orgs-xml

default: build-xml $(ALL_ORGS_XML)
all: $(ALL_ORGS_XML)

build-xml:
$(MAKE) $(ORGS_XML)

all-orgs-xml:
$(ALL_ORGS_XML):
$(TOOL) $(BUILD_DIR)/$(ALL_ORGS_XML) $(ORGS)
cp _common.xml $(BUILD_DIR)/.

%.xml:
$(TOOL) $(BUILD_DIR)/$@ $*
cp _common.xml $(BUILD_DIR)/.

clean:
rm -rf $(BUILD_DIR/*.xml)

clean-all:
rm -rf $(BUILD_DIR)

# Debug variables
Expand Down
16 changes: 15 additions & 1 deletion projects/rvi-repo-manifest/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,28 @@ Although manifest files can be created manually, a bash script is used here to d

==== Using git `repo` tool

===== `repo init`

Similarly to cloning a single repo, the first step in using `repo` is to link:https://source.android.com/docs/setup/reference/repo#init[initialize] a directory with the configuration (manifest file). This should be done in an empty dir.

There is only one `default.xml` manifest file that has been created. It contains all the projects of all the orgs that RVI uses. To filter down by organization or projects, use the `--groups=` feature of the `repo init` command.

Here's an example:
[source, bash]
----
mkdir rvi-repos && cd rvi-repos
repo init -u https://github.com/riscv-admin/docs-sig -g all,-riscv-android-src
repo init -u https://github.com/riscv-admin/docs-sig --groups=all,-org:riscv-android-src
----

NOTES:
* If a `--manifest` isn't provided, `default.xml` is assumed
* `--groups=all` is a special group to check out all
* If a `-` is used in front of a group, negates its use

==== `repo sync`

After `repo init` is done once, `repo sync` can be used to clone the initial repos and keep them sync'ed with upstream in the future.

=== Pros and cons

* Pros
Expand Down
5 changes: 0 additions & 5 deletions projects/rvi-repo-manifest/_common.xml

This file was deleted.

7 changes: 4 additions & 3 deletions projects/rvi-repo-manifest/generate-manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ xml_header='<?xml version="1.0" encoding="UTF-8"?>
<!-- GENERATED FILE DO NOT EDIT -->
<!-- https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.md -->
<manifest>
<include name="_common.xml" />'
<remote name="origin" fetch="ssh://[email protected]"/>
<default revision="refs/heads/main" remote="origin" sync-j="4"/>'

echo "$xml_header" > "$output_file"

Expand All @@ -50,7 +51,7 @@ for org in $org_list; do
echo "Fetching repositories for organization: $org"

# Get list of repositories for the organization
repos=$(gh repo list -L $MAX_REPOS --no-archived --source $org --json name --jq '.[].name')
repos=$(gh repo list -L $MAX_REPOS --no-archived --source $org --json name --jq '.[].name' | sort)

# Loop through each repository
for repo in $repos; do
Expand All @@ -60,7 +61,7 @@ for org in $org_list; do
default_branch=$(echo $repo_info | jq -r '.db')

# Add repository information to the XML file
repo_entry=" <project name='$org/$repo' revision='$default_branch' groups='$org' />"
repo_entry=" <project name='$org/$repo' revision='$default_branch' groups='org:$org,proj:$repo' />"
echo "$repo_entry" >> $output_file
done
done
Expand Down
5 changes: 0 additions & 5 deletions projects/rvi-repo-manifest/generated/_common.xml

This file was deleted.

344 changes: 0 additions & 344 deletions projects/rvi-repo-manifest/generated/all-rvi-orgs.xml

This file was deleted.

345 changes: 345 additions & 0 deletions projects/rvi-repo-manifest/generated/default.xml

Large diffs are not rendered by default.

104 changes: 0 additions & 104 deletions projects/rvi-repo-manifest/generated/riscv-admin.xml

This file was deleted.

Loading

0 comments on commit 607bbc2

Please sign in to comment.