microsoft / taco-team-build

taco-team-build is a node module designed to avoid common pitfalls when building Cordova apps in a Team or Continuous Integration (CI) environment
MIT License
26 stars 19 forks source link

Specified project path does not exist #23

Closed techsaqib closed 8 years ago

techsaqib commented 8 years ago

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

Chuxel commented 8 years ago

What version of node.js and Cordova are you running? Try double slashing your path and see if that resolves the issue. We have seen problems with certain versions of Node.js not properly resolving paths. Ex: C:\Users\Mohammad Salim\Desktop

techsaqib commented 8 years ago

hi , but now i am getting error cannot read property done()

and if i remove the done() function from my code its running

installing cordova " then a long path "

then nothing happen i come back to directory , i check the app folder , there is no apk file build

where it is Please help

Chuxel commented 8 years ago

The .done() is a doc bug - I will resolve.

Please include a your log along with the following information: The version of node.js and Cordova you are building.

Certain versions of Cordova have known issues with certain versions of node. There's not enough information here to help you out.

techsaqib commented 8 years ago

node version is 5.7.0 cordova version is 6.0.0

Chuxel commented 8 years ago

Thanks, please include the output log as requested as well.

techsaqib commented 8 years ago

after executiing build.js

i am getting

C:\Users\Mohammad Salim\Desktop\teco try\taco-team-build-master>node build.js Module cache at C:\Users\Mohammad Salim\AppData\Roaming\taco_home\node_modules Installing cordova to C:\Users\Mohammad Salim\AppData\Roaming\taco_home\node_mod ules\cordova\6.0.0. (This may take a few minutes.)

after few minuts i am back to

C:\Users\Mohammad Salim\Desktop\teco try\taco-team-build-master>

and my project files are on desktop thanks

C:\Users\Mohammad Salim\Desktop\taco

Chuxel commented 8 years ago

I assume build.js is your own code. Do you have a pointer to it?

Likely given what you are saying you are either doing ".done()" too early which stops the promise chain or are missing a .done() or .then().

You should use .then() if you intend to do another promise. Ex:

a.then(function() {}).then(function() {}).then(function() {}).done();

techsaqib commented 8 years ago

MY PROBLEM IS NOT DONE()

THE PROBLEM IS

after few minuts i am back to

C:\Users\Mohammad Salim\Desktop\teco try\taco-team-build-master>

AND WHEN I GO TO MY PROJECT WHICH IS HERE C:\Users\Mohammad Salim\Desktop\taco I AM NOT ABLE TO GET ANY COMPILE FILE see the file code which i am executing

see the image and file

error

build.txt

Chuxel commented 8 years ago

First, keep in mind that we cannot see your environment, so we're effectively having to guess without a complete repro. Now that you've provided one, we can take a look.

That said, build.buildProject(platforms, args) is in fact missing .done() in build.txt.

Try: build.buildProject(platforms, args).done()

Next, I'm not sure where you are expecting to see the build output. If the build actually executing, and succeeding, then the output will be in platforms/android/build/outputs/apk

I attempted to reproduce your issue but was unable to do so. I did the following:

  1. Created a folder with new cordova project in it
  2. Created a different folder with your build.js in it
  3. Executed "npm install taco-team-build" in the folder with build.js in it
  4. Updated the script as follows:
var build = require('taco-team-build');
build.configure({
    projectPath: "C:\\Projects\\cordova\\yelling test\\project is here\\stubproject"
})

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

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

node build.js executed successfully.

The only thing I can think of that might be different is I am using the npm version of taco-team-build and not referencing taco-team-build.js

techsaqib commented 8 years ago

thanks thats code work now , one last thing i want to know

can i get the path of compiled apk to print , in the done function

like

.done(function(){ console.log(compile file path ); }

thanks for your Help :)

Chuxel commented 8 years ago

The location varies by Cordova version unfortunately and is not returned by the library. The sample gulp file contains the locations the files tend to be in: https://github.com/Microsoft/taco-team-build/blob/master/samples/gulp/gulpfile.js

    paths = {
       apk:["./platforms/android/ant-build/*.apk", 
            "./platforms/android/bin/*.apk", 
            "./platforms/android/build/outputs/apk/*.apk"],
       ipa: ["./platforms/ios/build/device/*.ipa",
             "./platforms/ios/build/device/*.app.dSYM"],
       appx: "./platforms/windows/AppPackages/**/*"
    };  

You can use the glob npm package with these paths to get the filenames.