Skip to content

Commit e3e8a83

Browse files
committed
Initial release.
1 parent 3523ba5 commit e3e8a83

23 files changed

+22068
-1
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Build/CMake
2+
Build/Windows
3+
Build/Linux
4+
Output
5+
.vscode
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
package main
3+
4+
import (
5+
"fmt"
6+
"io"
7+
"net/http"
8+
"os"
9+
)
10+
11+
func main() {
12+
13+
argCount := len(os.Args[1:])
14+
if (argCount != 2) {
15+
fmt.Printf("Usage: urlDownload url localPath\n")
16+
fmt.Printf("\turl - The url to the file to download\n")
17+
fmt.Printf("\tlocalPath - The path and filename to save the downloaded file\n")
18+
os.Exit(1)
19+
}
20+
21+
fileUrl := os.Args[1]
22+
localPath := os.Args[2]
23+
24+
err := DownloadFile(localPath, fileUrl)
25+
if (err != nil) {
26+
panic(err)
27+
}
28+
29+
}
30+
31+
32+
// DownloadFile will download a url to a local file. It's efficient because it will
33+
// write as it downloads and not load the whole file into memory.
34+
func DownloadFile(filepath string, url string) error {
35+
36+
// Create the file
37+
out, err := os.Create(filepath)
38+
if err != nil {
39+
return err
40+
}
41+
defer out.Close()
42+
43+
// Get the data
44+
resp, err := http.Get(url)
45+
if err != nil {
46+
return err
47+
}
48+
defer resp.Body.Close()
49+
50+
// Write the body to file
51+
_, err = io.Copy(out, resp.Body)
52+
if err != nil {
53+
return err
54+
}
55+
56+
return nil
57+
}

AMDToolsDownloader/CMakeLists.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#=================================================================
2+
# Copyright 2018-2019 Advanced Micro Devices, Inc. All rights reserved.
3+
#=================================================================
4+
# CMakeList.txt : CMake project to compile AMDToolsDownloader.go
5+
#
6+
cmake_minimum_required(VERSION 2.8.11)
7+
8+
# Make a target that other projects can add as a dependency.
9+
add_custom_target(AMDToolsDownloader)
10+
11+
# Set the platform-dependent name of the binary.
12+
if(WIN32)
13+
set (AMDTOOLSDOWNLOADER_BINARY AMDToolsDownloader.exe)
14+
elseif (LINUX OR APPLE)
15+
set (AMDTOOLSDOWNLOADER_BINARY AMDToolsDownloader)
16+
endif()
17+
18+
# Set path to compiled AMDToolsDownloader binary.
19+
# This is cached so that projects depending on this binary
20+
# can copy it into their local output directory.
21+
set(AMDTOOLSDOWNLOADER_PATH
22+
${CMAKE_CURRENT_SOURCE_DIR}/${AMDTOOLSDOWNLOADER_BINARY}
23+
CACHE INTERNAL "")
24+
25+
# The command which actually compiles the binary.
26+
add_custom_command(TARGET AMDToolsDownloader PRE_BUILD
27+
COMMAND go build
28+
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/AMDToolsDownloader.go
29+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
30+
BYPRODUCTS ${AMDTOOLSDOWNLOADER_PATH}
31+
COMMENT "'go build' AMDToolsDownloader into ${CMAKE_CURRENT_SOURCE_DIR}"
32+
)
5.85 MB
Binary file not shown.
5.78 MB
Binary file not shown.

AMDToolsDownloader/README.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#=================================================================
2+
# Copyright 2018-2019 Advanced Micro Devices, Inc. All rights reserved.
3+
#=================================================================
4+
In order to build this project:
5+
6+
1) Download and install the Go tools from here: https://golang.org/doc/install
7+
2) Make any changes to the AMDToolsDownloader.go file.
8+
3) cd into the AMDToolsDownloader directory.
9+
4) Compile it with the command: "go build"
10+
* If there are compiler errors, they will be printed.
11+
* If the compilation is successful, nothing will get printed.
12+
5) You should find an updated AMDToolsDownloader.exe in the local directory.
13+
14+
NOTE: Go naming conventions specify that the project directory (/AMDToolsDownloader) should actually be entirely in lowercase to avoid differences in capitalization across platforms. We do not make heavy use of Go, and prefer this capitalization for this project, so the exception has been made. Also, the name of the compiled binary file is automatically selected from the project directory, not the source files, so in order to change the generated binary filename, the project directory name must also change.
5.6 MB
Binary file not shown.

CMakeLists.txt

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#=================================================================
2+
# Copyright 2018-2019 Advanced Micro Devices, Inc. All rights reserved.
3+
#=================================================================
4+
# CMakeList.txt : CMake project for UpdateCheckApi, include source and define
5+
# project specific logic here. The UpdateCheckApi is just a set a of source
6+
# code that other projects can include, it is not a buildable project on its
7+
# own.
8+
9+
cmake_minimum_required (VERSION 3.0)
10+
11+
# Root to the UpdateCheckApi directory.
12+
set (UPDATECHECKAPI_DIR ${CMAKE_CURRENT_SOURCE_DIR})
13+
14+
# Note: json.hpp file was originally downloaded from https://github.com/nlohmann/json/releases/download/v3.2.0/json.hpp
15+
set (JSON_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Ext/json-3.2.0)
16+
17+
if(WIN32)
18+
set(OS_SUFFIX Win32)
19+
set(UPDATECHECKAPI_OS_LIBS Shlwapi)
20+
set(AMDTOOLSDOWNLOADER_PATH ${CMAKE_CURRENT_SOURCE_DIR}/AMDToolsDownloader/Windows/AMDToolsDownloader.exe CACHE INTERNAL "")
21+
elseif(UNIX AND NOT APPLE)
22+
set(OS_SUFFIX Linux)
23+
set(UPDATECHECKAPI_OS_LIBS rt -pthread)
24+
set(AMDTOOLSDOWNLOADER_PATH ${CMAKE_CURRENT_SOURCE_DIR}/AMDToolsDownloader/Linux/AMDToolsDownloader CACHE INTERNAL "")
25+
elseif(APPLE)
26+
# Intentionally using the same Linux code on APPLE.
27+
set(OS_SUFFIX Linux)
28+
set(UPDATECHECKAPI_OS_LIBS -pthread)
29+
set(AMDTOOLSDOWNLOADER_PATH ${CMAKE_CURRENT_SOURCE_DIR}/AMDToolsDownloader/Mac/AMDToolsDownloader CACHE INTERNAL "")
30+
else()
31+
message(FATAL_ERROR "The current platform is not supported by UpdateCheckApi.")
32+
endif()
33+
34+
# Set a list of all source files.
35+
set(UPDATECHECKAPI_SRC
36+
${UPDATECHECKAPI_DIR}/Source/UpdateCheckApi.cpp
37+
${UPDATECHECKAPI_DIR}/Source/UpdateCheckApiUtils${OS_SUFFIX}.cpp
38+
${JSON_DIR}/json.hpp
39+
CACHE INTERNAL "")
40+
41+
# Set a list of Qt source files.
42+
set(UPDATECHECKAPI_QT_SRC
43+
${UPDATECHECKAPI_DIR}/Source/UpdateCheckThread.cpp
44+
${UPDATECHECKAPI_DIR}/Source/UpdateCheckResultsDialog.cpp
45+
CACHE INTERNAL "")
46+
47+
# Set a list of all header files.
48+
set(UPDATECHECKAPI_INC
49+
${UPDATECHECKAPI_DIR}/Include/UpdateCheckApi.h
50+
${UPDATECHECKAPI_DIR}/Include/UpdateCheckApiStrings.h
51+
${UPDATECHECKAPI_DIR}/Include/UpdateCheckApiUtils.h
52+
CACHE INTERNAL "")
53+
54+
# Set a list of Qt header files.
55+
set(UPDATECHECKAPI_QT_INC
56+
${UPDATECHECKAPI_DIR}/Include/UpdateCheckThread.h
57+
${UPDATECHECKAPI_DIR}/Include/UpdateCheckResultsDialog.h
58+
CACHE INTERNAL "")
59+
60+
# Set a list of Qt UI files.
61+
set (UPDATECHECKAPI_QT_UI
62+
${UPDATECHECKAPI_DIR}/Source/UpdateCheckResultsDialog.ui
63+
CACHE INTERNAL "")
64+
65+
# Set a list of all include directories.
66+
set(UPDATECHECKAPI_INC_DIRS
67+
${UPDATECHECKAPI_DIR}/Include
68+
${UPDATECHECKAPI_DIR}/Ext
69+
CACHE INTERNAL "")
70+
71+
# Set a list of all additional library directories.
72+
set (UPDATECHECKAPI_LIB_DIRS
73+
CACHE INTERNAL "")
74+
75+
# Set a list of additonal libraries to link.
76+
set (UPDATECHECKAPI_LIBS ${UPDATECHECKAPI_OS_LIBS} CACHE INTERNAL "")

Ext/json-3.2.0/LICENSE.MIT

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2013-2018 Niels Lohmann
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)