-
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: Gold856 <[email protected]> Co-authored-by: Jade <[email protected]> Co-authored-by: Tyler Veness <[email protected]> Co-authored-by: sciencewhiz <[email protected]>
- Loading branch information
1 parent
6a21d3b
commit 02729d7
Showing
11 changed files
with
251 additions
and
1 deletion.
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 ElasticConfig | ||
{ | ||
[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
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,13 @@ | ||
#!/bin/sh | ||
|
||
SCRIPT_PATH="$(dirname "$(realpath "$0")")" | ||
SCRIPT_NAME="$(basename "$(realpath "$0")")" | ||
SCRIPT_BASE="$(basename -s .sh "$SCRIPT_NAME")" | ||
OS_NAME="$(uname -s)" | ||
ELASTIC_PATH="$(realpath "$SCRIPT_PATH/../elastic")" | ||
|
||
if [ "$OS_NAME" = "Darwin" ]; then | ||
open "$ELASTIC_PATH/elastic_dashboard.app" | ||
else | ||
exec "$ELASTIC_PATH/elastic_dashboard" | ||
fi |
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 Elastic folder | ||
toolsFolder = fso.GetParentFolderName(WScript.ScriptFullName) | ||
yearFolder = fso.GetParentFolderName(toolsFolder) | ||
elasticFolder = fso.BuildPath(yearFolder, "elastic") | ||
|
||
'Get the full path to the exe | ||
fullExeName = fso.BuildPath(elasticFolder, "elastic_dashboard.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
apply from: 'scripts/versions.gradle' | ||
|
||
def baseUrl = "https://github.com/Gold872/elastic-dashboard/releases/download/$elasticGitTag/" | ||
|
||
def fileNameWindows = 'Elastic-WPILib-Windows.zip' | ||
|
||
def downloadUrlWindows = baseUrl + fileNameWindows | ||
|
||
def fileNameMac = 'Elastic-WPILib-macOS.tar.gz' | ||
|
||
def downloadUrlMac = baseUrl + fileNameMac | ||
|
||
def fileNameMacArm = 'Elastic-WPILib-macOS.tar.gz' | ||
|
||
def downloadUrlMacArm = baseUrl + fileNameMacArm | ||
|
||
def fileNameLinux = 'Elastic-WPILib-Linux.zip' | ||
|
||
def downloadUrlLinux = baseUrl + fileNameLinux | ||
|
||
apply plugin: 'de.undercouch.download' | ||
|
||
def downloadTaskWindows = tasks.register('downloadElasticWindows', Download) { | ||
src downloadUrlWindows | ||
def fileName = file(src.file).name | ||
dest "$buildDir/downloads/$fileName" | ||
overwrite true | ||
} | ||
|
||
def downloadTaskMac = tasks.register('downloadElasticMac', Download) { | ||
src downloadUrlMac | ||
def fileName = file(src.file).name | ||
dest "$buildDir/downloads/$fileName" | ||
overwrite true | ||
} | ||
|
||
def downloadTaskMacArm = tasks.register('downloadElasticMacArm', Download) { | ||
src downloadUrlMacArm | ||
def fileName = file(src.file).name | ||
dest "$buildDir/downloads/$fileName" | ||
overwrite true | ||
} | ||
|
||
def downloadTaskLinux = tasks.register('downloadElasticLinux', Download) { | ||
src downloadUrlLinux | ||
def fileName = file(src.file).name | ||
dest "$buildDir/downloads/$fileName" | ||
overwrite true | ||
} | ||
|
||
def elasticConfigFile = file("$buildDir/elasticConfig.json") | ||
|
||
def elasticConfigFileTask = tasks.register('elasticConfigFile') { | ||
it.outputs.file elasticConfigFile | ||
|
||
doLast { | ||
def config = [:] | ||
config['folder'] = 'elastic' | ||
config['zipFile'] = 'elastic.zip' | ||
|
||
def gbuilder = getGsonBuilder() | ||
|
||
gbuilder.setPrettyPrinting() | ||
def json = gbuilder.create().toJson(config) | ||
|
||
elasticConfigFile.parentFile.mkdirs() | ||
|
||
elasticConfigFile.text = json | ||
} | ||
} | ||
|
||
ext.elasticConfigFileSetup = { AbstractArchiveTask zip-> | ||
zip.dependsOn elasticConfigFileTask | ||
zip.inputs.file elasticConfigFile | ||
|
||
zip.from(elasticConfigFile) { | ||
rename { 'elasticConfig.json' } | ||
} | ||
} | ||
|
||
ext.elasticZipSetup = { AbstractArchiveTask zip-> | ||
if (project.hasProperty('linuxBuild')) { | ||
zip.dependsOn downloadTaskLinux | ||
|
||
zip.inputs.files downloadTaskLinux.get().outputFiles | ||
|
||
zip.from(project.zipTree(downloadTaskLinux.get().outputFiles.first())) { | ||
into '/elastic' | ||
includeEmptyDirs = false | ||
} | ||
} else if (project.hasProperty('macBuild')) { | ||
zip.dependsOn downloadTaskMac | ||
|
||
zip.inputs.files downloadTaskMac.get().outputFiles | ||
|
||
// Cannot extract, otherwise breaks mac | ||
zip.from(downloadTaskMac.get().outputFiles.first()) { | ||
into '/elastic' | ||
} | ||
} else if (project.hasProperty('macBuildArm')) { | ||
zip.dependsOn downloadTaskMacArm | ||
|
||
zip.inputs.files downloadTaskMacArm.get().outputFiles | ||
|
||
// Cannot extract, otherwise breaks mac | ||
zip.from(downloadTaskMacArm.get().outputFiles.first()) { | ||
into '/elastic' | ||
} | ||
} else { | ||
zip.dependsOn downloadTaskWindows | ||
|
||
zip.inputs.files downloadTaskWindows.get().outputFiles | ||
|
||
zip.from(project.zipTree(downloadTaskWindows.get().outputFiles.first())) { | ||
into '/elastic' | ||
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