Skip to content

Commit

Permalink
Add AdvantageScope for Linux arm64 (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner authored Jan 21, 2024
1 parent ac47a15 commit 75c5e73
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripts/advantagescope.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def fileNameLinux = "advantagescope-wpilib-linux-x64.zip"

def downloadUrlLinux = baseUrl + fileNameLinux

def fileNameLinuxArm64 = "advantagescope-wpilib-linux-arm64.zip"

def downloadUrlLinuxArm64 = baseUrl + fileNameLinuxArm64

apply plugin: 'de.undercouch.download'

def downloadTaskWindows = tasks.register('downloadAdvantageScopeWindows', Download) {
Expand Down Expand Up @@ -48,6 +52,13 @@ def downloadTaskLinux = tasks.register('downloadAdvantageScopeLinux', Download)
overwrite true
}

def downloadTaskLinuxArm64 = tasks.register('downloadAdvantageScopeLinuxArm64', Download) {
src downloadUrlLinuxArm64
def fileName = file(src.file).name
dest "$buildDir/downloads/$fileName"
overwrite true
}

def advantageScopeConfigFile = file("$buildDir/advantageScopeConfig.json")

def advantageScopeConfigFileTask = tasks.register("advantageScopeConfigFile") {
Expand Down Expand Up @@ -89,7 +100,15 @@ ext.advantageScopeZipSetup = { AbstractArchiveTask zip->
into '/advantagescope'
includeEmptyDirs = false
}
} else if (project.hasProperty('linuxBuildArm64')) {
zip.dependsOn downloadTaskLinuxArm64

zip.inputs.files downloadTaskLinuxArm64.get().outputFiles

zip.from(project.zipTree(downloadTaskLinuxArm64.get().outputFiles.first())) {
into '/advantagescope'
includeEmptyDirs = false
}
} else if (project.hasProperty('macBuild')) {
zip.dependsOn downloadTaskMac

Expand Down

0 comments on commit 75c5e73

Please sign in to comment.