Skip to content

Commit 06da326

Browse files
committed
only enable on mac
Signed-off-by: Jade Turner <[email protected]>
1 parent 012e31c commit 06da326

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

src/main/java/edu/wpi/first/nativeutils/WPINativeUtils.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,22 @@ public void apply(Project project) {
1616

1717
project.getPluginManager().apply(RpathRules.class);
1818

19-
if (project.hasProperty("developerID")) {
20-
project.getTasks().withType(AbstractLinkTask.class).forEach((task) -> {
21-
// Don't sign any executables because codesign complains
22-
// about relative rpath.
23-
if (!(task instanceof LinkExecutable)) {
24-
// Get path to binary.
25-
String path = task.getLinkedFile().getAsFile().get().getAbsolutePath();
26-
ProcessBuilder builder = new ProcessBuilder();
27-
var codesigncommand = String.format("codesign --force --strict --timestamp --options=runtime "
28-
+ "--version -s %s %s", project.findProperty("developerID"), path);
29-
builder.command("sh", "-c", codesigncommand);
30-
builder.directory(project.getRootDir());
31-
}
32-
});
19+
if (System.getProperty("os.name").startsWith("Mac")) {
20+
if (project.hasProperty("developerID")) {
21+
project.getTasks().withType(AbstractLinkTask.class).forEach((task) -> {
22+
// Don't sign any executables because codesign complains
23+
// about relative rpath.
24+
if (!(task instanceof LinkExecutable)) {
25+
// Get path to binary.
26+
String path = task.getLinkedFile().getAsFile().get().getAbsolutePath();
27+
ProcessBuilder builder = new ProcessBuilder();
28+
var codesigncommand = String.format("codesign --force --strict --timestamp --options=runtime "
29+
+ "--version -s %s %s", project.findProperty("developerID"), path);
30+
builder.command("sh", "-c", codesigncommand);
31+
builder.directory(project.getRootDir());
32+
}
33+
});
34+
}
3335
}
3436
}
3537
}

0 commit comments

Comments
 (0)