Browse Source

Merge pull request #917 from nextcloud/refactor/tool/query-packages-melos

refactor(tool): Use melos to query packages
pull/919/head
Kate 1 year ago committed by GitHub
parent
commit
dce3581c8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      docs/workflows.md
  2. 0
      packages/file_icons/assets/seti.ttf
  3. 8
      packages/file_icons/bin/file_icons.dart
  4. 2
      packages/file_icons/pubspec.yaml
  5. 20
      tool/build-app.sh

2
docs/workflows.md

@ -7,4 +7,4 @@ If you need to add a new package to the Neon project please make sure to execute
2. Make sure to activate our strict linting by adding it to the package.
3. Regenerate the dependency overrides by executing `melos bootstrap`.
4. Add a Symlink to our main [license](../LICENSE).
5. Update [commitlint.yaml](../commitlint.yaml) and [tool/build-app.sh](../tool/build-app.sh) by adding the new package name.
5. Update [commitlint.yaml](../commitlint.yaml) by adding the new package name.

0
packages/file_icons/fonts/seti.ttf → packages/file_icons/assets/seti.ttf

8
packages/file_icons/bin/file_icons.dart

@ -17,9 +17,9 @@ void main() {
}
void copyFont() {
final fontsDir = Directory('fonts');
if (!fontsDir.existsSync()) {
fontsDir.createSync();
final assetsDir = Directory('assets');
if (!assetsDir.existsSync()) {
assetsDir.createSync();
}
File(
p.join(
@ -29,7 +29,7 @@ void copyFont() {
'seti',
'seti.ttf',
),
).copySync(p.join('fonts', 'seti.ttf'));
).copySync(p.join(assetsDir.path, 'seti.ttf'));
}
void generateData() {

2
packages/file_icons/pubspec.yaml

@ -20,4 +20,4 @@ flutter:
fonts:
- family: Seti
fonts:
- asset: fonts/seti.ttf
- asset: assets/seti.ttf

20
tool/build-app.sh

@ -3,6 +3,18 @@ set -euxo pipefail
cd "$(dirname "$0")/.."
source tool/common.sh
function get_mount_paths_dir() {
dir="$1"
mapfile -t packages < <(melos list --parsable --relative --dir-exists="$dir")
echo "${packages[@]/%//$dir}"
}
function get_mount_paths_file() {
file="$1"
mapfile -t packages < <(melos list --parsable --relative --file-exists="$file")
echo "${packages[@]/%//$file}"
}
targets=("linux/arm64" "linux/amd64")
target="$1"
@ -29,8 +41,14 @@ if [[ "$target" == "linux/arm64" ]] || [[ "$target" == "linux/amd64" ]]; then
-f "tool/build/Dockerfile.$os" \
./tool/build
paths=(packages/app/{pubspec.lock,linux,build})
mapfile -O "${#paths[@]}" -t paths < <(get_mount_paths_dir "lib")
mapfile -O "${#paths[@]}" -t paths < <(get_mount_paths_dir "assets")
mapfile -O "${#paths[@]}" -t paths < <(get_mount_paths_file "pubspec.yaml")
mapfile -O "${#paths[@]}" -t paths < <(get_mount_paths_file "pubspec_overrides.yaml")
run_args=()
for path in packages/{app,dynamite/dynamite_runtime,file_icons,neon_lints,nextcloud,sort_box}/{lib,pubspec.yaml} packages/neon/*/{assets,lib,pubspec.yaml,pubspec_overrides.yaml} packages/file_icons/fonts packages/nextcloud/pubspec_overrides.yaml packages/app/{pubspec_overrides.yaml,assets,build,linux}; do
for path in ${paths[*]}; do
run_args+=(-v "$(pwd)/$path:/src/$path")
done
mkdir -p "packages/app/build"

Loading…
Cancel
Save