polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [33/50] polygene-java git commit: Working on getting everything in generator working properly.
Date Mon, 10 Jul 2017 06:53:35 GMT
Working on getting everything in generator working properly.


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/8393d863
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/8393d863
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/8393d863

Branch: refs/heads/es-jooq
Commit: 8393d8633ea646504eb0d8aaf2c8022dc4d10181
Parents: c543db5
Author: niclas <niclas@hedhman.org>
Authored: Wed Jul 5 12:08:08 2017 +0800
Committer: niclas <niclas@hedhman.org>
Committed: Wed Jul 5 12:08:08 2017 +0800

----------------------------------------------------------------------
 tools/generator-polygene/app/index.js           | 12 +++----
 .../indexing/ds-index-postgresql.properties     |  2 +-
 .../IndexingModule/module.js                    | 22 +++++++-----
 .../storage/ds-es-postgresql.properties         |  2 +-
 .../app/templates/buildtool/gradle-app.tmpl     | 38 +++++---------------
 .../app/templates/buildtool/gradle-root.tmpl    |  2 +-
 6 files changed, 31 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8393d863/tools/generator-polygene/app/index.js
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/index.js b/tools/generator-polygene/app/index.js
index bcb7453..a20b3eb 100644
--- a/tools/generator-polygene/app/index.js
+++ b/tools/generator-polygene/app/index.js
@@ -65,6 +65,7 @@ module.exports = generators.Base.extend(
                 polygene.indexing = polygene.indexing ? polygene.indexing : null;
                 polygene.entitystore = polygene.entitystore ? polygene.entitystore : null;
                 polygene.caching = polygene.caching ? polygene.caching : null;
+                polygene.dbpool = polygene.dbpool === undefined ? "DBCP" : answers.dbpool;
             }
         },
 
@@ -196,14 +197,13 @@ module.exports = generators.Base.extend(
                         this.log('Caching:', answers.caching);
                         this.log('Metrics:', answers.metrics);
                         this.log('Features:', answers.features);
-                        answers.dbpool = answers.dbpool === undefined ? "DBCP" : answers.dbpool;
                         polygene.name = answers.name;
                         polygene.packageName = answers.packageName;
                         polygene.applicationtype = answers.applicationtype;
                         polygene.features = answers.features;
                         polygene.indexing = answers.indexing;
                         polygene.entitystore = answers.entitystore;
-                        polygene.dbpool = answers.dbpool;
+                        polygene.dbpool = answers.dbpool === undefined ? "DBCP" : answers.dbpool;
                         polygene.metrics = answers.metrics;
                         polygene.caching = answers.caching;
                     }.bind(this)
@@ -280,16 +280,16 @@ function assignFunctions(polygene) {
     polygene.copyToConfig = function (ctx, from, toName) {
         polygene.copyTemplate(ctx,
             from,
-            'app/src/main/config/development/' + toName);
+            'app/src/dist/config/development/' + toName);
         polygene.copyTemplate(ctx,
             from,
-            'app/src/main/config/qa/' + toName);
+            'app/src/dist/config/qa/' + toName);
         polygene.copyTemplate(ctx,
             from,
-            'app/src/main/config/staging/' + toName);
+            'app/src/dist/config/staging/' + toName);
         polygene.copyTemplate(ctx,
             from,
-            'app/src/main/config/production/' + toName);
+            'app/src/dist/config/production/' + toName);
     };
 
     polygene.copyTemplate = function (ctx, from, to) {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8393d863/tools/generator-polygene/app/templates/InfrastructureLayer/IndexingModule/indexing/ds-index-postgresql.properties
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/InfrastructureLayer/IndexingModule/indexing/ds-index-postgresql.properties
b/tools/generator-polygene/app/templates/InfrastructureLayer/IndexingModule/indexing/ds-index-postgresql.properties
index 4097894..4c6eb91 100644
--- a/tools/generator-polygene/app/templates/InfrastructureLayer/IndexingModule/indexing/ds-index-postgresql.properties
+++ b/tools/generator-polygene/app/templates/InfrastructureLayer/IndexingModule/indexing/ds-index-postgresql.properties
@@ -17,7 +17,7 @@
 
 
 enabled=true
-url=jdbc:postgres://127.0.0.1:5432/<%= polygene.name %>
+url=jdbc:postgresql://127.0.0.1:5432/<%= polygene.name.toLowerCase() %>
 driver=org.postgresql.Driver
 username=polygene
 password=ThisIsGreat!

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8393d863/tools/generator-polygene/app/templates/InfrastructureLayer/IndexingModule/module.js
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/InfrastructureLayer/IndexingModule/module.js
b/tools/generator-polygene/app/templates/InfrastructureLayer/IndexingModule/module.js
index 4000571..bbcfb28 100644
--- a/tools/generator-polygene/app/templates/InfrastructureLayer/IndexingModule/module.js
+++ b/tools/generator-polygene/app/templates/InfrastructureLayer/IndexingModule/module.js
@@ -22,18 +22,24 @@ module.exports = {
         p.copyTemplate(p.ctx,
             'InfrastructureLayer/IndexingModule/bootstrap.tmpl',
             'bootstrap/src/main/java/' + p.javaPackageDir + '/bootstrap/infrastructure/'
+ p.indexing + 'IndexingModule.java');
-        if( p.indexing === 'SQL' ) {
-            p.copyTemplate(p.ctx,
+        if (p.indexing === 'SQL') {
+            p.copyToConfig(
+                p.ctx,
                 'InfrastructureLayer/IndexingModule/indexing/ds-index-postgresql.properties',
-                'app/src/main/resources/ds-index-postgresql.properties');
+                'ds-index-postgresql.properties'
+            );
         }
-        if( p.indexing === 'Solr' ) {
-            p.copyTemplate(p.ctx,
+        if (p.indexing === 'Solr') {
+            p.copyToConfig(
+                p.ctx,
                 'InfrastructureLayer/IndexingModule/indexing/solrconfig.xml',
-                'app/src/main/resources/solrconfig.xml');
-            p.copyTemplate(p.ctx,
+                'solrconfig.xml'
+            );
+            p.copyTemplate(
+                p.ctx,
                 'InfrastructureLayer/IndexingModule/indexing/solr-schema.xml',
-                'app/src/main/resources/schema.xml');
+                'schema.xml'
+            );
         }
     }
 };

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8393d863/tools/generator-polygene/app/templates/InfrastructureLayer/StorageModule/storage/ds-es-postgresql.properties
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/InfrastructureLayer/StorageModule/storage/ds-es-postgresql.properties
b/tools/generator-polygene/app/templates/InfrastructureLayer/StorageModule/storage/ds-es-postgresql.properties
index 333d6aa..8e696f1 100644
--- a/tools/generator-polygene/app/templates/InfrastructureLayer/StorageModule/storage/ds-es-postgresql.properties
+++ b/tools/generator-polygene/app/templates/InfrastructureLayer/StorageModule/storage/ds-es-postgresql.properties
@@ -18,7 +18,7 @@
 #
 #
 enabled=true
-url=jdbc:postgres://127.0.0.1:5432/<%= polygene.name %>
+url=jdbc:postgresql://127.0.0.1:5432/<%= polygene.name.toLowerCase() %>
 driver=org.postgresql.Driver
 username=polygene
 password=ThisIsGreat!

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8393d863/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl b/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl
index 697a2b0..441cdec 100644
--- a/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl
+++ b/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl
@@ -53,7 +53,6 @@ if( hasFeature( 'security' ) ) {
 }
 %>  implementation "org.apache.polygene.core:org.apache.polygene.core.spi:$polygeneVersion"
   implementation "org.apache.polygene.core:org.apache.polygene.core.bootstrap:$polygeneVersion"
-
   implementation "org.apache.polygene.extensions:org.apache.polygene.extension.entitystore-<%=
polygene.entitystoremodule.toLowerCase() %>:$polygeneVersion"
   implementation "org.apache.polygene.extensions:org.apache.polygene.extension.indexing-<%=
polygene.indexing.toLowerCase() %>:$polygeneVersion"
   implementation "org.apache.polygene.extensions:org.apache.polygene.extension.serialization-javaxjson:$polygeneVersion"
@@ -71,32 +70,30 @@ if( hasFeature( 'envisage' ) ) {
 <%
 }
 if( polygene.entitystore == 'LevelDB'  ) {
-%>  implementation "org.fusesource.leveldbjni:leveldbjni-all:$levelDbVersion"
+%>  runtimeOnly "org.fusesource.leveldbjni:leveldbjni-all:$levelDbVersion"
 <%
 }
 if( polygene.entitystore == 'DerbySQL'  ) {
-%>  implementation "org.apache.derby:derby:$derbyVersion"
+%>  runtimeOnly "org.apache.derby:derby:$derbyVersion"
 <%
 }
 if( polygene.entitystore == 'H2SQL'  ) {
-%>  implementation "com.h2database:h2:$h2Version"
+%>  runtimeOnly "com.h2database:h2:$h2Version"
 <%
 }
 if( polygene.entitystore == 'MySQL'  ) {
-%>  implementation "mysql:mysql-connector-java:$mysqlVersion"
+%>  runtimeOnly "mysql:mysql-connector-java:$mysqlVersion"
 <%
 }
-if( polygene.entitystore == 'PostgreSQL'  ) {
-%>  implementation "org.postgresql:postgresql:$postgresVersion"
+if( polygene.entitystore == 'PostgreSQL' || polygene.indexing == 'SQL' ) {
+%>  runtimeOnly "org.postgresql:postgresql:$postgresVersion"
 <%
 }
 if( polygene.entitystore == 'SQLite'  ) {
-%>  implementation "org.xerial:sqlite-jdbc:$sqliteVersion"
+%>  runtimeOnly "org.xerial:sqlite-jdbc:$sqliteVersion"
 <%
 }
-%>
-
-  runtimeOnly "org.apache.polygene.core:org.apache.polygene.core.runtime:$polygeneVersion"
+%>  runtimeOnly "org.apache.polygene.core:org.apache.polygene.core.runtime:$polygeneVersion"
   runtimeOnly "org.apache.johnzon:johnzon-core:$johnzonVersion"
   runtimeOnly "org.apache.johnzon:johnzon-mapper:$johnzonVersion"
   runtimeOnly "org.apache.geronimo.specs:geronimo-json_1.1_spec:1.0"
@@ -107,22 +104,3 @@ if( polygene.entitystore == 'SQLite'  ) {
   testImplementation "org.apache.polygene.core:org.apache.polygene.core.testsupport:$polygeneVersion"
   testImplementation "com.github.tdomzal:junit-docker-rule:0.3"
 }
-
-
-task createConfigs {
-  def config = file("src/main/config")
-  outputs.dir config
-  doLast {
-    config.mkdirs()
-  }
-}
-
-distributions {
-  main {
-    contents {
-      from(createConfigs) {
-        into "config"
-      }
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8393d863/tools/generator-polygene/app/templates/buildtool/gradle-root.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/buildtool/gradle-root.tmpl b/tools/generator-polygene/app/templates/buildtool/gradle-root.tmpl
index 60dbb70..6d2a6bf 100644
--- a/tools/generator-polygene/app/templates/buildtool/gradle-root.tmpl
+++ b/tools/generator-polygene/app/templates/buildtool/gradle-root.tmpl
@@ -44,7 +44,7 @@ if( polygene.entitystore == 'MySQL'  ) {
 %>  mysqlVersion = "6.0.6"
 <%
 }
-if( polygene.entitystore == 'PostgreSQL'  ) {
+if( polygene.entitystore == 'PostgreSQL' || polygene.indexing == 'SQL' ) {
 %>  postgresVersion = "42.0.0"
 <%
 }


Mime
View raw message