Skip to content

[windows] do not unpack jnidispatch.dll in temp folder (take 2) #6202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 26, 2017
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
41 changes: 38 additions & 3 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
<condition property="platform" value="linux64"><os family="unix" arch="amd64" /></condition>
<condition property="platform" value="linuxarm"><os family="unix" arch="arm" /></condition>

<condition property="windows_host" value="true"><os family="windows" /></condition>

<condition property="macosx"><equals arg1="${platform}" arg2="macosx" /></condition>
<condition property="windows"><equals arg1="${platform}" arg2="windows" /></condition>
<condition property="linux32"><equals arg1="${platform}" arg2="linux32" /></condition>
Expand Down Expand Up @@ -857,6 +859,19 @@
<unzip src="${archive_file}" dest="${dest_folder}"/>
</target>

<!-- Ensure that the executable flag is set in all enviroments/OS -->
<target name="make-file-executable" depends="make-file-executable-windows">
<chmod perm="755" file="${file}" />
</target>

<target name="make-file-executable-windows" if="windows_host">
<exec executable="icacls" failonerror="false">
<arg value="${file}"/>
<arg value="/grant"/>
<arg value="Everyone:(RX)"/>
</exec>
</target>

<target name="linux-dist" depends="build"
description="Build .tar.xz of linux version">

Expand Down Expand Up @@ -983,7 +998,9 @@
<param name="dest_folder" value="${staging_folder}" />
</antcall>
<copy file="windows/liblistSerials-${LIBLISTSERIAL-VERSION}/windows/listSerialsj.dll" todir="windows/work/lib/" />
<chmod perm="755" file="windows/work/lib/listSerialsj.dll" />
<antcall target="make-file-executable">
<param name="file" value="windows/work/lib/listSerialsj.dll" />
</antcall>

<delete dir="${staging_folder}/arduino-builder-windows" includeemptydirs="true"/>
<mkdir dir="${staging_folder}/arduino-builder-windows"/>
Expand All @@ -994,14 +1011,32 @@
<param name="dest_folder" value="${staging_folder}/arduino-builder-windows" />
</antcall>
<copy file="${staging_folder}/arduino-builder-windows/arduino-builder.exe" tofile="windows/work/arduino-builder.exe" />
<chmod perm="755" file="windows/work/arduino-builder.exe" />
<antcall target="make-file-executable">
<param name="file" value="windows/work/arduino-builder.exe" />
</antcall>
<move file="${staging_folder}/arduino-builder-windows/tools" tofile="windows/work/tools-builder"/>
<chmod perm="755" file="windows/work/tools-builder/ctags/5.8-arduino11/ctags.exe" />
<antcall target="make-file-executable">
<param name="file" value="windows/work/tools-builder/ctags/5.8-arduino11/ctags.exe" />
</antcall>
<copy todir="windows/work/hardware" overwrite="true">
<fileset dir="${staging_folder}/arduino-builder-windows/hardware" includes="*.txt"/>
</copy>
<delete dir="${staging_folder}/arduino-builder-windows" includeemptydirs="true"/>

<exec executable="unzip" failonerror="true">
<arg value="-q" />
<arg value="-n" />
<arg value="-j" />
<arg value="-d" />
<arg value="windows/work/lib" />
<arg value="../arduino-core/lib/jna-4.2.2.jar" />
<arg value="com/sun/jna/win32-x86/jnidispatch.dll" />
</exec>
<move file="windows/work/lib/jnidispatch.dll" tofile="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" />
<antcall target="make-file-executable">
<param name="file" value="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" />
</antcall>

<antcall target="assemble">
<param name="target.path" value="windows/work" />
</antcall>
Expand Down
3 changes: 3 additions & 0 deletions build/windows/launcher/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
<opt>-splash:"%EXEDIR%/lib/splash.png"</opt>
<opt>-Dsun.java2d.d3d=false</opt>
<opt>-Djna.nosys=true</opt>
<opt>-Djna.nounpack=true</opt>
<opt>-Djna.boot.library.name=jnidispatch-4.2.2-win32-x86</opt>
<opt>-Djna.boot.library.path="%EXEDIR%"/lib</opt>
<opt>-DAPP_DIR="%EXEDIR%"</opt>
</jre>
<versionInfo>
Expand Down
4 changes: 4 additions & 0 deletions build/windows/launcher/config_debug.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
<runtimeBits>32</runtimeBits>
<opt>-Dsun.java2d.d3d=false</opt>
<opt>-Djna.nosys=true</opt>
<opt>-Djna.nounpack=true</opt>
<opt>-Djna.boot.library.name=jnidispatch-4.2.2-win32-x86</opt>
<opt>-Djna.boot.library.path="%EXEDIR%"/lib</opt>
<opt>-Djna.debug_load=true</opt>
<opt>-DAPP_DIR="%EXEDIR%"</opt>
<opt>-DDEBUG=true</opt>
</jre>
Expand Down