How to upload to remote flat directory?


(Jamie Olson) #1

I have a non-java project for which I need to upload an artifact to a flat directory on an ftp server. I’ve tried variations on the following without success: ‘’’

1 configurations {

2

cran

3 }

4

repositories {

flatDir {

name “CRAN”

dirs “ftp://localhost/srv/ftp

} }

artifacts {

archives file: project.file("${project.buildDir}/${project.rpackage.name}_${project.version}.tar.gz") }

task uploadArchives{

repositories {

add project.repositories.CRAN

} } ‘’’

Is it not possible to use flatDir repositories with a url?

Also, I was unable to directly create an Upload task and explicitly state the artifacts, e.g. ‘’’ artifacts {

cran file: project.file("${project.buildDir}/${project.rpackage.name}_${project.version}.tar.gz") }

task uploadArchives{

artifacts = project.artifacts.cran

repositories {

add project.repositories.CRAN

} } ‘’’

I something like that allowed?


(Peter Niederwieser) #2

Out of the box, Gradle can upload to Maven and Ivy repositories. One option is to use the Ant ‘ftp’ task instead.

PS: Please use HTML code tags for all code snippets.


(Jamie Olson) #3

Thanks. Sorry, I keep on forgetting this forum doens’t do markdown code blocks.