polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [1/3] polygene-java git commit: Adding more features in the generator.
Date Thu, 13 Apr 2017 09:30:07 GMT
Repository: polygene-java
Updated Branches:
  refs/heads/develop 58fcd8fea -> 97b5cf3f2


Adding more features in the generator.


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

Branch: refs/heads/develop
Commit: 9c3f2b315879039f5f036f5cef2c5552aa54b488
Parents: 58fcd8f
Author: niclas <niclas@spicter.com>
Authored: Thu Apr 13 15:24:47 2017 +0800
Committer: niclas <niclas@spicter.com>
Committed: Thu Apr 13 15:24:47 2017 +0800

----------------------------------------------------------------------
 tools/generator-polygene/app/index.js           | 22 +++++-----
 .../DomainLayer/JmxModule/bootstrap.tmpl        | 42 ++++++++++++++++++++
 .../templates/DomainLayer/JmxModule/module.js   | 10 +++++
 .../app/templates/RestAPIApplication/app.js     |  2 +-
 .../app/templates/buildtool/gradle-model.tmpl   |  7 ++++
 .../app/templates/buildtool/gradle-root.tmpl    |  5 +--
 tools/generator-polygene/test/generator_test.js |  2 +
 7 files changed, 74 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/9c3f2b31/tools/generator-polygene/app/index.js
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/index.js b/tools/generator-polygene/app/index.js
index 3c2d323..dfeba37 100644
--- a/tools/generator-polygene/app/index.js
+++ b/tools/generator-polygene/app/index.js
@@ -93,6 +93,7 @@ module.exports = generators.Base.extend(
                             name: 'applicationtype',
                             choices: [
                                 'Command Line',
+                                // 'Web Application',
                                 'Rest API'
                             ],
                             message: 'what type of application do you want to create?',
@@ -171,19 +172,16 @@ module.exports = generators.Base.extend(
                             type: 'checkbox',
                             name: 'features',
                             choices: [
-                                , 'security'
+                                // 'alarms'
+                                // 'circuit breakers'
+                                // 'file transactions'
+                                // 'logging'
+                                'jmx',
+                                // 'spring integration'
+                                // 'scheduling'
+                                'mixin scripting',
+                                'security'
                                 // ,'version migration'
-                                // ,'logging'
-                                // ,'jmx'
-                                // ,'circuit breakers'
-                                // ,'file transactions'
-                                // ,'spring integration'
-                                // ,'servlet deployment'
-                                // ,'osgi support'
-                                // ,'alarms'
-                                // ,'scheduling'
-                                // ,'groovy mixins'
-                                // ,'javascript mixins'
                             ],
                             message: 'Other features?',
                             default: polygene.features ? polygene.features : []

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/9c3f2b31/tools/generator-polygene/app/templates/DomainLayer/JmxModule/bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/DomainLayer/JmxModule/bootstrap.tmpl b/tools/generator-polygene/app/templates/DomainLayer/JmxModule/bootstrap.tmpl
new file mode 100644
index 0000000..6a3a4a4
--- /dev/null
+++ b/tools/generator-polygene/app/templates/DomainLayer/JmxModule/bootstrap.tmpl
@@ -0,0 +1,42 @@
+<%#
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *
+-%>
+package <%= polygene.packageName %>.bootstrap.config;
+
+import org.apache.polygene.api.common.Visibility;
+import org.apache.polygene.bootstrap.AssemblyException;
+import org.apache.polygene.bootstrap.LayerAssembly;
+import org.apache.polygene.bootstrap.ModuleAssembly;
+import org.apache.polygene.bootstrap.layered.ModuleAssembler;
+import org.apache.polygene.entitystore.memory.MemoryEntityStoreService;
+
+public class JmxModule
+    implements ModuleAssembler
+{
+    @Override
+    public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
+        throws AssemblyException
+    {
+        module.services( JMXConnectorService.class ).instantiateOnStartup();
+        module.entities( JMXConnectorConfiguration.class );
+        module.forMixin( JMXConnectorConfiguration.class ).declareDefaults().port().set(
1099 );
+        return module;
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/9c3f2b31/tools/generator-polygene/app/templates/DomainLayer/JmxModule/module.js
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/DomainLayer/JmxModule/module.js b/tools/generator-polygene/app/templates/DomainLayer/JmxModule/module.js
new file mode 100644
index 0000000..8857c34
--- /dev/null
+++ b/tools/generator-polygene/app/templates/DomainLayer/JmxModule/module.js
@@ -0,0 +1,10 @@
+module.exports = {
+
+    write: function (p) {
+        if( p.hasFeature('jmx')) {
+            p.copyTemplate(p.ctx,
+                'DomainLayer/JmxModule/bootstrap.tmpl',
+                'bootstrap/src/main/java/' + p.javaPackageDir + '/bootstrap/domain/JmxModule.java');
+        }
+    }
+};

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/9c3f2b31/tools/generator-polygene/app/templates/RestAPIApplication/app.js
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/RestAPIApplication/app.js b/tools/generator-polygene/app/templates/RestAPIApplication/app.js
index 0972b82..3a814af 100644
--- a/tools/generator-polygene/app/templates/RestAPIApplication/app.js
+++ b/tools/generator-polygene/app/templates/RestAPIApplication/app.js
@@ -9,7 +9,7 @@ module.exports = {
 
         p.copyTemplate(p.ctx,
             'RestAPIApplication/web.xml.tmpl',
-            'app/src/main/web/WEB-INF/web.xml');
+            'app/src/main/webapp/WEB-INF/web.xml');
     }
 };
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/9c3f2b31/tools/generator-polygene/app/templates/buildtool/gradle-model.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/buildtool/gradle-model.tmpl b/tools/generator-polygene/app/templates/buildtool/gradle-model.tmpl
index 7b7243a..d9a954f 100644
--- a/tools/generator-polygene/app/templates/buildtool/gradle-model.tmpl
+++ b/tools/generator-polygene/app/templates/buildtool/gradle-model.tmpl
@@ -26,4 +26,11 @@ dependencies {
 <% if( polygene.applicationtype === 'Rest API' ) {
 %>    compile "org.apache.polygene.libraries:org.apache.polygene.library.restlet:$polygeneVersion"
 <% } %>
+<% if( polygene.hasFeature( 'mixin scripting' ) ) {
+%>    compile "org.apache.polygene.libraries:org.apache.polygene.library.scripting:$polygeneVersion"
+<% } %>
+<% if( polygene.hasFeature( 'jmx' ) ) {
+%>    compile "org.apache.polygene.libraries:org.apache.polygene.library.jmx:$polygeneVersion"
+<% } %>
+
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/9c3f2b31/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 c1960ba..2e169bc 100644
--- a/tools/generator-polygene/app/templates/buildtool/gradle-root.tmpl
+++ b/tools/generator-polygene/app/templates/buildtool/gradle-root.tmpl
@@ -34,9 +34,8 @@ allprojects() {
     mavenLocal()
     mavenCentral()
     maven { name 'restlet-repo'; url 'http://maven.restlet.org/' }
-<% if( polygene.entitystore == 'Jdbm' ) { -%>
-    maven { name 'clojure-repo'; url 'http://clojars.org/repo/' }
-<% } -%>
+<% if( polygene.entitystore == 'Jdbm' ) {
+-%>    maven { name 'clojure-repo'; url 'http://clojars.org/repo/' }<% } -%>
   }
 
   dependencies {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/9c3f2b31/tools/generator-polygene/test/generator_test.js
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/test/generator_test.js b/tools/generator-polygene/test/generator_test.js
index 792c7d1..195e528 100644
--- a/tools/generator-polygene/test/generator_test.js
+++ b/tools/generator-polygene/test/generator_test.js
@@ -59,6 +59,8 @@ var metricses = [
 
 var featuresset = [
     [],
+    ['jmx']
+    ['mixin scripting']
     ['security']
 ];
 


Mime
View raw message