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

Commit

Permalink
preparing final 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RaiMan authored and RaiMan committed Oct 6, 2015
1 parent be63b1d commit a87c5ac
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 49 deletions.
9 changes: 8 additions & 1 deletion API/src/main/java/org/sikuli/basics/FileManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,9 @@ public static String downloadURL(URL url, String localPath) {
_progress.setVisible(true);
}
InputStream reader = null;
FileOutputStream writer = null;
try {
FileOutputStream writer = new FileOutputStream(fullpath);
writer = new FileOutputStream(fullpath);
if (getProxy() != null) {
reader = url.openConnection(getProxy()).getInputStream();
} else {
Expand Down Expand Up @@ -272,6 +273,12 @@ public static String downloadURL(URL url, String localPath) {
} catch (IOException ex) {
}
}
if (writer != null) {
try {
writer.close();
} catch (IOException ex) {
}
}
}
if (_progress != null) {
if (targetPath == null) {
Expand Down
45 changes: 25 additions & 20 deletions Setup/src/main/java/org/sikuli/setup/RunSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class RunSetup {
private static String libsMac = "sikulixlibsmac";
private static String libsWin = "sikulixlibswin";
private static String libsLux = "sikulixlibslux";
private static File folderLibs;
private static File folderLib;
private static File folderLibsWin;
private static File folderLibsLux;
private static String linuxDistro = "*** testing Linux ***";
Expand Down Expand Up @@ -363,6 +363,9 @@ public static void main(String[] args) throws IOException {
}
fDownloadsObsolete = new File(fWorkDir, "Downloads");
workDir = fWorkDir.getAbsolutePath();

File fSetupStuff = new File(fWorkDir, "SetupStuff");
FileManager.resetFolder(fSetupStuff);

osarch = "" + runTime.javaArch;
if (runTime.runningLinux) {
Expand Down Expand Up @@ -411,8 +414,8 @@ public static void main(String[] args) throws IOException {
File localJarIDE = new File(fWorkDir, localIDE);
File localJarAPI = new File(fWorkDir, localAPI);

folderLibs = runTime.fLibsLocal;
folderLibsWin = new File(folderLibs, "windows");
folderLibsWin = new File(fSetupStuff, "sikulixlibs/windows");
folderLib = new File(fSetupStuff, "Lib");
folderLibsLux = runTime.fLibsProvided;

//TODO Windows 8 HKLM/SOFTWARE/JavaSoft add Prefs ????
Expand Down Expand Up @@ -698,14 +701,17 @@ public void propertyChange(PropertyChangeEvent pce) {
if (fDownloaded == null) {
fDownloaded = downloadJarFromMavenSx(libsWin, dlDir, libsWin);
}
downloadOK &= copyFromDownloads(fDownloaded, libsWin, jarsList[6]);
FileManager.resetFolder(folderLibsWin);
String aJar = FileManager.normalizeAbsolute(jarsList[6], false);
if (null == runTime.resourceListAsSikulixContentFromJar(aJar, "sikulixlibs/windows", folderLibsWin, null)) {
terminate("libswin content list could not be created", 999);
boolean dlLibsWinOK = copyFromDownloads(fDownloaded, libsWin, jarsList[6]);
if (dlLibsWinOK) {
FileManager.resetFolder(folderLibsWin);
String aJar = FileManager.normalizeAbsolute(jarsList[6], false);
if (null == runTime.resourceListAsSikulixContentFromJar(aJar, "sikulixlibs/windows", folderLibsWin, null)) {
terminate("libswin content list could not be created", 999);
}
addonFileList[addonLibswindows] = new File(folderLibsWin, runTime.fpContent).getAbsolutePath();
addonFilePrefix[addonLibswindows] = libsWin;
}
addonFileList[addonLibswindows] = new File(folderLibsWin, runTime.fpContent).getAbsolutePath();
addonFilePrefix[addonLibswindows] = libsWin;
downloadOK &= dlLibsWinOK;
}

if (forSystemMac || forAllSystems) {
Expand All @@ -727,17 +733,17 @@ public void propertyChange(PropertyChangeEvent pce) {
if (fDownloaded == null) {
fDownloaded = downloadJarFromMavenSx("sikulixsetupAPI#forsetup", dlDir, sDownloaded);
}
downloadOK &= copyFromDownloads(fDownloaded, sDownloaded, localJar);

if(forSystemWin || forAllSystems) {
FileManager.resetFolder(runTime.fSikulixLib);
boolean dlApiOK = copyFromDownloads(fDownloaded, sDownloaded, localJar);
if(dlApiOK && (forSystemWin || forAllSystems)) {
FileManager.resetFolder(folderLib);
String aJar = FileManager.normalizeAbsolute(localJar, false);
if (null == runTime.resourceListAsSikulixContentFromJar(aJar, "Lib", runTime.fSikulixLib, null)) {
terminate("libswin content list could not be created", 999);
if (null == runTime.resourceListAsSikulixContentFromJar(aJar, "Lib", folderLib, null)) {
terminate("Lib content list could not be created", 999);
}
addonFileList[addonFolderLib] = new File(runTime.fSikulixLib, runTime.fpContent).getAbsolutePath();
addonFileList[addonFolderLib] = new File(folderLib, runTime.fpContent).getAbsolutePath();
addonFilePrefix[addonFolderLib] = "Lib";
}
downloadOK &= dlApiOK;
}

if (getIDE) {
Expand Down Expand Up @@ -1053,8 +1059,7 @@ public boolean accept(ZipEntry entry, String jarname) {
log(lvl, "Running headless --- skipping tests");
}

FileManager.deleteFileOrFolder(folderLibsWin);
FileManager.deleteFileOrFolder(new File(runTime.fSikulixLib, runTime.fpContent));
FileManager.deleteFileOrFolder(fSetupStuff);

//<editor-fold defaultstate="collapsed" desc="api test">
boolean runAPITest = false;
Expand Down Expand Up @@ -1668,7 +1673,7 @@ private static String getMavenJarPath(String givenItem) {
itemSuffix = "-" + parts[1];
}
if (runTime.isVersionRelease()) {
if (itemSuffix.contains("forsetup")) {
if (itemSuffix.contains("forsetup") || item.contains("sikulixlibs")) {
mPath = runTime.downloadBaseDir;
} else {
mPath = String.format("%s%s/%s/", sikulixMavenGroup, item, version);
Expand Down
28 changes: 0 additions & 28 deletions Setup/src/main/java/org/sikuli/setup/RunSetupSuper.java

This file was deleted.

0 comments on commit a87c5ac

Please sign in to comment.