This is an automated email from the ASF dual-hosted git repository.
skygo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 276dbba Get a file of all libraries during download (#2001)
276dbba is described below
commit 276dbba00288a05a005c0fae84f5eeecf94f8884
Author: Eric Barboni <[email protected]>
AuthorDate: Sat Mar 7 13:57:16 2020 +0100
Get a file of all libraries during download (#2001)
* Get a file of all libraries during download use UTF-8
---
.../netbeans/nbbuild/extlibs/DownloadBinaries.java | 20 ++++++++++++++++++++
nbbuild/build.xml | 3 ++-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/DownloadBinaries.java
b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/DownloadBinaries.java
index 33a57b4..7fae888 100644
--- a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/DownloadBinaries.java
+++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/DownloadBinaries.java
@@ -33,6 +33,8 @@ import java.math.BigInteger;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
+import java.nio.file.Files;
+import java.nio.file.StandardOpenOption;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
@@ -93,6 +95,12 @@ public class DownloadBinaries extends Task {
this.repos = repos;
}
+ private File report = null;
+
+ public void setReportToFile(File file) {
+ this.report = file;
+ }
+
private final List<FileSet> manifests = new ArrayList<>();
/**
* Add one or more manifests of files to download.
@@ -133,6 +141,14 @@ public class DownloadBinaries extends Task {
@Override
public void execute() throws BuildException {
boolean success = true;
+ if (report != null) {
+ try {
+ Files.deleteIfExists(report.toPath());
+ Files.createFile(report.toPath());
+ } catch (IOException x) {
+ throw new BuildException("Cannot create report file at : " +
report + x, getLocation());
+ }
+ }
for (FileSet fs : manifests) {
DirectoryScanner scanner = fs.getDirectoryScanner(getProject());
File basedir = scanner.getBasedir();
@@ -161,6 +177,10 @@ public class DownloadBinaries extends Task {
} else {
success &= fillInFile(hashAndFile[0],
hashAndFile[1], manifest, () -> legacyDownload(hashAndFile[0] + "-" +
hashAndFile[1]));
}
+ if (report != null) {
+ Files.write(report.toPath(), (hashAndFile[0] +
";" + hashAndFile[1] + ";" + include +
"\n").getBytes("UTF-8"),StandardOpenOption.APPEND);
+ }
+
}
}
} catch (IOException x) {
diff --git a/nbbuild/build.xml b/nbbuild/build.xml
index ce6804f..99f95da 100644
--- a/nbbuild/build.xml
+++ b/nbbuild/build.xml
@@ -197,7 +197,8 @@ metabuild.hash=${metabuild.hash}</echo>
<target name="getgitinformation" depends="-git.up,-git.down" />
<target name="download-all-extbins" unless="ext.binaries.downloaded"
depends="bootstrap">
<echo>Downloading external binaries (*/external/ directories)...</echo>
- <downloadbinaries cache="${binaries.cache}" server="${binaries.server}">
+ <!-- optionnal reporttofile used to speed resolving artefacts resolution
for maven artefacts -->
+ <downloadbinaries cache="${binaries.cache}" server="${binaries.server}"
reporttofile="${nb_all}/nbbuild/build/external.info" >
<manifest dir="${nb_all}">
<include name="**/external/binaries-list"/>
</manifest>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists