You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2013/11/29 21:49:21 UTC

svn commit: r1546641 - in /httpcomponents/httpclient-android/trunk: build.gradle buildSrc/build.gradle buildSrc/src/main/groovy/Svn.groovy src/ src/main/ src/main/groovy/ src/main/groovy/HC.groovy src/main/groovy/Svn.groovy

Author: olegk
Date: Fri Nov 29 20:49:21 2013
New Revision: 1546641

URL: http://svn.apache.org/r1546641
Log:
Android port branch creation based on HttpCore and HttpClient tags

Added:
    httpcomponents/httpclient-android/trunk/build.gradle
    httpcomponents/httpclient-android/trunk/src/
    httpcomponents/httpclient-android/trunk/src/main/
    httpcomponents/httpclient-android/trunk/src/main/groovy/
    httpcomponents/httpclient-android/trunk/src/main/groovy/HC.groovy
    httpcomponents/httpclient-android/trunk/src/main/groovy/Svn.groovy
      - copied, changed from r1546111, httpcomponents/httpclient-android/trunk/buildSrc/src/main/groovy/Svn.groovy
Removed:
    httpcomponents/httpclient-android/trunk/buildSrc/build.gradle
    httpcomponents/httpclient-android/trunk/buildSrc/src/main/groovy/Svn.groovy

Added: httpcomponents/httpclient-android/trunk/build.gradle
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/trunk/build.gradle?rev=1546641&view=auto
==============================================================================
--- httpcomponents/httpclient-android/trunk/build.gradle (added)
+++ httpcomponents/httpclient-android/trunk/build.gradle Fri Nov 29 20:49:21 2013
@@ -0,0 +1,19 @@
+apply plugin: 'groovy'
+
+repositories {
+    mavenCentral()
+}
+
+version = '0.1-SNAPSHOT'
+
+sourceCompatibility = '1.6'
+
+dependencies {
+    compile 'org.codehaus.groovy:groovy:2.2.0'
+    compile 'org.tmatesoft.svnkit:svnkit:1.7.8'
+    compile 'org.tmatesoft.svnkit:svnkit-cli:1.7.8'
+    compile 'org.reflections:reflections:0.9.9-RC1'
+    runtime 'javax.servlet:servlet-api:2.5'
+    runtime 'org.slf4j:slf4j-nop:1.7.5'
+}
+

Added: httpcomponents/httpclient-android/trunk/src/main/groovy/HC.groovy
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/trunk/src/main/groovy/HC.groovy?rev=1546641&view=auto
==============================================================================
--- httpcomponents/httpclient-android/trunk/src/main/groovy/HC.groovy (added)
+++ httpcomponents/httpclient-android/trunk/src/main/groovy/HC.groovy Fri Nov 29 20:49:21 2013
@@ -0,0 +1,72 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+import org.tmatesoft.svn.core.io.ISVNEditor
+import org.tmatesoft.svn.core.io.SVNRepository
+
+class HC {
+
+    static void createAndroidBranch(String coreVersion, String clientVersion) {
+        SVNRepository hcRepo = Svn.getRepository(new URI('https://svn.apache.org/repos/asf/httpcomponents/'))
+
+        try {
+            ISVNEditor commitEditor = hcRepo.getCommitEditor(
+                    "Creating Android port branch based on HttpCore ${coreVersion} and HttpClient ${clientVersion}", null)
+            commitEditor.openRoot(-1)
+            commitEditor.openDir(
+                    'httpclient-android/branches', -1)
+            commitEditor.addDir(
+                    'httpclient-android/branches/test-branch/src/main', null, -1)
+            commitEditor.addDir(
+                    "httpclient-android/branches/test-branch/src/main/java",
+                    "httpcore/tags/${coreVersion}/httpcore/src/main/java/", -1)
+
+            List<String> modules = [
+                    'auth', 'impl/auth',
+                    'cookie', 'impl/cookie',
+                    'conn', 'impl/conn',
+                    'client', 'impl/execchain', 'impl/client']
+            modules.each { String module ->
+                commitEditor.addDir(
+                        "httpclient-android/branches/test-branch/src/main/java/org/apache/http/${module}",
+                        "httpclient/tags/${clientVersion}/httpclient/src/main/java/org/apache/http/${module}", -1)
+                commitEditor.closeDir()
+            }
+            commitEditor.closeDir()
+            commitEditor.closeDir()
+            commitEditor.closeDir()
+            commitEditor.closeEdit()
+
+        } finally {
+            hcRepo.closeSession()
+        }
+    }
+
+    static void main(String[] args) {
+        createAndroidBranch('4.3', '4.3.1')
+    }
+
+}

Copied: httpcomponents/httpclient-android/trunk/src/main/groovy/Svn.groovy (from r1546111, httpcomponents/httpclient-android/trunk/buildSrc/src/main/groovy/Svn.groovy)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/trunk/src/main/groovy/Svn.groovy?p2=httpcomponents/httpclient-android/trunk/src/main/groovy/Svn.groovy&p1=httpcomponents/httpclient-android/trunk/buildSrc/src/main/groovy/Svn.groovy&r1=1546111&r2=1546641&rev=1546641&view=diff
==============================================================================
--- httpcomponents/httpclient-android/trunk/buildSrc/src/main/groovy/Svn.groovy (original)
+++ httpcomponents/httpclient-android/trunk/src/main/groovy/Svn.groovy Fri Nov 29 20:49:21 2013
@@ -36,6 +36,8 @@ import org.tmatesoft.svn.core.SVNURL
 import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager
 import org.tmatesoft.svn.core.internal.wc17.SVNWCContext
 import org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec
+import org.tmatesoft.svn.core.io.SVNRepository
+import org.tmatesoft.svn.core.io.SVNRepositoryFactory
 import org.tmatesoft.svn.core.wc.SVNRevision
 import org.tmatesoft.svn.core.wc.SVNWCUtil
 import org.tmatesoft.svn.core.wc2.ISvnObjectReceiver
@@ -67,6 +69,15 @@ class Svn {
         opfactory
     }
 
+    static SVNRepository getRepository(URI src) {
+        SVNURL url = SVNURL.parseURIEncoded(src.toASCIIString())
+        SVNRepository repo = SVNRepositoryFactory.create(url)
+        ISVNAuthenticationManager authmanager = SVNWCUtil.createDefaultAuthenticationManager()
+        authmanager.setAuthenticationProvider(new SVNConsoleAuthenticationProvider(false))
+        repo.setAuthenticationManager(authmanager)
+        repo
+    }
+
     static void checkout(URI src, File dst) {
         SVNCommandEnvironment env = getSVNCommandEnvironment()
         SvnOperationFactory opfactory = createOperationFactory(env)