Skip to content
This repository has been archived by the owner on Mar 14, 2018. It is now read-only.

Commit

Permalink
Merge origin/master
Browse files Browse the repository at this point in the history
  • Loading branch information
RaiMan authored and RaiMan committed Oct 5, 2015
2 parents 216bcec + dd00e8a commit be63b1d
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 153 deletions.
9 changes: 6 additions & 3 deletions API/src/main/java/org/sikuli/basics/FileManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ public static String downloadURL(URL url, String localPath) {
_progress = null;
}
}
if (targetPath == null) {
fullpath.delete();
}
return targetPath;
}

Expand All @@ -297,14 +300,14 @@ public static String downloadURL(URL url, String localPath) {
* @return the absolute path to the downloaded file or null on any error
*/
public static String downloadURL(String url, String localPath) {
URL src = null;
URL urlSrc = null;
try {
src = new URL(url);
urlSrc = new URL(url);
} catch (MalformedURLException ex) {
log(-1, "download: bad URL: " + url);
return null;
}
return downloadURL(src, localPath);
return downloadURL(urlSrc, localPath);
}

public static String downloadURL(String url, String localPath, JFrame progress) {
Expand Down
11 changes: 7 additions & 4 deletions IDE/src/main/java/org/sikuli/ide/EditorViewFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,17 @@ class SyntaxHighlightLabelView extends LabelView {
"ImageFind", "ImageFinder", "Settings",
};
private static String[] keywordsSikuli = {
"find", "wait", "findAll", "findText", "findAllText", "waitVanish", "exists", "text",
"find", "wait", "findAll", "findText", "findAllText",
"waitVanish", "exists", "text",
"click", "doubleClick", "rightClick", "hover", "wheel", "delayClick",
"type", "paste", "write", "delayType",
"dragDrop", "drag", "dropAt",
"mouseMove", "mouseDown", "mouseUp",
"keyDown", "keyUp",
"onAppear", "onVanish", "onChange", "observe", "stopObserver", "isObserving",
"popup", "input", "sleep", "run",
"onAppear", "onVanish", "onChange",
"observe", "observeInBackground", "stopObserver", "isObserving",
"popup", "input", "sleep", "run", "runScript",
"switchApp", "openApp", "closeApp", "use", "useRemote", "ucode", "load",
"assertExist", "assertNotExist",
"capture", "selectRegion",
"getOS", "getMouseLocation", "exit",
//Region
Expand All @@ -189,6 +190,8 @@ class SyntaxHighlightLabelView extends LabelView {
"get", "setRows", "getRows", "setCols", "setCols", "getRowH", "getColW",
"setRaster", "getRow", "getCol", "getCell",
"getImage",
//Event
"repeat",
//Pattern
"similar", "targetOffset", "getLastMatch", "getLastMatches",
"getTargetOffset", "getFilename",
Expand Down
59 changes: 47 additions & 12 deletions Setup/src/main/java/org/sikuli/setup/RunSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public class RunSetup {
private static String updateVersion;
private static String downloadIDE;
private static String downloadAPI;
private static String downloadLibsMac;
private static String downloadLibsWin;
private static String downloadLibsLux;
private static String downloadRServer;
private static String downloadJython;
private static String downloadJython25;
Expand Down Expand Up @@ -119,7 +122,7 @@ public class RunSetup {
private static boolean shouldBuildVision = false;
private static boolean bequiet = false;
private static String sikulixMavenGroup = "com/sikulix/";
private static boolean testingMaven = false;
private static boolean testingMaven = true;
private static boolean withExtensions = false;

static Map <String, String> downloadsLookfor = new HashMap<String, String>();
Expand Down Expand Up @@ -168,10 +171,16 @@ public static void main(String[] args) throws IOException {
runTime.shouldCleanDownloads = true;
downloadIDE = String.format("sikulixsetupIDE-%s-%s.jar", version, runTime.sxBuildStamp);
downloadAPI = String.format("sikulixsetupAPI-%s-%s.jar", version, runTime.sxBuildStamp);
downloadLibsMac = String.format("sikulixlibsmac-%s-%s.jar", version, runTime.sxBuildStamp);
downloadLibsWin = String.format("sikulixlibswin-%s-%s.jar", version, runTime.sxBuildStamp);
downloadLibsLux = String.format("sikulixlibslux-%s-%s.jar", version, runTime.sxBuildStamp);
} else {
localSetup = "sikulixsetup-" + version + ".jar";
downloadIDE = getMavenJarName("sikulixsetupIDE#forsetup");
downloadAPI = getMavenJarName("sikulixsetupAPI#forsetup");
downloadLibsMac = getMavenJarName("sikulixlibsmac");
downloadLibsWin = getMavenJarName("sikulixlibswin");
downloadLibsLux = getMavenJarName("sikulixlibslux");
}

downloadJython = new File(runTime.SikuliJythonMaven).getName();
Expand Down Expand Up @@ -546,10 +555,20 @@ public void propertyChange(PropertyChangeEvent pce) {
if (!proxyMsg.isEmpty()) {
msg += proxyMsg + "\n";
}
if (forAllSystems)
if (forAllSystems) {
msg += "\n--- Native support libraries for all systems (sikulixlibs...)\n";
else {
downloadedFiles += downloadLibsWin + " ";
downloadedFiles += downloadLibsMac + " ";
downloadedFiles += downloadLibsLux + " ";
} else {
msg += "\n--- Native support libraries for " + runTime.osName + " (sikulixlibs...)\n";
if (runTime.runningWindows) {
downloadedFiles += downloadLibsWin + " ";
} else if (runTime.runningMac) {
downloadedFiles += downloadLibsMac + " ";
} else if (runTime.runningLinux) {
downloadedFiles += downloadLibsLux + " ";
}
}
if (getIDE) {
downloadedFiles += downloadIDE + " ";
Expand Down Expand Up @@ -851,16 +870,19 @@ public void propertyChange(PropertyChangeEvent pce) {
logPlus(lvl, "Downloads for selected options:\n" + downloadedFiles);
}
if (!downloadOK) {
popError("Some of the downloads did not complete successfully.\n"
String msg = "Some of the downloads did not complete successfully.\n"
+ "Check the logfile for possible error causes.\n\n"
+ "If you think, setup's inline download is blocked somehow on\n"
+ "your system, you might download the appropriate raw packages manually\n"
+ "into the folder Downloads in the setup folder and run setup again.\n\n"
+ "download page: " + runTime.downloadBaseDirWeb + "\n"
+ "files to download (information is in the setup log file too)\n"
+ downloadedFiles
+ "\n\nBe aware: The raw packages are not useable without being processed by setup!\n\n"
+ "For other reasons, you might simply try to run setup again.");
+ "files to download (information is in the setup log file too)\n\n";
for (String fnToDownload : downloadedFiles.split(" ")) {
msg += fnToDownload + "\n";
}
msg += "\nBe aware: The raw packages are not useable without being processed by setup!\n\n"
+ "For other reasons, you might simply try to run setup again.";
popError(msg);
terminate("download not completed successfully", 1);
}

Expand Down Expand Up @@ -1245,8 +1267,13 @@ public boolean accept(File dir, String name) {
}
}
for (String prefix : downloadsFound.keySet()) {
log(lvl, "checkDownloads: found: %s:\n%s", prefix, downloadsFound.get(prefix));
}
File fpDownloaded = downloadsFound.get(prefix);
if (fpDownloaded != null) {
log(lvl, "checkDownloads: found: %s:\n%s", prefix, fpDownloaded);
} else {
log(lvl, "checkDownloads: not found: %s", prefix);
}
}
if (!doubleFiles.isEmpty()) {
popError("The following files are double or even more often found in the\n"
+ "respective folders setup checks before downloading new artefacts:\n" + doubleFiles +
Expand Down Expand Up @@ -1641,7 +1668,11 @@ private static String getMavenJarPath(String givenItem) {
itemSuffix = "-" + parts[1];
}
if (runTime.isVersionRelease()) {
mPath = String.format("%s%s/%s/", sikulixMavenGroup, item, version);
if (itemSuffix.contains("forsetup")) {
mPath = runTime.downloadBaseDir;
} else {
mPath = String.format("%s%s/%s/", sikulixMavenGroup, item, version);
}
mJar = String.format("%s-%s%s.jar", item, version, itemSuffix);
} else {
String dlMavenSnapshotPath = version + "-SNAPSHOT";
Expand Down Expand Up @@ -1697,7 +1728,11 @@ private static File downloadJarFromMavenSx(String item, String targetDir, String
}

private static File downloadJarFromMaven(String item, String target, String itemName) {
return download(runTime.dlMavenRelease + item, target, null, itemName);
if (item.startsWith("http")) {
return download(item, target, null, itemName);
} else {
return download(runTime.dlMavenRelease + item, target, null, itemName);
}
}

private static void userTerminated(String msg) {
Expand Down
Loading

0 comments on commit be63b1d

Please sign in to comment.