|
30 | 30 | libraries. E.g., run ant -Dinstall_toolchains=false -->
|
31 | 31 | <property name="install_toolchains" value="true" />
|
32 | 32 | <property name="install_native_libs" value="true" />
|
| 33 | + <!-- Define this to true to make the $target/work/hardware/arduino |
| 34 | + a symlink instead of a copy. This makes development easier, |
| 35 | + because you can change core files without having to re-run ant. |
| 36 | + Enable by passing -Dlink_hardware=true to ant. --> |
| 37 | + <property name="link_hardware" value="false" /> |
33 | 38 |
|
34 | 39 | <condition property="arch-bits" value="32">
|
35 | 40 | <equals arg1="${platform}" arg2="linux32"/>
|
|
101 | 106 | <!-- - - - - - - - - -->
|
102 | 107 | <!-- Basic Assembly -->
|
103 | 108 | <!-- - - - - - - - - -->
|
104 |
| - <target name="copy-hardware"> |
| 109 | + <target name="clean-hardware"> |
| 110 | + <!-- Clean up old symlink and directory --> |
| 111 | + <symlink action="delete" link="${target.path}/hardware/arduino" failonerror="false" /> |
| 112 | + <delete dir="${target.path}/hardware" failonerror="false" /> |
| 113 | + <mkdir dir="${target.path}/hardware" /> |
| 114 | + </target> |
| 115 | + |
| 116 | + <target name="copy-hardware" depends="clean-hardware" unless="${link_hardware}"> |
105 | 117 | <!-- copy hardware folder -->
|
106 | 118 | <copy todir="${target.path}/hardware">
|
107 | 119 | <fileset dir="../hardware">
|
|
115 | 127 | </copy>
|
116 | 128 | </target>
|
117 | 129 |
|
118 |
| - <target name="assemble" depends="copy-hardware"> |
| 130 | + <target name="link-hardware" depends="clean-hardware" if="${link_hardware}"> |
| 131 | + <fail if="windows" |
| 132 | + message="link_hardware not supported on Windows" /> |
| 133 | + |
| 134 | + <symlink link="${target.path}/hardware/arduino" |
| 135 | + resource="${basedir}/../hardware/arduino" |
| 136 | + failonerror="true"/> |
| 137 | + </target> |
| 138 | + |
| 139 | + <target name="assemble" depends="copy-hardware, link-hardware"> |
119 | 140 | <fail unless="target.path"
|
120 | 141 | message="Do not call assemble from the command line." />
|
121 | 142 |
|
|
0 commit comments