Skip to content

Commit

Permalink
Merge branch 'main' into deploy_data
Browse files Browse the repository at this point in the history
  • Loading branch information
spacey-sooty authored Dec 1, 2024
2 parents 95b8941 + 2a5a5e7 commit df72f28
Show file tree
Hide file tree
Showing 73 changed files with 146 additions and 2,385 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
language: [cpp, java, asm] #, jni, kotlin]
language: [cpp, java, asm] #, jni]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand All @@ -37,14 +37,14 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: Maven
path: ~/.m2/
path: ~/.m2/repository/

- name: Setup RoboRIO Toolchain
if: ${{ (matrix.language == 'cpp') || (matrix.language == 'asm') }}
run: ./gradlew installRoboRioToolchain
run: ../../gradlew installRoboRioToolchain
working-directory: testing/${{ matrix.language }}
- name: Test ${{ matrix.language }} Build
run: ./gradlew build
run: ../../gradlew build
working-directory: testing/${{ matrix.language }}

publish:
Expand Down
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repositories {
dependencies {
api 'com.google.code.gson:gson:2.8.6'

api 'edu.wpi.first:native-utils:2024.6.1'
api 'edu.wpi.first:native-utils:2025.6.0'

api 'org.eclipse.jgit:org.eclipse.jgit:6.10.+'

Expand Down Expand Up @@ -55,6 +55,10 @@ allprojects {
tasks.withType(Javadoc) {
options.addBooleanOption('Xdoclint:all,-missing', true)
}

tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}

gradlePlugin {
Expand Down Expand Up @@ -112,6 +116,6 @@ examplesFolder.eachFile { File file ->
jar.finalizedBy zipExamples

wrapper {
gradleVersion = '8.5'
gradleVersion = '8.11'
distributionType = Wrapper.DistributionType.BIN
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = 2024.3.2
version = 2025.1.1-beta-2
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void deploy(DeployContext arg0) {
}

public FileCollection computeFiles() {
Set<File> configFileCaches = configuration.get().getResolvedConfiguration().getFiles();
Set<File> configFileCaches = configuration.get().getIncoming().getFiles().getFiles();
if (zipped) {
Optional<FileTree> allFiles = configFileCaches.stream().map(file -> getTarget().getProject().zipTree(file).matching(filter)).filter(x -> x != null).reduce((a, b) -> a.plus(b));
if (allFiles.isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@ public List<String> getAllowedImageVersions() {
return allowedImageVersions;
}

private static String parseMessage(String imageVersion) {
return "Invalid RoboRIO Image Version!" +
"\nRoboRIO image and GradleRIO versions are incompatible:" +
"\n\tCurrent image version: " + imageVersion +
"\n\tGradleRIO-compatible image versions: 2024_v2.* except 2024_v2.0" +
"\nSee https://docs.wpilib.org/en/stable/docs/zero-to-robot/step-3/imaging-your-roborio.html" +
"for information about upgrading the RoboRIO image." +
"\nSee https://docs.wpilib.org/en/stable/docs/zero-to-robot/step-2/wpilib-setup.html and" +
"\nhttps://docs.wpilib.org/en/stable/docs/software/vscode-overview/importing-gradle-project.html" +
"\nfor information about updating WPILib and GradleRIO.";
}

private static String parseMessage(String imageVersion, List<String> allowedImageVersions) {
return "Invalid RoboRIO Image Version!" +
"\nRoboRIO image and GradleRIO versions are incompatible:" +
Expand All @@ -46,12 +34,6 @@ public InvalidImageException(String imageVersion, List<String> allowedImageVersi
this.allowedImageVersions = new ArrayList<>(allowedImageVersions);
}

public InvalidImageException(String imageVersion, boolean isSpecialCase) {
super(parseMessage(imageVersion));
this.imageVersion = imageVersion;
this.allowedImageVersions = new ArrayList<>();
}

public InvalidImageException() {
super("Could not parse image version!");
allowedImageVersions = List.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,6 @@ private void readAndVerifyImage(DeployContext context) {
}

private void verifyImageVersion(String image) {
if (image.equalsIgnoreCase("2024_v2.0")) {
throw new InvalidImageException(image, true);
}

boolean foundMatch = validImageVersions.stream().filter(x -> {
int index = x.indexOf("*");
if (index == -1) {
Expand Down
25 changes: 21 additions & 4 deletions src/main/java/edu/wpi/first/gradlerio/wpi/WPIExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
import org.gradle.api.provider.Provider;
import org.gradle.internal.os.OperatingSystem;
import org.gradle.nativeplatform.plugins.NativeComponentPlugin;
import org.gradle.plugins.ide.eclipse.EclipsePlugin;
import org.gradle.plugins.ide.eclipse.model.ClasspathEntry;
import org.gradle.plugins.ide.eclipse.model.EclipseClasspath;
import org.gradle.plugins.ide.eclipse.model.EclipseModel;
import org.gradle.plugins.ide.eclipse.model.SourceFolder;

import edu.wpi.first.gradlerio.wpi.java.WPIJavaExtension;
import edu.wpi.first.gradlerio.wpi.cpp.WPINativeExtension;
Expand All @@ -24,7 +29,7 @@
public class WPIExtension {
// WPILib (first.wpi.edu/FRC/roborio/maven) libs

private static final List<String> validImageVersions = List.of("2024_v2.*");
private static final List<String> validImageVersions = List.of("2025_v1.*");

private String jreArtifactLocation = "edu.wpi.first.jdk:roborio-2024:17.0.9u7-3";

Expand Down Expand Up @@ -58,7 +63,7 @@ public WPIExtension(Project project) {
platforms = new NativePlatforms();

frcYear = factory.property(String.class);
frcYear.convention("2024");
frcYear.convention("2025");

frcHome = factory.directoryProperty().fileProvider(project.provider(WPIExtension::computeHomeRoot))
.dir(frcYear);
Expand All @@ -85,6 +90,20 @@ public WPIExtension(Project project) {

project.getPlugins().withType(JavaPlugin.class, p -> {
java = factory.newInstance(WPIJavaExtension.class, project, sim, versions);

project.getPluginManager().apply(EclipsePlugin.class);
EclipseModel eclipse = project.getExtensions().getByType(EclipseModel.class);
EclipseClasspath eclipseClasspath = eclipse.getClasspath();
eclipseClasspath.containers("org.eclipse.buildship.core.gradleclasspathcontainer");
eclipseClasspath.getFile().whenMerged(cp -> {
if (cp instanceof org.gradle.plugins.ide.eclipse.model.Classpath ecp) {
List<ClasspathEntry> entries = ecp.getEntries();
// TODO make this grab the build folder dynamically, and include everything else necessary
SourceFolder src = new SourceFolder("build/generated/sources/annotationProcessor/java/main", null);
entries.add(src);
}
});

});

maven = factory.newInstance(WPIMavenExtension.class, project);
Expand Down Expand Up @@ -147,8 +166,6 @@ private static File computeHomeRoot() {
// "wpilibVersion" : new Tuple("WPILib", wpilibVersion, "wpilib"),
// "opencvVersion" : new Tuple("OpenCV", opencvVersion, "opencv"),
// "frcYear " : new Tuple("FRC Year", frcYear, "frcYear"),
// "googleTestVersion" : new Tuple("Google Test", googleTestVersion,
// "googleTest"),
// "imguiVersion" : new Tuple("ImGUI", imguiVersion, "imgui"),
// "wpimathVersion" : new Tuple("WPIMath", wpimathVersion, "wpimath"),
// "ejmlVersion" : new Tuple("EJML", ejmlVersion, "ejml"),
Expand Down
29 changes: 13 additions & 16 deletions src/main/java/edu/wpi/first/gradlerio/wpi/WPIVersionsExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,29 @@

public abstract class WPIVersionsExtension {

private static final String wpilibVersion = "2024.3.2";
private static final String niLibrariesVersion = "2024.2.1";
private static final String opencvVersion = "4.8.0-2";
private static final String wpilibVersion = "2025.1.1-beta-2";
private static final String niLibrariesVersion = "2025.0.0";
private static final String opencvVersion = "4.8.0-4";
private static final String imguiVersion = "1.89.9-1";
private static final String ejmlVersion = "0.43.1";
private static final String jacksonVersion = "2.15.2";
private static final String quickbufVersion = "1.3.3";
private static final String wpimathVersion = "2024.3.2";
private static final String googleTestVersion = "1.14.0-1";
private static final String wpimathVersion = "2025.1.1-beta-2";

private static final String smartDashboardVersion = "2024.3.2";
private static final String shuffleboardVersion = "2024.3.2";
private static final String outlineViewerVersion = "2024.3.2";
private static final String robotBuilderVersion = "2024.3.2";
private static final String pathWeaverVersion = "2024.3.2";
private static final String glassVersion = "2024.3.2";
private static final String sysIdVersion = "2024.3.2";
private static final String roboRIOTeamNumberSetterVersion = "2024.3.2";
private static final String dataLogToolVersion = "2024.3.2";
private static final String smartDashboardVersion = "2025.1.1-beta-2";
private static final String shuffleboardVersion = "2025.1.1-beta-2";
private static final String outlineViewerVersion = "2025.1.1-beta-2";
private static final String robotBuilderVersion = "2025.1.1-beta-2";
private static final String pathWeaverVersion = "2025.1.1-beta-2";
private static final String glassVersion = "2025.1.1-beta-2";
private static final String sysIdVersion = "2025.1.1-beta-2";
private static final String roboRIOTeamNumberSetterVersion = "2025.1.1-beta-2";
private static final String dataLogToolVersion = "2025.1.1-beta-2";


public abstract Property<String> getWpilibVersion();
public abstract Property<String> getNiLibrariesVersion();
public abstract Property<String> getOpencvVersion();
public abstract Property<String> getGoogleTestVersion();
public abstract Property<String> getImguiVersion();
public abstract Property<String> getWpimathVersion();

Expand All @@ -52,7 +50,6 @@ public WPIVersionsExtension() {
getWpilibVersion().convention(wpilibVersion);
getNiLibrariesVersion().convention(niLibrariesVersion);
getOpencvVersion().convention(opencvVersion);
getGoogleTestVersion().convention(googleTestVersion);
getImguiVersion().convention(imguiVersion);
getWpimathVersion().convention(wpimathVersion);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,10 @@ public WPINativeExtension(Project project, WPIExtension wpi, WPIVersionsExtensio
// nte.setSinglePrintPerPlatform();

nte.getWpi().configureDependencies(wpiDeps -> {
wpiDeps.getGoogleTestYear().set("frc2024");
wpiDeps.getOpencvYear().set("frc2024");
wpiDeps.getWpiVersion().set(versions.getWpilibVersion());
wpiDeps.getNiLibVersion().set(versions.getNiLibrariesVersion());
wpiDeps.getOpencvVersion().set(versions.getOpencvVersion());
wpiDeps.getGoogleTestVersion().set(versions.getGoogleTestVersion());
wpiDeps.getImguiVersion().set(versions.getImguiVersion());
wpiDeps.getWpimathVersion().set(versions.getWpimathVersion());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private Set<File> getFiles() {
for (Configuration cfg : configs) {
if (cfg.isCanBeResolved()) {
logger.info("Resolving Deps Configuration: " + cfg.getName());
files.addAll(cfg.getResolvedConfiguration().getFiles());
files.addAll(cfg.getIncoming().getFiles().getFiles());
} else {
logger.info("Can't resolve: " + cfg.getName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.TaskAction;
import org.gradle.internal.os.OperatingSystem;
import org.gradle.process.ExecOperations;

import edu.wpi.first.gradlerio.SingletonTask;

public class CppToolRunTask extends DefaultTask implements SingletonTask {
private final Property<String> toolName;
private final DirectoryProperty toolsFolder;
private final ExecOperations operations;

@Internal
public Property<String> getToolName() {
Expand All @@ -33,11 +35,12 @@ public DirectoryProperty getToolsFolder() {
}

@Inject
public CppToolRunTask(ObjectFactory objects) {
public CppToolRunTask(ObjectFactory objects, ExecOperations execOperations) {
setGroup("GradleRIO");

this.toolName = objects.property(String.class);
toolsFolder = objects.directoryProperty();
operations = execOperations;
}

@TaskAction
Expand Down Expand Up @@ -77,8 +80,8 @@ private void runToolWindows() {
private void runToolUnix() {
Directory toolsFolder = this.toolsFolder.get();
String toolName = this.toolName.get();
File outputFile = toolsFolder.file(toolName + ".py").getAsFile();
getProject().exec(spec -> {
File outputFile = toolsFolder.file(toolName + ".sh").getAsFile();
operations.exec(spec -> {
spec.setExecutable(outputFile.getAbsolutePath());
spec.args(getArgumentPath(toolName.toLowerCase()));
});
Expand Down
Loading

0 comments on commit df72f28

Please sign in to comment.