-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Tyler Veness <[email protected]>
- Loading branch information
1 parent
6b7fc6f
commit 778914a
Showing
12 changed files
with
253 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#nullable disable | ||
|
||
using Newtonsoft.Json; | ||
|
||
namespace WPILibInstaller.Models | ||
{ | ||
public class ChoreoConfig | ||
{ | ||
[JsonProperty("zipFile")] | ||
public string ZipFile { get; set; } | ||
[JsonProperty("folder")] | ||
public string Folder { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
SCRIPT_PATH="$(dirname "$(realpath "$0")")" | ||
SCRIPT_NAME="$(basename "$(realpath "$0")")" | ||
SCRIPT_BASE="$(basename -s .sh "$SCRIPT_NAME")" | ||
OS_NAME="$(uname -s)" | ||
CHOREO_PATH="$(realpath "$SCRIPT_PATH/../choreo")" | ||
|
||
exec "$CHOREO_PATH/Choreo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
'Create File System Object for working with directories | ||
Set fso = WScript.CreateObject("Scripting.FileSystemObject") | ||
|
||
'Get the folder of this script | ||
toolsFolder = fso.GetParentFolderName(WScript.ScriptFullName) | ||
|
||
'Get the Choreo folder | ||
toolsFolder = fso.GetParentFolderName(WScript.ScriptFullName) | ||
yearFolder = fso.GetParentFolderName(toolsFolder) | ||
choreoFolder = fso.BuildPath(yearFolder, "choreo") | ||
|
||
'Get the full path to the exe | ||
fullExeName = fso.BuildPath(choreoFolder, "choreo.exe") | ||
|
||
shellScript = fullExeName | ||
|
||
'Create Shell Object | ||
Set objShell = WScript.CreateObject( "WScript.Shell" ) | ||
Set objEnv = objShell.Environment("PROCESS") | ||
dim runObject | ||
' Allow us to catch a script run failure | ||
On Error Resume Next | ||
Set runObj = objShell.Exec(shellScript) | ||
If Err.Number <> 0 Then | ||
If WScript.Arguments.Count > 0 Then | ||
If (WScript.Arguments(0) <> "silent") Then | ||
WScript.Echo "Error Launching Tool" + vbCrLf + Err.Description | ||
Else | ||
WScript.StdOut.Write("Error Launching Tool") | ||
WScript.StdOut.Write(Error.Description) | ||
End If | ||
Else | ||
WScript.Echo "Error Launching Tool" + vbCrLf + Err.Description | ||
End If | ||
Set runObj = Nothing | ||
Set objShell = Nothing | ||
Set fso = Nothing | ||
WScript.Quit(1) | ||
End If | ||
|
||
Set runObj = Nothing | ||
Set objShell = Nothing | ||
Set fso = Nothing | ||
WScript.Quit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
apply from: 'scripts/versions.gradle' | ||
|
||
def baseUrl = "https://github.com/SleipnirGroup/Choreo/releases/download/$choreoGitTag/" | ||
|
||
def fileNameWindows = "Choreo-$choreoGitTag-Windows-x86_64-standalone.zip" | ||
|
||
def downloadUrlWindows = baseUrl + fileNameWindows | ||
|
||
def fileNameMac = "Choreo-$choreoGitTag-macOS-x86_64-standalone.zip" | ||
|
||
def downloadUrlMac = baseUrl + fileNameMac | ||
|
||
def fileNameMacArm = "Choreo-$choreoGitTag-macOS-aarch64-standalone.zip" | ||
|
||
def downloadUrlMacArm = baseUrl + fileNameMacArm | ||
|
||
def fileNameLinux = "Choreo-$choreoGitTag-Linux-x86_64-standalone.zip" | ||
|
||
def downloadUrlLinux = baseUrl + fileNameLinux | ||
|
||
|
||
apply plugin: 'de.undercouch.download' | ||
|
||
def downloadTaskWindows = tasks.register('downloadChoreoWindows', Download) { | ||
src downloadUrlWindows | ||
def fileName = file(src.file).name | ||
dest "$buildDir/downloads/$fileName" | ||
overwrite true | ||
} | ||
|
||
def downloadTaskMac = tasks.register('downloadChoreoMac', Download) { | ||
src downloadUrlMac | ||
def fileName = file(src.file).name | ||
dest "$buildDir/downloads/$fileName" | ||
overwrite true | ||
} | ||
|
||
def downloadTaskMacArm = tasks.register('downloadChoreoMacArm', Download) { | ||
src downloadUrlMacArm | ||
def fileName = file(src.file).name | ||
dest "$buildDir/downloads/$fileName" | ||
overwrite true | ||
} | ||
|
||
def downloadTaskLinux = tasks.register('downloadChoreoLinux', Download) { | ||
src downloadUrlLinux | ||
def fileName = file(src.file).name | ||
dest "$buildDir/downloads/$fileName" | ||
overwrite true | ||
} | ||
|
||
def choreoConfigFile = file("$buildDir/choreoConfig.json") | ||
|
||
def choreoConfigFileTask = tasks.register("choreoConfigFile") { | ||
it.outputs.file choreoConfigFile | ||
|
||
doLast { | ||
|
||
def config = [:] | ||
config['folder'] = 'choreo' | ||
config['zipFile'] = 'choreo.zip' | ||
|
||
def gbuilder = getGsonBuilder() | ||
|
||
gbuilder.setPrettyPrinting() | ||
def json = gbuilder.create().toJson(config) | ||
|
||
choreoConfigFile.parentFile.mkdirs() | ||
|
||
choreoConfigFile.text = json | ||
} | ||
} | ||
|
||
ext.choreoConfigFileSetup = { AbstractArchiveTask zip-> | ||
zip.dependsOn choreoConfigFileTask | ||
zip.inputs.file choreoConfigFile | ||
|
||
zip.from(choreoConfigFile) { | ||
rename {'choreoConfig.json'} | ||
} | ||
} | ||
|
||
ext.choreoZipSetup = { AbstractArchiveTask zip-> | ||
if (project.hasProperty('linuxBuild')) { | ||
zip.dependsOn downloadTaskLinux | ||
|
||
zip.inputs.files downloadTaskLinux.get().outputFiles | ||
|
||
zip.from(project.zipTree(downloadTaskLinux.get().outputFiles.first())) { | ||
into '/choreo' | ||
includeEmptyDirs = false | ||
} | ||
} else if (project.hasProperty('macBuild')) { | ||
zip.dependsOn downloadTaskMac | ||
|
||
zip.inputs.files downloadTaskMac.get().outputFiles | ||
|
||
zip.from(project.zipTree(downloadTaskMac.get().outputFiles.first())) { | ||
into '/choreo' | ||
includeEmptyDirs = false | ||
} | ||
} else if (project.hasProperty('macBuildArm')) { | ||
zip.dependsOn downloadTaskMacArm | ||
|
||
zip.inputs.files downloadTaskMacArm.get().outputFiles | ||
|
||
zip.from(project.zipTree(downloadTaskMacArm.get().outputFiles.first())) { | ||
into '/choreo' | ||
includeEmptyDirs = false | ||
} | ||
} else { | ||
zip.dependsOn downloadTaskWindows | ||
|
||
zip.inputs.files downloadTaskWindows.get().outputFiles | ||
|
||
zip.from(project.zipTree(downloadTaskWindows.get().outputFiles.first())) { | ||
into '/choreo' | ||
includeEmptyDirs = false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters