From 4b265d513d0d662b80988cfca4ad2d2b5515b1af Mon Sep 17 00:00:00 2001 From: douzief Date: Wed, 17 Jul 2024 14:33:04 +0200 Subject: [PATCH 01/12] feat: configure plugin resources and files --- .gitignore | 1 + pom.xml | 102 +++++++++++++++++++++----- resources/META-INF/descriptor.xml | 71 ++++++++++++++++++ resources/sen2vm-template.vm | 2 + src/main/java/esa/sen2vm/App.java | 13 ---- src/main/nbm/manifest.mf | 13 ++++ src/test/java/esa/sen2vm/AppTest.java | 26 ------- 7 files changed, 169 insertions(+), 59 deletions(-) create mode 100644 resources/META-INF/descriptor.xml create mode 100644 resources/sen2vm-template.vm delete mode 100644 src/main/java/esa/sen2vm/App.java create mode 100755 src/main/nbm/manifest.mf delete mode 100644 src/test/java/esa/sen2vm/AppTest.java diff --git a/.gitignore b/.gitignore index 524f096..356a42c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Compiled class file *.class +target # Log file *.log diff --git a/pom.xml b/pom.xml index 53e8b64..60e92a5 100644 --- a/pom.xml +++ b/pom.xml @@ -3,21 +3,20 @@ 4.0.0 - - esa.sen2vm + org.esa.sen2vm sen2vm-snap-plugin 1.0-SNAPSHOT - + + Sentinel-2 Viewing Model tool goal is to compute and add geolocation information to L1B product images sen2vm-snap-plugin - http://www.example.com - UTF-8 - 1.8 - 1.8 + 11 + 11 + 11.0.0-SNAPSHOT + RELEASE113 - org.junit.jupiter @@ -25,51 +24,114 @@ 5.10.2 test + + + org.netbeans.api + org-openide-awt + ${netbeans.version} + + + org.netbeans.api + org-openide-util + ${netbeans.version} + + + org.netbeans.api + org-openide-util-lookup + ${netbeans.version} + + + org.netbeans.api + org-netbeans-api-annotations-common + ${netbeans.version} + + ../src/main/nbm + + + resources + + - + org.apache.netbeans.utilities + nbm-maven-plugin + 4.4 + true + + + THE BEER-WARE LICENSE + ../LICENSE.txt + true + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + maven-resources-plugin + 3.3.1 + + + maven-resources-plugin - 3.0.2 + 3.3.1 maven-compiler-plugin - 3.8.0 + 3.11.0 maven-surefire-plugin - 2.22.1 + 3.2.3 maven-jar-plugin - 3.0.2 + 3.4.0 maven-install-plugin - 2.5.2 + 3.0.1 maven-deploy-plugin - 2.8.2 + 3.4.0 - maven-site-plugin - 3.7.1 + 3.12.1 maven-project-info-reports-plugin - 3.0.0 - + 3.4.0 + --> + + + maven-compiler-plugin + 3.11.0 + + 11 + 11 + true + UTF-8 + + + diff --git a/resources/META-INF/descriptor.xml b/resources/META-INF/descriptor.xml new file mode 100644 index 0000000..f156c56 --- /dev/null +++ b/resources/META-INF/descriptor.xml @@ -0,0 +1,71 @@ + + org.esa.snap.core.gpf.operators.tooladapter.sen2vm + org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterOp + sen2vm + + 1.0.0 + Sentinel-2 Viewing Model tool goal is to compute and add geolocation information to L1B product images + CSGroup + unknow + false + false + Menu/Optical/Geometric + true + false + $SEN2VM_JRE + $java.io.tmpdir + + + + SEN2VM_JRE + $JAVA_HOME + false + + + SEN2VM_JAR_EXE + /home/florian/snap_dev/sen2vm-core/target/sen2vm-core-1.0-SNAPSHOT.jar + false + + + + + ProductPath + java.io.File + Product Path + + true + true + RegularParameter + + + targetProductFile + java.io.File + Output file + + false + false + RegularParameter + + + user + false + true + + NONE + REMOTE + + + NONE + REMOTE + + + NONE + REMOTE + + + + 0 + VELOCITY + \ No newline at end of file diff --git a/resources/sen2vm-template.vm b/resources/sen2vm-template.vm new file mode 100644 index 0000000..13f624d --- /dev/null +++ b/resources/sen2vm-template.vm @@ -0,0 +1,2 @@ +SEN2VM_JAR_EXE +$configurationFile diff --git a/src/main/java/esa/sen2vm/App.java b/src/main/java/esa/sen2vm/App.java deleted file mode 100644 index a57af07..0000000 --- a/src/main/java/esa/sen2vm/App.java +++ /dev/null @@ -1,13 +0,0 @@ -package esa.sen2vm; - -/** - * Hello world! - * - */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); - } -} diff --git a/src/main/nbm/manifest.mf b/src/main/nbm/manifest.mf new file mode 100755 index 0000000..4393713 --- /dev/null +++ b/src/main/nbm/manifest.mf @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +OpenIDE-Module-Specification-Version: 1.0.0 +OpenIDE-Module-Implementation-Version: 1.0.0 +OpenIDE-Module-Name: Sen2vm +OpenIDE-Module-Display-Category: SNAP Supported Plugins +AutoUpdate-Show-In-Client: false +AutoUpdate-Essential-Module: false +OpenIDE-Module-Java-Dependencies: Java > 11 +OpenIDE-Module-Type: STA +OpenIDE-Module-Short-Description: Sen2vm +OpenIDE-Module: org.esa.sen2vm +OpenIDE-Module-Alias: sen2vm +OpenIDE-Module-Module-Dependencies: org.esa.snap.snap.sta, org.esa.snap.snap.sta.ui diff --git a/src/test/java/esa/sen2vm/AppTest.java b/src/test/java/esa/sen2vm/AppTest.java deleted file mode 100644 index 8d708fe..0000000 --- a/src/test/java/esa/sen2vm/AppTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package esa.sen2vm; - -import static org.junit.jupiter.api.Assertions.assertAll; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTimeout; -import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import org.junit.jupiter.api.Test; - -/** - * Unit test for simple App. - */ -public class AppTest -{ - /** - * Rigorous Test :-) - */ - @Test - public void shouldAnswerWithTrue() - { - assertTrue( true ); - } -} From 23e19104e0a067b5f47d7f658b8755b61a472899 Mon Sep 17 00:00:00 2001 From: douzief Date: Thu, 25 Jul 2024 17:24:33 +0200 Subject: [PATCH 02/12] fix: build config and descriptor xml --- pom.xml | 133 +++++++++++++----------------- resources/META-INF/descriptor.xml | 64 +++++++++++--- resources/sen2vm-template.vm | 3 +- src/main/nbm/manifest.mf | 6 +- 4 files changed, 115 insertions(+), 91 deletions(-) diff --git a/pom.xml b/pom.xml index 60e92a5..3277657 100644 --- a/pom.xml +++ b/pom.xml @@ -3,13 +3,13 @@ 4.0.0 - org.esa.sen2vm + org.esa sen2vm-snap-plugin 1.0-SNAPSHOT - Sentinel-2 Viewing Model tool goal is to compute and add geolocation information to L1B product images - sen2vm-snap-plugin + sen2vm http://www.example.com + nbm UTF-8 11 @@ -19,12 +19,21 @@ - org.junit.jupiter - junit-jupiter-engine - 5.10.2 - test + org.esa.snap + snap-sta + ${snap.version} - + + org.esa.snap + snap-sta-ui + ${snap.version} + + + org.esa.snap + snap-rcp + ${snap.version} + + org.netbeans.api org-openide-awt @@ -48,90 +57,62 @@ - ../src/main/nbm + ../src/main/java resources - - + + + + maven-dependency-plugin + 3.6.0 + + + + + - org.apache.netbeans.utilities - nbm-maven-plugin - 4.4 - true - + maven-compiler-plugin + 3.13.0 - THE BEER-WARE LICENSE - ../LICENSE.txt - true + 11 + 11 + true + UTF-8 org.apache.maven.plugins maven-jar-plugin - 3.3.0 - - - - maven-resources-plugin - 3.3.1 + 3.4.0 + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + - + - maven-site-plugin - 3.12.1 + org.apache.netbeans.utilities + nbm-maven-plugin + 14.0 + true + + GPL 3 + LICENSE.txt + true + - - maven-project-info-reports-plugin - 3.4.0 - --> - - - - - maven-compiler-plugin - 3.11.0 - - 11 - 11 - true - UTF-8 - - + diff --git a/resources/META-INF/descriptor.xml b/resources/META-INF/descriptor.xml index f156c56..29a7b33 100644 --- a/resources/META-INF/descriptor.xml +++ b/resources/META-INF/descriptor.xml @@ -6,34 +6,57 @@ 1.0.0 Sentinel-2 Viewing Model tool goal is to compute and add geolocation information to L1B product images CSGroup - unknow + false false Menu/Optical/Geometric - true + false false $SEN2VM_JRE - $java.io.tmpdir + $SEN2VM_HOME - SEN2VM_JRE - $JAVA_HOME + SEN2VM_PLUGIN_DIR + $HOME/.snap/auxdata/tool-adapters/sen2vm-snap-plugin/ false - SEN2VM_JAR_EXE - /home/florian/snap_dev/sen2vm-core/target/sen2vm-core-1.0-SNAPSHOT.jar + SEN2VM_HOME + $HOME/.snap/var/cache/ + false + + + SEN2VM_JRE + $HOME/esa-snap/jre/bin/java + false + + $HOME/esa-snap/jre/bin/java + + false + + + SEN2VM_JAR + $SEN2VM_PLUGIN_DIR/sen2vm-core-1.0-SNAPSHOT.jar + false + + $SEN2VM_PLUGIN_DIR/sen2vm-core-1.0-SNAPSHOT.jar + + false + + + HOME + /home/florian false - ProductPath + configurationFile java.io.File - Product Path + Configuration Path true true @@ -57,8 +80,29 @@ REMOTE - NONE + ZIP REMOTE + http://0.0.0.0:8000/sen2vm.zip + + arguments + java.io.File + + TemplateParameter + + + targetLocation + java.io.File + null + + RegularParameter + + +