From 3474d931acb1e11b8110372af0e6d5e6e7fcc48b Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Sun, 2 Oct 2022 00:59:01 +0800 Subject: [PATCH] ci: use vscode tasks and makefile --- .vscode/tasks.json | 29 +++++++++++++++++++++++++++++ makefile | 13 +++++++++++++ scripts/build.sh | 5 ----- scripts/dev.sh | 3 --- scripts/format.sh | 3 --- scripts/update-schema.sh | 6 ------ 6 files changed, 42 insertions(+), 17 deletions(-) create mode 100644 .vscode/tasks.json create mode 100644 makefile delete mode 100644 scripts/build.sh delete mode 100644 scripts/dev.sh delete mode 100644 scripts/format.sh delete mode 100644 scripts/update-schema.sh diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..463b8a6 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,29 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "all", + "dependsOn": ["json", "github", "gitlab"] + }, + { + "label": "json", + "type": "dart", + "command": "dart", + "args": ["run", "build_runner", "watch"] + }, + { + "label": "github", + "type": "dart", + "command": "dart", + "cwd": "packages/gql_github", + "args": ["run", "build_runner", "watch"] + }, + { + "label": "gitlab", + "type": "dart", + "command": "dart", + "cwd": "packages/gql_gitlab", + "args": ["run", "build_runner", "watch"] + } + ] +} diff --git a/makefile b/makefile new file mode 100644 index 0000000..f195e4c --- /dev/null +++ b/makefile @@ -0,0 +1,13 @@ +.PHONY: build +build: + npx conventional-changelog-cli -p angular -i CHANGELOG.md -s -r 0 + flutter build ios --no-tree-shake-icons + flutter build apk --no-tree-shake-icons + +schema: + # https://docs.github.com/en/graphql/overview/public-schema + curl -o packages/gql_github/lib/schema.graphql https://docs.github.com/public/schema.docs.graphql + npx --yes get-graphql-schema https://gitlab.com/api/graphql > packages/gql_gitlab/lib/schema.graphql + +format: + dartfmt --overwrite lib/**/*.dart diff --git a/scripts/build.sh b/scripts/build.sh deleted file mode 100644 index 1f15c61..0000000 --- a/scripts/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -npx conventional-changelog-cli -p angular -i CHANGELOG.md -s -r 0 -flutter build ios --no-tree-shake-icons -flutter build apk --no-tree-shake-icons diff --git a/scripts/dev.sh b/scripts/dev.sh deleted file mode 100644 index 8daf8f2..0000000 --- a/scripts/dev.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -flutter pub run build_runner watch --delete-conflicting-outputs diff --git a/scripts/format.sh b/scripts/format.sh deleted file mode 100644 index 87f7b56..0000000 --- a/scripts/format.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -dartfmt --overwrite lib/**/*.dart diff --git a/scripts/update-schema.sh b/scripts/update-schema.sh deleted file mode 100644 index ad7d35e..0000000 --- a/scripts/update-schema.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -# https://docs.github.com/en/graphql/overview/public-schema -curl -o packages/gql_github/lib/schema.graphql https://docs.github.com/public/schema.docs.graphql - -npx --yes get-graphql-schema https://gitlab.com/api/graphql > packages/gql_gitlab/lib/schema.graphql