From b85a0d5cf350b67a33ff03c55767dbdef52ac0e6 Mon Sep 17 00:00:00 2001 From: PJ Reiniger Date: Wed, 16 Jul 2025 00:20:28 -0400 Subject: [PATCH] [build] Add missing sources to published zip files (#8055) Gradle publishing does not capture all of the source files that are used during a build. This should get most of them, and get it equivalent to what bazel pushes out. --- hal/build.gradle | 3 +++ ntcore/build.gradle | 6 ++++++ shared/javacpp/publish.gradle | 3 +++ wpilibc/publish.gradle | 3 +++ wpimath/build.gradle | 6 ++++++ wpinet/build.gradle | 6 ++++++ wpiutil/build.gradle | 3 +++ 7 files changed, 30 insertions(+) diff --git a/hal/build.gradle b/hal/build.gradle index ac298fad0a..c0e66354a3 100644 --- a/hal/build.gradle +++ b/hal/build.gradle @@ -80,6 +80,9 @@ cppHeadersZip { from(generatedHeaders) { into '/' } + from('src/mrc/include') { + into '/' + } } Action> symbolFilter = { symbols -> diff --git a/ntcore/build.gradle b/ntcore/build.gradle index 299afdd951..d4ec0ab3e4 100644 --- a/ntcore/build.gradle +++ b/ntcore/build.gradle @@ -48,6 +48,12 @@ cppHeadersZip { } } +cppSourcesZip { + from(generatedSources) { + into '/' + } +} + Action> symbolFilter = { symbols -> symbols.removeIf({ !it.startsWith('NT_') }) } as Action>; diff --git a/shared/javacpp/publish.gradle b/shared/javacpp/publish.gradle index 5af49f0c45..92b7b3df1d 100644 --- a/shared/javacpp/publish.gradle +++ b/shared/javacpp/publish.gradle @@ -23,6 +23,9 @@ task cppSourcesZip(type: Zip) { from("$buildDir/generated/cpp") { into '/' } + from("src/generated/main/native/cpp") { + into '/' + } } task cppHeadersZip(type: Zip) { diff --git a/wpilibc/publish.gradle b/wpilibc/publish.gradle index aff50caa69..a81239bba5 100644 --- a/wpilibc/publish.gradle +++ b/wpilibc/publish.gradle @@ -21,6 +21,9 @@ task cppSourcesZip(type: Zip) { from("$buildDir/generated/cpp") { into '/' } + from("src/generated/main/native/cpp") { + into '/' + } } cppSourcesZip.dependsOn generateCppVersion diff --git a/wpimath/build.gradle b/wpimath/build.gradle index 9cb07b416e..90174d2693 100644 --- a/wpimath/build.gradle +++ b/wpimath/build.gradle @@ -52,6 +52,12 @@ cppHeadersZip { } } +cppSourcesZip { + from('src/main/native/thirdparty/sleipnir/src') { + into '/' + } +} + model { components { all { diff --git a/wpinet/build.gradle b/wpinet/build.gradle index edb399a531..f2a10bfb15 100644 --- a/wpinet/build.gradle +++ b/wpinet/build.gradle @@ -198,6 +198,12 @@ cppHeadersZip { } } +cppSourcesZip { + from('src/main/native/thirdparty/tcpsockets/cpp') { + into '/' + } +} + model { components { all { diff --git a/wpiutil/build.gradle b/wpiutil/build.gradle index 4b3d51803e..8cbf887b0c 100644 --- a/wpiutil/build.gradle +++ b/wpiutil/build.gradle @@ -193,6 +193,9 @@ cppHeadersZip { } cppSourcesZip { + from('src/main/native/thirdparty/debugging/src') { + into '/' + } from('src/main/native/thirdparty/fmtlib/src') { into '/' }