Skip to content

Commit

Permalink
Fixes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleyj committed Jan 19, 2016
2 parents a6339f4 + bc9b5e4 commit 7b271f7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
12 changes: 6 additions & 6 deletions bin/aura
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/bash
#!//usr/bin/env bash

BASE=$(cd "$(dirname "$0")/.."; pwd -P)
COMPILER_JAR="$BASE/lib/robovm-dist-compiler.jar"
COMPILER_JAR="$BASE/lib/aura-compiler.jar"
if [ -f "$COMPILER_JAR" ]; then
export ROBOVM_HOME="$BASE"
export AURA_HOME="$BASE"
else
if [ "x$ROBOVM_DEV_ROOT" != 'x' ]; then
COMPILER_JAR=$(ls "$ROBOVM_DEV_ROOT"/../robovm-dist/compiler/target/robovm-dist-compiler*.jar | egrep -v 'javadoc|sources' 2> /dev/null)
if [ "x$AURA_DEV_ROOT" != 'x' ]; then
COMPILER_JAR=$(ls "$AURA_DEV_ROOT"/../aura-dist/compiler/target/aura-compiler*.jar | egrep -v 'javadoc|sources' 2> /dev/null)
fi
fi
if [ ! -f "$COMPILER_JAR" ]; then
echo "robovm-dist-compiler.jar not found"
echo "aura-compiler.jar not found"
exit 1
fi

Expand Down
38 changes: 19 additions & 19 deletions compiler/src/main/java/aura/compiler/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public enum TreeShakerMode {

private Home home = null;
private File tmpDir;
private File cacheDir = new File(System.getProperty("user.home"), ".robovm/cache");
private File cacheDir = new File(System.getProperty("user.home"), ".aura/cache");
private File ccBinPath = null;

private boolean clean = false;
Expand Down Expand Up @@ -317,7 +317,7 @@ public DependencyGraph getDependencyGraph() {
public File getTmpDir() {
if (tmpDir == null) {
try {
tmpDir = File.createTempFile("robovm", ".tmp");
tmpDir = File.createTempFile("aura", ".tmp");
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down Expand Up @@ -903,42 +903,42 @@ public File getCacertsPath(Cacerts cacerts) {
}

public static Home find() {
// Check if ROBOVM_DEV_ROOT has been set. If set it should be
// pointing at the root of a complete RoboVM source tree.
if (System.getenv("ROBOVM_DEV_ROOT") != null) {
File dir = new File(System.getenv("ROBOVM_DEV_ROOT"));
// Check if AURA_DEV_ROOT has been set. If set it should be
// pointing at the root of a complete Aura source tree.
if (System.getenv("AURA_DEV_ROOT") != null) {
File dir = new File(System.getenv("AURA_DEV_ROOT"));
return validateDevRootDir(dir);
}
if (System.getProperty("ROBOVM_DEV_ROOT") != null) {
File dir = new File(System.getProperty("ROBOVM_DEV_ROOT"));
if (System.getProperty("AURA_DEV_ROOT") != null) {
File dir = new File(System.getProperty("AURA_DEV_ROOT"));
return validateDevRootDir(dir);
}

if (System.getenv("ROBOVM_HOME") != null) {
File dir = new File(System.getenv("ROBOVM_HOME"));
if (System.getenv("AURA_HOME") != null) {
File dir = new File(System.getenv("AURA_HOME"));
return new Home(dir);
}

List<File> candidates = new ArrayList<File>();
File userHome = new File(System.getProperty("user.home"));
candidates.add(new File(userHome, "Applications/robovm"));
candidates.add(new File(userHome, ".robovm/home"));
candidates.add(new File("/usr/local/lib/robovm"));
candidates.add(new File("/opt/robovm"));
candidates.add(new File("/usr/lib/robovm"));
candidates.add(new File(userHome, "Applications/aura"));
candidates.add(new File(userHome, ".aura/home"));
candidates.add(new File("/usr/local/lib/aura"));
candidates.add(new File("/opt/aura"));
candidates.add(new File("/usr/lib/aura"));

for (File dir : candidates) {
if (dir.exists()) {
return new Home(dir);
}
}

throw new IllegalArgumentException("ROBOVM_HOME not set and no RoboVM "
throw new IllegalArgumentException("AURA_HOME not set and no Aura "
+ "installation found in " + candidates);
}

public static void validate(File dir) {
String error = "Path " + dir + " is not a valid RoboVM install directory: ";
String error = "Path " + dir + " is not a valid Aura install directory: ";
// Check for required dirs and match the compiler version with our
// version.
if (!dir.exists()) {
Expand Down Expand Up @@ -968,7 +968,7 @@ public static void validate(File dir) {
}

// Compare the version of this compiler with the version of the
// robovm-rt.jar in the home dir. They have to match.
// aura-rt.jar in the home dir. They have to match.
try {
String thisVersion = Version.getVersion();
String thatVersion = getImplementationVersion(rtJarFile);
Expand All @@ -983,7 +983,7 @@ public static void validate(File dir) {
}

private static Home validateDevRootDir(File dir) {
String error = "Path " + dir + " is not a valid RoboVM source tree: ";
String error = "Path " + dir + " is not a valid Aura source tree: ";
// Check for required dirs.
if (!dir.exists()) {
throw new IllegalArgumentException(error + "no such path");
Expand Down

0 comments on commit 7b271f7

Please sign in to comment.