此处的各种帖子都显示了从tmatesoft导入svnkit,如下所示,这在CLI中运行良好,但是在Android Studio中同步和运行时都会在 import org.tmatesoft.svn.cli.SVN;
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath group: 'org.tmatesoft.svnkit', name: 'svnkit', version: '1.7.11'
}
}
import org.tmatesoft.svn.cli.SVN;
project.ext.SVN = SVN;
def _disableSystemExitCall = {
System.setSecurityManager(
new SecurityManager() {
@Override public void checkPermission(java.security.Permission perm) {}
@Override public void checkExit(int status) { throw new SecurityException(); }
}
);
};
def _enableSystemExitCall = { System.setSecurityManager(null); };
/* for certain scenarios might be useful to share these closures with build */
project.ext.disableSystemExitCall = _disableSystemExitCall;
project.ext.enableSystemExitCall = _enableSystemExitCall;
project.ext.doSvnMain = { String... aSvnArgs ->
_disableSystemExitCall(); /* stop SVN.main from doing a System.exit call */
try {
SVN.main( aSvnArgs as String[] );
} finally {
_enableSystemExitCall();
}
} ;
task AAAA << {
doSvnMain( 'info', "mySVNUrl" );
}
使用Gradle-distributionUrl = https://services.gradle.org/distributions/gradle-2.2.1-all.zip Android Studio-1.0.2
根据此搜索,org.tmatesoft.svn.cli.SVN
任何org.tmatesoft.svnkit
org包中都没有类。
svnkit-cli
一个旧的组织org.tmate
曾经很久以前就拥有它,但是新版本和新组织却没有。
另外,您使用的工件ID是错误的,应该是svnkit-cli
。总而言之,这就是依赖项声明:
compile 'org.tmatesoft.svnkit:svnkit-cli:1.8.7' //newer version that the one you looked for.
您需要的类是:
org.tmatesoft.svn.cli.svn.SVNCheckoutCommand
org.tmatesoft.svn.cli.svn.SVNCommandEnvironment
org.tmatesoft.svn.cli.svn.SVNDeleteCommand
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句