8 years, 1 month ago.

How to implement "Update all..." from a command line...?

The compiler IDE provides a button "Update All..." for a program within your My Programs.

When you click it, it will go to all of your .lib and .bld components and update them to their latest revisions.

On examining the .lib and .bld files you find that contain a url to the lib and a sha for the latest revision.

As far as I can tell, mercurial doesn't really understand these files. They are a construction of the mbed IDE.

If I clone a particular project to my hard drive, I get a .lib file that might be out of date.

Are the ?scripts? that are used to implement the "Update All ..." generally available?

I want to update the mercurial repo locally on my hard drive with the most current versions of the libraries.

Thank you, Tony

1 Answer

8 years, 1 month ago.

If you have mercurial installed, you can go into the library directory and run:

hg update

To retrieve the latest version of the library. It should be easy to write a simple script that iterates over all directories and runs this.

Suppose I have a project. Let's call it iotprog. It's hosted on mbed.org That project has two source files foo.c and foo.h. In addition, the project references two external (mbed.org hosted) libraries: azureiot_common and azure_uamqp. If I clone my project to my local drive I will find in my iotprog directory the following files:

foo.c foo.h azureiot_common.lib azure_uamqp.lib

There will be no subdirectories. Am I correct so far? Assume I have NOT touched the project in any way for one week.

If I do an hg update at this point, nothing will happen correct?

However, what if azureiot_common changed yesterday? This change will NOT be reflected in the contents of the azureiot_common.lib file.

The only way that I know of to get my projects .lib files updated is to go to the web site and do update all followed by a publish.

What am I missing?

I am anticipating having to indeed write a script that

for each .lib files in my cloned project clone the libraries referenced in the .lib files to some temp directory. Get the current sha of these clones. Insert the new sha into my projects .lib files hg add/remove, hg commit and finally hg push.

This will then have my project "up to date".

My apologies if I am misunderstanding things.

posted by Tony Ercolano 29 Mar 2016

If you *export* to f.e. GCC you will not only have the .lib but also have a directory 'azureiot_common'. This directory contains a mercurial repository. Go into that dir and run `hg update` to get the latest version. The .lib file is only used online, offline the directory is used.

You'll need to export by right clicking on the project and select 'export'.

posted by Jan Jongboom 30 Mar 2016

What I want is to set things up for the online compiler. We currently have a little c# app that runs under Jenkins that submits a project for compilation to the online compiler. (You could find the app in azure-iot-sdks on github (./c/tools/compilembed). However, for this to work as part of a build gate we need to make sure the various components are up to date. Also, since this is being driven by Jenkins, no clicking a web page allowed.

posted by Tony Ercolano 30 Mar 2016