hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1546111 - in /httpcomponents/httpclient-android/trunk: .gitignore README.txt buildSrc/ buildSrc/build.gradle buildSrc/src/ buildSrc/src/main/ buildSrc/src/main/groovy/ buildSrc/src/main/groovy/Svn.groovy
Date Wed, 27 Nov 2013 17:01:21 GMT
Author: olegk
Date: Wed Nov 27 17:01:20 2013
New Revision: 1546111

URL: http://svn.apache.org/r1546111
Log:
Initial project structure

Added:
    httpcomponents/httpclient-android/trunk/.gitignore
    httpcomponents/httpclient-android/trunk/README.txt   (with props)
    httpcomponents/httpclient-android/trunk/buildSrc/
    httpcomponents/httpclient-android/trunk/buildSrc/build.gradle
    httpcomponents/httpclient-android/trunk/buildSrc/src/
    httpcomponents/httpclient-android/trunk/buildSrc/src/main/
    httpcomponents/httpclient-android/trunk/buildSrc/src/main/groovy/
    httpcomponents/httpclient-android/trunk/buildSrc/src/main/groovy/Svn.groovy

Added: httpcomponents/httpclient-android/trunk/.gitignore
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/trunk/.gitignore?rev=1546111&view=auto
==============================================================================
--- httpcomponents/httpclient-android/trunk/.gitignore (added)
+++ httpcomponents/httpclient-android/trunk/.gitignore Wed Nov 27 17:01:20 2013
@@ -0,0 +1,6 @@
+target
+build
+.gradle
+.idea
+*.iml
+out

Added: httpcomponents/httpclient-android/trunk/README.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/trunk/README.txt?rev=1546111&view=auto
==============================================================================
--- httpcomponents/httpclient-android/trunk/README.txt (added)
+++ httpcomponents/httpclient-android/trunk/README.txt Wed Nov 27 17:01:20 2013
@@ -0,0 +1,3 @@
+This project represents an effort to provide an implementation of Apache HttpClient, 
+which can be deployed on Google Android in parallel to the outdated version shipped with
platform  
+while remaining (almost fully) API compatible with Apache HttpClient 4.3.  

Propchange: httpcomponents/httpclient-android/trunk/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient-android/trunk/README.txt
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient-android/trunk/README.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: httpcomponents/httpclient-android/trunk/buildSrc/build.gradle
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/trunk/buildSrc/build.gradle?rev=1546111&view=auto
==============================================================================
--- httpcomponents/httpclient-android/trunk/buildSrc/build.gradle (added)
+++ httpcomponents/httpclient-android/trunk/buildSrc/build.gradle Wed Nov 27 17:01:20 2013
@@ -0,0 +1,39 @@
+/*
+ * ====================================================================
+ * 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/>.
+ *
+ */
+
+apply plugin: 'groovy'
+
+repositories {
+    mavenCentral()
+}
+
+dependencies {
+    compile gradleApi()
+    compile group: 'org.codehaus.groovy', name: 'groovy', version: '2.1.6'
+    compile group: 'org.tmatesoft.svnkit', name: 'svnkit', version: '1.7+'
+    compile group: 'org.tmatesoft.svnkit', name: 'svnkit-cli', version: '1.7+'
+}

Added: httpcomponents/httpclient-android/trunk/buildSrc/src/main/groovy/Svn.groovy
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/trunk/buildSrc/src/main/groovy/Svn.groovy?rev=1546111&view=auto
==============================================================================
--- httpcomponents/httpclient-android/trunk/buildSrc/src/main/groovy/Svn.groovy (added)
+++ httpcomponents/httpclient-android/trunk/buildSrc/src/main/groovy/Svn.groovy Wed Nov 27
17:01:20 2013
@@ -0,0 +1,221 @@
+/*
+ * ====================================================================
+ * 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.cli.SVNConsoleAuthenticationProvider
+import org.tmatesoft.svn.cli.svn.SVNCommandEnvironment
+import org.tmatesoft.svn.cli.svn.SVNNotifyPrinter
+import org.tmatesoft.svn.cli.svn.SVNStatusPrinter
+import org.tmatesoft.svn.core.SVNCommitInfo
+import org.tmatesoft.svn.core.SVNDepth
+import org.tmatesoft.svn.core.SVNException
+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.wc.SVNRevision
+import org.tmatesoft.svn.core.wc.SVNWCUtil
+import org.tmatesoft.svn.core.wc2.ISvnObjectReceiver
+import org.tmatesoft.svn.core.wc2.SvnCheckout
+import org.tmatesoft.svn.core.wc2.SvnCommit
+import org.tmatesoft.svn.core.wc2.SvnCopySource
+import org.tmatesoft.svn.core.wc2.SvnGetStatus
+import org.tmatesoft.svn.core.wc2.SvnOperationFactory
+import org.tmatesoft.svn.core.wc2.SvnRemoteCopy
+import org.tmatesoft.svn.core.wc2.SvnRemoteDelete
+import org.tmatesoft.svn.core.wc2.SvnRevert
+import org.tmatesoft.svn.core.wc2.SvnScheduleForAddition
+import org.tmatesoft.svn.core.wc2.SvnStatus
+import org.tmatesoft.svn.core.wc2.SvnTarget
+import org.tmatesoft.svn.core.wc2.SvnUpdate
+
+class Svn {
+
+    private static SVNCommandEnvironment getSVNCommandEnvironment() {
+        new SVNCommandEnvironment("SVN", System.out, System.err, System.in);
+    }
+
+    private static SvnOperationFactory createOperationFactory(SVNCommandEnvironment env)
{
+        SvnOperationFactory opfactory = new SvnOperationFactory()
+        ISVNAuthenticationManager authmanager = SVNWCUtil.createDefaultAuthenticationManager()
+        authmanager.setAuthenticationProvider(new SVNConsoleAuthenticationProvider(false))
+        opfactory.setAuthenticationManager(authmanager)
+        opfactory.setEventHandler(new SVNNotifyPrinter(env))
+        opfactory
+    }
+
+    static void checkout(URI src, File dst) {
+        SVNCommandEnvironment env = getSVNCommandEnvironment()
+        SvnOperationFactory opfactory = createOperationFactory(env)
+        try {
+            SvnCheckout checkoutOp = opfactory.createCheckout()
+            checkoutOp.setSource(SvnTarget.fromURL(SVNURL.parseURIEncoded(src.toASCIIString())))
+            checkoutOp.setSingleTarget(SvnTarget.fromFile(dst))
+            checkoutOp.run()
+        } finally {
+            opfactory.dispose()
+        }
+    }
+
+    static void update(File dir) {
+        SVNCommandEnvironment env = getSVNCommandEnvironment()
+        SvnOperationFactory opfactory = createOperationFactory(env)
+        try {
+            SvnUpdate updateOp = opfactory.createUpdate()
+            updateOp.setSingleTarget(SvnTarget.fromFile(dir))
+            updateOp.run()
+        } finally {
+            opfactory.dispose()
+        }
+    }
+
+    static void status(File dir) {
+        SVNCommandEnvironment env = getSVNCommandEnvironment()
+        SvnOperationFactory opfactory = createOperationFactory(env)
+        try {
+            SVNStatusPrinter statusPrinter = new SVNStatusPrinter(env)
+            SVNWCContext context = opfactory.getWcContext();
+            SvnGetStatus statusOp = opfactory.createGetStatus()
+            statusOp.setSingleTarget(SvnTarget.fromFile(dir))
+            statusOp.setReportAll(false)
+            statusOp.setReceiver(new ISvnObjectReceiver<SvnStatus>() {
+
+                @Override
+                void receive(SvnTarget target, SvnStatus object) throws SVNException {
+                    String root = dir.getAbsoluteFile();
+                    String f = target.getFile().getAbsolutePath()
+                    if (f.startsWith(root)) {
+                        f = f.substring(root.length())
+                        if (f.startsWith('/')) {
+                            f = f.substring(1, f.length() - 1)
+                        }
+                    }
+                    statusPrinter.printStatus(f,
+                            SvnCodec.status(context, object), false, true, true, false)
+                }
+
+            })
+            statusOp.run()
+        } finally {
+            opfactory.dispose()
+        }
+    }
+
+    static void revert(File dir) {
+        SVNCommandEnvironment env = getSVNCommandEnvironment()
+        SvnOperationFactory opfactory = createOperationFactory(env)
+        try {
+            SvnRevert revertOp = opfactory.createRevert()
+            revertOp.setSingleTarget(SvnTarget.fromFile(dir))
+            revertOp.setDepth(SVNDepth.INFINITY)
+            revertOp.setPreserveModifiedCopies(false)
+            revertOp.setRevertMissingDirectories(true)
+            revertOp.run()
+        } finally {
+            opfactory.dispose()
+        }
+    }
+
+    static void scheduleForAddition(File dir) {
+        SVNCommandEnvironment env = getSVNCommandEnvironment()
+        SvnOperationFactory opfactory = createOperationFactory(env)
+        try {
+            SvnScheduleForAddition schedulingOp = opfactory.createScheduleForAddition()
+            schedulingOp.setSingleTarget(SvnTarget.fromFile(dir))
+            schedulingOp.setDepth(SVNDepth.INFINITY)
+            schedulingOp.setForce(true)
+            schedulingOp.setIncludeIgnored(false)
+            schedulingOp.run()
+        } finally {
+            opfactory.dispose()
+        }
+    }
+
+    static long commit(File dir, String message) {
+        SVNCommandEnvironment env = getSVNCommandEnvironment()
+        SvnOperationFactory opfactory = createOperationFactory(env)
+        try {
+            SvnCommit commitOp = opfactory.createCommit()
+            commitOp.setSingleTarget(SvnTarget.fromFile(dir))
+            commitOp.setDepth(SVNDepth.INFINITY)
+            commitOp.setCommitMessage(message)
+            SVNCommitInfo result = commitOp.run()
+            result.newRevision
+        } finally {
+            opfactory.dispose()
+        }
+    }
+
+    static long copyLocal(File dir, URI dst, String message) {
+        SVNCommandEnvironment env = getSVNCommandEnvironment()
+        SvnOperationFactory opfactory = createOperationFactory(env)
+        try {
+            SvnRemoteCopy copyOp = opfactory.createRemoteCopy()
+            copyOp.addCopySource(
+                    SvnCopySource.create(SvnTarget.fromFile(dir), SVNRevision.WORKING))
+            copyOp.setSingleTarget(SvnTarget.fromURL(SVNURL.parseURIEncoded(dst.toASCIIString())))
+            copyOp.setFailWhenDstExists(true)
+            copyOp.setDisableLocalModifications(false)
+            copyOp.setCommitMessage(message)
+            SVNCommitInfo result = copyOp.run()
+            result.newRevision
+        } finally {
+            opfactory.dispose()
+        }
+    }
+
+    static long copyRemote(URI src, URI dst, String message) {
+        SVNCommandEnvironment env = getSVNCommandEnvironment()
+        SvnOperationFactory opfactory = createOperationFactory(env)
+        try {
+            SvnRemoteCopy copyOp = opfactory.createRemoteCopy()
+            copyOp.addCopySource(
+                    SvnCopySource.create(SvnTarget.fromURL(
+                            SVNURL.parseURIEncoded(src.toASCIIString())), SVNRevision.HEAD))
+            copyOp.setSingleTarget(SvnTarget.fromURL(SVNURL.parseURIEncoded(dst.toASCIIString())))
+            copyOp.setFailWhenDstExists(true)
+            copyOp.setCommitMessage(message)
+            SVNCommitInfo result = copyOp.run()
+            result.newRevision
+        } finally {
+            opfactory.dispose()
+        }
+    }
+
+    static void deleteRemote(URI src, String message) {
+        SVNCommandEnvironment env = getSVNCommandEnvironment()
+        SvnOperationFactory opfactory = createOperationFactory(env)
+        try {
+            SvnRemoteDelete deleteOp = opfactory.createRemoteDelete()
+            deleteOp.setSingleTarget(SvnTarget.fromURL(SVNURL.parseURIEncoded(src.toASCIIString())))
+            deleteOp.setCommitMessage(message)
+            deleteOp.run()
+        } finally {
+            opfactory.dispose()
+        }
+    }
+
+}



Mime
View raw message