[jira] [Updated] (CB-11873) No plugins installed when running a prepare before a build in a gulp task.
[ https://issues.apache.org/jira/browse/CB-11873?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex Buijs updated CB-11873: Description: I use a gulp task for building, so I work directly with {code}var cordova = require('cordova-lib').cordova; cordova.build({platforms: ['ios', 'android'], options: {}}, cb);{code} Because of [a check|https://github.com/apache/cordova-lib/blob/6.3.x/cordova-lib/src/cordova/util.js#L279] in cordova-lib/src/cordova/util.js, platforms need to be added before the project can be build, otherwise the error "No platforms added to this project..." is thrown. Since I always remove the contents of the platforms and plugins directories before building (I target multiple apps from the same codebase), I need to prepare the project before I can build, because of this check. This leads to a bug similar to CB-11519 and CB-11589, where plugins are never correctly installed. Unfortunately, I couldn't find the exact reason why platforms/ios/ios.json is missing the plugins when running a prepare immediately followed by a build. When the tasks are performed manually one after the other, everything works fine. I am waiting for the callback of prepare to be called, before the build task is started, but perhaps the prepare callback is called too early? Since the build function in cordova-lib/src/cordova/build.js already prepares the project (after calling preProcessOptions in util.js), it seems redundant to be forced to prepare the project before building. When the check I mentioned is not performed, a build with empty platforms and plugins directories works just fine: it saves one superfluous prepare task and, more importantly, plugins are correctly installed. My proposal: perhaps this check could be omitted when preProcessOptions is called from the build task? was: I use a gulp task for building, so I work directly with {code}var cordova = require('cordova-lib').cordova; cordova.build({platforms: ['ios', 'android'], options: {}}, cb);{code} Because of [a check|https://github.com/apache/cordova-lib/blob/6.3.x/cordova-lib/src/cordova/util.js#L279] in cordova-lib/src/cordova/util.js, platforms need to be added before the project can be build, otherwise the error "No platforms added to this project..." is thrown. Since I always remove the contents of the platforms and plugins directories before building (I target multiple apps from the same codebase), I need to prepare the project before I can build, because of this check. This leads to a bug similar to CB-11519 and CB-11589, where plugins are never correctly installed. Unfortunately, I couldn't find the exact reason why platforms/ios/ios.json is missing the plugins when running a prepare immediately followed by a build. When the tasks are performed manually one after the other, everything works fine. I am waiting for the callback of prepare to be called, before the build task is started, but perhaps the prepare callback is called too early? Since the build function in cordova-lib/src/cordova/build.js already prepares the project (after calling preProcessOptions in util.js), it seems redundant to be forced to prepare the project before building. When the check I mentioned is not performed, a build with empty platforms and plugins directories works just fine: it saves one superfluous prepare task and, more importantly, plugins are correctly installed. My proposal: perhaps this check could be omitted when preProcessOptions is called from the build task? > No plugins installed when running a prepare before a build in a gulp task. > -- > > Key: CB-11873 > URL: https://issues.apache.org/jira/browse/CB-11873 > Project: Apache Cordova > Issue Type: Bug > Components: CordovaLib >Affects Versions: 6.3.1 >Reporter: Alex Buijs > > I use a gulp task for building, so I work directly with {code}var cordova = > require('cordova-lib').cordova; > cordova.build({platforms: ['ios', 'android'], options: {}}, cb);{code} > Because of [a > check|https://github.com/apache/cordova-lib/blob/6.3.x/cordova-lib/src/cordova/util.js#L279] > in cordova-lib/src/cordova/util.js, platforms need to be added before the > project can be build, otherwise the error "No platforms added to this > project..." is thrown. > Since I always remove the contents of the platforms and plugins directories > before building (I target multiple apps from the same codebase), I need to > prepare the project before I can build, because of this check. This leads to > a bug similar to CB-11519 and CB-11589, where plugins are never correctly > installed. > Unfortunately, I couldn't find the exact reason why platforms/ios/ios.json is > missing the plugins when running a prepare immediately followed by a build. > When the tasks are
[jira] [Updated] (CB-11873) No plugins installed when running a prepare before a build in a gulp task.
[ https://issues.apache.org/jira/browse/CB-11873?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex Buijs updated CB-11873: Description: I use a gulp task for building, so I work directly with {code}var cordova = require('cordova-lib').cordova; cordova.build({platforms: ['ios', 'android'], options: {}}, cb);{code} Because of [a check|https://github.com/apache/cordova-lib/blob/6.3.x/cordova-lib/src/cordova/util.js#L279] in cordova-lib/src/cordova/util.js, platforms need to be added before the project can be build, otherwise the error "No platforms added to this project..." is thrown. Since I always remove the contents of the platforms and plugins directories before building (I target multiple apps from the same codebase), I need to prepare the project before I can build, because of this check. This leads to a bug similar to CB-11519 and CB-11589, where plugins are never correctly installed. Unfortunately, I couldn't find the exact reason why platforms/ios/ios.json is missing the plugins when running a prepare immediately followed by a build. When the tasks are performed manually one after the other, everything works fine. I am waiting for the callback of prepare to be called, before the build task is started, but perhaps the prepare callback is called too early? Since the build function in cordova-lib/src/cordova/build.js already prepares the project (after calling preProcessOptions in util.js), it seems redundant to be forced to prepare the project before building. When the check I mentioned is not performed, a build with empty platforms and plugins directories works just fine: it saves one superfluous prepare task and, more importantly, plugins are correctly installed. My proposal: perhaps this check could be omitted when preProcessOptions is called from the build task? was: I use a gulp task for building, so I work directly with {code}var cordova = require('cordova-lib').cordova.build({}, cb);{code} Because of [a check|https://github.com/apache/cordova-lib/blob/6.3.x/cordova-lib/src/cordova/util.js#L279] in cordova-lib/src/cordova/util.js, platforms need to be added before the project can be build, otherwise the error "No platforms added to this project..." is thrown. Since I always remove the contents of the platforms and plugins directories before building (I target multiple apps from the same codebase), I need to prepare the project before I can build, because of this check. This leads to a bug similar to CB-11519 and CB-11589, where plugins are never correctly installed. Unfortunately, I couldn't find the exact reason why platforms/ios/ios.json is missing the plugins when running a prepare immediately followed by a build. When the tasks are performed manually one after the other, everything works fine. I am waiting for the callback of prepare to be called, before the build task is started, but perhaps the prepare callback is called too early? Since the build function in cordova-lib/src/cordova/build.js already prepares the project (after calling preProcessOptions in util.js), it seems redundant to be forced to prepare the project before building. When the check I mentioned is not performed, a build with empty platforms and plugins directories works just fine: it saves one superfluous prepare task and, more importantly, plugins are correctly installed. My proposal: perhaps this check could be omitted when preProcessOptions is called from the build task? > No plugins installed when running a prepare before a build in a gulp task. > -- > > Key: CB-11873 > URL: https://issues.apache.org/jira/browse/CB-11873 > Project: Apache Cordova > Issue Type: Bug > Components: CordovaLib >Affects Versions: 6.3.1 >Reporter: Alex Buijs > > I use a gulp task for building, so I work directly with {code}var cordova = > require('cordova-lib').cordova; cordova.build({platforms: ['ios', 'android'], > options: {}}, cb);{code} > Because of [a > check|https://github.com/apache/cordova-lib/blob/6.3.x/cordova-lib/src/cordova/util.js#L279] > in cordova-lib/src/cordova/util.js, platforms need to be added before the > project can be build, otherwise the error "No platforms added to this > project..." is thrown. > Since I always remove the contents of the platforms and plugins directories > before building (I target multiple apps from the same codebase), I need to > prepare the project before I can build, because of this check. This leads to > a bug similar to CB-11519 and CB-11589, where plugins are never correctly > installed. > Unfortunately, I couldn't find the exact reason why platforms/ios/ios.json is > missing the plugins when running a prepare immediately followed by a build. > When the tasks are performed manually one after the other, everything