Skip to content

Process project name to make it a valid Java identifierΒ #5

@ramnivas

Description

@ramnivas

If the specified project name contains -s, the created sources have an invalid package and class names. I believe this is also the case with other disallowed characters or other rules such as starting with a digit.

  1. Package name
$ uvx --from git+https://github.com/embabel/project-creator.git project-creator

πŸ“š Available template repositories:
  1. Kotlin Agent Template - Kotlin agent template - https://github.com/embabel/kotlin-agent-template
  2. Java Agent Template - Java agent template - https://github.com/embabel/java-agent-template

Select repository (1-2) [default: 1]: 2
βœ… Selected: Java Agent Template
Project name: film-em-exograph-mcp
Package name (default: com.example.film-em-exograph-mcp): 

Here the package name should be processed to either drop -s or replace them with _ to make it a valid identifier.

  1. Class name

I overrode the suggested default with film_exograph_exograph_mcp. This still resulted in invalid class name: Film-em-exograph-mcpApplication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions