IBM Worklight 6.0 - worklightserverhost attribute

2019-02-20 05:26发布

问题:

I had an Ant build file working fine on Worklight v5.0.6. On porting to Worklight v6.0 I found out that there's a new mandatory attribute, worklightserverhost, for the app-builder task.

 <app-builder 
    applicationFolder="path/to/proj"
    environments="mobilewebapp,android,iphone"
    nativeProjectPrefix="myproj"
    worklightserverhost="?Here?" 
    outputFolder="where/to/put/it"/>

I can find no documentation of the value to put here or its significance; my guess is that it is supposed to be the value that was formerly in application-descriptor.xml and is now taken from worklight.properties when building in Worklight Studio, and hence it's not just the host but also the port and context root. Is that right?

回答1:

This attribute is now required due to, as you mentioned, the removal of worklightServerRootURL from application-descriptor.xml. So if you're using the app-builder Ant task you need to specify the host, port and context-root.
For example: worklightserverhost="http://9.148.22.4:10080/testProject"

Does this work for you?

I will open a documentation defect about the missing information; it seems more like the article(s) about the Ant task in 6.0 have not been updated in the IBM Worklight Information Center (adapters, apps).