hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1557796 - /httpcomponents/httpclient-android/trunk/build.gradle
Date Mon, 13 Jan 2014 18:03:01 GMT
Author: olegk
Date: Mon Jan 13 18:03:00 2014
New Revision: 1557796

URL: http://svn.apache.org/r1557796
Log:
Exclude everthing Punycode related (apparently those classes were excluded from Android release);
remove SPNEGO and Kerberos auth schemes; added rewrite task for Base64 encoding

Modified:
    httpcomponents/httpclient-android/trunk/build.gradle

Modified: httpcomponents/httpclient-android/trunk/build.gradle
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/trunk/build.gradle?rev=1557796&r1=1557795&r2=1557796&view=diff
==============================================================================
--- httpcomponents/httpclient-android/trunk/build.gradle (original)
+++ httpcomponents/httpclient-android/trunk/build.gradle Mon Jan 13 18:03:00 2014
@@ -80,12 +80,18 @@ task prepare(dependsOn: checkout) {
         Set<Class<?>> reservedClasses = HC.getApiClasses(allClasses)
         TreeSet<String> allClassNames = new TreeSet()
         allClasses.each { Class<?> clazz ->
-            allClassNames.add(clazz.name)
+            String classname = clazz.name
+            if (!(classname ==~ /^org\.apache\.http\.client\.utils\.(\w*Idn|Punycode)$/))
{
+                allClassNames.add(clazz.name)
+            }
         }
 
         TreeSet<String> reservedClassNames = new TreeSet()
         reservedClasses.each { Class<?> clazz ->
-            reservedClassNames.add(clazz.name)
+            String classname = clazz.name
+            if (classname != 'org.apache.http.client.utils.Idn') {
+                reservedClassNames.add(classname)
+            }
         }
         allClassNames.each { String line ->
             if (line ==~ /^org\.apache\.http\.\w+$/) {
@@ -152,7 +158,13 @@ task shade(dependsOn: prepare) {
     group = 'SVN'
     description = "Shades newer implementation classes"
     doLast {
-        Set<String> classesToRemove = []
+        Set<String> classesToRemove = [
+                'org.apache.http.impl.auth.GGSSchemeBase',
+                'org.apache.http.impl.auth.SPNegoScheme',
+                'org.apache.http.impl.auth.SPNegoSchemeFactory',
+                'org.apache.http.impl.auth.KerberosScheme',
+                'org.apache.http.impl.auth.KerberosSchemeFactory'
+        ]
         reservedClassesFile.eachLine { String line ->
             classesToRemove.add(line)
         }
@@ -243,4 +255,21 @@ task rewriteLogging(dependsOn: rewriteIm
         }
     }
 
-}
\ No newline at end of file
+}
+
+task rewriteBase64(dependsOn: rewriteImpl) {
+    group = 'Code'
+    description = "Rewrites Base64 coding"
+    doLast {
+        List<Replacement> replacements = [
+                new Replacement(~/^import org\.apache\.commons\.codec\.binary\.Base64;/,
'import android.util.Base64;'),
+                new Replacement(~/^(.*?)Base64\.encodeBase64\((.*?)\)(.*)$/, '$1Base64.encode($2,
Base64.DEFAULT)$3'),
+        ]
+        srcRoot.traverse(namefilter: ~/.*\.java$/) { File file ->
+            if (!file.directory) {
+                HC.replacePatterns(file, replacements)
+            }
+        }
+    }
+
+}



Mime
View raw message