Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run gulp build when installing sample #2

Open
karaxuna opened this issue Dec 3, 2015 · 10 comments
Open

Run gulp build when installing sample #2

karaxuna opened this issue Dec 3, 2015 · 10 comments

Comments

@karaxuna
Copy link
Member

karaxuna commented Dec 3, 2015

There might be several tasks that must be run for running sample, for example adding another plugin except io.jxcore.node or minifying css and js files... We could create gulpfile.js for each sample that will have task called "build". In samples package.json:

"scripts": {
        "build": "gulp build"
 }

So when running jxc --sample express_perf for example, it will execute npm build (that will start gulp build).

@ktrzeciaknubisa
Copy link
Member

Generally I agree with you. I'm just not sure, if we have to bring the heavy ammo and use devDepencencies. Where to install them? Surely not into www/jxcore. And then we need to remove them before app deployment.

If we talk about installing extra plugins/platforms (the greatest need I think), we could add e.g.

"jxc" : {
   plugins : [ "plugin1", "plugin2" ],
   platforms : [ "android", "ios"]
}

to package.json or separate jxc.json file. Just thinking.

Other tasks, like downloading and installing jxcore-cordova plugin as defined e.g. here jxcore/jxcore-cordova#109 will be redundant, since jxc already is doing that. What do you think?

@karaxuna
Copy link
Member Author

karaxuna commented Dec 3, 2015

devDependencies will be installed outside www. I mean in this folder, so it does not have to be removed before deployment.

Good thing is that you can build sample after installing without using jxc, with npm build (or jx build maybe) and create gulp tasks that are not common for every sample.

Bad thing about this is that you have to install devDependencies and write io.jxcore.node plugin installation task in gulp for each sample (or this task can be moved to separate file).

Creating jxc options will work well for current samples, but what if we will have some more complicated samples?

@ktrzeciaknubisa
Copy link
Member

Good this is that you can build sample after installing without using jxc,

But then: how can the same same gulp file work with jxc and without it? Some of the gulp tasks need to be disabled then when running through jxc. Or we need to have two gulp files. This gets complicated.

@karaxuna
Copy link
Member Author

karaxuna commented Dec 3, 2015

jxc will be used for copying sample folder, then it will run child process - gulp build. After this, user can run gulp build himself if he changes anything in sample code.

@ktrzeciaknubisa
Copy link
Member

I understand, but my point is that gulp invoked by jxc child process should not e.g. install jxcore-cordova, unpack it and add to the project as in the sample: photos_sqlite_sample/gulpfile.js#L6-L29. That's a job for jxc install.

@karaxuna
Copy link
Member Author

karaxuna commented Dec 3, 2015

Then we need 2 gulp files, one for common tasks.

@ktrzeciaknubisa
Copy link
Member

That's what I'm saying :) That's too much if you ask me. I suggest until we don't have a samples really requiring more sophisticated tasks, let's skip the jxc -> gulp concept. I'm tending towards "jxc" in package.json for now.

@karaxuna
Copy link
Member Author

karaxuna commented Dec 4, 2015

OK, so we'll have jxc property in package.json, where we put what plugins and platforms shall be installed. Shall I self assign this task?

@ktrzeciaknubisa
Copy link
Member

Yeap, feel free if you want to. Thanks!

@karaxuna
Copy link
Member Author

karaxuna commented Dec 6, 2015

#3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants