Project's template (without SDK)

Hi,

I started a github repo to collect and to provide project’s templates. The repo will include instructions and a list of templates (your contributions are welcome).

I bootstrap it with 2 basics templates using gradle one for jme 3.0 and one jme 3.1.

More to come,

PS: It should help some of you, who used SDK just to create new project.

5 Likes

Isn’t there something like Maven Archetypes with gradle?

After some investigation, no archetypes. there is an experimental feature that only works for “hard-coded” template (provided by gradle).

Chapter 15. Build Init Plugin

Maybe, in the future.

I think I may post a more basic basic project as your basic project has things that stand alone apps wouldn’t necessarily need.

Also, the version indirection is good but the group indirection just makes everything harder to read and harder to grep through later.

Got it to run with intellij in about 2 min (most of it being finding a suitable name for the folder on my drive :p)… that’s pretty cool.

Still…an archetype style project creation would have been nice…

But one thing gradle does have that maven doesn’t is the ability to slap a URL right into a build.gradle file to suck in another gradle file that could include a setupJmeProject task.

Edit: might be able to run a gradle file from a URL also… I’ll have to see.

I used the group+ version indirection to quickly switch between 3.0 <->3.1.

I’d do a separate templates for 3.1 and 3.0
As everything in master, so users dont have to switch branches

Having template in each branch allow :

  • to use download button, or url
  • to create project by git clone (command line, IDE,…)

It’s like having one template per repo.

EDIT: @nehon, edit the README to add the url of your template.

1 Like

Maybe we could use this to scaffold a project somehow
https://docs.gradle.org/current/userguide/init_scripts.html

Also ideally name the repository “project_templates” rather than “prj_templates”.

I think that’s not really a great idea in the end. Better to have the build.gradle files have real stuff in them than to depend on having magic in a hidden script somewhere.

ie: those are for setting up standard environment not for initializing a build just for the first time.

repository renamed.
Thanks

1 Like

my point is : Having a command that scaffolds a standard JME project, with all the asset folders shebang, the simpleApplication cube demo, and a proper gradle build with JME dependencies.

If we could say to users : install gradle CLI, create a folder, cd into it, launch gradle init JME, and boom…

And this would create a build.gradle file for them? Or?

the gradle file and the asset folders structure, and the Main.java

next step for the user would be : gradle run
And the app would start

The thing is… IMO we need something not too complicated to setup for users that don’t know much about gradle or git or everything.

I agree with this… but I’d kind of rather setup a plugin than init scripts because a plugin can self-update.

extract of future doc:

git clone -b basic_3.1 https://github.com/jMonkeyEngine-Contributions/project_templates.git myproject
cd myproject
gradle run

or

download https://github.com/jMonkeyEngine-Contributions/project_templates/archive/basic_3.1.zip
unzip basic_3.1.zip
1 Like

Well, yes, a plugin. I don’t know much about gradle so I’m poking around :stuck_out_tongue:
But from what I see you need a build.gradle to be able to use a plugin
So you can’t start from an empty folder.
It woudl be : gradle init, then edit the build.gradle to setup the plugin, then run the plugin.

Or copy in a standard build.gradle that already has the plugin.