diff --git a/build.gradle b/build.gradle index cceff83..8fbfd67 100644 --- a/build.gradle +++ b/build.gradle @@ -37,7 +37,6 @@ dependencies { implementation 'com.perforce:p4java:2015.2.1365273' implementation 'com.netflix.nebula:nebula-gradle-interop:latest.release' implementation 'com.netflix.nebula:gradle-contacts-plugin:latest.release' - implementation 'org.tmatesoft.svnkit:svnkit:1.8.12' implementation 'net.java.dev.jna:jna-platform:5.7.0' testImplementation 'com.github.stefanbirkner:system-rules:1.19.0' testImplementation ('org.ajoberstar.grgit:grgit-core:4.1.1') { diff --git a/gradle.lockfile b/gradle.lockfile index 2e46538..3a1e590 100644 --- a/gradle.lockfile +++ b/gradle.lockfile @@ -4,27 +4,16 @@ cglib:cglib-nodep:3.2.2=integTestRuntimeClasspath,testRuntimeClasspath com.github.stefanbirkner:system-rules:1.19.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.googlecode.javaewah:JavaEWAH:1.1.12=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.jcraft:jsch.agentproxy.connector-factory:0.0.7=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.jcraft:jsch.agentproxy.core:0.0.7=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.jcraft:jsch.agentproxy.pageant:0.0.7=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.jcraft:jsch.agentproxy.sshagent:0.0.7=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.jcraft:jsch.agentproxy.svnkit-trilead-ssh2:0.0.7=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.jcraft:jsch.agentproxy.usocket-jna:0.0.7=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.jcraft:jsch.agentproxy.usocket-nc:0.0.7=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.jcraft:jzlib:1.1.2=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.netflix.nebula:gradle-contacts-plugin:7.0.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.netflix.nebula:gradle-contacts-plugin:7.0.1=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.netflix.nebula:nebula-gradle-interop:2.1.1=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.netflix.nebula:nebula-test:10.5.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.perforce:p4java:2015.2.1365273=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.trilead:trilead-ssh2:1.0.0-build220=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -de.regnis.q.sequence:sequence-library:1.0.3=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit-dep:4.11=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.7.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.7.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.java.dev.jna:platform:3.4.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ajoberstar.grgit:grgit-core:4.1.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.antlr:antlr-runtime:3.4=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.apiguardian:apiguardian-api:1.1.2=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy:3.0.12=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -42,6 +31,4 @@ org.opentest4j:opentest4j:1.2.0=integTestCompileClasspath,integTestRuntimeClassp org.slf4j:slf4j-api:1.7.30=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.3-groovy-3.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.spockframework:spock-junit4:2.3-groovy-3.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.tmatesoft.sqljet:sqljet:1.1.10=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.tmatesoft.svnkit:svnkit:1.8.12=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath empty=annotationProcessor,integTestAnnotationProcessor,testAnnotationProcessor diff --git a/src/main/groovy/nebula/plugin/info/scm/ScmInfoPlugin.groovy b/src/main/groovy/nebula/plugin/info/scm/ScmInfoPlugin.groovy index 4750797..f99a71a 100644 --- a/src/main/groovy/nebula/plugin/info/scm/ScmInfoPlugin.groovy +++ b/src/main/groovy/nebula/plugin/info/scm/ScmInfoPlugin.groovy @@ -49,7 +49,7 @@ class ScmInfoPlugin implements Plugin, InfoCollectorPlugin { @Override void apply(Project project) { // TODO Delay findProvider() as long as possible - providers = [new GitScmProvider(providerFactory), new PerforceScmProvider(providerFactory), new SvnScmProvider(providerFactory), new UnknownScmProvider(providerFactory)] as List + providers = [new GitScmProvider(providerFactory), new PerforceScmProvider(providerFactory), new UnknownScmProvider(providerFactory)] as List selectedProvider = findProvider(project) ScmInfoExtension extension = project.extensions.create('scminfo', ScmInfoExtension) diff --git a/src/main/groovy/nebula/plugin/info/scm/SvnScmProvider.groovy b/src/main/groovy/nebula/plugin/info/scm/SvnScmProvider.groovy deleted file mode 100644 index 6446d75..0000000 --- a/src/main/groovy/nebula/plugin/info/scm/SvnScmProvider.groovy +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2014-2019 Netflix, Inc. - * - * Licensed 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. - */ - -package nebula.plugin.info.scm - -import org.gradle.api.Project -import org.gradle.api.provider.ProviderFactory -import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions -import org.tmatesoft.svn.core.wc.* - -class SvnScmProvider extends AbstractScmProvider { - - SvnScmProvider(ProviderFactory providerFactory) { - super(providerFactory) - } - - @Override - boolean supports(Project project) { - // TODO When we can make p4java optional, we'll add a classForName check here. - return findFile(project.projectDir, '.svn') != null - } - - private SVNWCClient getWorkingCopyClient() { - DefaultSVNOptions options = SVNWCUtil.createDefaultOptions(true); - SVNClientManager clientManager = SVNClientManager.newInstance(options); - return clientManager.getWCClient() - } - - private SVNInfo getInfo(File projectDir) { - return getWorkingCopyClient().doInfo(projectDir, SVNRevision.WORKING) - } - - @Override - String calculateModuleOrigin(File projectDir) { - return getInfo(projectDir).getURL().toString() - } - - @Override - String calculateModuleSource(File projectDir) { - File svnDir = getInfo(projectDir).getWorkingCopyRoot() - return projectDir.absolutePath - svnDir.parentFile.absolutePath - } - - @Override - String calculateChange(File projectDir) { - boolean isRevisionPresent = providerFactory.environmentVariable('SVN_REVISION').present - String revision - if (!isRevisionPresent) { - def base = getInfo(projectDir).getRevision() - if (!base) { - return null - } - revision = base.getNumber() - } else { - revision = providerFactory.environmentVariable('SVN_REVISION').get() - } - return revision - } - - @Override - def calculateFullChange(File projectDir) { - calculateChange(projectDir) - } - - @Override - String calculateBranch(File projectDir) { - return null // unsupported in svn - } -}