41 dependencyPattern =
"eth_use\((.*)\s+(OPTIONAL|REQUIRED)\s+(.*)\)" 48 cmakeListsPath = os.path.join(os.path.join(submodulePath, library),
52 if os.path.exists(cmakeListsPath):
53 with open(cmakeListsPath)
as fileHandle:
54 for line
in fileHandle.readlines():
55 result = re.search(dependencyPattern, line)
57 fromNode = result.group(1)
58 toNodes = result.group(3).split()
59 for toNode
in toNodes:
62 if toNode.startswith(
"JsonRpc::"):
63 toNode =
"json-rpc-cpp" 65 toNode = toNode.split(
"::")[1]
66 edgeText =
'"' + fromNode +
'" -> "' + toNode +
'"' 67 if "OPTIONAL" in line:
68 edgeText = edgeText +
" [style=dotted]" 69 outputString = outputString + edgeText +
"\n" 78 for subDirectoryName
in os.listdir(submodulePath):
79 if (subDirectoryName !=
"examples" and subDirectoryName !=
"utils" and subDirectoryName !=
".git"):
80 absSubDirectoryPath = os.path.join(submodulePath, subDirectoryName)
81 if os.path.isdir(absSubDirectoryPath):
82 cmakeListsPath = os.path.join(absSubDirectoryPath,
84 if os.path.exists(cmakeListsPath):
85 moduleName = subDirectoryName
87 if (moduleName ==
"libdevcore"):
88 moduleName =
"devcore" 89 if (moduleName ==
"libdevcrypto"):
90 moduleName =
"devcrypto" 91 if (moduleName ==
"libethash"):
93 if (moduleName ==
"libethash-cl"):
94 moduleName =
"ethash-cl" 95 if (moduleName ==
"libethashseal"):
96 moduleName =
"ethashseal" 97 if (moduleName ==
"libethcore"):
98 moduleName =
"ethcore" 99 if (moduleName ==
"libethereum"):
100 moduleName =
"ethereum" 101 if (moduleName ==
"libevm"):
103 if (moduleName ==
"libevmcore"):
104 moduleName =
"evmcore" 105 if (moduleName ==
"libp2p"):
107 if (moduleName ==
"libwebthree"):
108 moduleName =
"webthree" 109 if (moduleName ==
"libweb3jsonrpc"):
110 moduleName =
"web3jsonrpc" 111 if (moduleName ==
"libwhisper"):
112 moduleName =
"whisper" 114 outputString = outputString +
' "' + moduleName +
'"' 116 if (moduleName ==
"evmjit"):
117 outputString = outputString +
" [style=filled,fillcolor=coral]" 118 elif (
"lib" in absSubDirectoryPath):
119 outputString = outputString +
" [style=filled,fillcolor=deepskyblue]" 121 outputString = outputString +
" [shape=box;style=filled,penwidth=2,fillcolor=chartreuse]" 123 outputString = outputString +
"\n" 129 for folder
in os.listdir(root):
130 absPath = os.path.join(root, folder)
131 if os.path.isdir(absPath):
132 if not (
".git" in absPath):
136 print 'digraph webthree {' 137 print ' graph [ label = "Ethereum C++ dependencies" ]' 138 print ' node [ fontname = "Courier", fontsize = 10 ]' 140 print ' compound = true' 142 print ' "buildinfo" [style=filled,fillcolor=deepskyblue]' 143 print ' "json_spirit" [color=red]' 144 print ' "scrypt" [color=red]' 145 print ' "secp256k1" [color=red]' 146 print ' "testeth" [shape=box;style=filled,penwidth=2,fillcolor=chartreuse]' 147 print ' "testweb3" [shape=box;style=filled,penwidth=2,fillcolor=chartreuse]' 148 print ' "testweb3core" [shape=box;style=filled,penwidth=2,fillcolor=chartreuse]' 150 print ' "bench" -> "devcrypto"' 151 print ' "curl" -> "ssh2" [style=dotted]' 152 print ' "curl" -> "openssl" [style=dotted]' 153 print ' "curl" -> "zlib" [style=dotted]' 154 print ' "devcore" -> "boost::filesystem"' 155 print ' "devcore" -> "boost::random"' 156 print ' "devcore" -> "boost::system"' 157 print ' "devcore" -> "boost::thread"' 158 print ' "devcore" -> "LevelDB"' 159 print ' "devcrypto" -> "devcore"' 160 print ' "devcrypto" -> "json_spirit"' 161 print ' "devcrypto" -> "scrypt"' 162 print ' "devcrypto" -> "secp256k1"' 163 print ' "eth" -> "web3jsonrpc"' 164 print ' "ethcore" -> "devcore"' 165 print ' "ethcore" -> "buildinfo"' 166 print ' "ethcore" -> "json_spirit"' 167 print ' "ethereum" -> "boost::regex"' 168 print ' "ethereum" -> "evm"' 169 print ' "ethereum" -> "evmjit" [style=dotted]' 170 print ' "ethereum" -> "json_spirit"' 171 print ' "ethereum" -> "p2p"' 172 print ' "ethash" -> "Cryptopp"' 173 print ' "ethash-cl" -> "ethash"' 174 print ' "ethashseal" -> "ethereum"' 175 print ' "ethkey" -> "ethcore"' 176 print ' "ethminer" -> "ethashseal"' 177 print ' "ethvm" -> "ethashseal"' 178 print ' "evm" -> "ethcore"' 179 print ' "evm" -> "evmcore"' 180 print ' "json-rpc-cpp" -> "argtable2" [style=dotted]' 181 print ' "json-rpc-cpp" -> "curl"' 182 print ' "json-rpc-cpp" -> "microhttpd"' 183 print ' "json-rpc-cpp" -> "Jsoncpp"' 184 print ' "json-rpc-cpp" -> "libedit"' 185 print ' "LevelDB" -> "snappy" [style=dotted]' 186 print ' "evmjit" -> "llvm"' 187 print ' "p2p" -> "devcrypto"' 188 print ' "rlp" -> "devcrypto"' 189 print ' "rlp" -> "json_spirit"' 190 print ' "secp256k1" -> "gmp"' 191 print ' "testeth" -> "ethashseal"' 192 print ' "testeth" -> "boost::unit_test_framework"' 193 print ' "testweb3" -> "boost::unit_test_framework"' 194 print ' "testweb3" -> "web3jsonrpc"' 195 print ' "testweb3core" -> "boost::date_time"' 196 print ' "testweb3core" -> "boost::regex"' 197 print ' "testweb3core" -> "boost::unit_test_framework"' 198 print ' "testweb3core" -> "devcore"' 199 print ' "testweb3core" -> "devcrypto"' 200 print ' "testweb3core" -> "p2p"' 201 print ' "webthree" -> "ethashseal"' 202 print ' "webthree" -> "whisper"' 203 print ' "web3jsonrpc" -> "webthree"' 204 print ' "whisper" -> "boost::regex"' 205 print ' "whisper" -> "p2p"' def processRepository(root)
def getDependencyEdges(submodulePath, library)
def getLibraryAndApplicationNames(submodulePath)