Skip to content

Commit

Permalink
🔧 Update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
techouse committed Mar 21, 2022
1 parent 744cab3 commit be6798f
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

# Function to build header
oss_header() {
first=$(printf '%.s#' {1..78})
second=$(
printf '##'
printf '%.s ' {1..74}
printf '##'
)
third=$(
printf '##'
printf '%.s ' {1..27}
printf 'OPEN-SOURCE LICENSES'
printf '%.s ' {1..27}
printf '##'
)
printf "\n\n%s\n%s\n%s\n%s\n%s\n\n" "$first" "$second" "$third" "$second" "$first"
}

if [ -d "build/dist" ]; then
rm -rf build/dist
fi
Expand All @@ -9,4 +28,12 @@ fi

mkdir -p build/dist build/debug_info
cp -r info.plist assets/* LICENSE README.md build/dist
dart compile exe bin/main.dart -o build/dist/docs -S build/debug_info/docs

if command -v dart-pubspec-licenses-lite; then
oss_header >>build/dist/LICENSE
dart-pubspec-licenses-lite --pubspec-lock pubspec.lock >>build/dist/LICENSE
else
echo 'Info: Unable to generate OSS LICENSES. Please install https://github.com/techouse/dart_pubspec_licenses_lite'
fi

dart compile exe bin/main.dart -o build/dist/docs -S build/debug_info/docs

0 comments on commit be6798f

Please sign in to comment.