From 24fbce116d93d8855b86d371a444f9ed998b472e Mon Sep 17 00:00:00 2001
From: Georgy Litvinov <git@litvinovg.pro>
Date: Mon, 27 Jul 2020 16:41:19 +0200
Subject: [PATCH] Added new tasks

---
 build.gradle                                  | 77 ++++++++++++++++---
 .../oxt/releasenotes.txt => releasenotes.txt  |  0
 2 files changed, 67 insertions(+), 10 deletions(-)
 rename src/main/oxt/releasenotes.txt => releasenotes.txt (100%)

diff --git a/build.gradle b/build.gradle
index f452ff3..fa900c0 100644
--- a/build.gradle
+++ b/build.gradle
@@ -65,24 +65,63 @@ task xhtml(type: Jar) {
     from sourceSets.main.output 
         exclude '**/*Test.class'
         exclude '**/AllTests.class'
+        exclude '**/*.java'
+	    include 'w2phtml/pageSplitters/**/*.class'
+        include 'pro/litvinovg/**/*.class'
         include 'org/openoffice/da/comp/wl2common/**/*.class'
         include 'org/openoffice/da/comp/writer2xhtml/**/*.class'
         include 'org/openoffice/da/comp/wl2common/**/*.properties'
-	include 'w2phtml/api/**/*.class'
-	include 'w2phtml/base/**/*.class'
-	include 'w2phtml/epub/**/*.class'
-	include 'w2phtml/office/**/*.class'
-	include 'w2phtml/util/**/*.class'
-	include 'w2phtml/xhtml/**/*.class'
-	include 'w2phtml/xhtml/**/*.xml'
-	include 'w2phtml/xmerge/**/*.class'
+	    include 'w2phtml/api/**/*.class'
+	    include 'w2phtml/base/**/*.class'
+	    include 'w2phtml/epub/**/*.class'
+	    include 'w2phtml/office/**/*.class'
+	    include 'w2phtml/util/**/*.class'
+	    include 'w2phtml/xhtml/**/*.class'
+	    include 'w2phtml/xhtml/**/*.xml'
+	    include 'w2phtml/xmerge/**/*.class'
+        from 'src/main/java'
+	    include 'w2phtml/xhtml/**/*.properties'
+	    include 'w2phtml/xhtml/**/**/*.properties'
+        from sourceSets.main.output
+        include 'org/**/*'
+}
+
+task xhtml2(type: Jar) {
+    manifest {
+        attributes("Implementation-Title": rootProject.name,
+                   "Implementation-Version": releaseVersion,
+                   "RegistrationClassName" : "org.openoffice.da.comp.writer2xhtml.W2XRegistration",
+                   "Class-Path" : "jasp.jar parser.jar")
+    }
+    baseName = "writer2phtml"
+    from {
+    configurations.bundledLibs.collect {
+        it.isDirectory() ? it : zipTree(it)
+    }
+    }
+    from sourceSets.main.output
+        exclude '**/*Test.class'
+        exclude '**/AllTests.class'
+        exclude '**/*.java'
+        include 'org/openoffice/da/comp/wl2common/**/*.class'
+        include 'org/openoffice/da/comp/writer2xhtml/**/*.class'
+        include 'org/openoffice/da/comp/wl2common/**/*.properties'
+    include 'w2phtml/api/**/*.class'
+    include 'w2phtml/base/**/*.class'
+    include 'w2phtml/epub/**/*.class'
+    include 'w2phtml/office/**/*.class'
+    include 'w2phtml/util/**/*.class'
+    include 'w2phtml/xhtml/**/*.class'
+    include 'w2phtml/xhtml/**/*.xml'
+    include 'w2phtml/xmerge/**/*.class'
     from 'src/main/java'
-	include 'w2phtml/xhtml/**/*.properties'
-	include 'w2phtml/xhtml/**/**/*.properties'
+    include 'w2phtml/xhtml/**/*.properties'
+    include 'w2phtml/xhtml/**/**/*.properties'
     from sourceSets.main.output
     include 'org/**/*'
 }
 
+
 task oxt(type: Zip){
     dependsOn = [ 'xhtml', 'setVersion' ]
     archiveName 'w2phtml.oxt'
@@ -93,7 +132,25 @@ task oxt(type: Zip){
     include '*' 
     from 'src/main/idl/writer2xhtml'
     include 'writer2xhtml.rdb' 
+    from 'releasenotes.txt'
+    include '*'
 }
+
+task oxtNew(type: Zip){
+    dependsOn = [ 'xhtml2', 'setVersion' ]
+    archiveName 'w2phtml-new.oxt'
+    from 'src/main/oxt2'
+    include '*'
+    include '**'
+    exclude '.gradle'
+    from 'build/libs/writer2phtml.jar'
+    include '*'
+    from 'src/main/idl/writer2xhtml'
+    include 'writer2xhtml.rdb'
+    from 'releasenotes.txt'
+    include '*'
+}
+
 task setVersion(){   
    ant.taskdef(name: 'xmltask', classpath: 'buildPlugins/xmltask.jar', classname: 'com.oopsconsultancy.xmltask.ant.XmlTask') 
    ant.xmltask(source: 'src/main/oxt/description.xml', dest: 'src/main/oxt/description.xml', report:'true') {
diff --git a/src/main/oxt/releasenotes.txt b/releasenotes.txt
similarity index 100%
rename from src/main/oxt/releasenotes.txt
rename to releasenotes.txt