rife2 / bld

Pure java build tool for developers who don't like dealing with build tools
https://rife2.com/bld
Apache License 2.0
231 stars 12 forks source link

Clarity around 'create' #20

Closed paul-hammant closed 7 months ago

paul-hammant commented 7 months ago
The following commands are supported.

  create        Creates a new project
  create-base   Creates a new baseline Java project with minimal commands
  create-blank  Creates a new blank Java project with standard commands
  create-lib    Creates a new Java library with minimal commands
  create-rife2  Creates a new RIFE2 project

The "create " line would be even better if it suggested there would be an interactive prompt for base, blank, lib, etc.

Base and blank and lib might be better if they suggested roughly how many files that would be under git control at the end of the invocation. I say that cos I can't as a novice, guess which of base and blank would make fewer source files.

Maybe also a --dry-run option for create, so that could be made clear?

gbevin commented 7 months ago

I like the suggestion for the create description, however listing the number of files will be created will inevitably drift over time as we forget to update this. I'd rather not have to remember to maintain this. --dry-run is interesting, what would it do, show a tree of files that would be created?

paul-hammant commented 7 months ago

Yup tree of files. Maybe what I was trying to say was that superficially I couldn't tell which was more helloworld like of base and blank and lib.

ethauvin commented 7 months ago

@paul-hammant Would something like this make more sense?

  create         Creates a new project (multiple choice)
  create-base    Creates a new baseline Java application project with minimal commands (no dependencies)
  create-blank   Creates a new blank Java application project with standard commands (including JUnit tests)
  create-lib     Creates a new Java library project with minimal commands (no dependencies)
  create-rife2   Creates a new RIFE2 web application project
paul-hammant commented 7 months ago

Looks good. Observation (to this layman) "minimal commands" and "standard commands" remains undifferentiated. There's spare room in the create line to have a read-more URL?

ethauvin commented 7 months ago

How about something like:

  create         Creates a new project (multiple choice)
  create-base    Creates a new baseline Java application project with no dependencies
  create-blank   Creates a new blank Java application project with JUnit tests and publishing
  create-lib     Creates a new Java library project with no dependencies
  create-rife2   Creates a new RIFE2 web application project
ethauvin commented 7 months ago

The more I'm thinking about it, them more I think base should be removed, as it only allows you to compile and run the application. Most people will need to be able to create a jar.

With that in mind, blank should be renamed app.

Furthermore, lib should include standard commands (jar, publish, etc.)

So we'd be looking at something like:

  create         Creates a new project (multiple choice)
  create-app     Creates a new Java application project
  create-lib     Creates a new Java library project
  create-rife2   Creates a new RIFE2 web application project

If we wanted to keep base, then it should only have a basic build file, and no source code.

  create-base    Creates a basic project

This will make it a lot easier for people coming from Gradle or Maven.

paul-hammant commented 7 months ago

how about

create hello-world-app|hello-world-lib | rife2-helloworld-webapp

# optional args:
# --with-Junit5 - to create tests too, and tasks for those
# --make-a-jar - to create a jar too and a task for that

You're making your own command syntax here and there is not requirement to get everything on one.

Later:

# optional args:
# --maven-central-publishing - to create a manifest are tasks to do publication 
ethauvin commented 7 months ago

@paul-hammant That's starting to look a lot like Maven. I'd prefer to keep it as simple as possible.

paul-hammant commented 7 months ago

True Maven-like would be when you have -Darg going on to pass params to plugins ;)

gbevin commented 7 months ago

I don't want to get rid of base, it's the absolute minimum, no dependencies project bld can create. Some people will ask for that.

ethauvin commented 7 months ago

I don't want to get rid of base, it's the absolute minimum, no dependencies project bld can create. Some people will ask for that.

I agree, but it should not have any sources or tests, and true base project.

gbevin commented 7 months ago

There needs to be an example for the project bld not to fail on command execution. Without any sources, there's little point in creating a skeleton.

ethauvin commented 7 months ago

There needs to be an example for the project bld not to fail on command execution. Without any sources, there's little point in creating a skeleton.

That's how both Maven and Gradle do it.

gbevin commented 7 months ago

Well, bld is proudly not Maven nor Gradle 😁

ethauvin commented 7 months ago

Well, bld is proudly not Maven nor Gradle 😁

Then it will be a base application with no dependencies, and as @paul-hammant suggested, it should just be:

Hello, bld!

gbevin commented 7 months ago

Well it currently prints Hello World!, that's all the app does. I don't agree that the test blueprint should be removed.

ethauvin commented 7 months ago

Well it currently prints Hello World!, that's all the app does. I don't agree that the test blueprint should be removed.

Yeah, makes no difference at this point, it's a blank application.

gbevin commented 7 months ago
  create        Creates a new project (multiple choice)
  create-base   Creates the most basic Java project
  create-blank  Creates a new Java application project
  create-lib    Creates a new Java library project
  create-rife2  Creates a new RIFE2 web application project

I might rename create-blank to create-app, but that means I have to change all docs also and I might not be feeling that right now.

ethauvin commented 7 months ago

I might rename create-blank to create-app, but that means I have to change all docs also and I might not be feeling that right now.

I can do that.

I understand why you're not feeling it. I think you wanted the projects to match the Project, BaseProject and WebProject structures. But as @paul-hammant pointed out, it's not obvious to noobs.

gbevin commented 7 months ago

Well I like everything to be consistent, including the blueprint sources and so on. So I guess I'll go in and do that.

ethauvin commented 7 months ago

I would also keep blankas a hidden option, for backward-compatibility.

ethauvin commented 7 months ago

Well I like everything to be consistent, including the blueprint sources and so on. So I guess I'll go in and do that.

That kinda hurts my feelings. =D

gbevin commented 7 months ago

Sorry, that was not my intent.

ethauvin commented 7 months ago

Sorry, that was not my intent.

Dude, I was LOL'ing. It's not like I don't do the exact same thing with my code.

gbevin commented 7 months ago

1.9.0 was updated with these changes