mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
project: build/update scripts tuned to support home paths with spaces
This commit is contained in:
Binary file not shown.
@@ -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", {
|
||||
|
||||
@@ -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 + "'")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user