-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from asebak/deployment-algorithm
smarter deployment algorithm implementation
- Loading branch information
Showing
11 changed files
with
219 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
<idea-plugin version="2"> | ||
<id>com.atsebak.raspberrypi</id> | ||
<name>Embedded Linux JVM Debugger (Raspberry Pi, Intel x86, ARM processors)</name> | ||
<version>0.42</version> | ||
<version>0.45</version> | ||
<vendor email="[email protected]" url="http://www.atsebak.com">At Sebak</vendor> | ||
|
||
<description><![CDATA[ | ||
<p>Java Debugger for Embedded Systems that run on Embedded Linux or on the <a href="https://www.yoctoproject.org/">Yocto Project Kernel</a></p> | ||
]]></description> | ||
|
||
<change-notes><![CDATA[ | ||
<b>Version 0.42</b> | ||
<b>Version 0.45</b> | ||
<ul> | ||
<li> | ||
Fixed Null pointer exception on startup after adding run configuration. | ||
</li> | ||
<li> | ||
Smarter deployment algorithm to not deploy libs that already exist on target device. | ||
</li> | ||
</ul> | ||
<b>Version 0.41</b> | ||
<ul> | ||
|
@@ -80,6 +83,9 @@ | |
<configurationType implementation="com.atsebak.embeddedlinuxjvm.runner.conf.EmbeddedLinuxJVMConfigurationType"/> | ||
<projectService serviceImplementation="com.atsebak.embeddedlinuxjvm.console.EmbeddedLinuxJVMConsoleView"/> | ||
<moduleBuilder builderClass="com.atsebak.embeddedlinuxjvm.project.RPiJavaModuleBuilder"/> | ||
|
||
<projectService serviceImplementation="com.atsebak.embeddedlinuxjvm.services.ClasspathService" | ||
serviceInterface="com.atsebak.embeddedlinuxjvm.services.ClasspathService"/> | ||
</extensions> | ||
|
||
</idea-plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/com/atsebak/embeddedlinuxjvm/deploy/DeployedLibrary.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.atsebak.embeddedlinuxjvm.deploy; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
|
||
@Builder | ||
@Getter | ||
public class DeployedLibrary { | ||
private String jarName; | ||
private String size; | ||
private String lastModified; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
src/com/atsebak/embeddedlinuxjvm/services/ClasspathService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package com.atsebak.embeddedlinuxjvm.services; | ||
|
||
|
||
import com.atsebak.embeddedlinuxjvm.console.EmbeddedLinuxJVMConsoleView; | ||
import com.atsebak.embeddedlinuxjvm.deploy.DeployedLibrary; | ||
import com.atsebak.embeddedlinuxjvm.protocol.ssh.SSH; | ||
import com.atsebak.embeddedlinuxjvm.protocol.ssh.SSHHandlerTarget; | ||
import com.atsebak.embeddedlinuxjvm.runner.data.EmbeddedLinuxJVMRunConfigurationRunnerParameters; | ||
import com.intellij.execution.configurations.RuntimeConfigurationException; | ||
import com.intellij.openapi.project.Project; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class ClasspathService { | ||
@NotNull | ||
private final Project project; | ||
private List<File> previousDeployFiles; | ||
|
||
/** | ||
* Clear up static file list of deployments | ||
*/ | ||
public ClasspathService(@NotNull Project project) { | ||
this.project = project; | ||
previousDeployFiles = new ArrayList<File>(); | ||
} | ||
|
||
/** | ||
* Gets the delta of jars between host and target machines. It will always add the normal project output path but not necessarily the external libs | ||
* Some potential problems can be that the user stops it midway while deploying so the jars don't go on the target. | ||
* | ||
* @param hostLibraries | ||
* @return targetLibraries | ||
*/ | ||
public List<File> deltaOfDeployedJars(List<File> hostLibraries) { | ||
List<File> newLibraries = new ArrayList<File>(); | ||
for (File hostFile : hostLibraries) { | ||
if (!hostFile.getName().contains("jar")) { | ||
newLibraries.add(hostFile); | ||
} else if (!previousDeployFiles.contains(hostFile)) { | ||
newLibraries.add(hostFile); | ||
} | ||
} | ||
previousDeployFiles = hostLibraries; | ||
return newLibraries; | ||
} | ||
|
||
/** | ||
* Gets the deployed jars on target machine | ||
* | ||
* @return | ||
* @throws IOException | ||
* @throws RuntimeConfigurationException | ||
* @deprecated use deltaOfDeployedJars instead | ||
*/ | ||
@Deprecated | ||
public List<DeployedLibrary> invokeFindDeployedJars(EmbeddedLinuxJVMRunConfigurationRunnerParameters runnerParameters) | ||
throws IOException, RuntimeConfigurationException { | ||
SSHHandlerTarget target = SSHHandlerTarget.builder().piRunnerParameters(runnerParameters) | ||
.consoleView(EmbeddedLinuxJVMConsoleView.getInstance(project)) | ||
.ssh(SSH.builder() | ||
.connectionTimeout(30000) | ||
.timeout(30000) | ||
.build()).build(); | ||
return target.listAlreadyUploadedJars(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.