Conan: `conan new` for package consumers

Created on 2 Feb 2017  路  7Comments  路  Source: conan-io/conan

Hi,

It would be nice to have a fast/easy way to set up a new project with Conan, similar to npm init.
Setting up everything, like cmake file, conanfile, .gitignore, main.cpp etc. takes some time, and it's hard to do it right at the first time (was it "require" or "requires" etc). Automating these things can be useful, e.g. for creating small demos/experiments or smaller applications.
conan new can also be extended for package creators to generate files for travis and appveyor.
What files are generated should be controlled via flags or an interactive mode with questions.

Most helpful comment

Hi @sixten-hilborn , @lasote,

Any new thought on this request?. I personally think that it is bigger the effort in learning a new tool or command arguments than just learning the simple conanfile.txt syntax. Besides our effort in coding and documenting the tool. My vote is for closing this issue.

All 7 comments

I'm not sure. What will you use txt or py? what will be filled in the conanfile if you don't have previous requirements? Am I using cmake or not?

The current conan new command has sense because the structure for creating a new package is more complex and well known and you can generate also a test_package, all adjusted to the specified reference "Mylib/0.1@lasote/stable` but for a consumer, there are more "uncertainty" things than known things.

About extending conan new with the ci scripts, maybe could be useful, but we are not introducing interactive mode with questions and complex parameters to control it, it adds A LOT of complexity and maintain work.

Yes, I mostly agree with @lasote.

Current conan new -t provides a full working example, with test_package and most common things, while for simple projects creating a conanfile.txt is so simple that doing it via a command is overkill.

I wouldn't oppose to have CI scripts generated, but agree no interactive, but with arguments. Maybe it should belong to conan-package-tools

Thanks for the answers!

What will you use txt or py? what will be filled in the conanfile if you don't have previous requirements? Am I using cmake or not?

This can be controlled by flags like --type txt|py and --cmake
Regarding interactive mode I don't mind skipping it.

Maybe it should belong to conan-package-tools

Having another executable for utilities/helpers? That would work.

This can be controlled by flags like --type txt|py and --cmake

So the command would be?:

$ conan init --type txt --cmake --requires=Boost/1.63@user/channel

I think the command you are looking for is called vim ;)
It seems that you will have to type the same amount of characters, with the full power of an editor :)

Yes, a new executable, or even a plain python script that would do the task inside conan-package-tools would be good enough IMO

Hi @sixten-hilborn , @lasote,

Any new thought on this request?. I personally think that it is bigger the effort in learning a new tool or command arguments than just learning the simple conanfile.txt syntax. Besides our effort in coding and documenting the tool. My vote is for closing this issue.

That's fine with me, I agree this is out of scope for conan. I might create a separate tool for myself instead.

I think it is a good idea, of course we are open to rethink it if necessary, just let us know how your tool evolves. Thanks!

Was this page helpful?
0 / 5 - 0 ratings