Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Check output
run: git --no-pager diff --exit-code HEAD
- name: Install All Toolchains
run: ../../gradlew installArm64Toolchain installSystemCoreToolchain
run: ../../gradlew installArm64Toolchain installSystemcoreToolchain
working-directory: testing/cpp
- name: Build Test
run: ../../gradlew build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ toolchainsPlugin {
linuxCppCompilerExecutable = "g++-14"

// Add the systemcore compiler
withCrossSystemCore()
withCrossSystemcore()
// Add the raspbian compiler
withCrossLinuxArm64()
// The above 2 are included with nativeUtils.addWpiNativeUtils()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.gradle.api.model.ObjectFactory;

import org.wpilib.toolchain.arm64.Arm64ToolchainPlugin;
import org.wpilib.toolchain.systemcore.SystemCoreToolchainPlugin;
import org.wpilib.toolchain.systemcore.SystemcoreToolchainPlugin;
import org.wpilib.toolchain.configurable.CrossCompilerConfiguration;

public class ToolchainExtension {
Expand Down Expand Up @@ -143,8 +143,8 @@ public void withCrossLinuxArm64() {
}
}

public void withCrossSystemCore() {
project.getPluginManager().apply(SystemCoreToolchainPlugin.class);
public void withCrossSystemcore() {
project.getPluginManager().apply(SystemcoreToolchainPlugin.class);
}

private boolean removeInvalidWindowsToolchains = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

import org.wpilib.toolchain.opensdk.OpenSdkToolchainExtension;

public abstract class SystemCoreToolchainExtension extends OpenSdkToolchainExtension {
public abstract class SystemcoreToolchainExtension extends OpenSdkToolchainExtension {
public static final String TOOLCHAIN_VERSION = "2027-14.3.0";
public static final String INSTALL_SUBDIR = "systemcore";

@Inject
public SystemCoreToolchainExtension() {
public SystemcoreToolchainExtension() {
super();
getVersionLow().convention("14.3.0");
getVersionHigh().convention("14.3.0");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,34 @@
import org.wpilib.toolchain.opensdk.OpenSdkToolchainBase;
import org.wpilib.toolchain.opensdk.OpenSdkToolchainBase.ToolchainBaseOptions;

public class SystemCoreToolchainPlugin implements Plugin<Project> {
public class SystemcoreToolchainPlugin implements Plugin<Project> {

public static final String toolchainName = "systemCore";
public static final String toolchainName = "systemcore";
public static final String baseToolchainName = "arm64-systemcore";

private SystemCoreToolchainExtension systemcoreExt;
private SystemcoreToolchainExtension systemcoreExt;
private Project project;
private OpenSdkToolchainBase opensdk;
private ExecOperations operations;

@Inject
public SystemCoreToolchainPlugin(ExecOperations operations) {
public SystemcoreToolchainPlugin(ExecOperations operations) {
this.operations = operations;
}

@Override
public void apply(Project project) {
this.project = project;

systemcoreExt = project.getExtensions().create("systemcoreToolchain", SystemCoreToolchainExtension.class);
systemcoreExt = project.getExtensions().create("systemcoreToolchain", SystemcoreToolchainExtension.class);

ToolchainExtension toolchainExt = project.getExtensions().getByType(ToolchainExtension.class);

ToolchainBaseOptions options = new ToolchainBaseOptions();
options.baseToolchainName = baseToolchainName;
options.tcExt = systemcoreExt;
options.project = project;
options.installSubdir = SystemCoreToolchainExtension.INSTALL_SUBDIR;
options.installSubdir = SystemcoreToolchainExtension.INSTALL_SUBDIR;
options.toolchainPrefix = project.provider(() -> "aarch64-systemcore2027-linux-gnu");
options.rootExtension = toolchainExt.getToolchainGraphService();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import spock.lang.Specification
import spock.lang.IgnoreIf

@IgnoreIf({ !Boolean.valueOf(env['SPOCK_RUN_TOOLCHAINS']) })
class SystemCoreDownloadTest extends Specification {
class SystemcoreDownloadTest extends Specification {
@TempDir File testProjectDir
@TempDir File gradleUserHome
File buildFile
Expand All @@ -27,16 +27,16 @@ class SystemCoreDownloadTest extends Specification {
id 'org.wpilib.Toolchain'
}

toolchainsPlugin.withCrossSystemCore()
toolchainsPlugin.withCrossSystemcore()
"""
when:
def result = GradleRunner.create()
.withProjectDir(testProjectDir)
.withArguments('installSystemCoreToolchain', '--stacktrace', '-Dgradle.user.home=' + gradleUserHome)
.withArguments('installSystemcoreToolchain', '--stacktrace', '-Dgradle.user.home=' + gradleUserHome)
.withPluginClasspath()
.build()

then:
result.task(':installSystemCoreToolchain').outcome == SUCCESS
result.task(':installSystemcoreToolchain').outcome == SUCCESS
}
}
80 changes: 40 additions & 40 deletions src/main/java/org/wpilib/nativeutils/NativeUtilsExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
import org.wpilib.nativeutils.dependencies.CustomDependencySet;
import org.wpilib.nativeutils.dependencies.DelegatedDependencySet;
import org.wpilib.nativeutils.dependencies.FastDownloadDependencySet;
import org.wpilib.nativeutils.dependencies.NativeDependency;
import org.wpilib.nativeutils.dependencies.WPIHeaderOnlyMavenDependency;
import org.wpilib.nativeutils.dependencies.WPIOnDiskDependency;
import org.wpilib.nativeutils.dependencies.WPISharedMavenDependency;
import org.wpilib.nativeutils.dependencies.WPIStaticMavenDependency;
import org.wpilib.nativeutils.dependencies.NativeDependency;
import org.wpilib.nativeutils.dependencies.WPIHeaderOnlyMavenDependency;
import org.wpilib.nativeutils.dependencies.WPIOnDiskDependency;
import org.wpilib.nativeutils.dependencies.WPISharedMavenDependency;
import org.wpilib.nativeutils.dependencies.WPIStaticMavenDependency;
import org.wpilib.nativeutils.exports.DefaultExportsConfig;
import org.wpilib.nativeutils.exports.ExportsConfig;
import org.wpilib.nativeutils.exports.PrivateExportsConfig;
Expand All @@ -49,7 +49,7 @@
import org.wpilib.toolchain.ToolchainExtension;
import org.wpilib.toolchain.arm64.Arm64ToolchainPlugin;
import org.wpilib.toolchain.configurable.CrossCompilerConfiguration;
import org.wpilib.toolchain.systemcore.SystemCoreToolchainPlugin;
import org.wpilib.toolchain.systemcore.SystemcoreToolchainPlugin;

public class NativeUtilsExtension {

Expand Down Expand Up @@ -105,10 +105,10 @@ public NativeUtilsExtension(Project project, ToolchainExtension tcExt) {
});

dependencyContainer = objectFactory.polymorphicDomainObjectContainer(NativeDependency.class);
addNativeDependencyType(WPIStaticMavenDependency.class, project);
addNativeDependencyType(WPISharedMavenDependency.class, project);
addNativeDependencyType(WPIHeaderOnlyMavenDependency.class, project);
addNativeDependencyType(WPIOnDiskDependency.class, project);
addNativeDependencyType(WPIStaticMavenDependency.class, project);
addNativeDependencyType(WPISharedMavenDependency.class, project);
addNativeDependencyType(WPIHeaderOnlyMavenDependency.class, project);
addNativeDependencyType(WPIOnDiskDependency.class, project);

addNativeDependencyType(CombinedIgnoreMissingPlatformNativeDependency.class, dependencyContainer);
addNativeDependencyType(AllPlatformsCombinedNativeDependency.class, dependencyContainer);
Expand Down Expand Up @@ -366,8 +366,8 @@ public TaskProvider<ResourceGenerationTask> generateResources(String name, Actio
return project.getTasks().register(name, ResourceGenerationTask.class, configure);
}

public void withCrossSystemCore() {
project.getPluginManager().apply(SystemCoreToolchainPlugin.class);
public void withCrossSystemcore() {
project.getPluginManager().apply(SystemcoreToolchainPlugin.class);
}

public void withCrossLinuxArm64() {
Expand Down Expand Up @@ -410,31 +410,31 @@ public void setRemoveInvalidWindowsToolchains(boolean remove) {
tcExt.setRemoveInvalidWindowsToolchains(remove);
}

public boolean isRemoveInvalidWindowsToolchains() {
return tcExt.isRemoveInvalidWindowsToolchains();
}

public void setRequireVersionedLinuxGcc(boolean require) {
tcExt.setRequireVersionedLinuxGcc(require);
}

public boolean isRequireVersionedLinuxGcc() {
return tcExt.isRequireVersionedLinuxGcc();
}

public void setLinuxCCompilerExecutable(String executable) {
tcExt.setLinuxCCompilerExecutable(executable);
}

public String getLinuxCCompilerExecutable() {
return tcExt.getLinuxCCompilerExecutable();
}

public void setLinuxCppCompilerExecutable(String executable) {
tcExt.setLinuxCppCompilerExecutable(executable);
}

public String getLinuxCppCompilerExecutable() {
return tcExt.getLinuxCppCompilerExecutable();
}
}
public boolean isRemoveInvalidWindowsToolchains() {
return tcExt.isRemoveInvalidWindowsToolchains();
}
public void setRequireVersionedLinuxGcc(boolean require) {
tcExt.setRequireVersionedLinuxGcc(require);
}
public boolean isRequireVersionedLinuxGcc() {
return tcExt.isRequireVersionedLinuxGcc();
}
public void setLinuxCCompilerExecutable(String executable) {
tcExt.setLinuxCCompilerExecutable(executable);
}
public String getLinuxCCompilerExecutable() {
return tcExt.getLinuxCCompilerExecutable();
}
public void setLinuxCppCompilerExecutable(String executable) {
tcExt.setLinuxCppCompilerExecutable(executable);
}
public String getLinuxCppCompilerExecutable() {
return tcExt.getLinuxCppCompilerExecutable();
}
}
2 changes: 1 addition & 1 deletion testing/cpp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {

nativeUtils.addWpiNativeUtils()
nativeUtils.withCrossLinuxArm64()
nativeUtils.withCrossSystemCore();
nativeUtils.withCrossSystemcore();

nativeUtils.crossCompilers.getByName(NativePlatforms.linuxarm64).optional = false
nativeUtils.crossCompilers.getByName(NativePlatforms.systemcore).optional = false
Expand Down
Loading