Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 355eac8

Browse files
committed
During windows build use "icacls" tool to change file attributes
Previously the ant call "chmod" was used, but this is a no-op on Windows, so it would works only if the IDE is cross-built from a unix host. This patch allows to build a distribution of the IDE also from a Windows host.
1 parent a59cf8e commit 355eac8

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

‎build/build.xml‎

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,19 @@
856856
<unzip src="${archive_file}" dest="${dest_folder}"/>
857857
</target>
858858

859+
<!-- Ensure that the executable flag is set in all enviroments/OS -->
860+
<target name="make-file-executable" depends="make-file-executable-windows">
861+
<chmod perm="755" file="${file}" />
862+
</target>
863+
864+
<target name="make-file-executable-windows" if="windows">
865+
<exec executable="icacls" failonerror="false">
866+
<arg value="${file}"/>
867+
<arg value="/grant"/>
868+
<arg value="Everyone:(RX)"/>
869+
</exec>
870+
</target>
871+
859872
<target name="linux-dist" depends="build"
860873
description="Build .tar.xz of linux version">
861874

@@ -982,7 +995,9 @@
982995
<param name="dest_folder" value="${staging_folder}" />
983996
</antcall>
984997
<copy file="windows/liblistSerials-${LIBLISTSERIAL-VERSION}/windows/listSerialsj.dll" todir="windows/work/lib/" />
985-
<chmod perm="755" file="windows/work/lib/listSerialsj.dll" />
998+
<antcall target="make-file-executable">
999+
<param name="file" value="windows/work/lib/listSerialsj.dll" />
1000+
</antcall>
9861001

9871002
<delete dir="${staging_folder}/arduino-builder-windows" includeemptydirs="true"/>
9881003
<mkdir dir="${staging_folder}/arduino-builder-windows"/>
@@ -993,9 +1008,13 @@
9931008
<param name="dest_folder" value="${staging_folder}/arduino-builder-windows" />
9941009
</antcall>
9951010
<copy file="${staging_folder}/arduino-builder-windows/arduino-builder.exe" tofile="windows/work/arduino-builder.exe" />
996-
<chmod perm="755" file="windows/work/arduino-builder.exe" />
1011+
<antcall target="make-file-executable">
1012+
<param name="file" value="windows/work/arduino-builder.exe" />
1013+
</antcall>
9971014
<move file="${staging_folder}/arduino-builder-windows/tools" tofile="windows/work/tools-builder"/>
998-
<chmod perm="755" file="windows/work/tools-builder/ctags/5.8-arduino11/ctags.exe" />
1015+
<antcall target="make-file-executable">
1016+
<param name="file" value="windows/work/tools-builder/ctags/5.8-arduino11/ctags.exe" />
1017+
</antcall>
9991018
<copy todir="windows/work/hardware" overwrite="true">
10001019
<fileset dir="${staging_folder}/arduino-builder-windows/hardware" includes="*.txt"/>
10011020
</copy>
@@ -1011,7 +1030,9 @@
10111030
<arg value="com/sun/jna/win32-x86/jnidispatch.dll" />
10121031
</exec>
10131032
<move file="windows/work/lib/jnidispatch.dll" tofile="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" />
1014-
<chmod perm="755" file="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" />
1033+
<antcall target="make-file-executable">
1034+
<param name="file" value="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" />
1035+
</antcall>
10151036

10161037
<antcall target="assemble">
10171038
<param name="target.path" value="windows/work" />

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /