Golang和Java构建工具调查

Github:https://github.com/blindpirate/report-of-build-tools-for-java-and-golang

A Survey on Build Tools of Golang and Java

Java

Conclusion

In January 2017, the usage of build tools in Github’s top 1000 Java repositories is as follows:

Tool NameReference Count
Gradle627
Maven264
Ant52
Npm4
Bazel3
Make1

And the trending over the past 8 years is:

trending

Algorithm

  • Clone top 1000 Java repositories to local disk
  • Analyze the repositories by identity files:
Tool NameIdentity Files
Gradlebuild.gradle
Mavenpom.xml
Antbuild.xml
Npmpackage.json
BazelBUILD
MakeMakefile/makefile

How

  • Make sure Git/Groovy 2.4+/JDK 1.7+ are installed.
  • Run groovy GithubTopRankCrawler.groovy -l java -d <path to store the 1000 repos> to clone all repositories locally.
  • Run groovy JavaBuildToolScanner.groovy -d <path to store the 1000 repos> to analyze these repos.

Golang

Conclusion

There are various package management tools for golang as listed here. But which one is the most popular?

The usage of package manage tools in Github’s top 1000 Go repositories is as follows:

Tool NameUrlReference Count (Feb 2017)Reference Count (Nov 2017)
MakefileMakefile199181
depdepN/A94
godepgodep11990
govendorgovendor6584
glideglide6477
gvtgvt2516
trashtrash713
submodulesubmodule86
gpm/johnny-depsgpm johnny-deps76
glockglock54
gomgom42
gopackgopack32
gopmgopm31
goopgoop11
gvendgvend20

dep had a first release in May 2017, did not exist for first stats.

Technically, make is not a package management tool, here it is just for comparison.

Submodule refers to a set of tools which use git submodule to manage dependencies such as manul and Vendetta and so on.

Algorithm

  • Clone top 1000 Go repositories to local disk
  • Analyze the repositories by identity files:
Tool NameIdentity Files
godepGodeps/Godeps.json
govendorvendor/vendor.json
gopm.gopmfile
gvtvendor/manifest
gvendvendor.yml
glideglide.yaml or glide.lock
trashvendor.conf
gomGomfile
bunchbunchfile
goopGoopfile
goat.go.yaml
glockGLOCKFILE
gobsgoproject.json
gopackgopack.config
nutNut.toml
gpm/johnny-depsGodeps
Makefilemakefile or Makefile
submodule.gitmodules

How

  • Make sure Git/Groovy 2.4+/JDK 1.7+ are installed.
  • Run groovy GithubTopRankCrawler.groovy -l go -d <path to store the 1000 repos> to clone all repositories locally. You can use -s to do the shallow clone and decrease disk usage.
  • Run groovy GoBuildToolScanner.groovy <path to store the 1000 repos> to analyze these repos.