AppFlowy/frontend/scripts/makefile/flutter.toml

219 lines
5.8 KiB
TOML
Raw Normal View History

2021-11-17 06:17:46 +00:00
[tasks.appflowy]
mac_alias = "appflowy-macos"
windows_alias = "appflowy-windows"
linux_alias = "appflowy-linux"
2021-11-04 08:43:12 +00:00
2021-11-17 06:17:46 +00:00
[tasks.appflowy-macos]
dependencies = ["appflowy-core-release"]
run_task = { name = [
"code_generation",
"set-app-version",
"flutter-build",
"copy-to-product",
] }
script_runner = "@shell"
2021-11-17 06:17:46 +00:00
[tasks.appflowy-windows]
dependencies = ["appflowy-core-release"]
run_task = { name = [
"code_generation",
"set-app-version",
"flutter-build",
"copy-to-product",
] }
[tasks.appflowy-linux]
dependencies = ["appflowy-core-release"]
run_task = { name = [
"code_generation",
"set-app-version",
"flutter-build",
"copy-to-product",
"create-release-archive",
] }
script_runner = "@shell"
[tasks.appflowy-dev]
mac_alias = "appflowy-macos-dev"
windows_alias = "appflowy-windows-dev"
linux_alias = "appflowy-linux-dev"
[tasks.appflowy-macos-dev]
dependencies = ["appflowy-core-dev"]
run_task = { name = [
"code_generation",
"set-app-version",
"flutter-build",
"copy-to-product",
] }
script_runner = "@shell"
[tasks.appflowy-windows-dev]
dependencies = ["appflowy-core-dev"]
run_task = { name = [
"code_generation",
"set-app-version",
"flutter-build",
"copy-to-product",
] }
[tasks.appflowy-linux-dev]
dependencies = ["appflowy-core-dev"]
run_task = { name = [
"code_generation",
"set-app-version",
"flutter-build",
"copy-to-product",
] }
script_runner = "@shell"
[tasks.copy-to-product]
2021-11-17 06:17:46 +00:00
mac_alias = "copy-to-product-macos"
windows_alias = "copy-to-product-windows"
linux_alias = "copy-to-product-linux"
2021-11-17 06:17:46 +00:00
[tasks.copy-to-product-macos]
script = [
"""
product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/product/${APP_VERSION}
2021-11-17 06:17:46 +00:00
output_path=${product_path}/${TARGET_OS}/${FLUTTER_OUTPUT_DIR}
if [ -d "${output_path}" ]; then
rm -rf ${output_path}/
fi
2021-11-04 14:13:05 +00:00
mkdir -p ${output_path}
2021-11-06 14:35:45 +00:00
product=${PRODUCT_NAME}.${PRODUCT_EXT}
cp -R ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/build/${TARGET_OS}/Build/Products/${FLUTTER_OUTPUT_DIR}/${product} \
2021-11-06 14:35:45 +00:00
${output_path}/${product}
2021-11-04 08:43:12 +00:00
""",
]
script_runner = "@shell"
[tasks.copy-to-product-linux]
script = [
"""
product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/product/${APP_VERSION}
output_path=${product_path}/${TARGET_OS}/${FLUTTER_OUTPUT_DIR}
if [ -d "${output_path}" ]; then
rm -rf ${output_path}/
fi
mkdir -p ${output_path}
product=${PRODUCT_NAME}
cp -R ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/build/${TARGET_OS}/${LINUX_ARCH}/${BUILD_FLAG}/bundle \
${output_path}/${product}
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/linux/appflowy.desktop.temp ${output_path}/${product}
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/assets/images/flowy_logo.svg ${output_path}/${product}
""",
]
script_runner = "@shell"
2021-11-17 06:17:46 +00:00
[tasks.copy-to-product-windows]
script = [
"""
product_path= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/product/${APP_VERSION}
2021-11-18 08:18:20 +00:00
output_path= set ${product_path}/${TARGET_OS}
if is_path_exists ${output_path}
rm -r ${output_path}/
fi
mkdir ${output_path}
product= set ${PRODUCT_NAME}
glob_cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/build/${TARGET_OS}/runner/${FLUTTER_OUTPUT_DIR}/**/* \
2021-11-18 08:18:20 +00:00
${output_path}/${product}
2021-11-17 06:17:46 +00:00
""",
]
script_runner = "@duckscript"
2021-11-17 06:17:46 +00:00
2022-04-08 12:08:01 +00:00
[tasks.set-app-version]
script = ["""
2022-04-08 12:08:01 +00:00
if is_empty ${APP_VERSION}
APP_VERSION = set ${CURRENT_APP_VERSION}
set_env APP_VERSION ${CURRENT_APP_VERSION}
end
echo APP_VERSION: ${APP_VERSION}
"""]
2022-04-08 12:08:01 +00:00
script_runner = "@duckscript"
# The following tasks will create an archive that will be used on the GitHub Releases section
# The archives are created using different compression programs depending on the target OS
# The archive will be composed of all files that are located in the /Release/AppFlowy directory
[tasks.create-release-archive]
mac_alias = "create-release-archive-macos"
windows_alias = "create-release-archive-windows"
linux_alias = "create-release-archive-linux"
[tasks.create-release-archive-linux]
script = [
"cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/product/${APP_VERSION}/${TARGET_OS}/Release",
"tar -czf ${PRODUCT_NAME}-${TARGET_OS}-x86.tar.gz *",
]
[tasks.create-release-archive-windows]
script = [
# TODO
# "cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/product/${VERSION}/${TARGET_OS}/Release/${PRODUCT_NAME}",
# "tar -czf ${PRODUCT_NAME}-${TARGET_OS}-x86.tar.gz *"
]
[tasks.create-release-archive-macos]
script = [
2023-03-30 02:09:15 +00:00
# TODO
# "cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/product/${VERSION}/${TARGET_OS}/Release/${PRODUCT_NAME}",
# "tar -czf ${PRODUCT_NAME}-${TARGET_OS}-x86.tar.gz *"
]
2021-11-17 06:17:46 +00:00
[tasks.flutter-build]
script = ["""
cd appflowy_flutter/
2021-11-17 06:17:46 +00:00
flutter pub get
2023-06-22 13:22:46 +00:00
flutter build ${TARGET_OS} --${BUILD_FLAG}
"""]
2021-11-17 06:17:46 +00:00
script_runner = "@shell"
[tasks.flutter-build.windows]
script = ["""
cd appflowy_flutter
exec cmd.exe /c flutter pub get
2023-02-09 12:24:43 +00:00
exec cmd.exe /c flutter build ${TARGET_OS} --${BUILD_FLAG} --build-name=${APP_VERSION}
"""]
script_runner = "@duckscript"
2022-02-24 07:40:48 +00:00
[tasks.code_generation]
2022-02-23 13:32:53 +00:00
script_runner = "@shell"
script = [
"""
2023-07-09 03:03:22 +00:00
sh scripts/code_generation/generate.sh
"""
2022-02-23 13:32:53 +00:00
]
2022-02-24 07:40:48 +00:00
[tasks.code_generation.windows]
script_runner = "@duckscript"
2022-02-23 13:32:53 +00:00
script = [
"""
2023-07-09 03:03:22 +00:00
exec scripts/code_generation/generate.cmd
""",
]
feat: Dynamically Load Themes in AppFlowy (#2670) * feat: dynamic theme plugin (init) * feat: provide fallback color if plugin becomes out of date (transparent) * feat: use applicationDocumentsDirectory to store plugins * chore: remove json files * fix: add toJson to resolve analyzer errors * fix: analyzer (unused imports) * feat: add code generation scripts for freezed files (call recursively in packages) * fix: revert changes to dry generation * feat: call directly into script * refactor: scripts try to be stateless :) * fix: path to code generation in toml * fix: generate script permissions * fix: path not correct in generate.sh * feat: modify execution permissions before executing scripts * chore: switch order of build_runner and easy_localizations * fix: fs is not valid duckscript cmd * chore: clean build_runner before executing * chore: upgrade freezed and build_runner attempt to resolve InvalidType error * fix: use exec cmd.exe to chmod * feat: add task to generate all files * chore: remove redundant task (Code Gen) * chore: remove json_annoation to dev_dependencies * fix: dropped & between commands * chore: rename file and class to FlowyDynamicPlugin * fix: dependency hell * fix: json annotation in colorscheme * fix: analyzer warnings * fix: duckscript runner for code generator * fix: try without setting file permissions * chore: move file picker to infra * chore: restructure project directory * feat: add BLoC components for consumers * chore: update dependencies in pubspec.yaml file * fix: file picker imports * feat: add new translations for features * feat: add new widgets to render upload * fix: import * feat: add text overflow * feat: use animated switcher * chore: export FileType * fix: directory was not created, only files were copied * chore: separate some logic * feat: add saveFile to FilePickerService * fix: analyzer error with unused imports * feat: add translations for uploading * feat: add builtins property to apptheme * feat: add theme preview widget * fix: upload widgets need to fill whole space and account for overflow * refactor: do not watch file system for changes * feat: add deletion confirmation dialog * feat: add form factor resolution for dyanmic layout * feat: trigger rebuild only when plugins are loaded * feat: make all methods static * chore: remove TODO comment, requires further design * chore: move models to subfolder * fix: references to plugin service instance * fix: rebase errors * fix: more rebasing errors * feat: remove multiple themes from one plugin * refactor: use pattern to resolve widget in settings_appearance_view * refactor: remove commented code * feat: add translations * fix: import error * refactor: separate concerns a bit more * fix: bug in toJson serialization code * feat: add package to use represent memory files * fix: analyzer warnings * chore: add translation * chore: remove unused exceptions * chore: use join * chore: add documentation * feat: add tests on theme * fix: fix scripts for macOS * feat: use appFlowyDocumentDirectory * fix: remove unused import * fix: imports * feat: allow plugin service to be passed * fix: theme tests * feat: separate themes by built-in and plugin * fix: rebase change name of appFlowyDocumentDirectory * chore: add test to check that initial state falls back to initial theme * chore: theme upload preview widget * chore: rename to brightness setting * refactor: appearance for settings appearance view * feat: change show dialog api and use it * fix: handle plugin compilation exception when incorrect format supplied * fix: style of theme upload * fix: always change state so that ui updates * chore: style of loading widget * fix: analyzer errors * feat: add learn more button to documentation --------- Co-authored-by: Yijing Huang <hyj891204@gmail.com> Co-authored-by: nathan <nathan@appflowy.io>
2023-07-03 14:07:11 +00:00
[tasks.dry_code_generation]
script_runner = "@shell"
script = [
"""
cd appflowy_flutter
dart run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
dart run build_runner build -d
""",
]
[tasks.dry_code_generation.windows]
script_runner = "@duckscript"
script = [
"""
cd ./appflowy_flutter/
exec cmd.exe /c dart run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
exec cmd.exe /c dart run build_runner build -d
""",
]