ProjectChangeListener execution order

Given two modules A and B:

[ul]

  • A stands alone (does not require B)
  • B stands alone (does not require A)
  • If both A and B are installed, the projectUpdated() event for A must run before the one for B
    [/ul]

How can I enforce this?

Thanks.

Modules can interact with each other via their hook objects using BaseContext.getModule(). It should be possible to setup an appropriate dependency check using this method.

Something like the following should work:

A.projectUpdated() {
    if (B) {
        // do nothing
    } else {
        A.runUpdate();
    }
}

B.projectUpdated() {
    if (A) {
       A.runUpdate();
    }
    B.runUpdate();
}