calcmogul:
Thank you for the help. You put me on the right path. However, I could not simply add that statement (starting with the model) at the end of the build.gradle
file.
I had to insert the binaries.all
block that you provided within the existing model
block, as seen below (which may be what you originally intended, and I just didn’t understand that at first).
I understand the risks of ignoring warnings for deprecated code, and plan to put in our code source that we are using deprecated code, and how to remove the -Wno-deprecated-declarations
statement from the build.gradle
file, and pass this information along to our programmers. I just don’t them to miss other warnings because they know some are deprecated warnings.
Also, one other question: Our team pulls in the allwpilibc source into our Doxygen documentation, which generates a customized page similar to the official WPILib C++ documentation page (WPILibC++: Main Page). However, when I click on the “Deprecated List” over in the left-hand side of the above page (Deprecated List), all I see listed as deprecated is:
Member frc::CameraServer::SetSize (int size)
and
Member frc::Encoder::SetMaxPeriod (double maxPeriod) override
Should not all the old command-based programming be marked as deprecated (Deprecated Command)? This I would think would be helpful. I and our programmers have found the Doxygen documentation extremely helpful, and marking the deprecated code as deprecated would be helpful as well.
Again, thank you for the help. And thank you very much for being a WPILib developer!
======================================================================
model {
components {
frcUserProgram(NativeExecutableSpec) {
targetPlatform wpi.platforms.roborio
if (includeDesktopSupport) {
targetPlatform wpi.platforms.desktop
}
sources.cpp {
source {
srcDir 'src/main/cpp'
include '**/*.cpp', '**/*.cc'
}
exportedHeaders {
srcDir 'src/main/include'
if (includeSrcInIncludeRoot) {
srcDir 'src/main/cpp'
}
}
}
// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
wpi.deps.wpilib(it)
wpi.deps.vendor.cpp(it)
// From Chief Delphi contributor calcmogul, on post
// https://www.chiefdelphi.com/t/pragma-or-gradle-flag-for-ignoring-deprecated-warnings/375815/2
binaries.all {
if (!(toolChain instanceof VisualCpp)) {
cppCompiler.args << '-Wno-deprecated-declarations'
}
}
// end "From Chief Delphi contributor calcmogul, on post..."
}
}
testSuites {
frcUserProgramTest(GoogleTestTestSuiteSpec) {
testing $.components.frcUserProgram
sources.cpp {
source {
srcDir 'src/test/cpp'
include '**/*.cpp'
}
}
wpi.deps.wpilib(it)
wpi.deps.googleTest(it)
wpi.deps.vendor.cpp(it)
}
}
}