From f59dcede93351149bb5ff99c9310f467efd0d660 Mon Sep 17 00:00:00 2001
From: ulrich
Date: Tue, 17 Nov 2020 15:54:25 +0000
Subject: [PATCH] Ant build begonnen

---
 web/ui/index.html                                   |    1 +
 web/ui/api.js                                       |   10 ++++++++++
 src/java/de/uhilger/filecms/api/CompileService.java |   12 ++++++++++++
 web/ui/ui.js                                        |    5 +++++
 4 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/src/java/de/uhilger/filecms/api/CompileService.java b/src/java/de/uhilger/filecms/api/CompileService.java
index c12c1c7..473eea8 100644
--- a/src/java/de/uhilger/filecms/api/CompileService.java
+++ b/src/java/de/uhilger/filecms/api/CompileService.java
@@ -43,6 +43,18 @@
   
   private static final Logger logger = Logger.getLogger(CompileService.class.getName());
   
+  public String antBuild(String relPath) {
+    File targetDir = getTargetDir(relPath); // App-Ordner
+    StringBuilder sb = new StringBuilder();
+    sb.append("Ant build ist noch nicht implementiert.");
+    //sb.append(System.lineSeparator());
+    sb.append("<br/>");
+    sb.append("targetDir: ");
+    sb.append(targetDir.getAbsolutePath());
+    return sb.toString();
+  }
+  
+  
   /**
    * Annahme: relPath zeigt auf einen Ordner, in dem ein build-Ordner die 
    * fertigen Klassen und ein web-Ordner die Struktur mit WEB-INF 
diff --git a/web/ui/api.js b/web/ui/api.js
index aba6cfd..0011250 100644
--- a/web/ui/api.js
+++ b/web/ui/api.js
@@ -290,6 +290,16 @@
 
 /* -------- Compile / Build ------------- */
 
+function fm_ant_build() {
+  var m = '?c=de.uhilger.filecms.api.CompileService&m=antBuild&p=' + pfad;
+  var u = '../svc' + m;
+  fm_get(u, "text", function(resp) {
+    $('.system-out').empty();
+    $('.system-out').append('Ergebnis von Ant build: ' + resp);
+    fm_fusszeile_zeigen();
+  });
+}
+
 function fm_build_app() {
   var m = '?c=de.uhilger.filecms.api.CompileService&m=buildApp&p=' + pfad;
   var u = '../svc' + m;
diff --git a/web/ui/index.html b/web/ui/index.html
index 83921f0..cf3860f 100644
--- a/web/ui/index.html
+++ b/web/ui/index.html
@@ -136,6 +136,7 @@
               <a id="m-test-3" class="dropdown-item" href="#">Compile all</a>
               <a id="m-compile-results" class="dropdown-item" href="#">Compile results</a>
               <a id="m-build-app" class="dropdown-item" href="#">Build app</a>
+              <a id="m-ant-build" class="dropdown-item" href="#">Ant build</a>
               <div class="dropdown-divider"></div>
               <a id="profil" class="dropdown-item" href="/um/profil">Profil</a>
               <a id="logout" class="dropdown-item" href="#">Abmelden</a>
diff --git a/web/ui/ui.js b/web/ui/ui.js
index 556b455..ad9a26e 100644
--- a/web/ui/ui.js
+++ b/web/ui/ui.js
@@ -74,6 +74,7 @@
   $('#m-test-3').on('click', fm_menu_compile_all);
   $('#m-compile-results').on('click', fm_fusszeile_zeigen);
   $('#m-build-app').on('click', fm_menu_build_app);
+  $('#m-ant-build').on('click', fm_menu_ant_build);
   $('#saveModal').on('hidden.bs.modal', function (e) {
     $('#modal_ok').attr('onclick','').unbind('click');
   });
@@ -345,6 +346,10 @@
   fm_build_app();
 }
 
+function fm_menu_ant_build() {
+  fm_ant_build();
+}
+
 function fm_mark_compile_results_in_editor(resp) {
   cm.clearGutter("breakpoints");
 

--
Gitblit v1.9.3