0

I am trying to learn Gradle and, I try to build this code but it wasn't working. can someone tell me where is it failing?

import org.tmatesoft.svn.core.wc2.*
import org.tmatesoft.svn.core.wc.*
import org.tmatesoft.svn.core.*

allprojects {
    repositories {
        jcenter { url "http://jcenter.bintray.com"}
        mavenCentral()
    }
    dependencies {
        classpath group: 'org.tmatesoft.svnkit', name: 'svnkit', version: '1.7.11'
    }
}

task svnCommitFile(){
    description = "Commits a single file to an SVN repository"
    doLast{
        if (!project.hasProperty("commitMsg")){
          ext.commitMsg = "None"
        }
        SvnOperationFactory svnOperationFactory = new SvnOperationFactory()
        def authentication = SVNWCUtil.createDefaultAuthenticationManager(svnUser, svnPassword)
        svnOperationFactory.setAuthenticationManager(authentication)
        try {
            SvnCommit commit = svnOperationFactory.createCommit()
            commit.setSingleTarget(SvnTarget.fromFile(new File(fileToCommit)))
            commit.setCommitMessage(commitMsg)
            SVNCommitInfo commitInfo = commit.run()
            println "Commit info: " + commitInfo
            println "Commit message: " + commitMsg
        } finally{
            svnOperationFactory.dispose()
        }
    }
}
bahrep
  • 29,961
  • 12
  • 103
  • 150
saif
  • 21
  • 3
  • 2
    What is not warning? Be more precise.. – Opal Sep 22 '17 at 07:07
  • 1
    be specific with your error..! so others can help you. – Rucha Bhatt Joshi Sep 22 '17 at 07:18
  • Running commit tasks with gradle seems a bit weird since that usually remains the users decicions. Anyway a file needs to be added first before it can be committed. Check this doc: https://wiki.svnkit.com/Committing_To_A_Repository – real_paul Sep 22 '17 at 07:25

0 Answers0