Skip to content

Commit d4458c0

Browse files
committed
Merge remote-tracking branch 'cmaglie/jna-3'
2 parents 89e3c52 + 7dcc135 commit d4458c0

File tree

3 files changed

+45
-3
lines changed

3 files changed

+45
-3
lines changed

build/build.xml

+38-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
<condition property="platform" value="linux64"><os family="unix" arch="amd64" /></condition>
2525
<condition property="platform" value="linuxarm"><os family="unix" arch="arm" /></condition>
2626

27+
<condition property="windows_host" value="true"><os family="windows" /></condition>
28+
2729
<condition property="macosx"><equals arg1="${platform}" arg2="macosx" /></condition>
2830
<condition property="windows"><equals arg1="${platform}" arg2="windows" /></condition>
2931
<condition property="linux32"><equals arg1="${platform}" arg2="linux32" /></condition>
@@ -857,6 +859,19 @@
857859
<unzip src="${archive_file}" dest="${dest_folder}"/>
858860
</target>
859861

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

@@ -983,7 +998,9 @@
983998
<param name="dest_folder" value="${staging_folder}" />
984999
</antcall>
9851000
<copy file="windows/liblistSerials-${LIBLISTSERIAL-VERSION}/windows/listSerialsj.dll" todir="windows/work/lib/" />
986-
<chmod perm="755" file="windows/work/lib/listSerialsj.dll" />
1001+
<antcall target="make-file-executable">
1002+
<param name="file" value="windows/work/lib/listSerialsj.dll" />
1003+
</antcall>
9871004

9881005
<delete dir="${staging_folder}/arduino-builder-windows" includeemptydirs="true"/>
9891006
<mkdir dir="${staging_folder}/arduino-builder-windows"/>
@@ -994,14 +1011,32 @@
9941011
<param name="dest_folder" value="${staging_folder}/arduino-builder-windows" />
9951012
</antcall>
9961013
<copy file="${staging_folder}/arduino-builder-windows/arduino-builder.exe" tofile="windows/work/arduino-builder.exe" />
997-
<chmod perm="755" file="windows/work/arduino-builder.exe" />
1014+
<antcall target="make-file-executable">
1015+
<param name="file" value="windows/work/arduino-builder.exe" />
1016+
</antcall>
9981017
<move file="${staging_folder}/arduino-builder-windows/tools" tofile="windows/work/tools-builder"/>
999-
<chmod perm="755" file="windows/work/tools-builder/ctags/5.8-arduino11/ctags.exe" />
1018+
<antcall target="make-file-executable">
1019+
<param name="file" value="windows/work/tools-builder/ctags/5.8-arduino11/ctags.exe" />
1020+
</antcall>
10001021
<copy todir="windows/work/hardware" overwrite="true">
10011022
<fileset dir="${staging_folder}/arduino-builder-windows/hardware" includes="*.txt"/>
10021023
</copy>
10031024
<delete dir="${staging_folder}/arduino-builder-windows" includeemptydirs="true"/>
10041025

1026+
<exec executable="unzip" failonerror="true">
1027+
<arg value="-q" />
1028+
<arg value="-n" />
1029+
<arg value="-j" />
1030+
<arg value="-d" />
1031+
<arg value="windows/work/lib" />
1032+
<arg value="../arduino-core/lib/jna-4.2.2.jar" />
1033+
<arg value="com/sun/jna/win32-x86/jnidispatch.dll" />
1034+
</exec>
1035+
<move file="windows/work/lib/jnidispatch.dll" tofile="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" />
1036+
<antcall target="make-file-executable">
1037+
<param name="file" value="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" />
1038+
</antcall>
1039+
10051040
<antcall target="assemble">
10061041
<param name="target.path" value="windows/work" />
10071042
</antcall>

build/windows/launcher/config.xml

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
<opt>-splash:"%EXEDIR%/lib/splash.png"</opt>
6161
<opt>-Dsun.java2d.d3d=false</opt>
6262
<opt>-Djna.nosys=true</opt>
63+
<opt>-Djna.nounpack=true</opt>
64+
<opt>-Djna.boot.library.name=jnidispatch-4.2.2-win32-x86</opt>
65+
<opt>-Djna.boot.library.path="%EXEDIR%"/lib</opt>
6366
<opt>-DAPP_DIR="%EXEDIR%"</opt>
6467
</jre>
6568
<versionInfo>

build/windows/launcher/config_debug.xml

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
<runtimeBits>32</runtimeBits>
6060
<opt>-Dsun.java2d.d3d=false</opt>
6161
<opt>-Djna.nosys=true</opt>
62+
<opt>-Djna.nounpack=true</opt>
63+
<opt>-Djna.boot.library.name=jnidispatch-4.2.2-win32-x86</opt>
64+
<opt>-Djna.boot.library.path="%EXEDIR%"/lib</opt>
65+
<opt>-Djna.debug_load=true</opt>
6266
<opt>-DAPP_DIR="%EXEDIR%"</opt>
6367
<opt>-DDEBUG=true</opt>
6468
</jre>

0 commit comments

Comments
 (0)