Skip to content

Commit

Permalink
[java] Fixing dev mode detection
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Sep 15, 2019
1 parent 2602ab2 commit 2ea7c81
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion java/client/test/org/openqa/selenium/build/BazelBuild.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,20 @@
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.os.CommandLine;

import java.nio.file.Files;
import java.nio.file.Path;
import java.util.logging.Logger;

public class BazelBuild {
private static Logger log = Logger.getLogger(BazelBuild.class.getName());

public void build(String target) {
Path projectRoot = InProject.locate("Rakefile").getParent();
Path projectRoot = InProject.findProjectRoot();

if (!Files.exists(projectRoot.resolve("Rakefile"))) {
// we're not in dev mode
return;
}

if (target == null || "".equals(target)) {
throw new IllegalStateException("No targets specified");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
class StaticResources {

static void ensureAvailable() {
if (!Files.exists(InProject.findProjectRoot().resolve("Rakefile"))) {
// we're not in dev mode
return;
}

System.out.println("Copying resources");

BazelBuild bazel = new BazelBuild();
Expand Down

0 comments on commit 2ea7c81

Please sign in to comment.