netodevel / cli-spring-boot-scaffold

command line for generate crud and configs for spring boot projects
131 stars 49 forks source link

Store Project Info in base directory and use it for various Operations. #11

Closed RawSanj closed 7 years ago

RawSanj commented 7 years ago

When creating a Project create a file for saving project info which can be used later for other operations.

When I run cli -spring g model User mail:String password:String after creating a Project, the src/main/....Model.class is generated outside the Project directory.

Solution:

  1. Create a project info file say scaffolder.info file during project creation and save project properties in it (like project folder directory)
  2. Read the above file and use properties to execute subsequent operations.
  3. This file can be used for various other purposes later in future such as saving project type (Maven/Graddle), database info and also for updating datasource, entities, service, etc.
netodevel commented 7 years ago

It is great idea, i will implement this. thanks for contribution for project.

(temporary) But to executecli -spring g model User name:String It is necessary before that you acess of directory the project.

cd myproject

@RawSanj

RawSanj commented 7 years ago

Nope. I didn't get any error. I was under C:\TempStuff, opened cmd prompt and ran cli -spring g new my-project command. It created the project under C:\TempStuff\my-project and under C:\TempStuff\my-project there was the src/main/java. After that I ran cli -spring g model User mail:String password:String without cd my-project and I was able to create User model without any errors.

With a scaffolder.info file you can detect project directory and put the files in accurate folder.