Some components, such as Twitter, require external libraries (twitter4j.jar). Here is how to add a jar file referenced by your component source file.
The appinventor/lib directory contains one subdirectory for each external library. For example, there is a subdirectory appinventor/lib/twitter. Each of these subdirectories should contain the following files:
The path to the new library should be added to the build.xml files wherever there are references to the Twitter library:
<pathelement location=${lib.dir}/twitter/twitter4j-2.0.10-SNAPSHOT.jar” />
At the time of the writing of this document, these locations are:
If the Javadoc in your component links to the Javadoc for the external library, you should also add a link entry to the javadoc target in appinventor/build.xml.
You will also need to modify the build.xml file in the /buildserver/ directory (this is the file at appinventor/buildserver/build.xml) to include a line for your jar file in the list of <copy> tags under the “BuildServer” target.
Only one modification should be necessary to add your jar file to the list of <copy> tag declarations.
The format for this <copy> entry should be the following:
<copy toFile=”${classes.files.dir}/simplifiedNameForJARFile.jar”
file=”${lib.dir}/subfolderNameFromStep1/nameOfJARFileToAdd.jar” />
Note: in each <copy> tag, the file attribute refers to the path at which you placed your jar file in appinventor/lib. The “${lib.dir}” equates to “appinventor/lib”. The toFile attribute states the path into which the file will be copied during the ant build process. The “${classes.files.dir}” refers to the path “appinventor/buildserver/build/classes/BuildServer/files”. After the ant script finishes executing the BuildServer ant target, you should be able to navigate to appinventor/buildserver/build/classes/BuildServer/files and verify that your jar file did indeed get copied.
Note that all these changes are necessary to use the ant build system in the command line. If you use an IDE such as Eclipse, you will also need to add the new jar files in the Build Path or your project.
--
You received this message because you are subscribed to a topic in the Google Groups "App Inventor Open Source Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/app-inventor-open-source-dev/ZR7KbbqQW-o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to app-inventor-open-so...@googlegroups.com.
To post to this group, send email to app-inventor-o...@googlegroups.com.
Visit this group at https://groups.google.com/group/app-inventor-open-source-dev.
For more options, visit https://groups.google.com/d/optout.
So Now only 1 Build File Has to be edited to add a jar file? Yeay
On Tue, 19 Mar, 2019, 11:31 PM Evan Patton, <ewpa...@gmail.com> wrote:
--You should place the JAR files you need in the CopyComponentLibraries target in components/build.xml. I'll update the documentation to reflect this change.Regards,Evan
On Monday, March 18, 2019 at 11:40:08 AM UTC-4, clashw...@gmail.com wrote:after this fix https://github.com/mit-cml/appinventor-sources/pull/1605 i am not able to find where to place .jar file
On Monday, 18 March 2019 18:51:50 UTC+5:30, Abhijith Dominic wrote:The New Build.xml Files are different Compared to the Old ones
You received this message because you are subscribed to a topic in the Google Groups "App Inventor Open Source Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/app-inventor-open-source-dev/ZR7KbbqQW-o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to app-inventor-open-source-dev+unsub...@googlegroups.com.
To post to this group, send email to app-inventor-open-source-dev@googlegroups.com.
> To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-open-source-dev+unsub...@googlegroups.com.
> To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-open-source-dev+unsub...@googlegroups.com.
> To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-open-source-dev+unsub...@googlegroups.com.