| 
									
										
										
										
											2021-11-17 14:17:46 +08:00
										 |  |  | [tasks.appflowy] | 
					
						
							|  |  |  | mac_alias = "appflowy-macos" | 
					
						
							|  |  |  | windows_alias = "appflowy-windows" | 
					
						
							| 
									
										
										
										
											2021-11-19 11:13:07 +08:00
										 |  |  | linux_alias = "appflowy-linux" | 
					
						
							| 
									
										
										
										
											2021-11-04 16:43:12 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-17 14:17:46 +08:00
										 |  |  | [tasks.appflowy-macos] | 
					
						
							|  |  |  | dependencies = ["flowy-sdk-release"] | 
					
						
							| 
									
										
										
										
											2022-04-08 20:08:01 +08:00
										 |  |  | run_task = { name = ["code_generation", "set-app-version", "flutter-build", "copy-to-product"] } | 
					
						
							| 
									
										
										
										
											2021-11-04 18:03:36 +08:00
										 |  |  | script_runner = "@shell" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-17 14:17:46 +08:00
										 |  |  | [tasks.appflowy-windows] | 
					
						
							|  |  |  | dependencies = ["flowy-sdk-release"] | 
					
						
							| 
									
										
										
										
											2022-04-08 20:08:01 +08:00
										 |  |  | run_task = { name = ["code_generation", "set-app-version", "flutter-build", "copy-to-product"] } | 
					
						
							| 
									
										
										
										
											2021-11-04 18:03:36 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-19 11:13:07 +08:00
										 |  |  | [tasks.appflowy-linux] | 
					
						
							|  |  |  | dependencies = ["flowy-sdk-release"] | 
					
						
							| 
									
										
										
										
											2022-04-08 20:08:01 +08:00
										 |  |  | run_task = { name = ["code_generation", "set-app-version", "flutter-build", "copy-to-product", "create-release-archive"] } | 
					
						
							| 
									
										
										
										
											2021-11-19 11:13:07 +08:00
										 |  |  | script_runner = "@shell" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-20 11:41:06 +08:00
										 |  |  | [tasks.appflowy-dev] | 
					
						
							|  |  |  | mac_alias = "appflowy-macos-dev" | 
					
						
							|  |  |  | windows_alias = "appflowy-windows-dev" | 
					
						
							|  |  |  | linux_alias = "appflowy-linux-dev" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [tasks.appflowy-macos-dev] | 
					
						
							|  |  |  | dependencies = ["flowy-sdk-dev"] | 
					
						
							| 
									
										
										
										
											2022-04-08 20:08:01 +08:00
										 |  |  | run_task = { name = ["code_generation", "set-app-version", "flutter-build", "copy-to-product"] } | 
					
						
							| 
									
										
										
										
											2021-11-20 11:41:06 +08:00
										 |  |  | script_runner = "@shell" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [tasks.appflowy-windows-dev] | 
					
						
							|  |  |  | dependencies = ["flowy-sdk-dev"] | 
					
						
							| 
									
										
										
										
											2022-04-08 20:08:01 +08:00
										 |  |  | run_task = { name = ["code_generation", "set-app-version", "flutter-build", "copy-to-product"] } | 
					
						
							| 
									
										
										
										
											2021-11-20 11:41:06 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | [tasks.appflowy-linux-dev] | 
					
						
							|  |  |  | dependencies = ["flowy-sdk-dev"] | 
					
						
							| 
									
										
										
										
											2022-04-08 20:08:01 +08:00
										 |  |  | run_task = { name = ["code_generation", "set-app-version", "flutter-build", "copy-to-product"] } | 
					
						
							| 
									
										
										
										
											2021-11-20 11:41:06 +08:00
										 |  |  | script_runner = "@shell" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-04 18:03:36 +08:00
										 |  |  | [tasks.copy-to-product] | 
					
						
							| 
									
										
										
										
											2021-11-17 14:17:46 +08:00
										 |  |  | mac_alias = "copy-to-product-macos" | 
					
						
							|  |  |  | windows_alias = "copy-to-product-windows" | 
					
						
							| 
									
										
										
										
											2021-11-19 11:13:07 +08:00
										 |  |  | linux_alias = "copy-to-product-linux" | 
					
						
							| 
									
										
										
										
											2021-11-17 14:17:46 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | [tasks.copy-to-product-macos] | 
					
						
							| 
									
										
										
										
											2021-11-04 18:03:36 +08:00
										 |  |  | script = [ | 
					
						
							|  |  |  |   """ | 
					
						
							| 
									
										
										
										
											2022-04-08 20:08:01 +08:00
										 |  |  |   product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${APP_VERSION} | 
					
						
							| 
									
										
										
										
											2021-11-17 14:17:46 +08:00
										 |  |  |   output_path=${product_path}/${TARGET_OS}/${FLUTTER_OUTPUT_DIR} | 
					
						
							| 
									
										
										
										
											2021-11-04 18:03:36 +08:00
										 |  |  |   if [ -d "${output_path}" ]; then | 
					
						
							|  |  |  |     rm -rf ${output_path}/ | 
					
						
							|  |  |  |   fi | 
					
						
							| 
									
										
										
										
											2021-11-04 22:13:05 +08:00
										 |  |  |   mkdir -p ${output_path} | 
					
						
							| 
									
										
										
										
											2021-11-04 18:03:36 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-06 22:35:45 +08:00
										 |  |  |   product=${PRODUCT_NAME}.${PRODUCT_EXT} | 
					
						
							| 
									
										
										
										
											2021-11-15 15:53:08 +08:00
										 |  |  |   cp -R ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/Build/Products/${FLUTTER_OUTPUT_DIR}/${product} \ | 
					
						
							| 
									
										
										
										
											2021-11-06 22:35:45 +08:00
										 |  |  |   ${output_path}/${product} | 
					
						
							| 
									
										
										
										
											2021-11-04 16:43:12 +08:00
										 |  |  |   """, | 
					
						
							|  |  |  | ] | 
					
						
							|  |  |  | script_runner = "@shell" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-19 11:13:07 +08:00
										 |  |  | [tasks.copy-to-product-linux] | 
					
						
							|  |  |  | script = [ | 
					
						
							|  |  |  |   """ | 
					
						
							| 
									
										
										
										
											2022-04-08 20:08:01 +08:00
										 |  |  |   product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${APP_VERSION} | 
					
						
							| 
									
										
										
										
											2021-11-19 11:13:07 +08:00
										 |  |  |   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} | 
					
						
							| 
									
										
										
										
											2021-11-19 22:40:57 +08:00
										 |  |  |   cp -R ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/${LINUX_ARCH}/${BUILD_FLAG}/bundle \ | 
					
						
							| 
									
										
										
										
											2021-11-19 11:13:07 +08:00
										 |  |  |   ${output_path}/${product} | 
					
						
							| 
									
										
										
										
											2021-12-17 14:34:35 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |   cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/linux/appflowy.desktop.temp ${output_path}/${product} | 
					
						
							|  |  |  |   cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/assets/images/flowy_logo.svg ${output_path}/${product} | 
					
						
							| 
									
										
										
										
											2021-11-19 11:13:07 +08:00
										 |  |  |   """, | 
					
						
							|  |  |  | ] | 
					
						
							|  |  |  | script_runner = "@shell" | 
					
						
							| 
									
										
										
										
											2021-11-17 21:45:18 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-17 14:17:46 +08:00
										 |  |  | [tasks.copy-to-product-windows] | 
					
						
							|  |  |  | script = [ | 
					
						
							|  |  |  |   """ | 
					
						
							| 
									
										
										
										
											2022-04-08 20:08:01 +08:00
										 |  |  |   product_path= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${APP_VERSION} | 
					
						
							| 
									
										
										
										
											2021-11-18 16:18:20 +08: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}/app_flowy/build/${TARGET_OS}/runner/${FLUTTER_OUTPUT_DIR}/**/* \ | 
					
						
							|  |  |  |   ${output_path}/${product} | 
					
						
							| 
									
										
										
										
											2021-11-17 14:17:46 +08:00
										 |  |  |   """, | 
					
						
							|  |  |  | ] | 
					
						
							| 
									
										
										
										
											2021-11-17 21:45:18 +08:00
										 |  |  | script_runner = "@duckscript" | 
					
						
							| 
									
										
										
										
											2021-11-17 14:17:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-08 20:08:01 +08:00
										 |  |  | [tasks.set-app-version] | 
					
						
							|  |  |  | script = [ | 
					
						
							|  |  |  |   """ | 
					
						
							|  |  |  |   if is_empty ${APP_VERSION} | 
					
						
							|  |  |  |     APP_VERSION = set ${CURRENT_APP_VERSION} | 
					
						
							|  |  |  |     set_env APP_VERSION ${CURRENT_APP_VERSION} | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  |   echo APP_VERSION: ${APP_VERSION} | 
					
						
							|  |  |  |   """, | 
					
						
							|  |  |  | ] | 
					
						
							|  |  |  | script_runner = "@duckscript" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-17 14:34:35 -05:00
										 |  |  | # 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 = [ | 
					
						
							| 
									
										
										
										
											2022-04-11 22:07:07 +08:00
										 |  |  |   "cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${APP_VERSION}/${TARGET_OS}/Release", | 
					
						
							| 
									
										
										
										
											2021-12-17 14:34:35 -05:00
										 |  |  |   "tar -czf ${PRODUCT_NAME}-${TARGET_OS}-x86.tar.gz *" | 
					
						
							|  |  |  | ] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [tasks.create-release-archive-windows] | 
					
						
							|  |  |  | script = [ | 
					
						
							|  |  |  |   # TODO | 
					
						
							|  |  |  |   # "cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${VERSION}/${TARGET_OS}/Release/${PRODUCT_NAME}", | 
					
						
							|  |  |  |   # "tar -czf ${PRODUCT_NAME}-${TARGET_OS}-x86.tar.gz *" | 
					
						
							|  |  |  | ] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [tasks.create-release-archive-macos] | 
					
						
							|  |  |  | script = [ | 
					
						
							|  |  |  |   # TODO  | 
					
						
							|  |  |  |   # "cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${VERSION}/${TARGET_OS}/Release/${PRODUCT_NAME}", | 
					
						
							|  |  |  |   # "tar -czf ${PRODUCT_NAME}-${TARGET_OS}-x86.tar.gz *" | 
					
						
							|  |  |  | ] | 
					
						
							| 
									
										
										
										
											2021-11-17 14:17:46 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | [tasks.flutter-build] | 
					
						
							|  |  |  | script = [ | 
					
						
							|  |  |  |   """ | 
					
						
							|  |  |  |   cd app_flowy/ | 
					
						
							|  |  |  |   flutter clean | 
					
						
							|  |  |  |   flutter pub get | 
					
						
							| 
									
										
										
										
											2022-04-08 20:08:01 +08:00
										 |  |  |   flutter build ${TARGET_OS} --${BUILD_FLAG} --build-name=${APP_VERSION} | 
					
						
							| 
									
										
										
										
											2021-11-17 14:17:46 +08:00
										 |  |  |   """, | 
					
						
							|  |  |  | ] | 
					
						
							|  |  |  | script_runner = "@shell" | 
					
						
							| 
									
										
										
										
											2021-11-04 18:03:36 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-19 11:13:07 +08:00
										 |  |  | [tasks.flutter-build.linux] | 
					
						
							|  |  |  | script = [ | 
					
						
							|  |  |  |   """ | 
					
						
							|  |  |  |   cd app_flowy/ | 
					
						
							|  |  |  |   flutter clean | 
					
						
							|  |  |  |   flutter pub get | 
					
						
							|  |  |  |   flutter build ${TARGET_OS} --${BUILD_FLAG} | 
					
						
							|  |  |  |   """, | 
					
						
							|  |  |  | ] | 
					
						
							|  |  |  | script_runner = "@shell" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-17 21:45:18 +08:00
										 |  |  | [tasks.flutter-build.windows] | 
					
						
							|  |  |  | script = [ | 
					
						
							|  |  |  |   """ | 
					
						
							|  |  |  |   cd app_flowy | 
					
						
							|  |  |  |   exec cmd.exe /c flutter clean | 
					
						
							|  |  |  |   exec cmd.exe /c flutter pub get | 
					
						
							|  |  |  |   exec cmd.exe /c flutter build ${TARGET_OS} --${BUILD_FLAG} | 
					
						
							|  |  |  |   """, | 
					
						
							|  |  |  | ] | 
					
						
							|  |  |  | script_runner = "@duckscript" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-24 14:40:48 +07:00
										 |  |  | [tasks.code_generation] | 
					
						
							| 
									
										
										
										
											2022-02-23 20:32:53 +07:00
										 |  |  | script_runner = "@shell" | 
					
						
							|  |  |  | script = [ | 
					
						
							|  |  |  |   """ | 
					
						
							|  |  |  |   cd app_flowy | 
					
						
							|  |  |  |   flutter clean | 
					
						
							| 
									
										
										
										
											2022-02-23 22:02:46 +07:00
										 |  |  |   flutter packages pub get | 
					
						
							| 
									
										
										
										
											2022-02-24 14:40:48 +07:00
										 |  |  |   flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json | 
					
						
							| 
									
										
										
										
											2022-02-23 20:32:53 +07:00
										 |  |  |   flutter packages pub run build_runner build --delete-conflicting-outputs | 
					
						
							|  |  |  |   """ | 
					
						
							|  |  |  | ] | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-24 14:40:48 +07:00
										 |  |  | [tasks.code_generation.windows] | 
					
						
							| 
									
										
										
										
											2022-02-23 22:02:46 +07:00
										 |  |  | script_runner = "@duckscript" | 
					
						
							| 
									
										
										
										
											2022-02-23 20:32:53 +07:00
										 |  |  | script = [ | 
					
						
							|  |  |  |   """ | 
					
						
							| 
									
										
										
										
											2022-02-23 22:02:46 +07:00
										 |  |  |   cd ./app_flowy/ | 
					
						
							|  |  |  |   exec cmd.exe /c flutter clean | 
					
						
							| 
									
										
										
										
											2022-02-24 14:40:48 +07:00
										 |  |  |   exec cmd.exe /c flutter pub get | 
					
						
							|  |  |  |   exec cmd.exe /c flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json | 
					
						
							| 
									
										
										
										
											2022-02-23 22:02:46 +07:00
										 |  |  |   exec cmd.exe /c flutter packages pub run build_runner build --delete-conflicting-outputs | 
					
						
							| 
									
										
										
										
											2022-02-23 20:32:53 +07:00
										 |  |  |   """ | 
					
						
							|  |  |  | ] |