Skip to content
12 changes: 10 additions & 2 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@
</target>

<!-- copy library folder -->
<target name="assemble-libraries" unless="light_bundle">
<target name="assemble-libraries" depends="assemble-libraries-full, assemble-libraries-light" />
<target name="assemble-libraries-full" unless="light_bundle">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guees this is to keep the empty libraries folder. Is it really needed?

<copy todir="${target.path}/libraries">
<fileset dir="../libraries"/>
</copy>
Expand All @@ -236,6 +237,9 @@
<download-library name="Mouse" version="1.0.1"/>
<download-library name="Keyboard" version="1.0.1"/>
</target>
<target name="assemble-libraries-light" if="light_bundle">
<mkdir dir="${target.path}/libraries" />
</target>

<macrodef name="download-library">
<attribute name="name"/>
Expand All @@ -254,13 +258,17 @@
</macrodef>

<!-- copy hardware folder -->
<target name="assemble-hardware" unless="light_bundle">
<target name="assemble-hardware" depends="assemble-hardware-full, assemble-hardware-light" />
<target name="assemble-hardware-full" unless="light_bundle">
<copy todir="${target.path}/hardware">
<fileset dir="../hardware">
<exclude name="arduino/sam/**"/>
</fileset>
</copy>
</target>
<target name="assemble-hardware-light" if="light_bundle">
<copy file="../hardware/package_index_bundled.json" todir="${target.path}/hardware" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case the file ../hardware/package_index_bundled.json is wrong, it should be a json with zero platforms defined. I don't know maybe the best thing to do is to add a check to the IDE...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a lot of problems with this file. Currently I add a copy fo the avr core to the hardware path with a different name and patches to use the archlinux tools. However If i define this package in this json the IDE always crashs on a name not equal to "arduino". I am not sure if the file is required in this case.

If it should be empty, maybe you should add a stub with no data in it instead. However this works for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package_index_bundled.json is, basically, a core-package json that describe what's bundled inside the IDE hardware folder. The IDE merges the content of package_index_bundled.json with the general package_index.json that is downloaded from arduino.cc. The bundled index has priority over the downloaded index.

If you want to make a real no-bundle (or light) version of the IDE, the correct thing to do is to create an empty (== with zero platforms defined) package_index_bundled.json.

</target>

<!-- - - - - - - - - -->
<!-- Revision check -->
Expand Down