ruijun
ruijun
ruijun @ Snip2Code
2 Snippets
Published
1 Channel
Created
0 Channels
Following
3 points
Reputation
Junior Code Generator
Junior Popular Coder
Junior Autobiographer
Senior Autobiographer
Junior Famous Coder
Junior Wise Coder

Recent Snippets See all snippets by ruijun

public by ruijun  2460  1  4  0

copy proguard mapping.txt to save it

copy proguard mapping.txt to save it: copy-mapping
android {
applicationVariants.all { variant ->
        variant.outputs.each { output ->
            if (variant.getBuildType().isMinifyEnabled()) {
                variant.assemble.doLast{
                        copy {
                            from variant.mappingFile
                            into "${projectDir}/mappings"
                            rename { String fileName ->
                                "mapping-${variant.name}.txt"
                            }
                        }
                }
            }
        }
        ......
    }
}

;

public by Derek Pauley  381646  18  3  1

SVNKit export from Subversion example

SVNKit export from Subversion example: SvnExportExample.java
import java.io.File;

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.io.SVNRepository;
import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
import org.tmatesoft.svn.core.wc.SVNClientManager;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNUpdateClient;
import org.tmatesoft.svn.core.wc.SVNWCUtil;


public class SvnExportExample {

	public static void main(String... args){
		final String url = "svn://cavcops01.global.local/skunkworks";
		final String destPath = "c:/temp/svntest";
		
		SVNRepository repository = null;
		
		try{
			//initiate the reporitory from the url
			repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url));
			//create authentication data
			ISVNAuthenticationManager authManager = 
					SVNWCUtil.createDefaultAuthenticationManager("cliff.darling", "svnuser");
			repository.setAuthenticationManager(authManager);
			//output some data to verify connection
			System.out.println( "Repository Root: " + repository.getRepositoryRoot( true ) );
			System.out.println(  "Repository UUID: " + repository.getRepositoryUUID( true ) );
			//need to identify latest revision
			long latestRevision = repository.getLatestRevision();
			System.out.println(  "Repository Latest Revision: " + latestRevision);
			
			//create client manager and set authentication
			SVNClientManager ourClientManager = SVNClientManager.newInstance();
			ourClientManager.setAuthenticationManager(authManager);
			//use SVNUpdateClient to do the export
			SVNUpdateClient updateClient = ourClientManager.getUpdateClient( );
			updateClient.setIgnoreExternals( false );
			updateClient.doExport( repository.getLocation(), new File(destPath), 
					SVNRevision.create(latestRevision), SVNRevision.create(latestRevision), 
					null, true, SVNDepth.INFINITY);
			
		} catch (SVNException e) {
			e.printStackTrace();
		}finally {
			System.out.println("Done");
		}
	}
}


;