Skip to content

Commit 6277f12

Browse files
committed
Add UpdateCommon script to clone GitHub repos (this will be overridden to clone from git.amd.com in the internal build
1 parent 3edb3e9 commit 6277f12

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

Utils/UpdateCommon.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#! /usr/bin/python
2+
#
3+
# Simple script to update a set of common directories that are needed as dependencies of the current project
4+
5+
import os
6+
import string
7+
import subprocess
8+
import sys
9+
10+
# GPUPerfAPI git project to folder map definitions
11+
# - GitHubMapping
12+
from UpdateCommonMap import *
13+
14+
# to allow the script to be run from anywhere - not just the cwd - store the absolute path to the script file
15+
scriptRoot = os.path.dirname(os.path.realpath(__file__))
16+
17+
# for each GitHub dependency - test if it has already been fetched - if not, then fetch it,
18+
# otherwise update it to top of tree
19+
20+
for key in GitHubMapping:
21+
# convert targetPath to OS specific format
22+
tmppath = os.path.join(scriptRoot, "..", GitHubMapping[key])
23+
# clean up path, collapsing any ../ and converting / to \ for Windows
24+
targetPath = os.path.normpath(tmppath)
25+
if os.path.isdir(targetPath):
26+
print("\nDirectory " + targetPath + " exists, using 'git pull' to get latest")
27+
p = subprocess.Popen(["git","pull"], cwd=targetPath)
28+
p.wait();
29+
else:
30+
print("\nDirectory " + targetPath + " does not exist, using 'git clone' to get latest")
31+
gitamdRoot = "https://github.com/GPUOpen-Tools/" + key
32+
commandArgs = ["git", "clone", gitamdRoot, targetPath]
33+
p = subprocess.Popen( commandArgs )
34+
p.wait()
35+

Utils/UpdateCommonMap.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# UpdateCommonMap.py
2+
#
3+
# Map of GitHub project names to clone target paths, relative to the GPUPerfAPI
4+
# project root on the local disk.
5+
6+
# GitHub GPUOpen-Tools projects map
7+
GitHubMapping = {
8+
"common-dk-GraphViz" : "../Common/DK/GraphViz",
9+
"common-dk-Doxygen" : "../Common/DK/Doxygen",
10+
"common-lib-amd-ADL" : "../Common/Lib/AMD/ADL",
11+
"common-lib-amd-APPSDK-3.0" : "../Common/Lib/AMD/APPSDK",
12+
"common-lib-amd-HSA" : "../Common/Lib/AMD/HSA",
13+
"common-lib-ext-Boost-1.59" : "../Common/Lib/Ext/Boost",
14+
"common-lib-ext-GoogleTest-1.7" : "../Common/Lib/Ext/GoogleTest",
15+
"common-lib-ext-OpenGL" : "../Common/Lib/Ext/OpenGL",
16+
"common-lib-ext-OpenGLES" : "../Common/Lib/Ext/OpenGLES",
17+
"common-lib-ext-WindowsKits" : "../Common/Lib/Ext/Windows-Kits",
18+
"common-src-ADLUtil" : "../Common/Src/ADLUtil",
19+
"common-src-AMDTMutex" : "../Common/Src/AMDTMutex",
20+
"common-src-AmdDxExt" : "../Common/Src/AmdDxExt",
21+
"common-src-DeviceInfo" : "../Common/Src/DeviceInfo",
22+
"common-src-DynamicLibraryModule" : "../Common/Src/DynamicLibraryModule",
23+
"common-src-GPUPerfAPIUtils" : "../Common/Src/GPUPerfAPIUtils",
24+
"common-src-TSingleton" : "../Common/Src/TSingleton",
25+
"common-src-Vsprops" : "../Common/Src/Vsprops",
26+
}
27+

0 commit comments

Comments
 (0)