@@ -16,20 +16,22 @@ public void apply(Project project) {
16
16
17
17
project .getPluginManager ().apply (RpathRules .class );
18
18
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
+ }
33
35
}
34
36
}
35
37
}
0 commit comments