uploadArchives task in cpp project publishes nothing


(Steven Emmerson) #1

The ‘uploadArchives’ task of my ‘cpp’ project doesn’t publish anything. Here’s the build-file:

apply plugin: ‘cpp’

version = ‘2.1.25’

sources {

lib {

c {

source {

srcDirs = [“src/lib”]

include “*.c”

exclude “scanner.c”, “test*.c”

}

exportedHeaders {

srcDirs = [“src/lib”]

include “udunits.h”

include “udunits2.h”

include “converter.h”

}

}

}

exe {

c {

source {

srcDirs = [“src/prog”]

include “*.c”

}

}

}

}

libraries {

udunits2 {

source sources.lib

binaries.all {

compilerArgs “-DDEFAULT_UDUNITS2_XML_PATH=”${projectDir}" +

‘/share/udunits/udunits2.xml"’

}

}

}

executables {

udunits2 {

source sources.exe

binaries.all {

lib libraries.udunits2.shared

compilerArgs “-I” + projectDir.toString() + “/src/lib”

linkerArgs “-lexpat”

}

}

}

apply plugin: ‘maven’

uploadArchives {

repositories {

mavenDeployer {

repository(url: uri("${buildDir}/repo"))

}

}

}

task wrapper(type: Wrapper) {

gradleVersion = “1.9-20130903235553+0000”

}

And here’s the output:

~/udunits2: ./gradlew --no-daemon --info --build-file problem.gradle uploadArchives

Starting Build

Settings evaluated using empty settings script.

Projects loaded. Root project using build file ‘/home/steve/udunits2/problem.gradle’.

Included projects: [root project ‘udunits2’]

Evaluating root project ‘udunits2’ using build file ‘/home/steve/udunits2/problem.gradle’.

Starting process ‘command ‘/usr/bin/g++’’. Working directory: /usr/bin Command: /usr/bin/g++ -v

An attempt to initialize for well behaving parent process finished.

Successfully started process ‘command ‘/usr/bin/g++’’

Process ‘command ‘/usr/bin/g++’’ finished with exit value 0 (state: SUCCEEDED)

Found C++ compiler with version 4.5.1

All projects evaluated.

Selected primary task ‘uploadArchives’

Tasks to be executed: [task ‘:uploadArchives’]

:uploadArchives (Thread[main,5,main]) started.

:uploadArchives

Executing task ‘:uploadArchives’ (up-to-date check took 0.0 secs) due to:

Task has not declared any outputs.

Publishing configuration: configuration ‘:archives’

Publishing to repository ‘mavenDeployer’

[ant:null] Error reading settings file ‘/tmp/gradle_empty_settings6251621177122270207.xml’ - ignoring. Error was:

/tmp/gradle_empty_settings6251621177122270207.xml (No such file or directory)

:uploadArchives (Thread[main,5,main]) completed. Took 0.77 secs.

BUILD SUCCESSFUL

Total time: 6.098 secs

~/udunits2: ls build/repo

ls: cannot access build/repo: No such file or directory

I assume I’m doing something stupid, but what is it?


(Peter Niederwieser) #2

I think you’ll need at least an ‘archives’ block, telling it which artifacts to publish (see upload chapter in Gradle User Guide).


(Steven Emmerson) #3

I thought the “cpp” plugin automatically configured the artifacts to be published (see http://www.gradle.org/docs/current/userguide/userguide_single.html#cppPublish). I’ll try your suggestion, however.


#4

Automatic artifact configuration is only done by the conventional ‘cpp-lib’ and ‘cpp-exe’ plugins.