Skip to content

Commit 150d3de

Browse files
committed
Introduce submodules, closes #8536
Instead of the manual clone of sizzle and qunit, use git submodules instead. this will ensure that all future releases can be recreated by checking out an tag.
1 parent 714ae37 commit 150d3de

File tree

5 files changed

+12
-32
lines changed

5 files changed

+12
-32
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ dist
44
*~
55
*.diff
66
*.patch
7-
test/qunit
8-
src/sizzle
97
/*.html
108
.DS_Store

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "src/sizzle"]
2+
path = src/sizzle
3+
url = git://github.com/jeresig/sizzle.git
4+
[submodule "test/qunit"]
5+
path = test/qunit
6+
url = git://github.com/jquery/qunit.git

Makefile

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
V ?= 0
2-
31
SRC_DIR = src
42
TEST_DIR = test
53
BUILD_DIR = build
@@ -38,7 +36,6 @@ JQ = ${DIST_DIR}/jquery.js
3836
JQ_MIN = ${DIST_DIR}/jquery.min.js
3937

4038
SIZZLE_DIR = ${SRC_DIR}/sizzle
41-
QUNIT_DIR = ${TEST_DIR}/qunit
4239

4340
JQ_VER = $(shell cat version.txt)
4441
VER = sed "s/@VERSION/${JQ_VER}/"
@@ -51,32 +48,8 @@ all: jquery min lint
5148
${DIST_DIR}:
5249
@@mkdir -p ${DIST_DIR}
5350

54-
ifeq ($(strip $(V)),0)
55-
verbose = --quiet
56-
else ifeq ($(strip $(V)),1)
57-
verbose =
58-
else
59-
verbose = --verbose
60-
endif
61-
62-
define clone_or_pull
63-
-@@if test ! -d $(strip ${1})/.git; then \
64-
echo "Cloning $(strip ${1})..."; \
65-
git clone $(strip ${verbose}) --depth=1 $(strip ${2}) $(strip ${1}); \
66-
else \
67-
echo "Pulling $(strip ${1})..."; \
68-
git --git-dir=$(strip ${1})/.git pull $(strip ${verbose}) origin master; \
69-
fi
70-
71-
endef
72-
73-
${QUNIT_DIR}:
74-
$(call clone_or_pull, ${QUNIT_DIR}, git://github.com/jquery/qunit.git)
75-
76-
${SIZZLE_DIR}:
77-
$(call clone_or_pull, ${SIZZLE_DIR}, git://github.com/jeresig/sizzle.git)
78-
79-
init: ${QUNIT_DIR} ${SIZZLE_DIR}
51+
init:
52+
@@if [ -d .git ]; then git submodule update --init --recursive; fi
8053

8154
jquery: init ${JQ}
8255
jq: init ${JQ}
@@ -122,7 +95,8 @@ clean:
12295
@@echo "Removing built copy of Sizzle"
12396
@@rm -f src/selector.js
12497

125-
@@echo "Removing cloned directories"
98+
distclean: clean
99+
@@echo "Removing submodules"
126100
@@rm -rf test/qunit src/sizzle
127101

128102
.PHONY: all jquery lint min init jq clean

src/sizzle

Submodule sizzle added at ef19279

test/qunit

Submodule qunit added at d404faf

0 commit comments

Comments
 (0)