| 1 |
<?xml version="1.0"?> |
| 2 |
<project name="Arduino" default="build"> |
| 3 |
<!--echo message="os.name = ${os.name}" /--> |
| 4 |
<!--echo message="os.arch = ${os.arch}" /--> |
| 5 |
<!--echo message="os.version = ${os.version}" /--> |
| 6 |
|
| 7 |
<tstamp> |
| 8 |
<format property="BUILD_DATE" pattern="yyyy/MM/dd hh:mm"/> |
| 9 |
</tstamp> |
| 10 |
|
| 11 |
<!-- Sets properties for macosx/windows/linux depending on current system --> |
| 12 |
<condition property="platform" value="macosx-old"> |
| 13 |
<and> |
| 14 |
<os family="mac" /> |
| 15 |
<matches string="${os.version}" pattern="^10.[56]." /> |
| 16 |
</and> |
| 17 |
</condition> |
| 18 |
<condition property="macosx-old"><equals arg1="${platform}" arg2="macosx-old" /></condition> |
| 19 |
<fail if="macosx-old" message="MacOSX older than 10.7 are not supported"/> |
| 20 |
|
| 21 |
<condition property="platform" value="macosx"><os family="mac" /></condition> |
| 22 |
<condition property="platform" value="windows"><os family="windows" /></condition> |
| 23 |
<condition property="platform" value="linux32"><os family="unix" arch="i386" /></condition> |
| 24 |
<condition property="platform" value="linux64"><os family="unix" arch="amd64" /></condition> |
| 25 |
<condition property="platform" value="linuxarm"><os family="unix" arch="arm" /></condition> |
| 26 |
<condition property="platform" value="linuxaarch64"><os family="unix" arch="aarch64" /></condition> |
| 27 |
|
| 28 |
<condition property="windows_host" value="true"><os family="windows" /></condition> |
| 29 |
|
| 30 |
<condition property="macosx"><equals arg1="${platform}" arg2="macosx" /></condition> |
| 31 |
<condition property="windows"><equals arg1="${platform}" arg2="windows" /></condition> |
| 32 |
<condition property="linux32"><equals arg1="${platform}" arg2="linux32" /></condition> |
| 33 |
<condition property="linux64"><equals arg1="${platform}" arg2="linux64" /></condition> |
| 34 |
<condition property="linux"><equals arg1="${platform}" arg2="linux32" /></condition> |
| 35 |
<condition property="linux"><equals arg1="${platform}" arg2="linux64" /></condition> |
| 36 |
<condition property="linux"><equals arg1="${platform}" arg2="linuxarm" /></condition> |
| 37 |
<condition property="linux"><equals arg1="${platform}" arg2="linuxaarch64" /></condition> |
| 38 |
|
| 39 |
<condition property="staging_folder" value="macosx"><equals arg1="${platform}" arg2="macosx" /></condition> |
| 40 |
<condition property="staging_folder" value="windows"><equals arg1="${platform}" arg2="windows" /></condition> |
| 41 |
<condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linux32" /></condition> |
| 42 |
<condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linux64" /></condition> |
| 43 |
<condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linuxarm" /></condition> |
| 44 |
<condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linuxaarch64" /></condition> |
| 45 |
|
| 46 |
<condition property="staging_hardware_folder" value="Arduino.app/Contents/Java/hardware"><equals arg1="${platform}" arg2="macosx" /></condition> |
| 47 |
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="windows" /></condition> |
| 48 |
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux32" /></condition> |
| 49 |
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux64" /></condition> |
| 50 |
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linuxarm" /></condition> |
| 51 |
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linuxaarch64" /></condition> |
| 52 |
|
| 53 |
<condition property="arch-bits" value="32"> |
| 54 |
<equals arg1="${platform}" arg2="linux32"/> |
| 55 |
</condition> |
| 56 |
<condition property="arch-bits" value="32"> |
| 57 |
<equals arg1="${platform}" arg2="linuxarm"/> |
| 58 |
</condition> |
| 59 |
<condition property="arch-bits" value="64"> |
| 60 |
<equals arg1="${platform}" arg2="linux64"/> |
| 61 |
</condition> |
| 62 |
<condition property="arch-bits" value="64"> |
| 63 |
<equals arg1="${platform}" arg2="linuxaarch64"/> |
| 64 |
</condition> |
| 65 |
|
| 66 |
<condition property="launch4j-download-unpack-target-name" value="launch4j-windows"><os family="windows" /></condition> |
| 67 |
<property name="launch4j-download-unpack-target-name" value="launch4j-linux"/> |
| 68 |
|
| 69 |
<property name="MACOSX_BUNDLED_JVM" value="${java.home}/../"/> |
| 70 |
<property name="WINDOWS_BUNDLED_JVM" value="${java.home}"/> |
| 71 |
<property name="LINUX32_BUNDLED_JVM" value="none"/> |
| 72 |
<property name="LINUX64_BUNDLED_JVM" value="none"/> |
| 73 |
<property name="LINUXARM_BUNDLED_JVM" value="none"/> |
| 74 |
<property name="LINUXAARCH64_BUNDLED_JVM" value="none"/> |
| 75 |
<condition property="linux-bundle-jvm-task" value="noop"> |
| 76 |
<and> |
| 77 |
<equals arg1="${LINUX32_BUNDLED_JVM}" arg2="none"/> |
| 78 |
<equals arg1="${LINUX64_BUNDLED_JVM}" arg2="none"/> |
| 79 |
<equals arg1="${LINUXARM_BUNDLED_JVM}" arg2="none"/> |
| 80 |
<equals arg1="${LINUXAARCH64_BUNDLED_JVM}" arg2="none"/> |
| 81 |
</and> |
| 82 |
</condition> |
| 83 |
<condition property="linux-bundle-jvm-task" value="bundle"> |
| 84 |
<or> |
| 85 |
<not> |
| 86 |
<equals arg1="${LINUX32_BUNDLED_JVM}" arg2="none"/> |
| 87 |
</not> |
| 88 |
<not> |
| 89 |
<equals arg1="${LINUX64_BUNDLED_JVM}" arg2="none"/> |
| 90 |
</not> |
| 91 |
<not> |
| 92 |
<equals arg1="${LINUXARM_BUNDLED_JVM}" arg2="none"/> |
| 93 |
</not> |
| 94 |
<not> |
| 95 |
<equals arg1="${LINUXAARCH64_BUNDLED_JVM}" arg2="none"/> |
| 96 |
</not> |
| 97 |
</or> |
| 98 |
</condition> |
| 99 |
|
| 100 |
<property name="portable" value="false" /> |
| 101 |
|
| 102 |
<property name="ARDUINO-BUILDER-VERSION" value="1.6.1" /> |
| 103 |
<property name="LIBLISTSERIAL-VERSION" value="1.4.2-2" /> |
| 104 |
<property name="AVRGCC-VERSION" value="7.3.0-atmel3.6.1-arduino7" /> |
| 105 |
<property name="AVRDUDE-VERSION" value="6.3.0-arduino17" /> |
| 106 |
<property name="AVRCORE-VERSION" value="1.8.3" /> |
| 107 |
<property name="arduinoOTA-VERSION" value="1.3.0" /> |
| 108 |
<property name="WIFI101-FW-UPDATER_VERSION" value="0.12.0" /> |
| 109 |
<!-- https://github.com/arduino/built-in-examples --> |
| 110 |
<property name="BUILT-IN-EXAMPLES-VERSION" value="1.9.1" /> |
| 111 |
|
| 112 |
<!-- Libraries required for running arduino --> |
| 113 |
<fileset dir=".." id="runtime.jars"> |
| 114 |
<include name="arduino-core/arduino-core.jar" /> |
| 115 |
<include name="app/pde.jar" /> |
| 116 |
<include name="app/lib/*.jar" /> |
| 117 |
<include name="arduino-core/lib/*.jar" /> |
| 118 |
</fileset> |
| 119 |
|
| 120 |
<!-- Remove all default excludes for directory tasks (see https://ant.apache.org/manual/dirtasks.html#defaultexcludes) --> |
| 121 |
<defaultexcludes remove="**/.git"/> |
| 122 |
<defaultexcludes remove="**/.git/**"/> |
| 123 |
<defaultexcludes remove="**/.gitattributes"/> |
| 124 |
<defaultexcludes remove="**/.gitignore"/> |
| 125 |
<defaultexcludes remove="**/.gitmodules"/> |
| 126 |
<defaultexcludes remove="**/.hg"/> |
| 127 |
<defaultexcludes remove="**/.hg/**"/> |
| 128 |
<defaultexcludes remove="**/.hgignore"/> |
| 129 |
<defaultexcludes remove="**/.hgsub"/> |
| 130 |
<defaultexcludes remove="**/.hgsubstate"/> |
| 131 |
<defaultexcludes remove="**/.hgtags"/> |
| 132 |
<defaultexcludes remove="**/.bzr"/> |
| 133 |
<defaultexcludes remove="**/.bzr/**"/> |
| 134 |
<defaultexcludes remove="**/.bzrignore"/> |
| 135 |
|
| 136 |
<target name="build" description="Build Arduino."> |
| 137 |
<antcall target="${platform}-build" /> |
| 138 |
|
| 139 |
<antcall target="generate-hourly-build-txt"/> |
| 140 |
</target> |
| 141 |
|
| 142 |
<target name="run" description="Packs and runs Arduino"> |
| 143 |
<antcall target="${platform}-run" /> |
| 144 |
</target> |
| 145 |
|
| 146 |
<target name="start" description="Starts Arduino"> |
| 147 |
<antcall target="${platform}-start" /> |
| 148 |
</target> |
| 149 |
|
| 150 |
<target name="dist" depends="revision-check" description="Build Arduino for distribution."> |
| 151 |
<input message="Enter version number:" addproperty="version" defaultvalue="${revision}"/> |
| 152 |
<condition property="full-version" value="${version}-${platform}"> |
| 153 |
<not> |
| 154 |
<equals arg1="${portable}" arg2="true"/> |
| 155 |
</not> |
| 156 |
</condition> |
| 157 |
<condition property="full-version" value="${version}-${platform}-portable"> |
| 158 |
<equals arg1="${portable}" arg2="true"/> |
| 159 |
</condition> |
| 160 |
<antcall target="${platform}-dist"> |
| 161 |
<param name="full-version" value="${full-version}"/> |
| 162 |
</antcall> |
| 163 |
</target> |
| 164 |
|
| 165 |
<!-- "§$§$&, ant doesn't have a built-in help target :( --> |
| 166 |
<target name="help" description="Show project help"> |
| 167 |
<java classname="org.apache.tools.ant.Main"> |
| 168 |
<arg value="-p" /> |
| 169 |
</java> |
| 170 |
</target> |
| 171 |
|
| 172 |
<target name="test" depends="subprojects-build, subprojects-test"/> |
| 173 |
|
| 174 |
<!-- - - - - - - - - - - - - - - - - - --> |
| 175 |
<!-- Subprojects: Core, App, Libraries --> |
| 176 |
<!-- - - - - - - - - - - - - - - - - - --> |
| 177 |
|
| 178 |
<target name="subprojects-clean"> |
| 179 |
<subant buildpath="../arduino-core" target="clean"/> |
| 180 |
<subant buildpath="../app" target="clean"/> |
| 181 |
</target> |
| 182 |
|
| 183 |
<target name="subprojects-build"> |
| 184 |
<subant buildpath="../arduino-core" target="build"/> |
| 185 |
<subant buildpath="../app" target="build"/> |
| 186 |
</target> |
| 187 |
|
| 188 |
<target name="subprojects-test"> |
| 189 |
<subant buildpath="../app" target="test"> |
| 190 |
<propertyset> |
| 191 |
<!-- Forward these to subant. Use propertyset/propertyref instead of a direct property so we do not need to specify a value --> |
| 192 |
<propertyref name="single-test-class"/> |
| 193 |
<propertyref name="single-test-methods"/> |
| 194 |
<propertyref name="running-from-github-actions"/> |
| 195 |
</propertyset> |
| 196 |
</subant> |
| 197 |
</target> |
| 198 |
|
| 199 |
<!-- - - - - - - - - --> |
| 200 |
<!-- Basic Assembly --> |
| 201 |
<!-- - - - - - - - - --> |
| 202 |
|
| 203 |
<target name="assemble"> |
| 204 |
<fail unless="target.path" message="Do not call assemble from the command line." /> |
| 205 |
|
| 206 |
<!-- copy shared tools folder --> |
| 207 |
<copy todir="${target.path}/tools"> |
| 208 |
<fileset dir="shared/tools" /> |
| 209 |
</copy> |
| 210 |
|
| 211 |
<copy file="shared/icons/48x48/apps/arduino.png" tofile="${target.path}/lib/arduino_small.png"/> |
| 212 |
|
| 213 |
<antcall target="assemble-hardware" /> |
| 214 |
|
| 215 |
<antcall target="assemble-examples" /> |
| 216 |
|
| 217 |
<!-- Write the revision file! --> |
| 218 |
<echo file="${target.path}/lib/version.txt" message="${version}" /> |
| 219 |
|
| 220 |
<antcall target="assemble-libraries" /> |
| 221 |
|
| 222 |
<!-- Add WiFi101 updater tool --> |
| 223 |
<antcall target="unzip"> |
| 224 |
<param name="archive_file" value="shared/WiFi101-Updater-ArduinoIDE-Plugin-${WIFI101-FW-UPDATER_VERSION}.zip" /> |
| 225 |
<param name="archive_url" value="https://github.com/arduino-libraries/WiFi101-FirmwareUpdater-Plugin/releases/download/v${WIFI101-FW-UPDATER_VERSION}/WiFi101-Updater-ArduinoIDE-Plugin-${WIFI101-FW-UPDATER_VERSION}.zip" /> |
| 226 |
<param name="final_folder" value="${target.path}/tools/WiFi101" /> |
| 227 |
<param name="dest_folder" value="${target.path}/tools/" /> |
| 228 |
</antcall> |
| 229 |
</target> |
| 230 |
|
| 231 |
<target name="assemble-examples"> |
| 232 |
<!-- Add the built-in example sketches --> |
| 233 |
<property name="BUILT-IN-EXAMPLES-REPOSITORY-OWNER" value="arduino" /> |
| 234 |
<property name="BUILT-IN-EXAMPLES-REPOSITORY-NAME" value="arduino-examples" /> |
| 235 |
<property name="BUILT-IN-EXAMPLES-STAGING-PATH" value="shared" /> |
| 236 |
<property name="BUILT-IN-EXAMPLES-FINAL-PATH" value="${target.path}/examples" /> |
| 237 |
|
| 238 |
<!-- Download built-in examples from repository --> |
| 239 |
<antcall target="unzip"> |
| 240 |
<param name="archive_file" value="${BUILT-IN-EXAMPLES-REPOSITORY-NAME}-${BUILT-IN-EXAMPLES-VERSION}.zip" /> |
| 241 |
<param name="archive_url" value="https://github.com/${BUILT-IN-EXAMPLES-REPOSITORY-OWNER}/${BUILT-IN-EXAMPLES-REPOSITORY-NAME}/archive/${BUILT-IN-EXAMPLES-VERSION}.zip" /> |
| 242 |
<!-- Because the presence of this folder determines whether the extraction happens, this must point to a version-dependent path, otherwise updates will fail --> |
| 243 |
<param name="final_folder" value="${BUILT-IN-EXAMPLES-STAGING-PATH}/${BUILT-IN-EXAMPLES-REPOSITORY-NAME}-${BUILT-IN-EXAMPLES-VERSION}/examples" /> |
| 244 |
<param name="dest_folder" value="${BUILT-IN-EXAMPLES-STAGING-PATH}" /> |
| 245 |
</antcall> |
| 246 |
|
| 247 |
<!-- Copy examples from subfolder of the downloaded repository --> |
| 248 |
<copy todir="${BUILT-IN-EXAMPLES-FINAL-PATH}"> |
| 249 |
<fileset dir="${BUILT-IN-EXAMPLES-STAGING-PATH}/${BUILT-IN-EXAMPLES-REPOSITORY-NAME}-${BUILT-IN-EXAMPLES-VERSION}/examples" /> |
| 250 |
</copy> |
| 251 |
</target> |
| 252 |
|
| 253 |
<!-- copy library folder --> |
| 254 |
<target name="assemble-libraries" unless="light_bundle"> |
| 255 |
<download-library name="Ethernet" version="2.0.0"/> |
| 256 |
<download-library name="GSM" version="1.0.6"/> |
| 257 |
<download-library name="Stepper" version="1.1.3"/> |
| 258 |
<download-library name="TFT" version="1.0.6"/> |
| 259 |
<download-library name="WiFi" version="1.2.7"/> |
| 260 |
<download-library githubuser="firmata" name="arduino" version="2.5.8" foldername="Firmata"/> |
| 261 |
<download-library name="Bridge" version="1.7.0"/> |
| 262 |
<download-library name="Robot_Control" version="1.0.4"/> |
| 263 |
<download-library name="Robot_Motor" version="1.0.3"/> |
| 264 |
<download-library name="RobotIRremote" version="2.0.0"/> |
| 265 |
<download-library name="SpacebrewYun" version="1.0.2"/> |
| 266 |
<download-library name="Temboo" version="1.2.1"/> |
| 267 |
<download-library name="Esplora" version="1.0.4"/> |
| 268 |
<download-library name="Mouse" version="1.0.1"/> |
| 269 |
<download-library name="Keyboard" version="1.0.2"/> |
| 270 |
<download-library name="SD" version="1.2.4"/> |
| 271 |
<download-library name="Servo" version="1.1.8"/> |
| 272 |
<download-library name="LiquidCrystal" version="1.0.7"/> |
| 273 |
<download-library githubuser="Adafruit" name="Adafruit_CircuitPlayground" version="1.11.3" foldername="Adafruit_Circuit_Playground"/> |
| 274 |
</target> |
| 275 |
|
| 276 |
<macrodef name="download-library"> |
| 277 |
<attribute name="name"/> |
| 278 |
<attribute name="foldername" default="@{name}"/> |
| 279 |
<attribute name="version"/> |
| 280 |
<attribute name="tag" default="@{version}"/> |
| 281 |
<attribute name="githubuser" default="arduino-libraries"/> |
| 282 |
<sequential> |
| 283 |
<antcall target="unzip"> |
| 284 |
<param name="archive_file" value="@{foldername}-@{version}.zip"/> |
| 285 |
<param name="archive_url" value="https://github.com/@{githubuser}/@{name}/archive/@{tag}.zip"/> |
| 286 |
<param name="final_folder" value="${target.path}/libraries/@{name}-@{version}"/> |
| 287 |
<param name="dest_folder" value="${target.path}/libraries"/> |
| 288 |
</antcall> |
| 289 |
<move file="${target.path}/libraries/@{name}-@{version}" tofile="${target.path}/libraries/@{foldername}"/> |
| 290 |
</sequential> |
| 291 |
</macrodef> |
| 292 |
|
| 293 |
<!-- copy hardware folder --> |
| 294 |
<target name="assemble-hardware" unless="light_bundle"> |
| 295 |
<mkdir dir="${target.path}/hardware/arduino" /> |
| 296 |
<antcall target="untar-bz2"> |
| 297 |
<param name="archive_file" value="avr-${AVRCORE-VERSION}.tar.bz2"/> |
| 298 |
<param name="archive_url" value="https://downloads.arduino.cc/cores/avr-${AVRCORE-VERSION}.tar.bz2"/> |
| 299 |
<param name="final_folder" value="${target.path}/hardware/arduino/avr"/> |
| 300 |
<param name="dest_folder" value="${target.path}/hardware/arduino"/> |
| 301 |
</antcall> |
| 302 |
<copy file="../hardware/package_index_bundled.json" todir="${target.path}/hardware/" /> |
| 303 |
</target> |
| 304 |
|
| 305 |
<!-- - - - - - - - - --> |
| 306 |
<!-- Revision check --> |
| 307 |
<!-- - - - - - - - - --> |
| 308 |
<target name="revision-check"> |
| 309 |
|
| 310 |
<!-- figure out the latest AVR core version number in package_index.json --> |
| 311 |
<loadfile srcfile="../hardware/package_index_bundled.json" property="revision.avr.index"> |
| 312 |
<filterchain> |
| 313 |
<tokenfilter> |
| 314 |
<linetokenizer /> |
| 315 |
<containsregex pattern="archiveFileName.*"avr-.......?tar.bz2"/> |
| 316 |
<replaceregex pattern=".*avr-(.*).tar.bz2.*" flags="g" replace="\1"/> |
| 317 |
</tokenfilter> |
| 318 |
<striplinebreaks/> |
| 319 |
<tailfilter lines="1"/> |
| 320 |
</filterchain> |
| 321 |
</loadfile> |
| 322 |
|
| 323 |
<echo message="AVR Arduino core version in build.xml is: ${AVRCORE-VERSION}" /> |
| 324 |
<echo message=" latest in package_index_bundled.json is: ${revision.avr.index}" /> |
| 325 |
<condition property="revision.avr.ok"> |
| 326 |
<or> |
| 327 |
<!-- fail build if -Drevision.check=enforce is set --> |
| 328 |
<not><equals arg1="${revision.check}" arg2="enforce"/></not> |
| 329 |
<equals arg1="${revision.avr.index}" arg2="${AVRCORE-VERSION}"/> |
| 330 |
</or> |
| 331 |
</condition> |
| 332 |
<fail unless="revision.avr.ok"> |
| 333 |
Mismatching versions for bundled AVR core and package_index_bundled.json. |
| 334 |
Please check your package_index_bundled.json. |
| 335 |
</fail> |
| 336 |
|
| 337 |
<!-- figure out the IDE version number --> |
| 338 |
<loadfile srcfile="shared/revisions.txt" property="revision"> |
| 339 |
<filterchain> |
| 340 |
<ignoreblank /> |
| 341 |
<headfilter lines="1"/> |
| 342 |
<tokenfilter> |
| 343 |
<linetokenizer includeDelims="false" /> |
| 344 |
<!-- grab the thing from the first line that's 4 digits --> |
| 345 |
<containsregex pattern="ARDUINO ([^ ]*)" /> |
| 346 |
<replaceregex pattern="ARDUINO ([^ ]*).*" replace="\1" /> |
| 347 |
</tokenfilter> |
| 348 |
<tokenfilter> |
| 349 |
<stringtokenizer suppressdelims="true" /> |
| 350 |
</tokenfilter> |
| 351 |
</filterchain> |
| 352 |
</loadfile> |
| 353 |
|
| 354 |
<!-- figure out the IDE version number in base.java --> |
| 355 |
<loadfile srcfile="../arduino-core/src/processing/app/BaseNoGui.java" |
| 356 |
property="revision.base"> |
| 357 |
<filterchain> |
| 358 |
<tokenfilter> |
| 359 |
<linetokenizer /> |
| 360 |
<containsregex pattern="String VERSION_NAME = "/> |
| 361 |
<replaceregex pattern=".*"(.*)".*" flags="g" replace="\1"/> |
| 362 |
</tokenfilter> |
| 363 |
</filterchain> |
| 364 |
</loadfile> |
| 365 |
<echo message="Latest revision detected in shared/revision.txt is: ${revision}" /> |
| 366 |
<echo message=" Revision in BaseNoGui.java is: ${revision.base}" /> |
| 367 |
</target> |
| 368 |
|
| 369 |
<!-- - - - - - - - --> |
| 370 |
<!-- Mac OS X --> |
| 371 |
<!-- - - - - - - - --> |
| 372 |
<target name="macosx-clean" depends="subprojects-clean" description="Clean Mac OS X build"> |
| 373 |
<delete dir="macosx/work" /> |
| 374 |
<delete dir="macosx/working_dir" /> |
| 375 |
<delete dir="macosx/working.dmg" /> |
| 376 |
<delete file="macosx/arduino-*.dmg" /> |
| 377 |
<delete> |
| 378 |
<fileset dir="macosx" includes="arduino-*macosx*.zip"/> |
| 379 |
</delete> |
| 380 |
</target> |
| 381 |
|
| 382 |
<target name="macosx-checkos" unless="macosx"> |
| 383 |
<echo> |
| 384 |
======================================================= |
| 385 |
Arduino for Mac OS X can only be built on Mac OS X. |
| 386 |
|
| 387 |
Bye. |
| 388 |
======================================================= |
| 389 |
</echo> |
| 390 |
<fail message="wrong platform (${os.name})" /> |
| 391 |
</target> |
| 392 |
|
| 393 |
<target name="macosx-build" if="macosx" depends="revision-check, macosx-checkos, subprojects-build" description="Build Mac OS X version"> |
| 394 |
<fail unless="MACOSX_BUNDLED_JVM" message="MacOSX requires MACOSX_BUNDLED_JVM property set"/> |
| 395 |
<mkdir dir="${staging_folder}/work" /> |
| 396 |
|
| 397 |
<antcall target="unzip"> |
| 398 |
<param name="archive_file" value="${staging_folder}/appbundler-1.0ea-arduino9.jar.zip" /> |
| 399 |
<param name="archive_url" value="https://downloads.arduino.cc/appbundler-1.0ea-arduino9.jar.zip" /> |
| 400 |
<param name="final_folder" value="${staging_folder}/appbundler-1.0ea-arduino9" /> |
| 401 |
<param name="dest_folder" value="${staging_folder}/appbundler-1.0ea-arduino9" /> |
| 402 |
</antcall> |
| 403 |
|
| 404 |
<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="${staging_folder}/appbundler-1.0ea-arduino9/appbundler-1.0ea-arduino9.jar"/> |
| 405 |
|
| 406 |
<bundleapp |
| 407 |
jvmRequired="1.8" |
| 408 |
jrepreferred="true" |
| 409 |
outputdirectory="${staging_folder}/work" |
| 410 |
name="Arduino" |
| 411 |
displayname="Arduino" |
| 412 |
executablename="Arduino" |
| 413 |
identifier="cc.arduino.Arduino" |
| 414 |
shortversion="${version}" |
| 415 |
version="${revision}" |
| 416 |
signature="Pde1" |
| 417 |
icon="macosx/processing.icns" |
| 418 |
mainclassname="processing.app.Base" |
| 419 |
copyright="Arduino LLC" |
| 420 |
applicationCategory="public.app-category.education" |
| 421 |
minimumsystemversion="10.8" |
| 422 |
highresolutioncapable="true"> |
| 423 |
|
| 424 |
<runtime dir="${MACOSX_BUNDLED_JVM}"/> |
| 425 |
|
| 426 |
<arch name="x86_64"/> |
| 427 |
<arch name="i386"/> |
| 428 |
|
| 429 |
<classpath refid="runtime.jars"/> |
| 430 |
|
| 431 |
<option value="-Dapple.awt.application.name=Arduino"/> |
| 432 |
<option value="-Dcom.apple.macos.use-file-dialog-packages=true"/> |
| 433 |
<option value="-Dcom.apple.smallTabs=true"/> |
| 434 |
<option value="-DAPP_DIR=$APP_ROOT/Contents/Java"/> |
| 435 |
<option value="-Djava.ext.dirs=$JVM_RUNTIME/Contents/Home/lib/ext/:$JVM_RUNTIME/Contents/Home/jre/lib/ext/"/> |
| 436 |
<option value="-Djava.net.preferIPv4Stack=true"/> |
| 437 |
|
| 438 |
<!-- |
| 439 |
<option value="-Dapple.awt.showGrowBox=false"/> |
| 440 |
<option value="-Dapple.awt.Antialiasing=false"/> |
| 441 |
<option value="-Dapple.awt.TextAntialiasing=true"/> |
| 442 |
<option value="-Dcom.apple.hwaccel=true"/> |
| 443 |
<option value="-Dapple.awt.graphics.UseQuartz=true"/> |
| 444 |
--> |
| 445 |
|
| 446 |
<!--<option value="-Dcom.apple.macos.useScreenMenuBar=true"/>--> |
| 447 |
|
| 448 |
<!-- Workaround since the icon parameter for bundleapp doesn't work --> |
| 449 |
<option value="-Xdock:name=Arduino"/> |
| 450 |
<option value="-Dcom.apple.mrj.application.apple.menu.about.name=Arduino"/> |
| 451 |
<option value="-Dfile.encoding=UTF-8"/> |
| 452 |
|
| 453 |
<option value="-Xms128M"/> |
| 454 |
<option value="-Xmx512M"/> |
| 455 |
<option value="-splash:$APP_ROOT/Contents/Java/lib/splash.png"/> |
| 456 |
|
| 457 |
<bundledocument extensions="ino,c,cpp,h" |
| 458 |
icon="macosx/pde.icns" |
| 459 |
name="Arduino Source File" |
| 460 |
role="Editor" ispackage="false"> |
| 461 |
</bundledocument> |
| 462 |
|
| 463 |
</bundleapp> |
| 464 |
|
| 465 |
<mkdir dir="${staging_folder}/work/${staging_hardware_folder}" /> |
| 466 |
|
| 467 |
<copy todir="${staging_folder}/work/${staging_hardware_folder}/../"> |
| 468 |
<fileset dir="shared" includes="lib/**" /> |
| 469 |
<fileset file="shared/revisions.txt" /> |
| 470 |
</copy> |
| 471 |
|
| 472 |
<mkdir dir="${staging_folder}/work" /> |
| 473 |
<mkdir dir="${staging_folder}/work/${staging_hardware_folder}" /> |
| 474 |
|
| 475 |
<antcall target="macosx-build-avr-toolchain" /> |
| 476 |
|
| 477 |
<antcall target="assemble"> |
| 478 |
<param name="target.path" value="${staging_folder}/work/${staging_hardware_folder}/.." /> |
| 479 |
</antcall> |
| 480 |
|
| 481 |
<antcall target="unzip"> |
| 482 |
<param name="archive_file" value="./libastylej-2.05.1-5.zip" /> |
| 483 |
<param name="archive_url" value="https://downloads.arduino.cc/libastylej-2.05.1-5.zip" /> |
| 484 |
<param name="final_folder" value="${staging_folder}/libastylej-2.05.1" /> |
| 485 |
<param name="dest_folder" value="${staging_folder}" /> |
| 486 |
</antcall> |
| 487 |
<copy file="macosx/libastylej-2.05.1/libastylej.jnilib" todir="macosx/work/${staging_hardware_folder}/../lib/" /> |
| 488 |
<chmod perm="755" file="macosx/work/${staging_hardware_folder}/../lib/libastylej.jnilib" /> |
| 489 |
<copy file="macosx/libastylej-2.05.1/libastylej.jnilib" tofile="macosx/work/${staging_hardware_folder}/../lib/libastylej.dylib" /> |
| 490 |
<chmod perm="755" file="macosx/work/${staging_hardware_folder}/../lib/libastylej.dylib" /> |
| 491 |
|
| 492 |
<antcall target="unzip"> |
| 493 |
<param name="archive_file" value="./liblistSerials-${LIBLISTSERIAL-VERSION}.zip" /> |
| 494 |
<param name="archive_url" value="https://downloads.arduino.cc/liblistSerials/liblistSerials-${LIBLISTSERIAL-VERSION}.zip" /> |
| 495 |
<param name="final_folder" value="${staging_folder}/liblistSerials-${LIBLISTSERIAL-VERSION}" /> |
| 496 |
<param name="dest_folder" value="${staging_folder}" /> |
| 497 |
</antcall> |
| 498 |
<copy file="macosx/liblistSerials-${LIBLISTSERIAL-VERSION}/osx/liblistSerialsj.dylib" todir="macosx/work/${staging_hardware_folder}/../lib/" /> |
| 499 |
<chmod perm="755" file="macosx/work/${staging_hardware_folder}/../lib/liblistSerialsj.dylib" /> |
| 500 |
|
| 501 |
<property name="ARDUINO-BUILDER-EXTRA-VERSION" value="-signed" /> |
| 502 |
<antcall target="build-arduino-builder" /> |
| 503 |
|
| 504 |
<antcall target="portable-${portable}"> |
| 505 |
<param name="parentdir" value="macosx/work/${staging_hardware_folder}/.." /> |
| 506 |
</antcall> |
| 507 |
</target> |
| 508 |
|
| 509 |
<!-- Unzip AVR tools --> |
| 510 |
<target name="macosx-build-avr-toolchain" unless="light_bundle"> |
| 511 |
<antcall target="avr-toolchain-bundle"> |
| 512 |
<param name="unpack_target" value="untar-native"/> |
| 513 |
<param name="gcc_archive_file" value="avr-gcc-${AVRGCC-VERSION}-x86_64-apple-darwin14-signed.tar.bz2"/> |
| 514 |
<param name="gcc_version" value="${AVRGCC-VERSION}"/> |
| 515 |
<param name="avrdude_archive_file" value="avrdude-${AVRDUDE-VERSION}-x86_64-apple-darwin12-signed.tar.bz2"/> |
| 516 |
<param name="avrdude_version" value="${AVRDUDE-VERSION}"/> |
| 517 |
<param name="arduinoOTA_archive_file" value="arduinoOTA-${arduinoOTA-VERSION}-darwin_amd64-signed.tar.bz2"/> |
| 518 |
<param name="arduinoOTA_version" value="${arduinoOTA-VERSION}"/> |
| 519 |
</antcall> |
| 520 |
|
| 521 |
<chmod perm="+x"> |
| 522 |
<fileset dir="${staging_folder}/work/${staging_hardware_folder}/tools" includes="**/bin/*"/> |
| 523 |
<fileset dir="${staging_folder}/work/${staging_hardware_folder}/tools" includes="**/libexec/gcc/avr/4.8.1/*"/> |
| 524 |
</chmod> |
| 525 |
</target> |
| 526 |
|
| 527 |
<target name="macosx-run" depends="build,start"/> |
| 528 |
|
| 529 |
<target name="macosx-start"> |
| 530 |
<exec executable="macosx/work/Arduino.app/Contents/MacOS/Arduino" spawn="false" failonerror="true"/> |
| 531 |
</target> |
| 532 |
|
| 533 |
<!-- - - - - - - - - - - - - - - - --> |
| 534 |
<!-- Sign application for MacOSX. --> |
| 535 |
<!-- - - - - - - - - - - - - - - - --> |
| 536 |
<target name="macosx-signed-dist" if="macosx" depends="macosx-singed-dist-check, dist" |
| 537 |
description="Create a downloadable and signed .zip for the Mac OS X version"> |
| 538 |
<fail unless="version" message="Please set the property 'version' to correctly sign distribution file" /> |
| 539 |
|
| 540 |
<!-- Remove everything from working folder --> |
| 541 |
<delete dir="macosx/work/Arduino.app" /> |
| 542 |
|
| 543 |
<!-- Unzip unsigned app into working dir --> |
| 544 |
<exec executable="unzip" dir="macosx/work" failonerror="true"> |
| 545 |
<arg line="../arduino-${version}-${platform}.zip" /> |
| 546 |
</exec> |
| 547 |
|
| 548 |
<!-- Unlock keychain file --> |
| 549 |
<exec executable="security" dir="macosx/work" failonerror="true"> |
| 550 |
<arg line="unlock-keychain -p "${macosx-sign-keychain-pass}" "${macosx-sign-keychain}"" /> |
| 551 |
</exec> |
| 552 |
|
| 553 |
<!-- Sign app --> |
| 554 |
<exec executable="codesign" dir="macosx/work" failonerror="true"> |
| 555 |
<arg line="--keychain "${macosx-sign-keychain}" --force -s "${macosx-sign-id}" --timestamp --options runtime --deep -v Arduino.app/" /> |
| 556 |
</exec> |
| 557 |
|
| 558 |
<!-- Check for successful signing --> |
| 559 |
<exec executable="codesign" dir="macosx/work" failonerror="true"> |
| 560 |
<arg line="-vvvv Arduino.app/" /> |
| 561 |
</exec> |
| 562 |
|
| 563 |
<delete file="macosx/arduino-${version}-${platform}.zip" /> |
| 564 |
|
| 565 |
<!-- Create signed zip file --> |
| 566 |
<exec executable="zip" dir="macosx/work" failonerror="true"> |
| 567 |
<arg line="-q -r ../arduino-${full-version}-signed.zip ." /> |
| 568 |
</exec> |
| 569 |
|
| 570 |
<echo> |
| 571 |
======================================================= |
| 572 |
Arduino for Mac OS X built and signed. |
| 573 |
|
| 574 |
macosx/arduino-${full-version}-signed.zip |
| 575 |
======================================================= |
| 576 |
</echo> |
| 577 |
</target> |
| 578 |
|
| 579 |
<target name="macosx-singed-dist-check"> |
| 580 |
<fail unless="macosx-sign-keychain" message="Please set the property 'macosx-sign-keychain' to the correct keychain file" /> |
| 581 |
<fail unless="macosx-sign-keychain-pass" message="Please set the property 'macosx-sign-keychain-pass' with the password to unlock the keychain" /> |
| 582 |
<fail unless="macosx-sign-id" message="Please set the property 'macosx-sign-id' to the correct cert identifier" /> |
| 583 |
</target> |
| 584 |
|
| 585 |
<!-- - - - - - - - - - - - - - - - - - - --> |
| 586 |
<!-- Build distribution file for MacOSX. --> |
| 587 |
<!-- - - - - - - - - - - - - - - - - - - --> |
| 588 |
<target name="macosx-dist" if="macosx" depends="build" description="Create a downloadable .zip for the Mac OS X version"> |
| 589 |
<exec executable="zip" dir="macosx/work" failonerror="true"> |
| 590 |
<arg line="-q -r ../arduino-${full-version}.zip ." /> |
| 591 |
</exec> |
| 592 |
|
| 593 |
<echo> |
| 594 |
======================================================= |
| 595 |
Arduino for Mac OS X was built. Grab the image from |
| 596 |
|
| 597 |
macosx/arduino-${full-version}.zip |
| 598 |
======================================================= |
| 599 |
</echo> |
| 600 |
</target> |
| 601 |
|
| 602 |
<!-- - - - - - - - --> |
| 603 |
<!-- Linux --> |
| 604 |
<!-- - - - - - - - --> |
| 605 |
|
| 606 |
<target name="linux-clean" depends="subprojects-clean" description="Clean linux version"> |
| 607 |
<delete dir="linux/work" /> |
| 608 |
<delete> |
| 609 |
<fileset dir="linux" includes="arduino-*linux*.tar.xz"/> |
| 610 |
</delete> |
| 611 |
<delete> |
| 612 |
<fileset dir="linux" includes="arduino-*linux*.tar.xz"/> |
| 613 |
</delete> |
| 614 |
</target> |
| 615 |
|
| 616 |
<target name="linux-checkos" unless="linux"> |
| 617 |
<echo> |
| 618 |
======================================================= |
| 619 |
Arduino for Linux can only be built on unix systems. |
| 620 |
|
| 621 |
Bye. |
| 622 |
======================================================= |
| 623 |
</echo> |
| 624 |
|
| 625 |
<fail message="wrong platform (${os.name})" /> |
| 626 |
</target> |
| 627 |
|
| 628 |
<target name="linux-build" depends="revision-check, linux-checkos, subprojects-build" description="Build linux version"> |
| 629 |
<mkdir dir="linux/work" /> |
| 630 |
<mkdir dir="linux/work/${staging_hardware_folder}" /> |
| 631 |
|
| 632 |
<copy todir="linux/work"> |
| 633 |
<fileset dir="shared" includes="lib/**" /> |
| 634 |
<fileset file="shared/revisions.txt" /> |
| 635 |
</copy> |
| 636 |
|
| 637 |
<copy todir="linux/work"> |
| 638 |
<fileset dir="linux/dist" includes="lib/**" /> |
| 639 |
</copy> |
| 640 |
|
| 641 |
<copy todir="linux/work/lib"> |
| 642 |
<fileset dir="shared" includes="icons/**/*.png" /> |
| 643 |
</copy> |
| 644 |
|
| 645 |
<copy todir="linux/work/lib" flatten="true"> |
| 646 |
<fileset refid="runtime.jars" /> |
| 647 |
</copy> |
| 648 |
|
| 649 |
<antcall target="assemble"> |
| 650 |
<param name="target.path" value="linux/work" /> |
| 651 |
</antcall> |
| 652 |
|
| 653 |
<copy tofile="linux/work/lib/arduino-arduinoide.xml" file="linux/dist/mime.xml" /> |
| 654 |
<copy todir="linux/work/lib" file="linux/dist/desktop.template" /> |
| 655 |
<copy tofile="linux/work/usr/share/metainfo/cc.arduino.arduinoide.appdata.xml" file="linux/dist/appdata.xml" /> |
| 656 |
|
| 657 |
<copy todir="linux/work" file="linux/dist/arduino" /> |
| 658 |
<copy todir="linux/work" file="linux/dist/install.sh" /> |
| 659 |
<copy todir="linux/work" file="linux/dist/arduino-linux-setup.sh" /> |
| 660 |
<copy todir="linux/work" file="linux/dist/uninstall.sh" /> |
| 661 |
|
| 662 |
<chmod perm="ugo+x"> |
| 663 |
<fileset dir="linux/work" includes="arduino" /> |
| 664 |
<fileset dir="linux/work" includes="**/*.sh" /> |
| 665 |
<fileset dir="linux/work/lib" includes="**/*desktop*" /> |
| 666 |
</chmod> |
| 667 |
</target> |
| 668 |
|
| 669 |
<target name="linux-libastyle-x86" depends="linux-build" description="Download libastyle.so for x86/x64 arch"> |
| 670 |
<!-- ((( |
| 671 |
libastyle is already packaged |
| 672 |
|
| 673 |
<antcall target="unzip"> |
| 674 |
<param name="archive_file" value="./libastylej-2.05.1-5.zip" /> |
| 675 |
<param name="archive_url" value="https://downloads.arduino.cc/libastylej-2.05.1-5.zip" /> |
| 676 |
<param name="final_folder" value="${staging_folder}/libastylej-2.05.1" /> |
| 677 |
<param name="dest_folder" value="${staging_folder}" /> |
| 678 |
</antcall> |
| 679 |
<copy file="linux/libastylej-2.05.1/libastylej${arch-bits}.so" tofile="linux/work/lib/libastylej.so" /> |
| 680 |
<chmod perm="755" file="linux/work/lib/libastylej.so" /> |
| 681 |
))) --> |
| 682 |
|
| 683 |
<antcall target="portable-${portable}"> |
| 684 |
<param name="parentdir" value="linux/work" /> |
| 685 |
</antcall> |
| 686 |
|
| 687 |
<antcall target="unzip"> |
| 688 |
<param name="archive_file" value="./liblistSerials-${LIBLISTSERIAL-VERSION}.zip" /> |
| 689 |
<param name="archive_url" value="https://downloads.arduino.cc/liblistSerials/liblistSerials-${LIBLISTSERIAL-VERSION}.zip" /> |
| 690 |
<param name="final_folder" value="${staging_folder}/liblistSerials-${LIBLISTSERIAL-VERSION}" /> |
| 691 |
<param name="dest_folder" value="${staging_folder}" /> |
| 692 |
</antcall> |
| 693 |
<copy file="linux/liblistSerials-${LIBLISTSERIAL-VERSION}/linux${arch-bits}/liblistSerialsj.so" todir="linux/work/lib/" /> |
| 694 |
<chmod perm="755" file="linux/work/lib/liblistSerialsj.so" /> |
| 695 |
|
| 696 |
</target> |
| 697 |
|
| 698 |
<target name="linux-libastyle-arm" depends="linux-build" description="Download libastyle.so for ARM"> |
| 699 |
<!-- ((( |
| 700 |
libastyle is already packaged |
| 701 |
|
| 702 |
<antcall target="unzip"> |
| 703 |
<param name="archive_file" value="./libastylej-2.05.1-5.zip" /> |
| 704 |
<param name="archive_url" value="https://downloads.arduino.cc/libastylej-2.05.1-5.zip" /> |
| 705 |
<param name="final_folder" value="${staging_folder}/libastylej-2.05.1" /> |
| 706 |
<param name="dest_folder" value="${staging_folder}" /> |
| 707 |
</antcall> |
| 708 |
<copy file="linux/libastylej-2.05.1/libastylej_arm.so" tofile="linux/work/lib/libastylej.so" /> |
| 709 |
<chmod perm="755" file="linux/work/lib/libastylej.so" /> |
| 710 |
))) --> |
| 711 |
|
| 712 |
<antcall target="portable-${portable}"> |
| 713 |
<param name="parentdir" value="linux/work" /> |
| 714 |
</antcall> |
| 715 |
|
| 716 |
<antcall target="unzip"> |
| 717 |
<param name="archive_file" value="./liblistSerials-${LIBLISTSERIAL-VERSION}.zip" /> |
| 718 |
<param name="archive_url" value="https://downloads.arduino.cc/liblistSerials/liblistSerials-${LIBLISTSERIAL-VERSION}.zip" /> |
| 719 |
<param name="final_folder" value="${staging_folder}/liblistSerials-${LIBLISTSERIAL-VERSION}" /> |
| 720 |
<param name="dest_folder" value="${staging_folder}" /> |
| 721 |
</antcall> |
| 722 |
<copy file="linux/liblistSerials-${LIBLISTSERIAL-VERSION}/arm/liblistSerialsj.so" todir="linux/work/lib/" /> |
| 723 |
<chmod perm="755" file="linux/work/lib/liblistSerialsj.so" /> |
| 724 |
|
| 725 |
</target> |
| 726 |
|
| 727 |
<target name="linuxarm-build" depends="linux-libastyle-arm" description="Build linux (32-bit) version"> |
| 728 |
<antcall target="linux-jvm-${linux-bundle-jvm-task}"> |
| 729 |
<param name="JVM" value="${LINUXARM_BUNDLED_JVM}"/> |
| 730 |
</antcall> |
| 731 |
|
| 732 |
<antcall target="build-arduino-builder" /> |
| 733 |
|
| 734 |
<antcall target="avr-toolchain-bundle"> |
| 735 |
<param name="unpack_target" value="untar-native"/> |
| 736 |
<param name="gcc_archive_file" value="avr-gcc-${AVRGCC-VERSION}-arm-linux-gnueabihf.tar.bz2"/> |
| 737 |
<param name="gcc_version" value="${AVRGCC-VERSION}"/> |
| 738 |
<param name="avrdude_archive_file" value="avrdude-${AVRDUDE-VERSION}-armhf-pc-linux-gnu.tar.bz2"/> |
| 739 |
<param name="avrdude_version" value="${AVRDUDE-VERSION}"/> |
| 740 |
<param name="arduinoOTA_archive_file" value="arduinoOTA-${arduinoOTA-VERSION}-linux_arm.tar.bz2"/> |
| 741 |
<param name="arduinoOTA_version" value="${arduinoOTA-VERSION}"/> |
| 742 |
</antcall> |
| 743 |
</target> |
| 744 |
|
| 745 |
<target name="linux-libastyle-aarch64" depends="linux-build" description="Download libastyle.so for AArch64"> |
| 746 |
<antcall target="unzip"> |
| 747 |
<param name="archive_file" value="./libastylej-2.05.1-5.zip" /> |
| 748 |
<param name="archive_url" value="https://downloads.arduino.cc/libastylej-2.05.1-5.zip" /> |
| 749 |
<param name="final_folder" value="${staging_folder}/libastylej-2.05.1" /> |
| 750 |
<param name="dest_folder" value="${staging_folder}" /> |
| 751 |
</antcall> |
| 752 |
<copy file="linux/libastylej-2.05.1/libastylej_aarch64.so" tofile="linux/work/lib/libastylej.so" /> |
| 753 |
<chmod perm="755" file="linux/work/lib/libastylej.so" /> |
| 754 |
|
| 755 |
<antcall target="portable-${portable}"> |
| 756 |
<param name="parentdir" value="linux/work" /> |
| 757 |
</antcall> |
| 758 |
|
| 759 |
<antcall target="unzip"> |
| 760 |
<param name="archive_file" value="./liblistSerials-${LIBLISTSERIAL-VERSION}.zip" /> |
| 761 |
<param name="archive_url" value="https://downloads.arduino.cc/liblistSerials/liblistSerials-${LIBLISTSERIAL-VERSION}.zip" /> |
| 762 |
<param name="final_folder" value="${staging_folder}/liblistSerials-${LIBLISTSERIAL-VERSION}" /> |
| 763 |
<param name="dest_folder" value="${staging_folder}" /> |
| 764 |
</antcall> |
| 765 |
<copy file="linux/liblistSerials-${LIBLISTSERIAL-VERSION}/aarch64/liblistSerialsj.so" todir="linux/work/lib/" /> |
| 766 |
<chmod perm="755" file="linux/work/lib/liblistSerialsj.so" /> |
| 767 |
</target> |
| 768 |
|
| 769 |
<target name="linuxaarch64-build" depends="linux-libastyle-aarch64" description="Build Linux (AArch64) version"> |
| 770 |
<antcall target="linux-jvm-${linux-bundle-jvm-task}"> |
| 771 |
<param name="JVM" value="${LINUXAARCH64_BUNDLED_JVM}"/> |
| 772 |
</antcall> |
| 773 |
|
| 774 |
<antcall target="build-arduino-builder" /> |
| 775 |
|
| 776 |
<antcall target="avr-toolchain-bundle"> |
| 777 |
<param name="unpack_target" value="untar-native"/> |
| 778 |
<param name="gcc_archive_file" value="avr-gcc-${AVRGCC-VERSION}-aarch64-pc-linux-gnu.tar.bz2"/> |
| 779 |
<param name="gcc_version" value="${AVRGCC-VERSION}"/> |
| 780 |
<param name="avrdude_archive_file" value="avrdude-${AVRDUDE-VERSION}-aarch64-pc-linux-gnu.tar.bz2"/> |
| 781 |
<param name="avrdude_version" value="${AVRDUDE-VERSION}"/> |
| 782 |
<param name="arduinoOTA_archive_file" value="arduinoOTA-${arduinoOTA-VERSION}-linux_aarch64.tar.bz2"/> |
| 783 |
<param name="arduinoOTA_version" value="${arduinoOTA-VERSION}"/> |
| 784 |
</antcall> |
| 785 |
</target> |
| 786 |
|
| 787 |
<target name="linux32-build" depends="linux-libastyle-x86" description="Build linux (32-bit) version"> |
| 788 |
<antcall target="linux-jvm-${linux-bundle-jvm-task}"> |
| 789 |
<param name="JVM" value="${LINUX32_BUNDLED_JVM}"/> |
| 790 |
</antcall> |
| 791 |
|
| 792 |
<antcall target="build-arduino-builder" /> |
| 793 |
|
| 794 |
<antcall target="avr-toolchain-bundle"> |
| 795 |
<param name="unpack_target" value="untar-native"/> |
| 796 |
<param name="gcc_archive_file" value="avr-gcc-${AVRGCC-VERSION}-i686-pc-linux-gnu.tar.bz2"/> |
| 797 |
<param name="gcc_version" value="${AVRGCC-VERSION}"/> |
| 798 |
<param name="avrdude_archive_file" value="avrdude-${AVRDUDE-VERSION}-i686-pc-linux-gnu.tar.bz2"/> |
| 799 |
<param name="avrdude_version" value="${AVRDUDE-VERSION}"/> |
| 800 |
<param name="arduinoOTA_archive_file" value="arduinoOTA-${arduinoOTA-VERSION}-linux_386.tar.bz2"/> |
| 801 |
<param name="arduinoOTA_version" value="${arduinoOTA-VERSION}"/> |
| 802 |
</antcall> |
| 803 |
</target> |
| 804 |
|
| 805 |
<target name="linux64-build" depends="linux-libastyle-x86" description="Build linux (64-bit) version"> |
| 806 |
<antcall target="linux-jvm-${linux-bundle-jvm-task}"> |
| 807 |
<param name="JVM" value="${LINUX64_BUNDLED_JVM}"/> |
| 808 |
</antcall> |
| 809 |
|
| 810 |
<antcall target="build-arduino-builder" /> |
| 811 |
|
| 812 |
<antcall target="avr-toolchain-bundle"> |
| 813 |
<param name="unpack_target" value="untar-native"/> |
| 814 |
<param name="gcc_archive_file" value="avr-gcc-${AVRGCC-VERSION}-x86_64-pc-linux-gnu.tar.bz2"/> |
| 815 |
<param name="gcc_version" value="${AVRGCC-VERSION}"/> |
| 816 |
<param name="avrdude_archive_file" value="avrdude-${AVRDUDE-VERSION}-x86_64-pc-linux-gnu.tar.bz2"/> |
| 817 |
<param name="avrdude_version" value="${AVRDUDE-VERSION}"/> |
| 818 |
<param name="arduinoOTA_archive_file" value="arduinoOTA-${arduinoOTA-VERSION}-linux_amd64.tar.bz2"/> |
| 819 |
<param name="arduinoOTA_version" value="${arduinoOTA-VERSION}"/> |
| 820 |
</antcall> |
| 821 |
</target> |
| 822 |
|
| 823 |
<target name="linux-jvm-noop"/> |
| 824 |
|
| 825 |
<target name="linux-jvm-bundle"> |
| 826 |
<mkdir dir="${staging_folder}/work/java" /> |
| 827 |
|
| 828 |
<exec executable="rsync"> |
| 829 |
<arg value="-a"/> |
| 830 |
<arg value="${JVM}"/> |
| 831 |
<arg value="${staging_folder}/work/java/"/> |
| 832 |
</exec> |
| 833 |
</target> |
| 834 |
|
| 835 |
<target name="linux32-run" depends="build,start"/> |
| 836 |
|
| 837 |
<target name="linux64-run" depends="build,start"/> |
| 838 |
|
| 839 |
<target name="linuxarm-run" depends="build,start"/> |
| 840 |
|
| 841 |
<target name="linuxaarch64-run" depends="build,start"/> |
| 842 |
|
| 843 |
<target name="linux32-start"> |
| 844 |
<exec executable="./linux/work/arduino" spawn="false" failonerror="true"/> |
| 845 |
</target> |
| 846 |
|
| 847 |
<target name="linux64-start"> |
| 848 |
<exec executable="./linux/work/arduino" spawn="false" failonerror="true"/> |
| 849 |
</target> |
| 850 |
|
| 851 |
<target name="linuxarm-start"> |
| 852 |
<exec executable="./linux/work/arduino" spawn="false" failonerror="true"/> |
| 853 |
</target> |
| 854 |
|
| 855 |
<target name="linuxaarch64-start"> |
| 856 |
<exec executable="./linux/work/arduino" spawn="false" failonerror="true"/> |
| 857 |
</target> |
| 858 |
|
| 859 |
<target name="build-arduino-builder" unless="no_arduino_builder"> |
| 860 |
<property name="ARDUINO-BUILDER-EXTRA-VERSION" value="" /> <!-- default if not set already --> |
| 861 |
<delete dir="${staging_folder}/arduino-builder-${platform}" includeemptydirs="true"/> |
| 862 |
<mkdir dir="${staging_folder}/arduino-builder-${platform}"/> |
| 863 |
<antcall target="untar-native"> |
| 864 |
<param name="archive_file" value="./arduino-builder-${platform}-${ARDUINO-BUILDER-VERSION}${ARDUINO-BUILDER-EXTRA-VERSION}.tar.bz2" /> |
| 865 |
<param name="archive_url" value="https://downloads.arduino.cc/tools/arduino-builder-${platform}-${ARDUINO-BUILDER-VERSION}${ARDUINO-BUILDER-EXTRA-VERSION}.tar.bz2" /> |
| 866 |
<param name="final_folder" value="${staging_folder}/arduino-builder-${platform}/arduino-builder" /> |
| 867 |
<param name="dest_folder" value="${staging_folder}/arduino-builder-${platform}" /> |
| 868 |
</antcall> |
| 869 |
<copy file="${staging_folder}/arduino-builder-${platform}/arduino-builder" tofile="${staging_folder}/work/${staging_hardware_folder}/../arduino-builder" /> |
| 870 |
<chmod perm="755" file="${staging_folder}/work/${staging_hardware_folder}/../arduino-builder" /> |
| 871 |
<move file="${staging_folder}/arduino-builder-${platform}/tools" tofile="${staging_folder}/work/${staging_hardware_folder}/../tools-builder"/> |
| 872 |
<copy todir="${staging_folder}/work/${staging_hardware_folder}" overwrite="true"> |
| 873 |
<fileset dir="${staging_folder}/arduino-builder-${platform}/hardware" includes="*.txt"/> |
| 874 |
</copy> |
| 875 |
<delete dir="${staging_folder}/arduino-builder-${platform}" includeemptydirs="true"/> |
| 876 |
</target> |
| 877 |
|
| 878 |
<!-- Set '${dist_file}_available' property if toolchain dist_file is downloaded --> |
| 879 |
<!-- Set '${dist_file}_installed' property if toolchain is installed in working directory --> |
| 880 |
<!-- hardware/tools/${dist_check_file} is checked for existence --> |
| 881 |
<target name="untar-unzip-check"> |
| 882 |
<available file="${archive_file}" property="${archive_file}_available" /> |
| 883 |
<available file="${final_folder}" property="${archive_file}_installed" /> |
| 884 |
</target> |
| 885 |
|
| 886 |
<!-- Retrieve tool --> |
| 887 |
<target name="untar-unzip-download" depends="untar-unzip-check" unless="${archive_file}_available"> |
| 888 |
<antcall target="untar-unzip-download-web" /> |
| 889 |
<antcall target="untar-unzip-download-local" /> |
| 890 |
</target> |
| 891 |
<target name="untar-unzip-download-web" unless="local_sources"> |
| 892 |
<get src="${archive_url}" dest="${archive_file}" verbose="true" ignoreerrors="true" /> |
| 893 |
</target> |
| 894 |
<target name="untar-unzip-download-local" if="local_sources"> |
| 895 |
<basename file="${archive_file}" property="basename" /> |
| 896 |
<echo>Skipping download of ${archive_url}, using makepkg downloaded ${basename}</echo> |
| 897 |
<exec executable="ln" failonerror="true"> |
| 898 |
<arg value="-s" /> |
| 899 |
<arg value="${basedir}/../../${basename}" /> |
| 900 |
<arg value="${archive_file}" /> |
| 901 |
</exec> |
| 902 |
</target> |
| 903 |
|
| 904 |
<target name="untar-unzip-checksum" depends="untar-unzip-download"> |
| 905 |
<echo>Testing checksum of "${archive_file}"</echo> |
| 906 |
<checksum file="${archive_file}" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/> |
| 907 |
<condition property="checksum.matches.fail"> |
| 908 |
<equals arg1="${checksum.matches}" arg2="false"/> |
| 909 |
</condition> |
| 910 |
<fail if="checksum.matches.fail">Checksum failed. |
| 911 |
|
| 912 |
File ${archive_file} failed checksum. |
| 913 |
Please remove "${archive_file}" to download it again. |
| 914 |
</fail> |
| 915 |
</target> |
| 916 |
|
| 917 |
<!-- Ensure that the tool is downloaded and test checksums, if everything's ok unzip it on the tools folder --> |
| 918 |
<target name="untar" depends="untar-unzip-checksum" unless="${archive_file}_installed"> |
| 919 |
<echo>Untarring ${archive_file} into folder ${dest_folder}</echo> |
| 920 |
<untar src="${archive_file}" dest="${dest_folder}"/> |
| 921 |
</target> |
| 922 |
<target name="untar-bz2" depends="untar-unzip-checksum" unless="${archive_file}_installed"> |
| 923 |
<echo>Untarring ${archive_file} into folder ${dest_folder}</echo> |
| 924 |
<untar src="${archive_file}" dest="${dest_folder}" compression="bzip2"/> |
| 925 |
</target> |
| 926 |
<target name="untar-native" depends="untar-unzip-checksum" unless="${archive_file}_installed"> |
| 927 |
<echo>Untarring ${archive_file} into folder ${dest_folder}</echo> |
| 928 |
<exec executable="tar" failonerror="true"> |
| 929 |
<arg value="xf"/> |
| 930 |
<arg value="${archive_file}"/> |
| 931 |
<arg value="--directory=${dest_folder}"/> |
| 932 |
</exec> |
| 933 |
</target> |
| 934 |
|
| 935 |
<target name="unzip" depends="untar-unzip-checksum" unless="${archive_file}_installed"> |
| 936 |
<echo>Unzipping ${archive_file} into folder ${dest_folder}</echo> |
| 937 |
<mkdir dir="${dest_folder}" /> |
| 938 |
<unzip src="${archive_file}" dest="${dest_folder}"/> |
| 939 |
</target> |
| 940 |
|
| 941 |
<!-- Ensure that the executable flag is set in all enviroments/OS --> |
| 942 |
<target name="make-file-executable" depends="make-file-executable-windows"> |
| 943 |
<chmod perm="755" file="${file}" /> |
| 944 |
</target> |
| 945 |
|
| 946 |
<target name="make-file-executable-windows" if="windows_host"> |
| 947 |
<exec executable="icacls" failonerror="false"> |
| 948 |
<arg value="${file}"/> |
| 949 |
<arg value="/grant"/> |
| 950 |
<arg value="Everyone:(RX)"/> |
| 951 |
</exec> |
| 952 |
</target> |
| 953 |
|
| 954 |
<target name="linux-dist" depends="build" |
| 955 |
description="Build .tar.xz of linux version"> |
| 956 |
|
| 957 |
<move file="linux/work" tofile="linux/arduino-${version}" /> |
| 958 |
|
| 959 |
<exec executable="tar" dir="linux" failonerror="true"> |
| 960 |
<arg value="--lzma"/> |
| 961 |
<arg value="-c"/> |
| 962 |
<arg value="-f"/> |
| 963 |
<arg value="arduino-${full-version}.tar.xz"/> |
| 964 |
<arg value="arduino-${version}"/> |
| 965 |
</exec> |
| 966 |
|
| 967 |
<move file="linux/arduino-${version}" tofile="linux/work" /> |
| 968 |
|
| 969 |
<echo> |
| 970 |
======================================================= |
| 971 |
Arduino for Linux was built. Grab the archive from |
| 972 |
|
| 973 |
linux/arduino-${full-version}.tar.xz |
| 974 |
======================================================= |
| 975 |
</echo> |
| 976 |
</target> |
| 977 |
|
| 978 |
<target name="linux32-dist" depends="linux-dist" |
| 979 |
description="Build .tar.xz of linux x86_32 version" /> |
| 980 |
|
| 981 |
<target name="linux64-dist" depends="linux-dist" |
| 982 |
description="Build .tar.xz of linux x86_64 version" /> |
| 983 |
|
| 984 |
<target name="linuxarm-dist" depends="linux-dist" |
| 985 |
description="Build .tar.xz of linux armhf version" /> |
| 986 |
|
| 987 |
<target name="linuxaarch64-dist" depends="linux-dist" |
| 988 |
description="Build .tar.xz of linux aarch64 version" /> |
| 989 |
|
| 990 |
<!-- - - - - - - - --> |
| 991 |
<!-- Windows --> |
| 992 |
<!-- - - - - - - - --> |
| 993 |
|
| 994 |
<target name="windows-clean" depends="subprojects-clean" |
| 995 |
description="Clean windows version"> |
| 996 |
<delete dir="windows/work" /> |
| 997 |
<delete> |
| 998 |
<fileset dir="windows" includes="arduino-*windows*.zip"/> |
| 999 |
</delete> |
| 1000 |
</target> |
| 1001 |
|
| 1002 |
<target name="windows-checkos" unless="windows"> |
| 1003 |
<echo> |
| 1004 |
======================================================= |
| 1005 |
Arduino for Windows can only be built on windows. |
| 1006 |
|
| 1007 |
Bye. |
| 1008 |
======================================================= |
| 1009 |
</echo> |
| 1010 |
|
| 1011 |
<fail message="wrong platform (${os.name})" /> |
| 1012 |
</target> |
| 1013 |
|
| 1014 |
<target name="download-launch4j-windows"> |
| 1015 |
<antcall target="unzip"> |
| 1016 |
<param name="archive_file" value="windows/launch4j-3.9-win32.zip"/> |
| 1017 |
<param name="archive_url" value="https://downloads.arduino.cc/tools/launch4j-3.9-win32.zip"/> |
| 1018 |
<param name="final_folder" value="windows/launcher/launch4j"/> |
| 1019 |
<param name="dest_folder" value="windows/launcher/"/> |
| 1020 |
</antcall> |
| 1021 |
</target> |
| 1022 |
|
| 1023 |
<target name="download-launch4j-linux"> |
| 1024 |
<antcall target="untar-native"> |
| 1025 |
<param name="archive_file" value="windows/launch4j-3.9-linux.tgz"/> |
| 1026 |
<param name="archive_url" value="https://downloads.arduino.cc/tools/launch4j-3.9-linux.tgz"/> |
| 1027 |
<param name="final_folder" value="windows/launcher/launch4j"/> |
| 1028 |
<param name="dest_folder" value="windows/launcher/"/> |
| 1029 |
</antcall> |
| 1030 |
</target> |
| 1031 |
|
| 1032 |
<target name="windows-build" |
| 1033 |
depends="revision-check, windows-checkos, subprojects-build" |
| 1034 |
description="Build windows version"> |
| 1035 |
<mkdir dir="windows/work" /> |
| 1036 |
<mkdir dir="windows/work/${staging_hardware_folder}" /> |
| 1037 |
|
| 1038 |
<copy todir="windows/work/lib"> |
| 1039 |
<fileset dir="shared" includes="icons/**/*.png"/> |
| 1040 |
</copy> |
| 1041 |
|
| 1042 |
<!-- assemble the pde --> |
| 1043 |
<mkdir dir="windows/work/lib" /> |
| 1044 |
<copy todir="windows/work/lib" flatten="true"> |
| 1045 |
<fileset refid="runtime.jars" /> |
| 1046 |
</copy> |
| 1047 |
|
| 1048 |
<copy todir="windows/work"> |
| 1049 |
<fileset dir="shared" includes="lib/**" /> |
| 1050 |
<fileset file="shared/revisions.txt" /> |
| 1051 |
</copy> |
| 1052 |
|
| 1053 |
<fixcrlf file="windows/work/revisions.txt" eol="dos"/> |
| 1054 |
<fixcrlf file="windows/work/lib/formatter.conf" eol="dos"/> |
| 1055 |
|
| 1056 |
<copy todir="windows/work"> |
| 1057 |
<fileset dir="windows/dist" includes="*.dll" /> |
| 1058 |
</copy> |
| 1059 |
|
| 1060 |
<copy todir="windows/work"> |
| 1061 |
<fileset dir="windows/dist" includes="drivers/**" /> |
| 1062 |
</copy> |
| 1063 |
|
| 1064 |
<antcall target="windows-build-avr-toolchain" /> |
| 1065 |
|
| 1066 |
<antcall target="unzip"> |
| 1067 |
<param name="archive_file" value="./libastylej-2.05.1-5.zip" /> |
| 1068 |
<param name="archive_url" value="https://downloads.arduino.cc/libastylej-2.05.1-5.zip" /> |
| 1069 |
<param name="final_folder" value="${staging_folder}/libastylej-2.05.1" /> |
| 1070 |
<param name="dest_folder" value="${staging_folder}" /> |
| 1071 |
</antcall> |
| 1072 |
<copy file="windows/libastylej-2.05.1/AStylej.dll" todir="windows/work/lib" /> |
| 1073 |
<copy file="windows/msvcp100.dll" todir="windows/work" /> |
| 1074 |
<copy file="windows/msvcr100.dll" todir="windows/work" /> |
| 1075 |
|
| 1076 |
<antcall target="unzip"> |
| 1077 |
<param name="archive_file" value="./liblistSerials-${LIBLISTSERIAL-VERSION}.zip" /> |
| 1078 |
<param name="archive_url" value="https://downloads.arduino.cc/liblistSerials/liblistSerials-${LIBLISTSERIAL-VERSION}.zip" /> |
| 1079 |
<param name="final_folder" value="${staging_folder}/liblistSerials-${LIBLISTSERIAL-VERSION}" /> |
| 1080 |
<param name="dest_folder" value="${staging_folder}" /> |
| 1081 |
</antcall> |
| 1082 |
<copy file="windows/liblistSerials-${LIBLISTSERIAL-VERSION}/windows/listSerialsj.dll" todir="windows/work/lib/" /> |
| 1083 |
<antcall target="make-file-executable"> |
| 1084 |
<param name="file" value="windows/work/lib/listSerialsj.dll" /> |
| 1085 |
</antcall> |
| 1086 |
|
| 1087 |
<delete dir="${staging_folder}/arduino-builder-windows" includeemptydirs="true"/> |
| 1088 |
<mkdir dir="${staging_folder}/arduino-builder-windows"/> |
| 1089 |
<antcall target="unzip"> |
| 1090 |
<param name="archive_file" value="./arduino-builder-windows-${ARDUINO-BUILDER-VERSION}.zip" /> |
| 1091 |
<param name="archive_url" value="https://downloads.arduino.cc/tools/arduino-builder-windows-${ARDUINO-BUILDER-VERSION}.zip" /> |
| 1092 |
<param name="final_folder" value="${staging_folder}/arduino-builder-windows/arduino-builder.exe" /> |
| 1093 |
<param name="dest_folder" value="${staging_folder}/arduino-builder-windows" /> |
| 1094 |
</antcall> |
| 1095 |
<copy file="${staging_folder}/arduino-builder-windows/arduino-builder.exe" tofile="windows/work/arduino-builder.exe" /> |
| 1096 |
<antcall target="make-file-executable"> |
| 1097 |
<param name="file" value="windows/work/arduino-builder.exe" /> |
| 1098 |
</antcall> |
| 1099 |
<move file="${staging_folder}/arduino-builder-windows/tools" tofile="windows/work/tools-builder"/> |
| 1100 |
<antcall target="make-file-executable"> |
| 1101 |
<param name="file" value="windows/work/tools-builder/ctags/5.8-arduino11/ctags.exe" /> |
| 1102 |
</antcall> |
| 1103 |
<copy todir="windows/work/hardware" overwrite="true"> |
| 1104 |
<fileset dir="${staging_folder}/arduino-builder-windows/hardware" includes="*.txt"/> |
| 1105 |
</copy> |
| 1106 |
<delete dir="${staging_folder}/arduino-builder-windows" includeemptydirs="true"/> |
| 1107 |
|
| 1108 |
<unzip src="../arduino-core/lib/jna-4.2.2.jar" dest="windows/work/lib"> |
| 1109 |
<patternset> |
| 1110 |
<include name="com/sun/jna/win32-x86/jnidispatch.dll"/> |
| 1111 |
</patternset> |
| 1112 |
<mapper type="flatten"/> |
| 1113 |
</unzip> |
| 1114 |
<move file="windows/work/lib/jnidispatch.dll" tofile="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" /> |
| 1115 |
<antcall target="make-file-executable"> |
| 1116 |
<param name="file" value="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" /> |
| 1117 |
</antcall> |
| 1118 |
|
| 1119 |
<unzip src="../arduino-core/lib/jssc-2.8.0-arduino4.jar" dest="windows/work/lib"> |
| 1120 |
<patternset> |
| 1121 |
<include name="libs/windows/jSSC-2.8_x86.dll"/> |
| 1122 |
</patternset> |
| 1123 |
<mapper type="flatten"/> |
| 1124 |
</unzip> |
| 1125 |
<move file="windows/work/lib/jSSC-2.8_x86.dll" tofile="windows/work/lib/jSSC-2.8_x86.dll" /> |
| 1126 |
<antcall target="make-file-executable"> |
| 1127 |
<param name="file" value="windows/work/lib/jSSC-2.8_x86.dll" /> |
| 1128 |
</antcall> |
| 1129 |
<unzip src="../arduino-core/lib/jssc-2.8.0-arduino4.jar" dest="windows/work/lib"> |
| 1130 |
<patternset> |
| 1131 |
<include name="libs/windows/jSSC-2.8_x86_64.dll"/> |
| 1132 |
</patternset> |
| 1133 |
<mapper type="flatten"/> |
| 1134 |
</unzip> |
| 1135 |
<move file="windows/work/lib/jSSC-2.8_x86_64.dll" tofile="windows/work/lib/jSSC-2.8_x86_64.dll" /> |
| 1136 |
<antcall target="make-file-executable"> |
| 1137 |
<param name="file" value="windows/work/lib/jSSC-2.8_x86_64.dll" /> |
| 1138 |
</antcall> |
| 1139 |
|
| 1140 |
<antcall target="assemble"> |
| 1141 |
<param name="target.path" value="windows/work" /> |
| 1142 |
</antcall> |
| 1143 |
|
| 1144 |
<delete dir="windows/launcher/launch4j"/> |
| 1145 |
<antcall target="download-${launch4j-download-unpack-target-name}" /> |
| 1146 |
|
| 1147 |
<property name="launch4j.dir" value="windows/launcher/launch4j/" /> |
| 1148 |
<taskdef name="launch4j" |
| 1149 |
classname="net.sf.launch4j.ant.Launch4jTask" |
| 1150 |
classpath="${launch4j.dir}/launch4j.jar; ${launch4j.dir}/lib/xstream.jar" /> |
| 1151 |
|
| 1152 |
<copy todir="windows/work"> |
| 1153 |
<fileset dir="windows/launcher" |
| 1154 |
includes="application.ico, config.xml, config_debug.xml, arduino.l4j.ini, wrapper-manifest.xml"/> |
| 1155 |
</copy> |
| 1156 |
<launch4j configFile="windows/work/config.xml" fileVersion="${revision}.0" txtFileVersion="${revision}" productVersion="${revision}.0" txtProductVersion="${revision}"/> |
| 1157 |
<launch4j configFile="windows/work/config_debug.xml" fileVersion="${revision}.0" txtFileVersion="${revision}" productVersion="${revision}.0" txtProductVersion="${revision}"/> |
| 1158 |
<delete dir="windows/work" includes="application.ico, config.xml, config_debug.xml" /> |
| 1159 |
<copy file="windows/work/arduino.l4j.ini" tofile="windows/work/arduino_debug.l4j.ini" /> |
| 1160 |
|
| 1161 |
<!-- cygwin requires html, dll, and exe to have the +x flag --> |
| 1162 |
<chmod perm="755"> |
| 1163 |
<fileset dir="windows/work" includes="**/*.html, **/*.dll, **/*.exe" /> |
| 1164 |
</chmod> |
| 1165 |
|
| 1166 |
<!-- For JVM within JDK, release file is in parent directory --> |
| 1167 |
<property file="${WINDOWS_BUNDLED_JVM}/release" prefix="windows"/> |
| 1168 |
<property file="${WINDOWS_BUNDLED_JVM}/../release" prefix="windows"/> |
| 1169 |
|
| 1170 |
<fail message="It looks like ${WINDOWS_BUNDLED_JVM} does not contain a Windows JVM"> |
| 1171 |
<condition> |
| 1172 |
<not> |
| 1173 |
<equals arg1="${windows.OS_NAME}" arg2=""Windows""/> |
| 1174 |
</not> |
| 1175 |
</condition> |
| 1176 |
</fail> |
| 1177 |
|
| 1178 |
<copy todir="${staging_folder}/work/java" includeemptydirs="true" preservelastmodified="true" overwrite="true" failonerror="true"> |
| 1179 |
<fileset dir="${WINDOWS_BUNDLED_JVM}" includes="*/**"/> |
| 1180 |
</copy> |
| 1181 |
|
| 1182 |
<antcall target="portable-${portable}"> |
| 1183 |
<param name="parentdir" value="${staging_folder}/work" /> |
| 1184 |
</antcall> |
| 1185 |
</target> |
| 1186 |
|
| 1187 |
<target name="windows-build-avr-toolchain"> |
| 1188 |
<antcall target="avr-toolchain-bundle"> |
| 1189 |
<param name="unpack_target" value="unzip"/> |
| 1190 |
<param name="gcc_archive_file" value="avr-gcc-${AVRGCC-VERSION}-i686-w64-mingw32.zip"/> |
| 1191 |
<param name="gcc_version" value="${AVRGCC-VERSION}"/> |
| 1192 |
<param name="avrdude_archive_file" value="avrdude-${AVRDUDE-VERSION}-i686-w64-mingw32.zip"/> |
| 1193 |
<param name="avrdude_version" value="${AVRDUDE-VERSION}"/> |
| 1194 |
<param name="arduinoOTA_archive_file" value="arduinoOTA-${arduinoOTA-VERSION}-windows_386.zip"/> |
| 1195 |
<param name="arduinoOTA_version" value="${arduinoOTA-VERSION}"/> |
| 1196 |
</antcall> |
| 1197 |
</target> |
| 1198 |
|
| 1199 |
<target name="windows-run" depends="build,start"/> |
| 1200 |
|
| 1201 |
<target name="windows-start"> |
| 1202 |
<exec executable="windows/work/arduino.exe" dir="windows/work" spawn="false" failonerror="true"/> |
| 1203 |
</target> |
| 1204 |
|
| 1205 |
<target name="windows-dist" depends="build" description="Create .zip files of windows version"> |
| 1206 |
<zip destfile="windows/arduino-${full-version}.zip" level="9"> |
| 1207 |
<zipfileset dir="windows/work" prefix="arduino-${version}"/> |
| 1208 |
</zip> |
| 1209 |
|
| 1210 |
<echo> |
| 1211 |
======================================================= |
| 1212 |
Arduino for Windows was built. Grab the archive from |
| 1213 |
|
| 1214 |
windows/arduino-${full-version}.zip |
| 1215 |
======================================================= |
| 1216 |
</echo> |
| 1217 |
</target> |
| 1218 |
|
| 1219 |
|
| 1220 |
<!-- - - - - - - - --> |
| 1221 |
<!-- Source --> |
| 1222 |
<!-- - - - - - - - --> |
| 1223 |
|
| 1224 |
<target name="source-dist" depends="revision-check" |
| 1225 |
description="Build .tar.gz of source code"> |
| 1226 |
<input message="Enter version number:" |
| 1227 |
addproperty="version" |
| 1228 |
defaultvalue="${revision}" /> |
| 1229 |
|
| 1230 |
<tar compression="gzip" destfile="arduino-${version}-src.tar.gz"> |
| 1231 |
<tarfileset dir="../" |
| 1232 |
prefix="arduino-${version}" |
| 1233 |
excludes="**/*.tgz, |
| 1234 |
**/*.bz2, |
| 1235 |
**/build/macosx/, |
| 1236 |
**/build/windows/, |
| 1237 |
**/work/, |
| 1238 |
**/.git/, |
| 1239 |
**/*.class" |
| 1240 |
/> |
| 1241 |
</tar> |
| 1242 |
|
| 1243 |
<echo> |
| 1244 |
======================================================= |
| 1245 |
Arduino source distribution was built. Grab the archive from |
| 1246 |
|
| 1247 |
arduino-${version}-src.tar.gz |
| 1248 |
======================================================= |
| 1249 |
</echo> |
| 1250 |
</target> |
| 1251 |
|
| 1252 |
|
| 1253 |
<!-- - - - - - - - --> |
| 1254 |
<!-- Run It! --> |
| 1255 |
<!-- - - - - - - - --> |
| 1256 |
|
| 1257 |
<target name="clean" description="Perform a spring cleaning" |
| 1258 |
depends="linux-clean, windows-clean, macosx-clean, subprojects-clean"> |
| 1259 |
</target> |
| 1260 |
|
| 1261 |
<target name="avr-toolchain-bundle" unless="light_bundle"> |
| 1262 |
<!-- Unzip AVR tools --> |
| 1263 |
<mkdir dir="${staging_folder}/work/${staging_hardware_folder}/tmp/gcc"/> |
| 1264 |
|
| 1265 |
<antcall target="${unpack_target}"> |
| 1266 |
<param name="archive_file" value="${staging_folder}/${gcc_archive_file}"/> |
| 1267 |
<param name="archive_url" value="https://downloads.arduino.cc/tools/${gcc_archive_file}"/> |
| 1268 |
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tmp/gcc/${gcc_version}/"/> |
| 1269 |
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tmp/gcc/"/> |
| 1270 |
</antcall> |
| 1271 |
|
| 1272 |
<mkdir dir="${staging_folder}/work/${staging_hardware_folder}/tmp/avrdude"/> |
| 1273 |
|
| 1274 |
<antcall target="${unpack_target}"> |
| 1275 |
<param name="archive_file" value="${staging_folder}/${avrdude_archive_file}"/> |
| 1276 |
<param name="archive_url" value="https://downloads.arduino.cc/tools/${avrdude_archive_file}"/> |
| 1277 |
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tmp/avrdude/${avrdude_version}"/> |
| 1278 |
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tmp/avrdude/"/> |
| 1279 |
</antcall> |
| 1280 |
|
| 1281 |
<mkdir dir="${staging_folder}/work/${staging_hardware_folder}/tmp/arduinoOTA"/> |
| 1282 |
|
| 1283 |
<antcall target="${unpack_target}"> |
| 1284 |
<param name="archive_file" value="${staging_folder}/${arduinoOTA_archive_file}"/> |
| 1285 |
<param name="archive_url" value="http://downloads.arduino.cc/tools/${arduinoOTA_archive_file}"/> |
| 1286 |
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/tmp/arduinoOTA/${arduinoOTA_version}"/> |
| 1287 |
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/tmp/arduinoOTA/"/> |
| 1288 |
</antcall> |
| 1289 |
|
| 1290 |
<move file="${staging_folder}/work/${staging_hardware_folder}/tmp/gcc/avr" tofile="${staging_folder}/work/${staging_hardware_folder}/tools/avr"/> |
| 1291 |
<move file="${staging_folder}/work/${staging_hardware_folder}/tmp/avrdude/avrdude" tofile="${staging_folder}/work/${staging_hardware_folder}/tools/avr"/> |
| 1292 |
<move file="${staging_folder}/work/${staging_hardware_folder}/tmp/arduinoOTA/arduinoOTA/" tofile="${staging_folder}/work/${staging_hardware_folder}/tools/avr"/> |
| 1293 |
|
| 1294 |
<echo append="true" file="${staging_folder}/work/${staging_hardware_folder}/tools/avr/builtin_tools_versions.txt" message="arduino.avrdude=${avrdude_version}${line.separator}"/> |
| 1295 |
<echo append="true" file="${staging_folder}/work/${staging_hardware_folder}/tools/avr/builtin_tools_versions.txt" message="arduino.arduinoOTA=${arduinoOTA_version}${line.separator}"/> |
| 1296 |
<echo append="true" file="${staging_folder}/work/${staging_hardware_folder}/tools/avr/builtin_tools_versions.txt" message="arduino.avr-gcc=${gcc_version}${line.separator}"/> |
| 1297 |
|
| 1298 |
<delete dir="${staging_folder}/work/${staging_hardware_folder}/tmp"/> |
| 1299 |
</target> |
| 1300 |
|
| 1301 |
<target name="generate-hourly-build-txt" if="hourly"> |
| 1302 |
<echo file="${staging_folder}/work/${staging_hardware_folder}/../lib/hourlyBuild.txt">${BUILD_DATE}</echo> |
| 1303 |
</target> |
| 1304 |
|
| 1305 |
<target name="portable-true"> |
| 1306 |
<mkdir dir="${parentdir}/portable"/> |
| 1307 |
</target> |
| 1308 |
<target name="portable-false"/> |
| 1309 |
</project> |