From ea293f57d2b1b4d8b5bc69784c896fc35def7200 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 31 Dec 2022 19:56:16 -0800 Subject: [PATCH] Only include OpenCV for current platform (#675) Shrinks JAR by ~15MB --- .github/workflows/main.yml | 9 +++++---- build.gradle | 20 ++++++++------------ shared/common.gradle | 2 +- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6ae350df7..5ea61645b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -156,10 +156,11 @@ jobs: pip install sphinx sphinx_rtd_theme sphinx-tabs sphinxext-opengraph doc8 pip install -r requirements.txt - - name: Check the docs - run: | - make linkcheck - make lint + # Don't check the docs. If a PR was merged to the docs repo, it ought to pass CI. No need to re-check here. + # - name: Check the docs + # run: | + # make linkcheck + # make lint - name: Build the docs run: | diff --git a/build.gradle b/build.gradle index fe388df47..f9d19a018 100644 --- a/build.gradle +++ b/build.gradle @@ -32,18 +32,14 @@ ext { pubVersion = versionString isDev = pubVersion.startsWith("dev") - if(project.hasProperty('pionly')) { - jniPlatforms = ['linuxarm32'] - } else if(project.hasProperty('winonly')) { - jniPlatforms = ['windowsx86-64'] - } else if(project.hasProperty('aarch64only')) { - jniPlatforms = ['linuxaarch64bionic'] - } else { - jniPlatforms = ['linuxarm64', 'linuxarm32', 'linuxx86-64', 'osxuniversal', 'windowsx86-64'] - } - - println("Building for archs " + jniPlatforms) - + // A list, for legacy reasons, with only the current platform contained + String nativeName = wpilibTools.platformMapper.currentPlatform.platformName; + if (nativeName == "linuxx64") nativeName = "linuxx86-64"; + if (nativeName == "winx64") nativeName = "windowsx86-64"; + if (nativeName == "macx64") nativeName = "osxx86-64"; + if (nativeName == "macarm64") nativeName = "osxarm64"; + jniPlatform = nativeName + println("Building for platform " + jniPlatform) } wpilibTools.deps.wpilibVersion = wpilibVersion diff --git a/shared/common.gradle b/shared/common.gradle index 2b8a765bc..684cf24bf 100644 --- a/shared/common.gradle +++ b/shared/common.gradle @@ -37,7 +37,7 @@ dependencies { implementation wpilibTools.deps.wpilibJava("wpilibj") implementation "edu.wpi.first.thirdparty.frc2023.opencv:opencv-java:$opencvVersion" - jniPlatforms.each { implementation "edu.wpi.first.thirdparty.frc2023.opencv:opencv-jni:$opencvVersion:$it" } + implementation "edu.wpi.first.thirdparty.frc2023.opencv:opencv-jni:$opencvVersion:$jniPlatform" implementation "org.ejml:ejml-simple:0.41"