diff --git a/docs/workflows.md b/docs/workflows.md index ff1a8576..ee89f7fe 100644 --- a/docs/workflows.md +++ b/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. diff --git a/packages/file_icons/fonts/seti.ttf b/packages/file_icons/assets/seti.ttf similarity index 100% rename from packages/file_icons/fonts/seti.ttf rename to packages/file_icons/assets/seti.ttf diff --git a/packages/file_icons/bin/file_icons.dart b/packages/file_icons/bin/file_icons.dart index cea7b274..e9924d37 100644 --- a/packages/file_icons/bin/file_icons.dart +++ b/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() { diff --git a/packages/file_icons/pubspec.yaml b/packages/file_icons/pubspec.yaml index ff513503..5ded88cc 100644 --- a/packages/file_icons/pubspec.yaml +++ b/packages/file_icons/pubspec.yaml @@ -20,4 +20,4 @@ flutter: fonts: - family: Seti fonts: - - asset: fonts/seti.ttf + - asset: assets/seti.ttf diff --git a/tool/build-app.sh b/tool/build-app.sh index c3509dbf..5b4b83f6 100755 --- a/tool/build-app.sh +++ b/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"