Coder Social home page Coder Social logo

microsoft / taco-team-build Goto Github PK

View Code? Open in Web Editor NEW
26.0 64.0 19.0 116 KB

taco-team-build is a node module designed to avoid common pitfalls when building Cordova apps in a Team or Continuous Integration (CI) environment

License: MIT License

JavaScript 99.94% Batchfile 0.06%

taco-team-build's Introduction

As of March 2019, this repo is no longer maintained by Microsoft. If you're interested in continuing this project, please feel free to fork it. As of March 2019, we will no longer monitor or respond to open issues. Thanks for your support!


Cordova Continuous Integration (CI) / Team Build Helper Node Module (taco-team-build)

License: MIT

taco-team-build is a node module designed to avoid common pitfalls when building any Cordova-CLI compliant (ex: Cordova Ionic, PhoneGap local) Cordova apps in a Continuous Integration (CI) environment. It was originally created for a set of tutorials for the Tools for Apache Cordova (TACo) feature set in Visual Studio but does not require its use.

Specifically it helps with the following challenges:

  1. Handling multiple versions of Cordova from the same build server in a performant way on Windows, Linux, or a Mac.
  2. Allowing developers to specify a location to store versions of Cordova, its plugins, and platforms outside of a user's home directory (useful in CI environments where a system user may run the build)
  3. Automated detection of whether a platform should be added avoid a non-zero exit code for incremental builds (the default CLI behavior)
  4. Fixes for problems where execute bits are lost in the hooks or platforms folder when added to control from Windows.
  5. Generating an ipa for iOS when using versions of Cordova that do not automatically generate one.
  6. Via cordova-plugin-vs-taco-support:
    1. Removing plugins/android.json, plugins/ios.json, plugins/windows.json, or plugins/wp8.json files which can cause strange results if present when adding a platform. (Though files are not removed if the Cordova platforms folder was added to source control.)
    2. Fixes for problems with symlinks are lost when a plugin is added to source control from Windows.
    3. Adds in support for the res/native folder that will overlay the contents of the platforms folder so you can add files to the native project without checking native code into source control (via a plugin) - Ex: res/native/Android/AndroidManifest.xml will overwrite the default one before Cordova's "prepare" step.
    4. Some Windows packaging features and bug fixes (via a plugin) designed for use with versions of Cordova that pre-date the Windows platform's support of build.json

It is a generic node module so it can be used with any number of build systems including Gulp, Grunt, and Jake.

General Settings

  1. Set a CORDOVA_CACHE environment variable to tell it where you want the various versions of Cordova to land. You can also specify this using the module’s “configure” method. The TACO_HOME environment variable is also respected as a fallback. 2. The Cordova Version is automatically picked up from taco.json if present but can also be specified using the module's configure method
  2. You can also set a CORDOVA_DEFAULT_VERSION environment variable if no version is specified at in either taco.json or the configure method. The final fallback is the latest version of Cordova.

Sample Usage

Gulp Build Sample

  1. Install Gulp globally if you haven’t (npm install -g gulp).
  2. Copy the contents of the “samples/gulp” folder to the root of your project.
  3. Go to the command line in that folder and type “npm install”
  4. Type "gulp"

Grunt Build Sample

  1. Install Grunt globally if you haven’t (npm install -g grunt).
  2. Copy the contents of the “samples/grunt” folder to the root of your project.
  3. Go to the command line in that folder and type “npm install”
  4. Type "grunt"

Command Line Utility Sample

  1. npm install the taco-team-build package globally (Ex: npm install -g c:\path\to\taco-team-build)
  2. Type "taco-team-build [platform] [options]" (Ex: taco-team-build android --release --ant)
  3. Source can be found under "samples/cli"

Module Methods

configure(config)

Allows you to programmatically configure the Cordova version to use, the location that Cordova libraries should be cached, and the project path.

var build = require('taco-team-build');
build.configure({
    nodePackageName: "cordova-cli",
    moduleCache: "D:\\path\\to\\cache",
    moduleVersion: "6.0.0",
    projectPath: "myproject"
});
  • moduleCache defaults to either the CORDOVA_CACHE environment variable or %APPDATA%\taco_home on Windows and ~/.taco_home on OSX if no value is set for the variable. This will also automatically set CORDOVA_HOME and PLUGMAN_HOME to sub-folders in this same location to avoid conflicting with any global instllations you may have.

  • projectPath defaults to the current working directory.

  • If the moduleVersion is not set, the version will be pulled from taco.json if present and otherwise default to latest. You can manually create a taco.json file if you are not using Visual Studio by including the following in the file:

    {
        "cordova-cli": "6.0.0"
    }
    

setupCordova(config)

Downloads and installs the correct version of Cordova in the appropriate cache location. See the configure method for defaults. setupCordova() should always be called before executing a platform specific command.

You can also pass in the same config object as the configure method to set configuration options before initialization.

The method returns a promise that is fulfilled with the appropriate cordova-lib node module once setup is completed. Once setup has completed, you can use value from the promise to access a number of Cordova CLI functions in JavaScript. Ex:

var build = require("taco-team-build");
build.setupCordova().done(function(cordova) {
	cordova.plugin("add","org.apache.cordova.camera", function () {
		// Continue processing after camera plugin has been added
    });
});
var build = require("taco-team-build");
build.setupCordova().done(function(cordova) {
	cordova.run({platforms:["android"], options:["--nobuild"]}, function() {
		// Continue processing after run is complete
    });
});

If you would prefer to use a promise instead of a callback syntax, you can use "cordova.raw" to access that version of the function.

buildProject(platforms, args)

Builds the specified platform(s). Passed in platforms can be an array of platforms or a single platform string. Unlike cordova.raw.build, passed in args can be an array of arguments or an object with an array of arguments per platform name. The method returns a promise that is fulfilled once the specified platform(s) are built.

The method automatically calls setupCordova() if it has not yet been called.

var build = require('taco-team-build'),
    platforms = ["android", "windows"],
    args = { android: ["--release", "--device", "--gradleArg=--no-daemon"], windows: ["--release"] };
            
build.buildProject(platforms, args).done();

WARNING: Unlike the Cordova CLI, you should not use the "double-double dash" when referencing platform specific arguments. Ex: Use "--gradleArg" not "-- --gradleArg" for Android.

Not only will your flag not be picked up but older versions of the Cordova Android platform will error out if you specify unrecognized flags with a "TypeError: Cannot call method 'prepEnv' of undefined" error. (This particular error is fixed Cordova 4.3.0 but your flags will still be ignored.)

Note that for iOS you can also add a custom build-debug.xcconfig or build-release.xcconfig file in the res/native/ios/cordova folder in your project to set these and other iOS build settings. Be sure to grab the version of these files from the branch appropriate for the version of Cordova you are targeting - the "master" branch may not be compatible with your version.

For iOS you may need to unlock the keychain to build your app depending on your build server. You can use some variant of the following shell command to do so:

security unlock-keychain -p ${KEYCHAIN_PWD} ${HOME}/Library/Keychains/login.keychain 

See packageProject for older versions of Cordova that do not automatically generate an ipa.

packageProject(platforms, args)

[DEPRECATED] - This method does nothing if the version of Cordova being used already generates an ipa.

Supported platforms: ios

Runs any post-build packaging steps required for the specified platforms. The method returns a promise that is fulfilled once packaging is completed. Passed in platforms can be an array of platforms or a single platform string. Passed in args can be an array of arguments or an object with an array of arguments per platform name.

Note: The android, windows, and wp8 platforms automatically package on build and you can place the appropriate files for signing under res/native/android or res/native/windows. See this tutorial for details.

var build = require('taco-team-build');

build.buildProject("ios",["--device"])); })
    .then(function() { return build.packageProject("ios"); })
    .done();

iOS Arguments:

  • --sign: Specifies an alternate signing identity or a path to a signing file
  • --embed: Specifies the location of an alternate provisioning profile
build.packageProject("ios", ["--sign=/path/to/signing.p12" ", "--embed=/path/to/some.mobileprovision"]); 

getInstalledPlatformVersion(projectPath, platform)

Returns the version of the platform that is installed to the project.

var build = require('taco-team-build'),
    platform = "android";

build.getInstalledPlatformVersion("./",platform))
    .then(function(version) { return version; })
    .done();

getVersionForNpmPackage(pkgName)

Returns the latest version of pkgName available on NPM.

var build = require('taco-team-build');

build.getVersionForNpmPackage("taco-team-build"))
    .then(function(version) { return version; })
    .done();

getNpmVersionFromConfig(config)

Returns the version of NPM specified in the config.

cacheModule(config)

Caches the NPM module specified by the config. Config specifies both the name of the package and the expected version. Empty version assumes latest.

var build = require('taco-team-build'),
    config = {
        nodePackageName: "cordova",
        moduleCache: "D:\\path\\to\\cache",
        moduleVersion: "6.0.0",
        projectPath: "myproject"
    };

build.cacheModule(config)
    .then(function(version) { return version; })
    .done();
  • projectPath is assumed to be the current working directory if not specified.
  • moduleVersion is assumed to be latest if not specified.
  • moduleCache defaults to either the CORDOVA_CACHE environment variable or %APPDATA%\taco_home on Windows and ~/.taco_home on OSX if no value is set for the variable. This will also automatically set CORDOVA_HOME and PLUGMAN_HOME to sub-folders in this same location to avoid conflicting with any global instllations you may have.

Terms of Use

By downloading and running this project, you agree to the license terms of the third party application software, Microsoft products, and components to be installed.

The third party software and products are provided to you by third parties. You are responsible for reading and accepting the relevant license terms for all software that will be installed. Microsoft grants you no rights to third party software.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

License

Unless otherwise mentioned, the code samples are released under the MIT license.

The MIT License (MIT)

Copyright (c) Microsoft Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

taco-team-build's People

Contributors

akshayakrsh avatar chuxel avatar cloudcolonel avatar dlevine82 avatar drewgillies avatar jicongw avatar msftgits avatar ryuyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

taco-team-build's Issues

Cordova-Android build fails on Azure pipeline whereas the same project work perfectly fine on local build

Hello,
Cordova build android pipeline on Azure DevOps is throwing error with old cordova version or latest version. But grunt build android is running perfectly fine on my local project. So I believe this is some problem with new version of some tasks. Could you look and fix it ?

Thanks,

What is expected to happen?

Build is supposed to finish successfully by running all scripts the same project work perfectly fine on my local build
image

What does actually happen?

##[section]Starting: Cordova Build android
2020-06-30T14:28:09.1569434Z ##[section]Starting: Cordova Build android
2020-06-30T14:28:09.1986970Z ==============================================================================
2020-06-30T14:28:09.1987541Z Task : Cordova Build
2020-06-30T14:28:09.1988130Z Description : Build a hybrid app project based on the Cordova CLI, Ionic CLI, TACO CLI, or other Cordova-compliant CLI
2020-06-30T14:28:09.1988748Z Version : 1.3.12
2020-06-30T14:28:09.1989150Z Author : Microsoft Corporation
2020-06-30T14:28:09.1989715Z Help : More Information
2020-06-30T14:28:09.1990328Z ==============================================================================
2020-06-30T14:28:10.0943023Z Module cache at C:\Users\VssAdministrator\AppData\Roaming\taco_home\node_modules
2020-06-30T14:28:12.1530642Z Installing cordova to C:\Users\VssAdministrator\AppData\Roaming\taco_home\node_modules\cordova\9.0.0. (This may take a few minutes.)
2020-06-30T14:28:49.8644198Z Exec complete.
2020-06-30T14:28:49.8645079Z npm WARN using --force I sure hope you know what you are doing.
2020-06-30T14:28:49.8645622Z npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
2020-06-30T14:28:49.8646383Z npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
2020-06-30T14:28:49.8647161Z npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
2020-06-30T14:28:49.8648054Z npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\VssAdministrator\AppData\Roaming\taco_home\node_modules\cordova\9.0.0\package.json'
2020-06-30T14:28:49.8648865Z npm notice created a lockfile as package-lock.json. You should commit this file.
2020-06-30T14:28:49.8649608Z npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\VssAdministrator\AppData\Roaming\taco_home\node_modules\cordova\9.0.0\package.json'
2020-06-30T14:28:49.8651538Z npm WARN 9.0.0 No description
2020-06-30T14:28:49.8652075Z npm WARN 9.0.0 No repository field.
2020-06-30T14:28:49.8657924Z npm WARN 9.0.0 No README data
2020-06-30T14:28:49.8658284Z npm WARN 9.0.0 No license field.
2020-06-30T14:28:49.8658510Z
2020-06-30T14:28:49.8658725Z + [email protected]
2020-06-30T14:28:49.8660020Z added 432 packages from 355 contributors and audited 432 packages in 36.268s
2020-06-30T14:28:49.8660637Z
2020-06-30T14:28:49.8660889Z 3 packages are looking for funding
2020-06-30T14:28:49.8661221Z run npm fund for details
2020-06-30T14:28:49.8661418Z
2020-06-30T14:28:49.8661638Z found 0 vulnerabilities
2020-06-30T14:28:49.8661824Z
2020-06-30T14:28:49.8661983Z
2020-06-30T14:28:53.1350051Z Adding ant.properties update hook
2020-06-30T14:28:56.5720896Z Module cache at C:\Users\VssAdministrator\AppData\Roaming\taco_home\node_modules
2020-06-30T14:28:58.3840929Z cordova already installed.
2020-06-30T14:28:58.3848166Z Adding support plugin.
2020-06-30T14:29:00.2569681Z Removing ant.properties update hook
2020-06-30T14:29:00.2607733Z TypeError: Cannot read property 'plugin' of undefined
2020-06-30T14:29:00.2608687Z at D:\a_tasks\CordovaBuild_70e94267-15dc-434d-8973-023d766825d7\1.3.12\node_modules\taco-team-build\taco-team-build.js:66:37
2020-06-30T14:29:00.2609634Z at _fulfilled (D:\a_tasks\CordovaBuild_70e94267-15dc-434d-8973-023d766825d7\1.3.12\node_modules\q\q.js:854:54)
2020-06-30T14:29:00.2610635Z at D:\a_tasks\CordovaBuild_70e94267-15dc-434d-8973-023d766825d7\1.3.12\node_modules\q\q.js:883:30
2020-06-30T14:29:00.2612386Z at Promise.promise.promiseDispatch (D:\a_tasks\CordovaBuild_70e94267-15dc-434d-8973-023d766825d7\1.3.12\node_modules\q\q.js:816:13)
2020-06-30T14:29:00.2613817Z at D:\a_tasks\CordovaBuild_70e94267-15dc-434d-8973-023d766825d7\1.3.12\node_modules\q\q.js:624:44
2020-06-30T14:29:00.2616905Z at runSingle (D:\a_tasks\CordovaBuild_70e94267-15dc-434d-8973-023d766825d7\1.3.12\node_modules\q\q.js:137:13)
2020-06-30T14:29:00.2617974Z at flush (D:\a_tasks\CordovaBuild_70e94267-15dc-434d-8973-023d766825d7\1.3.12\node_modules\q\q.js:125:13)
2020-06-30T14:29:00.2620041Z at processTicksAndRejections (internal/process/task_queues.js:79:11)
2020-06-30T14:29:00.2975480Z ##[error]Task failed
2020-06-30T14:29:00.2993888Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.2994474Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.2994994Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.2995478Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.2996195Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.2996851Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.2997189Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.2997520Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.2997873Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.2998215Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.2998542Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.2998888Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.2999218Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.2999565Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.2999892Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.3000218Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.3000562Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.3000891Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.3001716Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.3002074Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.3002399Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.3002727Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.3004212Z (node:5656) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-30T14:29:00.3107477Z ##[section]Finishing: Cordova Build android

Information

You can see the list of plugins with versions
image

image

Command or Code

Cordova build Android

Environment, Platform, Device

This issue is happening on Azure pipelines and even if I use cordova android version 8.1.0 the issue is same build fails on cordova build android script or cordova prepare android script. The same pipeline used to work with cordova 6 version previously but from june first week it started failing, so tried updating all plugin versions and cordova version to latest and local build work perfectly fine I am able to get debug apk. But to deploy changes release apk is failing at those shown scripts

Version information

Checklist

  • - I searched for existing GitHub issues

  • I updated all Cordova tooling to most recent version

  • I included all the necessary information above

Specifying moduleCache in the configure method fails.

Repro:

var build = require('taco-team-build');
build.configure({
    moduleCache: "C:\\put the cache here\\"
})

build.buildProject("android", ["--release", "--device", "--gradleArg=--no-daemon"]).done();

Result is as follows:

C:\Projects\cordova\testProj\node_modules\taco-team-build\lib\ttb-util.js:62
pathList.forEach(function (relPath) {
^

TypeError: pathList.forEach is not a function
at joinAndCreatePath (C:\Projects\cordova\yelling test\build file is here\node_modules\taco-team-build\lib
ttb-util.js:62:14)
at Object.parseConfig (C:\Projects\cordova\yelling test\build file is here\node_modules\taco-team-build\lib
\ttb-util.js:169:22)
at Object.configure (C:\Projects\cordova\yelling test\build file is here\node_modules\taco-team-build\taco-
team-build.js:29:31)
at Object. (C:\Projects\cordova\yelling test\build file is here\build.js:2:7)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:141:18)

Cordova 5.4.0 changed the way args are passed in, requires tweak to getCallArgs in ttb-util.js

So, for some reason the way arguments get passed into commands line build changed in 5.4.0 so this breaks our extension – likely the same problem I’ve heard we have for VS TACO and TACO CLI.

Before:

cordova.build({
platforms: ["android"],
options: ["--ant", "--gradleArg=--no-daemon"]
}, callback);

After:
cordova.build({
platforms: ["android"],
options: {
argv: ["--ant", "--gradleArg=--no-daemon"]
}
}, callback);

Here’s what you see with 5.4.0 right now:

Running: C:\a\1\s\tfs-vnext-test\platforms\android\gradlew cdvBuildDebug -b C:\a\1\s\tfs-vnext-test\platforms\android\build.gradle -Dorg.gradle.daemon=true

And the same thing with 5.3.3:

Running: C:\a\1\s\tfs-vnext-test\platforms\android\gradlew cdvBuildRelease -b C:\a\1\s\tfs-vnext-test\platforms\android\build.gradle -Dorg.gradle.daemon=true --no-daemon

Builds work, but are not doing the right thing since the args don’t make it through. Builds are also always “debug” right now with 5.4.0.

TACO Installs and uses Cordova 6.0.0 when 5.4.1 is required

When building a Cordova app using Gulp, the TACO tools now install and use Cordova 6.0.0 rather than the required 5.4.1. This started to occur as soon as Cordova 6.0.0 was released in late January.

My taco.json file specifies 5.4.1 as the version of Cordova to use.

{
  "cordova-cli": "5.4.1"
}

When building in Visual Studio 2015, Cordova 5.4.1 is correctly installed and used.

The problem only occurs when building on the command line or from our Jenkins server, both of which use gulp to build. All of our automated builds started to fail after Cordova 6.0.0 was released.

My package.json references the latest version of gulp and taco-team-build.

{
  "devDependencies": {
    "gulp": "latest",
    "gulp-typescript": "latest",
    "gulp-sourcemaps": "latest",
    "gulp-less": "latest",
    "gulp-cssmin": "latest",
    "gulp-rename": "latest",
    "gulp-file": "latest",
    "semver": "latest",
    "del": "latest",
    "gulp-bump": "latest",
    "gulp-cheerio": "latest",
    "run-sequence": "latest",
    "yargs": "latest",
    "taco-team-build": "latest",
    "browser-sync": "~2.11.1"
  }
}

How can I force the build to use 5.4.1? Is this a problem with taco-team-build?

PS. this is a copy of the same question on Stack Overflow. Getting no response and need to build soon!

Version incorrect if cordova config specifying a git repo to use for cordova engine

Our config.xml uses the below engine as a way to get round an exising bug in the latest stable npm release of cordova-ios

However our cordova build task fails on a version check because platforms.json returns "https://github.com/apache/cordova-ios.git"

<engine name="ios" spec="https://github.com/apache/cordova-ios.git" />

Our work around is to set the engine to use the nightly build on npm but thought you should know of the edge case where getInstalledPlatformVersion wont work

init() fails to find cordova cache

When using the Visual Studio Task Runner and "latest" version of taco-team-build. The Task Runner fails to read my gulpfile.js and gives the following output:

Failed to run "D:\Projects\Hyper\MM_trunk_gulpbuild\MarkbookMobile\Gulpfile.js"...
cmd.exe /c gulp --tasks-simple
Error: EPERM, operation not permitted 'C:\'
    at Object.fs.mkdirSync (fs.js:653:18)
    at D:\Projects\Hyper\MM_trunk_gulpbuild\MarkbookMobile\node_modules\taco-team-build\lib\ttb-util.js:69:42
    at Array.forEach (native)
    at joinAndCreatePath (D:\Projects\Hyper\MM_trunk_gulpbuild\MarkbookMobile\node_modules\taco-team-build\lib\ttb-util.js:62:14)
    at ensurePathExists (D:\Projects\Hyper\MM_trunk_gulpbuild\MarkbookMobile\node_modules\taco-team-build\lib\ttb-util.js:57:12)
    at init (D:\Projects\Hyper\MM_trunk_gulpbuild\MarkbookMobile\node_modules\taco-team-build\lib\ttb-util.js:41:5)
    at Object.<anonymous> (D:\Projects\Hyper\MM_trunk_gulpbuild\MarkbookMobile\node_modules\taco-team-build\lib\ttb-util.js:43:3)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

When run from a command prompt I get:

fs.js:799
  return binding.mkdir(pathModule._makeLong(path),
                 ^

Error: EPERM: operation not permitted, mkdir 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Users'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:799:18)
    at D:\Projects\Hyper\MM_trunk_gulpbuild\MarkbookMobile\node_modules\taco-team-build\lib\ttb-util.js:69:42
    at Array.forEach (native)
    at joinAndCreatePath (D:\Projects\Hyper\MM_trunk_gulpbuild\MarkbookMobile\node_modules\taco-team-build\lib\ttb-util.js:62:14)
    at ensurePathExists (D:\Projects\Hyper\MM_trunk_gulpbuild\MarkbookMobile\node_modules\taco-team-build\lib\ttb-util.js:57:12)
    at init (D:\Projects\Hyper\MM_trunk_gulpbuild\MarkbookMobile\node_modules\taco-team-build\lib\ttb-util.js:41:5)
    at Object.<anonymous> (D:\Projects\Hyper\MM_trunk_gulpbuild\MarkbookMobile\node_modules\taco-team-build\lib\ttb-util.js:43:3)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)

I have attempted this with CORDOVA_CACHE both set and unset with the same results.

Using Visual Studio 2015.
Tools for Apache Cordova (latest)
Taco Team Build 0.2.0

Default cache location is incorrect, does not get created automatically

Repro:

  1. Run in an environment without CORDOVA_CACHE or TACO_HOME set
  2. Delete your ~/.taco_home folder if it exists
  3. Run a build

Expected: ~/.taco_home/node_modules/cordova is created along with /.taco_home/node_modules/cordova/<version>/node_modules
Actual: Folder is not created and cache appears to be at "
/.taco_home/node_modules" without the "cordova" folder name and folder is not created

It looks like we need to update moduleCache = cc in ttb-util.js to the following:

moduleCache = joinAndCreatePath(cc.split(path.sep));
process.env['CORDOVA_HOME'] = path.join(moduleCache, '_cordova'); // Set platforms to cache in cache location to avoid unexpected results
process.env['PLUGMAN_HOME'] = path.join(moduleCache, '_plugman'); // Set plugin cache in cache location to 

There is then a bug somewhere that is causing "cordova" to be omitted from the module path.

cordovaBuild.configure causing TypeError: pathList.forEach is not a function

running this task in a gulpfile gives me an error - I have the latest code from the repo.... thanks....

gulp.task("configure-cordova", function () {
cordovaBuild.configure({
nodePackageName: "cordova-cli",
moduleCache: "C:\BuildTest\cordova-install",
moduleVersion: "6.0.0"
// ,
// projectPath: "myproject"
});
});

as follows:

[16:46:37] Starting 'configure-cordova'...
[16:46:37] 'configure-cordova' errored after 673 µs
[16:46:37] TypeError: pathList.forEach is not a function
at joinAndCreatePath (C:\BuildTest\buildmob\node_modules\taco-team-build\lib\ttb-util.js:62:14)
at Object.parseConfig (C:\BuildTest\buildmob\node_modules\taco-team-build\lib\ttb-util.js:169:22)
at Object.configure (C:\BuildTest\buildmob\node_modules\taco-team-build\taco-team-build.js:29:31)
at Gulp. (C:\BuildTest\buildmob\gulpfile.js:71:17)
at module.exports (C:\BuildTest\buildmob\node_modules\orchestrator\lib\runTask.js:34:7)
at Gulp.Orchestrator._runTask (C:\BuildTest\buildmob\node_modules\orchestrator\index.js:273:3)
at Gulp.Orchestrator._runStep (C:\BuildTest\buildmob\node_modules\orchestrator\index.js:214:10)
at Gulp.Orchestrator.start (C:\BuildTest\buildmob\node_modules\orchestrator\index.js:134:8)
at C:\Users\msdnh_000\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:20
at nextTickCallbackWith0Args (node.js:420:9)

simple question about configuration of build function

    platforms = ["android", "ios"],
    args = { android: ["--release", "--device", "--gradleArg=--no-daemon"]};

what will be the args for ios , and android ?

what are the roles of this options --release", "--device", "--gradleArg=--no-daemon ?

please reply as soon as possible

with correct syntex of code thanks

CordovaError: Current working directory is not a Cordova-based project

I have these two gulp tasks:

gulp.task("configure-cordova-version", function () {
cordovaBuild.configure({
nodePackageName: "cordova",
moduleCache: "C:\BuildTest\cordova-install",
moduleVersion: "6.1.0"
// ,
// projectPath: "myproject"
});
});
gulp.task("configure-cordova", function () {
return
cordovaBuild.setupCordova().done(function(cordova) {
cordova.run({platforms:["android"], options:["--nobuild"]}, function() {
// Continue processing after run is complete
});
cordova.run({platforms:["ios"], options:["--nobuild"]}, function() {
// Continue processing after run is complete
});
cordova.plugin("add","cordova-plugin-splashscreen", function () {
// Continue processing
});
cordova.plugin("add","cordova-plugin-geolocation", function () {
// Continue processing
});
});
});

but I am getting this error (below) - and I get a cordova/6.1.0/node-modules directory with modules. I am not sure where to go from here. Tried various

npm WARN enoent ENOENT: no such file or directory, open 'C:\BuildTest\cordova-install\cordova\6.1.0\package.json'
npm WARN 6.1.0 No description
npm WARN 6.1.0 No repository field.
npm WARN 6.1.0 No README data
npm WARN 6.1.0 No license field.

Adding support plugin.
[18:12:18] 'build' errored after 1.87 min
[18:12:18] CordovaError: Current working directory is not a Cordova-based project.
at Object.cdProjectRoot (C:\BuildTest\cordova-install\cordova\6.1.0\node_modules\cordova-lib\src\cordova\util.js:129:15)
at C:\BuildTest\cordova-install\cordova\6.1.0\node_modules\cordova-lib\src\cordova\plugin.js:47:40
at _fulfilled (C:\BuildTest\cordova-install\cordova\6.1.0\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\BuildTest\cordova-install\cordova\6.1.0\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\BuildTest\cordova-install\cordova\6.1.0\node_modules\q\q.js:749:13)
at C:\BuildTest\cordova-install\cordova\6.1.0\node_modules\q\q.js:810:14
at flush (C:\BuildTest\cordova-install\cordova\6.1.0\node_modules\q\q.js:108:17)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)

Unable to build application using VSO

I have tried to build my application using Visual Studio Online by following this document:

Unfortunately, build failed:

Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\Gulp\0.5.3\Gulptask.ps1
C:\NPM\Modules\gulp.cmd --gulpfile "C:\a\1\s\Locomotive\DataCollectorApp\gulpfile.js" 
 Using gulpfile C:\a\1\s\Locomotive\DataCollectorApp\gulpfile.js
 Starting 'scripts'...
 Finished 'scripts' after 12 ms
 Starting 'build'...
Cordova version set to 5.3.1 based on the contents of taco.json
Cordova cache found at C:\cordova\cli
Installing Cordova 5.3.1.

npm WARN engine [email protected]: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.7","npm":"2.11.3"})
Exec complete.
[email protected] node_modules\cordova
Γö£ΓöÇΓöÇ [email protected]
Γö£ΓöÇΓöÇ [email protected]
Γö£ΓöÇΓöÇ [email protected] ([email protected])
ΓööΓöÇΓöÇ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
Adding support plugin.
 'build' errored after 55 s
 CordovaError: The provided path "C:\a\1\s\Locomotive\DataCollectorApp\platforms\android" is not an Android project.
    at new android_parser (C:\cordova\cli\5.3.1\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:35:15)
    at new PlatformProjectAdapter (C:\cordova\cli\5.3.1\node_modules\cordova\node_modules\cordova-lib\src\platforms\platforms.js:61:19)
    at Object.getPlatformProject (C:\cordova\cli\5.3.1\node_modules\cordova\node_modules\cordova-lib\src\platforms\platforms.js:97:23)
    at handleInstall (C:\cordova\cli\5.3.1\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:563:36)
    at C:\cordova\cli\5.3.1\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:363:28
    at _fulfilled (C:\cordova\cli\5.3.1\node_modules\cordova\node_modules\q\q.js:787:54)
    at self.promiseDispatch.done (C:\cordova\cli\5.3.1\node_modules\cordova\node_modules\q\q.js:816:30)
    at Promise.promise.promiseDispatch (C:\cordova\cli\5.3.1\node_modules\cordova\node_modules\q\q.js:749:13)
    at C:\cordova\cli\5.3.1\node_modules\cordova\node_modules\q\q.js:509:49
    at flush (C:\cordova\cli\5.3.1\node_modules\cordova\node_modules\q\q.js:108:17)

Unexpected exit code 1 returned from tool gulp.cmd

Build fails if you try to generate a signed APK without specifying the passwords in build.json, but entering it during the prompt

I encountered problems when trying to create a signed APK using the gulp build process.

The issue seems to be that with the following build.json config:

{
     "android": {
         "release": {
             "keystore": "geoffrey-keys.keystore",
             "storePassword": "",
             "alias": "geoffrey",
             "password" : "",
             "keystoreType": ""
         }
     }
 }

that is, if I do not provide the keystore passwords in build.json but only enter it in manually when the gulp dialog prompts you to do so ("Enter keystore password: )", it tells me that my password is wrong even though I have typed it correctly.

The build does work and successfully generate a signed APK only if the passwords are provided in build.json. There is also another strange issue in that the storePassword and the password must be the same, but I think it the same issue can be seen with using the Cordova CLI directly as well.

not able to generate Ios files

i getting this message Skipping packaging. Detected cordova-ios verison that auto-creates ipa

i passing the path of p12 file and mobileprovision file too.. , still getting this

build.buildProject(platforms,build_args).then(function(){ var signpath = path.join(__dirname, '/../../public/uploads/mst_938ad485-947d-8ed0-0ce2- 8c0d_mohdsalimfahim786.p12'); var mobileprovision = path.join(__dirname, '/../../public/uploads/mst_bc5be5bb-32a9-0662-4ecf- f82f_masterappprofile.mobileprovision'); build.packageProject("ios", ["--sign="+signpath+ "" , "--embed="+mobileprovision+""]); }).done(function(){
Signing Identity: "-"

/usr/bin/codesign --force --sign - --timestamp=none /Users/myfolder/myapp/app/build/app/users/myfold/build/platforms/ios/build/emulator/mm\ App.app

** BUILD SUCCEEDED **

Module cache at /Users/ttsaqib/.taco_home/node_modules
app has been created
cordova already installed.
Skipping packaging. Detected cordova-ios verison that auto-creates ipa.

Use Yarn if Available

A lot of people are starting to use Yarn instead of NPM. My team started using it after finding that it cut CI build times in half. It would be awesome if taco-team-build would use Yarn to install packages and plugins instead of NPM when Yarn is available.

Execute bit

I believe the execute bit fixes will have to be extended to include execute bit set for linux.

Specified project path does not exist

Hi guys please help i build my own build.js using the following code

var build = require('./taco-team-build.js');
build.configure({
projectPath: "C:\Users\Mohammad Salim\Desktop"
}).done();

platforms = ["android", "windows"],
args = { android: ["--release", "--device", "--gradleArg=--no-daemon"], windows: ["--release"] };

build.buildProject(platforms, args).done();

but i am getting error , "Specified project path does not exist"

i hope i can compile project which are on another directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.