Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19859

Use dependency version from platform outside the dependencies clause

$
0
0

so sorry, I somehow missed your reply.

my platform project is not a subproject, so I’m getting this error if I try to use your syntax (assuming my project is called P, my group called X and my artifact called Y):

Project with path ‘X:Y:1.0.+’ could not be found in project ‘:P’.

this is the way I consume my platform right now:

dependencies {
    implementation platform ('X:Y:1.0.+')
}

so I tried to remove the project from the call, like this:

configurations.all {
  if (it.name.startsWith('protobufToolsLocator')) {
    it.dependencies.add(project.dependencies.create(platform('X:Y:1.0.+')))
  }
}

but I’m getting this error message:

Could not find method platform() for arguments [X:Y:1.0.+] on configuration ‘:P:protobufToolsLocator_protoc’ of type org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.


Viewing all articles
Browse latest Browse all 19859

Trending Articles