Skip to content
Snippets Groups Projects
Commit d80bbf09 authored by Amandine  TOURNAY's avatar Amandine TOURNAY
Browse files

Fixed POM

parent 415e6ff9
No related branches found
No related tags found
1 merge request!2Merge main branck into carlos-edits to integrate Amandine and Stephane's and and Carlos' codes
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
<!-- Inherited Icy Parent POM --> <!-- Inherited Icy Parent POM -->
<parent> <parent>
<artifactId>pom-icy</artifactId>
<groupId>org.bioimageanalysis.icy</groupId> <groupId>org.bioimageanalysis.icy</groupId>
<artifactId>parent-pom-plugin</artifactId> <version>2.0.0</version>
<version>1.0.5</version> </parent>
</parent>
<!-- Project Information --> <!-- Project Information -->
<artifactId>icy-jep</artifactId> <artifactId>icy-jep</artifactId>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<name>JEP - Java Embedded Python fot Icy</name> <name>JEP - Java Embedded Python fot Icy</name>
<description>Jep embeds CPython in Java through JNI. Fork to include the library in Icy.</description> <description>Jep embeds CPython in Java through JNI. Fork to include the library in Icy.</description>
<url></url> <url>https://icy.bioimageanalysis.org/plugin/jep-java-embedded-python/</url>
<inceptionYear>2022</inceptionYear> <inceptionYear>2022</inceptionYear>
<organization> <organization>
...@@ -74,35 +74,21 @@ ...@@ -74,35 +74,21 @@
</properties> </properties>
<!-- Project build configuration --> <profiles>
<build> <profile>
<plugins> <id>icy-plugin-extract-library</id>
<plugin> <activation>
<groupId>org.apache.maven.plugins</groupId> <activeByDefault>true</activeByDefault>
<artifactId>maven-dependency-plugin</artifactId> </activation>
<executions> </profile>
<execution> </profiles>
<id>${project.artifactId}-fetch</id>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>autocomplete</includeArtifactIds>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<stripVersion>true</stripVersion>
<excludeTransitive>true</excludeTransitive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- List of project's dependencies --> <!-- List of project's dependencies -->
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.bioimageanalysis.icy</groupId> <groupId>org.bioimageanalysis.icy</groupId>
<artifactId>icy-kernel</artifactId> <artifactId>icy-kernel</artifactId>
<version>${icy-kernel.version}</version>
</dependency> </dependency>
<dependency> <dependency>
......
package plugins.atournay.jep; package plugins.atournay.jep;
import com.drew.lang.annotations.NotNull;
import icy.plugin.abstract_.Plugin; import icy.plugin.abstract_.Plugin;
import icy.plugin.interface_.PluginLibrary; import icy.plugin.interface_.PluginLibrary;
...@@ -25,7 +24,7 @@ public class JepPlugin extends Plugin implements PluginLibrary { ...@@ -25,7 +24,7 @@ public class JepPlugin extends Plugin implements PluginLibrary {
* @param path The path to test * @param path The path to test
* @return The result if the String is really a path (compatible Windows, MacOS &amp; Linux) * @return The result if the String is really a path (compatible Windows, MacOS &amp; Linux)
*/ */
public boolean isPath(@NotNull String path) { public boolean isPath(String path) {
if (Pattern.compile("([A-Za-z]:|[/\\\\])+.(\\w)+.*").matcher(path).find()) { if (Pattern.compile("([A-Za-z]:|[/\\\\])+.(\\w)+.*").matcher(path).find()) {
return true; return true;
} }
......
package plugins.atournay.jep; package plugins.atournay.jep;
import com.drew.lang.annotations.NotNull;
import jep.*; import jep.*;
import java.io.File; import java.io.File;
...@@ -30,7 +29,7 @@ public class JepUtils { ...@@ -30,7 +29,7 @@ public class JepUtils {
* @param sitePackagesPath Path to the site-packages directory * @param sitePackagesPath Path to the site-packages directory
* @return Path to JEP * @return Path to JEP
*/ */
public String findJepLib(@NotNull String sitePackagesPath) { public String findJepLib(String sitePackagesPath) {
String jetPath = ""; String jetPath = "";
File jepDir = new File(sitePackagesPath, "jep"); File jepDir = new File(sitePackagesPath, "jep");
...@@ -58,7 +57,7 @@ public class JepUtils { ...@@ -58,7 +57,7 @@ public class JepUtils {
* @param jepPath Path the JEP execution file (libjep.(so|jnilib|ddl)) * @param jepPath Path the JEP execution file (libjep.(so|jnilib|ddl))
* @param pythonRoot Path to the Python root directory * @param pythonRoot Path to the Python root directory
*/ */
public void setJepPath(@NotNull String jepPath, @NotNull String pythonRoot) throws JepException { public void setJepPath(String jepPath, String pythonRoot) throws JepException {
setJepConfig(new JepConfig()); setJepConfig(new JepConfig());
getJepConfig().setClassEnquirer(new CustomClassEnquirer()); getJepConfig().setClassEnquirer(new CustomClassEnquirer());
...@@ -106,7 +105,7 @@ public class JepUtils { ...@@ -106,7 +105,7 @@ public class JepUtils {
* @param jepConfig JEP configurations {@link jep.JepConfig} and example at {@link plugins.atournay.jep.CustomClassEnquirer} * @param jepConfig JEP configurations {@link jep.JepConfig} and example at {@link plugins.atournay.jep.CustomClassEnquirer}
* @return Python interpreter to execute some Python commands, retrieve values, etc... * @return Python interpreter to execute some Python commands, retrieve values, etc...
*/ */
public SubInterpreter openSubPython(@NotNull JepConfig jepConfig) { public SubInterpreter openSubPython(JepConfig jepConfig) {
return new SubInterpreter(jepConfig); return new SubInterpreter(jepConfig);
} }
...@@ -125,7 +124,7 @@ public class JepUtils { ...@@ -125,7 +124,7 @@ public class JepUtils {
return jepConfig; return jepConfig;
} }
private void setJepConfig(@NotNull JepConfig newJepConfig) { private void setJepConfig(JepConfig newJepConfig) {
this.jepConfig = newJepConfig; this.jepConfig = newJepConfig;
} }
...@@ -133,7 +132,7 @@ public class JepUtils { ...@@ -133,7 +132,7 @@ public class JepUtils {
return jepInterpreter; return jepInterpreter;
} }
private void setJepInterpreter(@NotNull Interpreter jepInterpreter) { private void setJepInterpreter(Interpreter jepInterpreter) {
this.jepInterpreter = jepInterpreter; this.jepInterpreter = jepInterpreter;
} }
} }
package plugins.atournay.jep; package plugins.atournay.jep;
import com.drew.lang.annotations.NotNull;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
...@@ -76,7 +74,7 @@ public class PythonUtils { ...@@ -76,7 +74,7 @@ public class PythonUtils {
* @param isDirectory Set if the path is ending by a directory (true) or a file (false) * @param isDirectory Set if the path is ending by a directory (true) or a file (false)
* @return The full path of the Python execution file * @return The full path of the Python execution file
*/ */
public String findPythonExecutable(@NotNull String path, @NotNull boolean isDirectory) { public String findPythonExecutable(String path, boolean isDirectory) {
if (isDirectory) { if (isDirectory) {
File[] pythonFiles = new File(path).listFiles((file, name) -> name.equals("bin") && file.isDirectory()); File[] pythonFiles = new File(path).listFiles((file, name) -> name.equals("bin") && file.isDirectory());
...@@ -106,7 +104,7 @@ public class PythonUtils { ...@@ -106,7 +104,7 @@ public class PythonUtils {
* @param pythonExecutionPath Path to the Python home directory * @param pythonExecutionPath Path to the Python home directory
* @return The path to the site-packages directory * @return The path to the site-packages directory
*/ */
public String setSitePackagesDirectory(@NotNull String pythonExecutionPath) { public String setSitePackagesDirectory(String pythonExecutionPath) {
String terminalLine; String terminalLine;
String[] command = new String[]{pythonExecutionPath, "-c", "import sys; print([p for p in sys.path if p.endswith(\"site-packages\")])"}; String[] command = new String[]{pythonExecutionPath, "-c", "import sys; print([p for p in sys.path if p.endswith(\"site-packages\")])"};
String sitePackagesPath = ""; String sitePackagesPath = "";
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment