From 4b6f2a210e772885d51097407edba32ea2428140 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Fri, 24 Dec 2021 15:48:48 +0900 Subject: [PATCH] add make rule to fetch qtdeclarative repo and try parsing *.qml files --- .gitignore | 1 + Makefile | 10 ++++++++++ examples/Makefile | 10 ++++++++++ 3 files changed, 21 insertions(+) create mode 100644 examples/Makefile diff --git a/.gitignore b/.gitignore index 755746153..5f83ac024 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /Cargo.lock /build/ +/examples/qtdeclarative /node_modules/ /package-lock.json /target/ diff --git a/Makefile b/Makefile index cf633554b..3e9aa6714 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ help: @echo 'Make targets:' @echo ' generate - generate parser sources' @echo ' tests - run all tests' + @echo ' fetch-examples - fetch example repositories' + @echo ' parse-examples - parse example files' .PHONY: generate generate: @@ -17,3 +19,11 @@ src/typescript-scanner.h: node_modules/tree-sitter-typescript/common/scanner.h .PHONY: tests tests: $(TREE_SITTER) test $(TESTFLAGS) + +.PHONY: fetch-examples +fetch-examples: + $(MAKE) -C examples all + +.PHONY: parse-examples +parse-examples: + $(TREE_SITTER) parse -q 'examples/**/*.qml' diff --git a/examples/Makefile b/examples/Makefile new file mode 100644 index 000000000..3d7d4e067 --- /dev/null +++ b/examples/Makefile @@ -0,0 +1,10 @@ +GIT = git + +.PHONY: all +all: qtdeclarative + +.PHONY: qtdeclarative +qtdeclarative: + [ -d $@ ] || $(GIT) clone git://code.qt.io/qt/qtdeclarative.git $@ + $(GIT) -C $@ fetch + $(GIT) -C $@ reset --hard 3d23912b0e9710dad7ecaf238690e4a7d253534d