From ee458f82b8502e238a96e6582e910cb366059ead Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Mon, 07 Nov 2011 22:12:38 -0500 Subject: [PATCH] Log feature based on Search dialog. Renamed some classes. --- src/com/gitblit/build/Build.java | 95 +++++++++++++++++++++++++++++++++-------------- 1 files changed, 67 insertions(+), 28 deletions(-) diff --git a/src/com/gitblit/build/Build.java b/src/com/gitblit/build/Build.java index 3fa542b..80c88f3 100644 --- a/src/com/gitblit/build/Build.java +++ b/src/com/gitblit/build/Build.java @@ -49,6 +49,10 @@ */ public class Build { + public interface DownloadListener { + public void downloading(String name); + } + /** * BuildType enumeration representing compile-time or runtime. This is used * to download dependencies either for Gitblit GO runtime or for setting up @@ -57,6 +61,8 @@ public static enum BuildType { RUNTIME, COMPILETIME; } + + private static DownloadListener downloadListener; public static void main(String... args) { runtime(); @@ -114,6 +120,29 @@ // needed for site publishing downloadFromApache(MavenObject.COMMONSNET, BuildType.RUNTIME); + } + + public static void federationClient() { + downloadFromApache(MavenObject.JCOMMANDER, BuildType.RUNTIME); + downloadFromApache(MavenObject.SERVLET, BuildType.RUNTIME); + downloadFromApache(MavenObject.MAIL, BuildType.RUNTIME); + downloadFromApache(MavenObject.SLF4JAPI, BuildType.RUNTIME); + downloadFromApache(MavenObject.SLF4LOG4J, BuildType.RUNTIME); + downloadFromApache(MavenObject.LOG4J, BuildType.RUNTIME); + downloadFromApache(MavenObject.GSON, BuildType.RUNTIME); + downloadFromApache(MavenObject.JSCH, BuildType.RUNTIME); + + downloadFromEclipse(MavenObject.JGIT, BuildType.RUNTIME); + } + + public static void manager(DownloadListener listener) { + downloadListener = listener; + downloadFromApache(MavenObject.GSON, BuildType.RUNTIME); + downloadFromApache(MavenObject.ROME, BuildType.RUNTIME); + downloadFromApache(MavenObject.JDOM, BuildType.RUNTIME); + downloadFromApache(MavenObject.JSCH, BuildType.RUNTIME); + + downloadFromEclipse(MavenObject.JGIT, BuildType.RUNTIME); } /** @@ -260,6 +289,9 @@ throw new RuntimeException("Failed to create destination folder structure!"); } } + if (downloadListener != null) { + downloadListener.downloading(mo.name + "..."); + } ByteArrayOutputStream buff = new ByteArrayOutputStream(); try { URL url = new URL(mavenURL); @@ -280,10 +312,17 @@ if (progress - lastProgress >= 0.1f) { lastProgress = progress; updateDownload(progress, targetFile); + if (downloadListener != null) { + int percent = Math.round(100 * progress); + downloadListener.downloading(mo.name + " (" + percent + "%)"); + } } } in.close(); updateDownload(1f, targetFile); + if (downloadListener != null) { + downloadListener.downloading(mo.name + " (100%)"); + } } catch (IOException e) { throw new RuntimeException("Error downloading " + mavenURL + " to " + targetFile, e); @@ -348,10 +387,10 @@ "bc75f05dd4f7fa848720ac669b8b438ee4a6b146", "dcd42f672e734521d1a6ccc0c2f9ecded1a1a281"); - public static final MavenObject SERVLET = new MavenObject("Servlet 2.5", "javax/servlet", - "servlet-api", "2.5", 105000, 158000, 0, - "5959582d97d8b61f4d154ca9e495aafd16726e34", - "021599814ad9a605b86f3e6381571beccd861a32", null); + public static final MavenObject SERVLET = new MavenObject("Servlet 3.0", "org/glassfish", + "javax.servlet", "3.0.1", 84000, 211000, 0, + "58f17c941cd0607bb5edcbcafc491d02265ac9a1", + "63f2f8bcdd3f138020bbadd5c847e8f3847b77d2", null); public static final MavenObject SLF4JAPI = new MavenObject("SLF4J API", "org/slf4j", "slf4j-api", "1.6.1", 25500, 45000, 182000, @@ -371,22 +410,22 @@ "78aa1cbf0fa3b259abdc7d87f9f6788d785aac2a"); public static final MavenObject WICKET = new MavenObject("Apache Wicket", - "org/apache/wicket", "wicket", "1.4.18", 1960000, 1906000, 6818000, - "921a50dbbebdf034f0042f2294760e7535cb7041", - "b432d60b32449fdfb216ac23af8a3ed3e0a3368c", - "435e70f9de94975ee30c3f1b1aa1401aea9b4e70"); + "org/apache/wicket", "wicket", "1.4.19", 1960000, 1906000, 6818000, + "7e6af5cadaf6c9b7e068e45cf2ffbea3cc91592f", + "5e91cf00efaf2fedeef98e13464a4230e5966588", + "5dde8afbe5eb2314a704cb74938c1b651b2cf190"); public static final MavenObject WICKET_EXT = new MavenObject("Apache Wicket Extensions", - "org/apache/wicket", "wicket-extensions", "1.4.18", 1180000, 1118000, 1458000, - "f568bd2ad382db935ab06fdccfdead3f10ed1f15", - "c00a4979d7647d3367c6e4897a2fd7d0f78a73cc", - "5e76ab69f6307e3ecb2638779008b3adf5cbf9aa"); + "org/apache/wicket", "wicket-extensions", "1.4.19", 1180000, 1118000, 1458000, + "c7a1d343e216cdc2e692b6fabc6eaeca9aa24ca4", + "6c2e2ad89b69fc9977c24467e3aa0d7f6c75a579", + "3a3082fb106173f7ca069a6f5969cc8d347d9f44"); public static final MavenObject WICKET_AUTH_ROLES = new MavenObject( - "Apache Wicket Auth Roles", "org/apache/wicket", "wicket-auth-roles", "1.4.18", - 44000, 45000, 166000, "44cf0647e1adca377cc4258cd7fac33aa1dd11ab", - "2a7e9c6a9687136c2527afa2e53148cfa82696c6", - "6e280995097e84b72b283132b8fe6796595caa38"); + "Apache Wicket Auth Roles", "org/apache/wicket", "wicket-auth-roles", "1.4.19", + 44000, 45000, 166000, "70c26ac4cd167bf7323372d2d49eb2a9beff73b9", + "ca219726c1768a9483e4a0bb6550881babfe46d6", + "17753908f8a9e997c464a69765b4682126fa1fd6"); public static final MavenObject WICKET_GOOGLE_CHARTS = new MavenObject( "Apache Wicket Google Charts Add-On", "org/wicketstuff", "googlecharts", "1.4.18", @@ -398,10 +437,10 @@ 237000, 0, 0, "c94f54227b08100974c36170dcb53329435fe5ad", "", ""); public static final MavenObject MARKDOWNPAPERS = new MavenObject("MarkdownPapers", - "org/tautua/markdownpapers", "markdownpapers-core", "1.1.1", 87000, 58000, 278000, - "07046e6d8f33866398dfc3955698925df9ff7719", - "178b49c34dbab6301ce848b67e7957bcf9b94d6a", - "160d370f6cb119a1b46a00f37cc28d23fd27daed"); + "org/tautua/markdownpapers", "markdownpapers-core", "1.2.5", 87000, 58000, 268000, + "295910b1893d73d4803f9ea2790ee1d10c466364", + "2170f358f29886aea8794c4bfdb6f1b27b152b9b", + "481599f34cb2abe4a9ebc771d8d81823375ec1ce"); public static final MavenObject BOUNCYCASTLE = new MavenObject("BouncyCastle", "org/bouncycastle", "bcprov-jdk16", "1.46", 1900000, 1400000, 4670000, @@ -416,16 +455,16 @@ "3b7c5f3938f202311bdca0bf7ed46bc0118af081"); public static final MavenObject JGIT = new MavenObject("JGit", "org/eclipse/jgit", - "org.eclipse.jgit", "1.0.0.201106090707-r", 1318000, 1354000, 2993000, - "34e70691382d67ee5c84ef207fb8d3784594ba2c", - "78dbd385cf40cb266f4fb2de8651b288a72f4e2d", - "dab55685bb6eee8d07cc87faf0cedaa3f9d04a0d"); + "org.eclipse.jgit", "1.1.0.201109151100-r", 1318000, 1354000, 3300000, + "bacc988346c839f79513d7bc7f5c88b22ea6e7a5", + "90abf988d98ce0d4b162f94f63fc99c435eba6b4", + "a46540a2857a0fdbf43debf3383295a897946c79"); public static final MavenObject JGIT_HTTP = new MavenObject("JGit", "org/eclipse/jgit", - "org.eclipse.jgit.http.server", "1.0.0.201106090707-r", 68000, 62000, 99000, - "35e22f7000af95d0c90caaf2012071ef3734ff59", - "4a2368beb1e9db4a6a0d609b7b869f218bf8e7a9", - "3100ce7c40d6968481a12377c59c708cda2d17b5"); + "org.eclipse.jgit.http.server", "1.1.0.201109151100-r", 68000, 62000, 110000, + "3070161a89756aac2dfc2e26d89faf31fe894ab4", + "9cecb8e4351e616688cafbcca906f542d9b1f525", + "20aaab759acd8eb6cb6acbb1b2934a689fb3774d"); public static final MavenObject JSCH = new MavenObject("JSch", "com/jcraft", "jsch", "0.1.44-1", 214000, 211000, 413000, "2e9ae08de5a71bd0e0d3ba2558598181bfa71d4e", -- Gitblit v1.9.1