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

feat: Support to create new project #1146

Merged
merged 1 commit into from
Jan 17, 2022
Merged

feat: Support to create new project #1146

merged 1 commit into from
Jan 17, 2022

Conversation

CsCherrYY
Copy link
Collaborator

@CsCherrYY CsCherrYY commented Jan 5, 2022

fix #1027

The create new project command has two modes:
create

Simple mode has two steps:

  • specify DSL
  • specify project name

Advanced mode has five steps:

  • specify Project type
  • specify DSL
  • specify test framework
  • specify project name
  • specify package name

create

@CsCherrYY CsCherrYY added the enhancement New feature or request label Jan 5, 2022
@CsCherrYY CsCherrYY added this to the January 2022 milestone Jan 5, 2022
@CsCherrYY CsCherrYY marked this pull request as ready for review January 10, 2022 07:37
{
"command": "gradle.createProjectAdvanced",
"category": "Gradle",
"title": "Create a Gradle Java Project... (Advanced)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In long term, you can consider use a custom button to "switch to advanced mode" in the wizard. Then you only need one command as the only entry.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. #1153 will track it.

@CsCherrYY
Copy link
Collaborator Author

steps to verify:

simple mode

  1. open command palette, execute Gradle: Create a Gradle Java Project..
  2. select an empty folder as the target folder of the new project
  3. There will be 2 steps in total, you can just specify:
    • dsl type: Kotlin
    • project name: whatever you like
  4. VSCode will automatically open the newly created project, check:
    • The dsl type is kts
    • the project name in settings.gradle.kts is as expected

advanced mode

  1. open command palette, execute Gradle: Create a Gradle Java Project... (Advanced)
  2. select an empty folder as the target folder of the new project
  3. There will be 4 steps in total, you can just specify:
    • project type: Gradle plugin
    • dsl type: Groovy
    • project name & package name: whatever you like
  4. VSCode will automatically open the newly created project, check:
    • The dsl type is groovy
    • The plugin java-gradle-plugin is applied in ./plugin/build.gradle
    • the project name in settings.gradle is as expected
    • the package name in ./plugin/src/main/java is as expected

@Eskibear
Copy link
Member

Verified.

Some suggestions on UX:

  • During creating projects, the progress on status bar is not visible. Maybe consider to use notification. And message of the first notification is "Gradle", missing details.
  • After project is created, it might be better to notify user about it, and ask for further actions instead of directly opening it.
  • Project is directly extracted to target folder, instead of creating a parent folder containing it. It might mess up the filesystem, e.g. if I select c:/users/username/Desktop. But it depends on user's taste.

@CsCherrYY
Copy link
Collaborator Author

During creating projects, the progress on status bar is not visible. Maybe consider to use notification. And message of the first notification is "Gradle", missing details.

for the notification part, IMO it makes sense to show the progress as the notification. for the message part, the message is just reported by Gradle itself, what we can do it to specify the title, something like creating new Gradle project: and some initializing messages, I'll try it.

After project is created, it might be better to notify user about it, and ask for further actions instead of directly opening it.

#1166 will track it.

Project is directly extracted to target folder, instead of creating a parent folder containing it. It might mess up the filesystem, e.g. if I select c:/users/username/Desktop. But it depends on user's taste.

I think the behavior is the same as what Gradle CLI does, it just generate all files in the folder where gradle init is called.

@CsCherrYY
Copy link
Collaborator Author

@Eskibear the new ux looks like this
image
any comments?

@Eskibear
Copy link
Member

I think the behavior is the same as what Gradle CLI does, it just generate all files in the folder where gradle init is called.

After all, it's telling me it's "creating a project", instead of "running gradle init in my project folder". I'm ok with current behavior, just raise my concern about the behavior as I've received complaints from users. But again, it's also related to user's taste.

@CsCherrYY
Copy link
Collaborator Author

I think the behavior is the same as what Gradle CLI does, it just generate all files in the folder where gradle init is called.

After all, it's telling me it's "creating a project", instead of "running gradle init in my project folder". I'm ok with current behavior, just raise my concern about the behavior as I've received complaints from users. But again, it's also related to user's taste.

Agree, so l suggest keeping eyes on the feedback from users.

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

Successfully merging this pull request may close these issues.

More convenient ways to create a new gradle project
2 participants