/** * Parses the file that stores the locations in the workspace where modules loaded by svn:external * is placed. * <p/> * <p/> * Note that the format of the file has changed in 1.180 from simple text file to XML. * * @return immutable list. Can be empty but never null. */ /*package*/ static List<External> parseExternalsFile(AbstractProject project) throws IOException { File file = getExternalsFile(project); if (file.exists()) { try { return (List<External>) new XmlFile(External.XSTREAM, file).read(); } catch (IOException e) { // in < 1.180 this file was a text file, so it may fail to parse as XML, // in which case let's just fall back LOGGER.log(Level.FINEST, "Couldn't parse externals file. It is text file with version < 1.180. Expected XML", e); } } return Collections.emptyList(); }
/** * Parses the file that stores the locations in the workspace where modules loaded by svn:external * is placed. * <p/> * <p/> * Note that the format of the file has changed in 1.180 from simple text file to XML. * * @return immutable list. Can be empty but never null. */ /*package*/ static List<External> parseExternalsFile(AbstractProject project) { File file = getExternalsFile(project); if (file.exists()) { try { return (List<External>) new XmlFile(External.XSTREAM, file).read(); } catch (IOException e) { // in < 1.180 this file was a text file, so it may fail to parse as XML, // in which case let's just fall back LOGGER.log(Level.FINEST, "Couldn't parse externals file. It is text file with version < 1.180. Expected XML", e); } } return Collections.emptyList(); }
public boolean checkout(AbstractBuild build, Launcher launcher, FilePath workspace, final BuildListener listener, File changelogFile) throws IOException, InterruptedException { List<External> externals = checkout(build, workspace, listener); if (externals == null) { return false; } // write out the revision file PrintWriter w = new PrintWriter(new FileOutputStream(getRevisionFile(build))); try { Map<String, SvnInfo> revMap = workspace.act(new BuildRevisionMapTask(build, this, listener, externals)); for (Entry<String, SvnInfo> e : revMap.entrySet()) { w.println(e.getKey() + '/' + e.getValue().revision); } build.addAction(new SubversionTagAction(build, revMap.values())); } finally { w.close(); } // write out the externals info new XmlFile(External.XSTREAM, getExternalsFile(build.getProject())).write(externals); return calcChangeLog(build, changelogFile, listener, externals); }
public boolean checkout(AbstractBuild build, Launcher launcher, FilePath workspace, final BuildListener listener, File changelogFile) throws IOException, InterruptedException { List<External> externals = checkout(build, workspace, listener); if (externals == null) { return false; } // write out the revision file PrintWriter w = new PrintWriter(new FileOutputStream(getRevisionFile(build))); try { Map<String, SvnInfo> revMap = workspace.act(new BuildRevisionMapTask(build, this, listener, externals)); for (Entry<String, SvnInfo> e : revMap.entrySet()) { w.println(e.getKey() + '/' + e.getValue().revision); } build.addAction(new SubversionTagAction(build, revMap.values())); } finally { w.close(); } // write out the externals info new XmlFile(External.XSTREAM, getExternalsFile(build.getProject())).write(externals); return calcChangeLog(build, changelogFile, listener, externals); }