diff --git a/build/lib/jps/jps-builders.jar b/build/lib/jps/jps-builders.jar index 05c199bfbb85..f937e00ed467 100644 Binary files a/build/lib/jps/jps-builders.jar and b/build/lib/jps/jps-builders.jar differ diff --git a/build/scripts/utils.gant b/build/scripts/utils.gant index e0cb06b9004c..d64c75f799d0 100644 --- a/build/scripts/utils.gant +++ b/build/scripts/utils.gant @@ -88,7 +88,7 @@ private String require(String key) { this[key] } catch (MissingPropertyException ignored) { - projectBuilder.error("Property $key is required") + projectBuilder.error("Property '$key' is required") } } @@ -97,7 +97,7 @@ private String require(String key, String defaultValue) { this[key] } catch (MissingPropertyException ignored) { - projectBuilder.info("$key is not defined. Defaulting to $defaultValue") + projectBuilder.info("'$key' is not defined. Defaulting to '$defaultValue'") this[key] = defaultValue } } @@ -112,8 +112,9 @@ binding.setVariable("requireProperty", {String key, String defaultValue = null - }) binding.setVariable("guessHome", { - // Current file is supposed to be at build/scripts/release.gant path - new File(requireProperty("gant.file").substring("file:".length())).getParentFile().getParentFile().getParent() + // current file is supposed to be at build/scripts/*.gant path + String uri = requireProperty("gant.file") + new File(new URI(uri).getSchemeSpecificPart()).getParentFile().getParentFile().getParent() }) binding.setVariable("loadProject", { diff --git a/jps/standalone-builder/src/org/jetbrains/jps/idea/IdeaProjectLoader.groovy b/jps/standalone-builder/src/org/jetbrains/jps/idea/IdeaProjectLoader.groovy index 627c9f821b99..d7e52c6d061f 100644 --- a/jps/standalone-builder/src/org/jetbrains/jps/idea/IdeaProjectLoader.groovy +++ b/jps/standalone-builder/src/org/jetbrains/jps/idea/IdeaProjectLoader.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,21 +14,23 @@ * limitations under the License. */ package org.jetbrains.jps.idea + /** * @author max */ public class IdeaProjectLoader { public static String guessHome(Script script) { - File home = new File(script["gant.file"].substring("file:".length())) + String uri = script["gant.file"] + File home = new File(new URI(uri).getSchemeSpecificPart()) while (home != null) { - if (home.isDirectory()) { - if (new File(home, ".idea").exists()) return home.getCanonicalPath() + if (home.isDirectory() && new File(home, ".idea").exists()) { + return home.getCanonicalPath() } home = home.getParentFile() } - return null + throw new IllegalArgumentException("Cannot guess project home from '" + uri + "'") } }