You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polygene.apache.org by ni...@apache.org on 2017/04/13 06:22:48 UTC

polygene-java git commit: make CommandLine app compile.

Repository: polygene-java
Updated Branches:
  refs/heads/develop 4a2d64432 -> 3610b58a8


make CommandLine app compile.


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

Branch: refs/heads/develop
Commit: 3610b58a8a29651594545fc8d0d18ceca5aa6724
Parents: 4a2d644
Author: niclas <ni...@spicter.com>
Authored: Thu Apr 13 14:22:39 2017 +0800
Committer: niclas <ni...@spicter.com>
Committed: Thu Apr 13 14:22:39 2017 +0800

----------------------------------------------------------------------
 .../CommandLineModule/bootstrap.tmpl            | 39 ++++++++++++++++++++
 .../CommandLineModule/module.js                 |  6 +--
 .../app/templates/buildtool/build.js            |  4 +-
 .../templates/buildtool/gradle-bootstrap.tmpl   |  4 +-
 4 files changed, 47 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3610b58a/tools/generator-polygene/app/templates/UserInterfaceLayer/CommandLineModule/bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/UserInterfaceLayer/CommandLineModule/bootstrap.tmpl b/tools/generator-polygene/app/templates/UserInterfaceLayer/CommandLineModule/bootstrap.tmpl
new file mode 100644
index 0000000..4793bb3
--- /dev/null
+++ b/tools/generator-polygene/app/templates/UserInterfaceLayer/CommandLineModule/bootstrap.tmpl
@@ -0,0 +1,39 @@
+<%#
+ *  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.ui;
+
+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.<%- polygene.entitystore.toLowerCase() %>.assembly.<%- polygene.entitystore %>EntityStoreAssembler;
+
+public class CommandLineModule
+    implements ModuleAssembler
+{
+    @Override
+    public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
+        throws AssemblyException
+    {
+        // AUTO-GENERATION not supported yet.
+        return module;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3610b58a/tools/generator-polygene/app/templates/UserInterfaceLayer/CommandLineModule/module.js
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/UserInterfaceLayer/CommandLineModule/module.js b/tools/generator-polygene/app/templates/UserInterfaceLayer/CommandLineModule/module.js
index 3ae88a3..41facd8 100644
--- a/tools/generator-polygene/app/templates/UserInterfaceLayer/CommandLineModule/module.js
+++ b/tools/generator-polygene/app/templates/UserInterfaceLayer/CommandLineModule/module.js
@@ -4,9 +4,9 @@ module.exports = {
     write: function (p) {
         if (p.applicationtype === 'Command Line') {
             // NOT SUPPORTED YET!!!
-            // p.copyTemplate(p.ctx,
-            //     'UserInterfaceLayer/CommandLineModule/bootstrap.tmpl',
-            //     'bootstrap/src/main/java/' + p.javaPackageDir + '/bootstrap/ui/CommandLineModule.java');
+            p.copyTemplate(p.ctx,
+                'UserInterfaceLayer/CommandLineModule/bootstrap.tmpl',
+                'bootstrap/src/main/java/' + p.javaPackageDir + '/bootstrap/ui/CommandLineModule.java');
         }
     }
 };

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3610b58a/tools/generator-polygene/app/templates/buildtool/build.js
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/buildtool/build.js b/tools/generator-polygene/app/templates/buildtool/build.js
index 7df3c75..7606514 100644
--- a/tools/generator-polygene/app/templates/buildtool/build.js
+++ b/tools/generator-polygene/app/templates/buildtool/build.js
@@ -4,7 +4,9 @@ module.exports = {
         copyBuildFile(p, "app");
         copyBuildFile(p, "bootstrap");
         copyBuildFile(p, "model");
-        copyBuildFile(p, "rest");
+        if( p.applicationtype === 'Rest API'){
+            copyBuildFile(p, "rest");
+        }
         p.copyTemplate(p.ctx, 'buildtool/gradle-root.tmpl', 'build.gradle');
         p.copyTemplate(p.ctx, 'buildtool/settings.tmpl', 'settings.gradle');
         p.copyTemplate(p.ctx, 'buildtool/gradlew.tmpl', 'gradlew');

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3610b58a/tools/generator-polygene/app/templates/buildtool/gradle-bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/buildtool/gradle-bootstrap.tmpl b/tools/generator-polygene/app/templates/buildtool/gradle-bootstrap.tmpl
index 5815660..4c33c19 100644
--- a/tools/generator-polygene/app/templates/buildtool/gradle-bootstrap.tmpl
+++ b/tools/generator-polygene/app/templates/buildtool/gradle-bootstrap.tmpl
@@ -19,12 +19,12 @@
 -%>
 dependencies {
   compile project( ":model" )
-  compile project( ":rest" )
+<% if( polygene.applicationtype === 'Rest API' ) {
+%>  compile project( ":rest" )<% } %>
 
   compile "org.apache.polygene.core:org.apache.polygene.core.spi:$polygeneVersion"
   compile "org.apache.polygene.core:org.apache.polygene.core.bootstrap:$polygeneVersion"
 
-
   compile "org.apache.polygene.libraries:org.apache.polygene.library.fileconfig:$polygeneVersion"
 <% if( polygene.applicationtype === 'Rest API' ) { %>
   compile "org.apache.polygene.libraries:org.apache.polygene.library.restlet:$polygeneVersion"