Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
0f53ad09
Unverified
提交
0f53ad09
authored
4月 30, 2019
作者:
Steven Allen
提交者:
GitHub
4月 30, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6282 from cbuesser/go-version-check
GOCC implementation & fix in make & build scripts
上级
64744521
f31dd2aa
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
22 行增加
和
12 行删除
+22
-12
Rules.mk
Rules.mk
+2
-1
check_go_version
bin/check_go_version
+5
-3
dist_get
bin/dist_get
+3
-1
maketarball.sh
bin/maketarball.sh
+3
-1
Rules.mk
coverage/Rules.mk
+6
-4
golang.mk
mk/golang.mk
+1
-1
tarball.mk
mk/tarball.mk
+2
-1
没有找到文件。
Rules.mk
浏览文件 @
0f53ad09
...
...
@@ -4,6 +4,7 @@ COVERAGE :=
DISTCLEAN
:=
TEST
:=
TEST_SHORT
:=
GOCC
?=
go
all
:
help
#
all has to be first defined target
.PHONY
:
all
...
...
@@ -104,7 +105,7 @@ install_unsupported: install
.PHONY
:
install_unsupported
uninstall
:
go
clean
-i
./cmd/ipfs
$(GOCC)
clean
-i
./cmd/ipfs
.PHONY
:
uninstall
help
:
...
...
bin/check_go_version
浏览文件 @
0f53ad09
...
...
@@ -31,12 +31,14 @@ PREFIX=$(expr "$0" : "\(.*\/\)") || PREFIX='./'
# Check that the go binary exist and is in the path
type
go
>
/dev/null 2>&1
||
die_upgrade
"go is not installed or not in the PATH!"
GOCC
=
${
GOCC
=
"go"
}
type
${
GOCC
}
>
/dev/null 2>&1
||
die_upgrade
"go is not installed or not in the PATH!"
# Check the go binary version
VERS_STR
=
$(
go
version 2>&1
)
||
die
"'go version' failed with output:
$VERS_STR
"
VERS_STR
=
$(
${
GOCC
}
version 2>&1
)
||
die
"'go version' failed with output:
$VERS_STR
"
GO_CUR_VERSION
=
$(
expr
"
$VERS_STR
"
:
".*go version go
\(
[^ ]*
\)
.*"
)
||
die
"Invalid 'go version' output:
$VERS_STR
"
check_at_least_version
"
$GO_MIN_VERSION
"
"
$GO_CUR_VERSION
"
"
go
"
check_at_least_version
"
$GO_MIN_VERSION
"
"
$GO_CUR_VERSION
"
"
${
GOCC
}
"
bin/dist_get
浏览文件 @
0f53ad09
#!/bin/sh
GOCC
=
${
GOCC
=go
}
die
()
{
echo
"
$@
"
>
&2
exit
1
...
...
@@ -99,7 +101,7 @@ get_go_vars() {
if
[
!
-z
"
$GOOS
"
]
&&
[
!
-z
"
$GOARCH
"
]
;
then
printf
"%s-%s"
"
$GOOS
"
"
$GOARCH
"
elif
have_binary go
;
then
printf
"%s-%s"
"
$(
go env GOOS
)
"
"
$(
go
env GOARCH
)
"
printf
"%s-%s"
"
$(
$GOCC
env GOOS
)
"
"
$(
$GOCC
env GOARCH
)
"
else
die
"no way of determining system GOOS and GOARCH
\n
Please manually set GOOS and GOARCH then retry."
fi
...
...
bin/maketarball.sh
浏览文件 @
0f53ad09
...
...
@@ -11,11 +11,13 @@ if ! [[ "$OUTPUT" = /* ]]; then
OUTPUT
=
"
$PWD
/
$OUTPUT
"
fi
GOCC
=
${
GOCC
=go
}
TMPDIR
=
"
$(
mktemp
-d
)
"
cp
-r
.
"
$TMPDIR
"
(
cd
"
$TMPDIR
"
&&
echo
$PWD
&&
go
mod vendor
&&
$GOCC
mod vendor
&&
(
git describe
--always
--match
=
NeVeRmAtCh
--dirty
2>/dev/null
||
true
)
>
.tarball
&&
chmod
-R
u
=
rwX,go
=
rX
"
$TMPDIR
"
# normalize permissions
tar
-czf
"
$OUTPUT
"
--exclude
=
"./.git"
.
...
...
coverage/Rules.mk
浏览文件 @
0f53ad09
include
mk/header.mk
GOCC
?=
go
$(d)/coverage_deps
:
$$(DEPS_GO)
rm
-rf
$
(
@D
)
/unitcover
&&
mkdir
$
(
@D
)
/unitcover
rm
-rf
$
(
@D
)
/sharnesscover
&&
mkdir
$
(
@D
)
/sharnesscover
...
...
@@ -11,16 +13,16 @@ endif
.PHONY
:
$(d)/coverage_deps
# unit tests coverage
UTESTS_$(d)
:
= $(shell
go
list -f '{{if (len .TestGoFiles)}}{{.ImportPath}}{{end}}' $(go-flags-with-tags) ./...)
UTESTS_$(d)
+=
$(shell
go
list
-f
'{{if (len .XTestGoFiles)}}{{.ImportPath}}{{end}}'
$(go-flags-with-tags)
./...
|
grep
-v
go-ipfs/vendor
|
grep
-v
go-ipfs/Godeps)
UTESTS_$(d)
:
= $(shell
$(GOCC)
list -f '{{if (len .TestGoFiles)}}{{.ImportPath}}{{end}}' $(go-flags-with-tags) ./...)
UTESTS_$(d)
+=
$(shell
$(GOCC)
list
-f
'{{if (len .XTestGoFiles)}}{{.ImportPath}}{{end}}'
$(go-flags-with-tags)
./...
|
grep
-v
go-ipfs/vendor
|
grep
-v
go-ipfs/Godeps)
UCOVER_$(d)
:
= $(addsuffix .coverprofile
,
$(addprefix $(d)/unitcover/
,
$(subst /
,
_
,
$(UTESTS_$(d)))))
$(UCOVER_$(d))
:
$(d)/coverage_deps ALWAYS
$
(
eval
TMP_PKG :
=
$
(
subst _,/,
$
(
basename
$
(
@F
))))
$
(
eval
TMP_DEPS :
=
$(
shell
go
list
-f
'{{range .Deps}}{{.}} {{end}}'
$
(
go-flags-with-tags
)
$(TMP_PKG)
| sed
's/ /\n/g'
|
grep
ipfs/go-ipfs
)
$(TMP_PKG)
)
$
(
eval
TMP_DEPS :
=
$(
shell
$(GOCC)
list
-f
'{{range .Deps}}{{.}} {{end}}'
$
(
go-flags-with-tags
)
$(TMP_PKG)
| sed
's/ /\n/g'
|
grep
ipfs/go-ipfs
)
$(TMP_PKG)
)
$
(
eval
TMP_DEPS_LIST :
=
$
(
call join-with,
$(comma)
,
$(TMP_DEPS)
))
go
test
$
(
go-flags-with-tags
)
$(GOTFLAGS)
-v
-covermode
=
atomic
-json
-coverpkg
=
$(TMP_DEPS_LIST)
-coverprofile
=
$@
$(TMP_PKG)
| tee
-a
test
/unit/gotest.json
$(GOCC)
test
$
(
go-flags-with-tags
)
$(GOTFLAGS)
-v
-covermode
=
atomic
-json
-coverpkg
=
$(TMP_DEPS_LIST)
-coverprofile
=
$@
$(TMP_PKG)
| tee
-a
test
/unit/gotest.json
$(d)/unit_tests.coverprofile
:
$(UCOVER_$(d))
...
...
mk/golang.mk
浏览文件 @
0f53ad09
...
...
@@ -73,7 +73,7 @@ test_go_megacheck:
test_go
:
$(TEST_GO)
check_go_version
:
@
go
version
@
$(GOCC)
version
bin/check_go_version
$(GO_MIN_VERSION)
.PHONY
:
check_go_version
DEPS_GO
+=
check_go_version
...
...
mk/tarball.mk
浏览文件 @
0f53ad09
...
...
@@ -8,6 +8,7 @@ tarball-is:=1
git-hash:=$(shell cat .tarball)
endif
GOCC ?= go
go-ipfs-source.tar.gz: distclean
bin/maketarball.sh $@
GOCC=$(GOCC)
bin/maketarball.sh $@
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论