Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eg fixbrowserlink #129

Merged
merged 3 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bootstrap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>parent</artifactId>
<groupId>org.unigrid.janus</groupId>
<version>1.0.10-SNAPSHOT</version>
<version>1.0.11-SNAPSHOT</version>
</parent>
<groupId>org.unigrid</groupId>
<artifactId>bootstrap</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public <T extends RepositorySystem> void shouldBeAbleToHandleSingleDependency()
@Mock
public List<FileMetadata> getDependencies(Invocation inv, String currentArtifact) {
currentArtifact = currentArtifact.contains("org.unigrid:bootstrap")
? "org.unigrid.test:bootstrap:1.0.10-SNAPSHOT" : currentArtifact;
? "org.unigrid.test:bootstrap:1.0.11-SNAPSHOT" : currentArtifact;
return inv.proceed(currentArtifact);
}

Expand Down Expand Up @@ -136,7 +136,7 @@ public CollectResult collectDependencies(Invocation inv, RepositorySystemSession

if (collectRequest.getRoot().getArtifact().getGroupId().equals("org.unigrid.test")) {
if (collectRequest.getRoot().getArtifact().getArtifactId().equals("fx")) {
setupRootArtifact("org.unigrid.test:fx:1.0.10-SNAPSHOT", collectRequest);
setupRootArtifact("org.unigrid.test:fx:1.0.11-SNAPSHOT", collectRequest);

final org.eclipse.aether.graph.Dependency depOne
= createDependency("com.google.inject:guice:5.1.0");
Expand All @@ -149,7 +149,7 @@ public CollectResult collectDependencies(Invocation inv, RepositorySystemSession

collectRequest.setDependencies(Arrays.asList(depOne, depTwo, depThree));
} else if (collectRequest.getRoot().getArtifact().getArtifactId().equals("bootstrap")) {
setupRootArtifact("org.unigrid.test:bootstrap:1.0.10-SNAPSHOT", collectRequest);
setupRootArtifact("org.unigrid.test:bootstrap:1.0.11-SNAPSHOT", collectRequest);

final org.eclipse.aether.graph.Dependency dependency
= createDependency("org.openjfx:javafx-controls:jar:17-ea+7");
Expand Down Expand Up @@ -209,7 +209,7 @@ public Model getModels(String artifactId) {
projectModel.setModelVersion("4.0.0");
projectModel.setGroupId("org.unigrid.test");
projectModel.setArtifactId(artifactId);
projectModel.setVersion("1.0.10-SNAPSHOT");
projectModel.setVersion("1.0.11-SNAPSHOT");

return projectModel;
}
Expand Down
6 changes: 3 additions & 3 deletions desktop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.unigrid.janus</groupId>
<artifactId>parent</artifactId>
<version>1.0.10-SNAPSHOT</version>
<version>1.0.11-SNAPSHOT</version>
</parent>
<properties>
<mainClass>org.unigrid.janus.Janus</mainClass>
Expand Down Expand Up @@ -99,7 +99,7 @@
<goal>jpackage</goal>
</goals>
<configuration>
<appVersion>1.0.10</appVersion>
<appVersion>1.0.11</appVersion>
<vendor>org.unigrid</vendor>
<module>org.unigrid.bootstrap/org.unigrid.bootstrap.App</module>
<modulePaths>
Expand All @@ -122,7 +122,7 @@
<goal>jpackage</goal>
</goals>
<configuration>
<appVersion>1.0.10</appVersion>
<appVersion>1.0.11</appVersion>
<appImage>target/dist/Unigrid</appImage>
</configuration>
</execution>
Expand Down
2 changes: 1 addition & 1 deletion fx/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.unigrid.janus</groupId>
<artifactId>parent</artifactId>
<version>1.0.10-SNAPSHOT</version>
<version>1.0.11-SNAPSHOT</version>
</parent>
<properties>
<mainClass>org.unigrid.janus.Janus</mainClass>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@ of the License (see COPYING and COPYING.addendum).

package org.unigrid.janus.model.service;

import java.awt.Desktop;
import java.net.URI;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import java.io.IOException;
import java.net.URISyntaxException;
import javafx.application.HostServices;
import lombok.RequiredArgsConstructor;
import org.unigrid.janus.model.cdi.Eager;
import org.update4j.OS;

@Eager
@ApplicationScoped
Expand All @@ -35,6 +31,7 @@ public class BrowserService {
private static final String TX_PART = "tx";

@Inject private DebugService debug;
@Inject private HostServices hostServices;

public void navigateAddress(String address) {
navigate(String.format(BASE_URL_TEMPLATE, ADDRESS_PART, address));
Expand All @@ -46,24 +43,9 @@ public void navigateTransaction(String tx) {

public void navigate(String url) {
try {
switch (OS.CURRENT) {
case WINDOWS -> {
if (Desktop.isDesktopSupported()
&& Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
Desktop.getDesktop().browse(new URI(url));
}
}

case MAC -> {
Runtime.getRuntime().exec("open " + url);
}

default -> {
Runtime.getRuntime().exec("xxx-www-browser " + url);
}
}
} catch (IOException | URISyntaxException ex) {
debug.log(String.format("ERROR: (browse url) %s", ex.getMessage()));
hostServices.showDocument(url);
} catch (NullPointerException e) {
debug.print(e.getMessage(), BrowserService.class.getSimpleName());
}
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.unigrid.janus</groupId>
<artifactId>parent</artifactId>
<version>1.0.10-SNAPSHOT</version>
<version>1.0.11-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Unigrid Janus Parent</name>
<organization>
Expand Down