polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@hedhman.org>
Subject Yeoman generator
Date Sun, 05 Mar 2017 01:17:46 GMT
A heads-up;
I am working on the Yeoman generator to create Polygene projects from
commandline, and there is some progress that I will commit shortly.

One of the new things that I have added is that it is possible to provide a
"model" in JSON, which either used as defaults for the questions, or one
can disable the prompts and it will take all the stuff from that model.

It came about because I couldn't figure out how to do "repeat questions" in
Yeoman, i.e. Add the name of a Module, then add X value types, Y entity
types..., then back to be able to add another Module and so on. If there is
someone with Yeoman experience who can fix that, please step forward.

So, I created a small json format (see sample below).
This in turn means that small "profiles" could be prepared and simply fed
into Yeoman and out comes a skeletal application, runnable at that point.

If anyone wants to help working on this, here is what you need to do,

install npm and yeoman on your system (http://yeoman.io/learning/)

cd tools/generator-polygene/
sudo npm link

That will make the "polygene" generator available in yeoman.

I typically do my workflow by first creating my "project directory", say
"mkdir niclas", then I repeatedly run,


rm -rf * && cp ../model.json imported-model.json && yo polygene --import
--export && ./gradlew clean build assemble

between each change in the source code. Above I have an "model.json"
containing the "modules" section seen in the "exported" model below. (Later
the name of import and export files will be added)

One thing that needs to be figured out, is how to make this available in
the Polygene SDK distribution. Another that Paul has brought up is how to
test all the permutations so that every combination of entitystore,
indexing, serialization, caching, rest, jmx, reindexer, migration support,
metrics and what else could be dreamt up, actually compiles after a
generation. With the new "--import" this automation should be easier to do,
although I think Yeoman has support for it too.


Anyway, a good chunk of work is going to be committed a bit later today..

{
   "modules": {
       "users": {
           "cruds": [
               {
                   "name": "Users"
               },
               {
                   "name": "Roles"
               },
               {
                   "name": "User"
               },
               {
                   "name": "Role"
               },
               {
                   "name": "Permission"
               },
               {
                   "name": "Group"
               },
               {
                   "name": "Groups"
               }
           ],
           "entities": [],
           "values": [],
           "services": [
               {
                   "name": "AuthService",
                   "visibilty": "application"
               }
           ],
           "transients": [],
           "objects": [],
           "name": "users",
           "clazz": {
               "name": "AuthService",
               "visibilty": "application"
           }
       }
   },
   "name": "Niclas",
   "packageName": "com.acme.niclas",
   "singletonApp": false,
   "features": [
       "rest api"
   ],
   "entitystore": "Cassandra",
   "indexing": "Rdf",
   "caching": "none",
   "serialization": "Jackson",
   "packagename": "com.acme.niclas",
   "javaPackageDir": "com/acme/niclas"
}

-- 
Niclas Hedhman, Software Developer
http://polygene.apache.org <http://zest.apache.org> - New Energy for Java

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message