Hey guys, how can I access / set `archivesBaseName...
# gradle
l
Hey guys, how can I access / set
archivesBaseName
? I saw some scripts using
base { archivesBaseName = ".." }
but can’t get that work.. always get the following compile error - even though it get’s recognized and resolved in the editor in IntelliJ
Copy code
Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public val PluginDependenciesSpec.base: PluginDependencySpec defined in org.gradle.kotlin.dsl
c
For me it works, can you show your build file and state the gradle version you use?
l
Gradle 4.4 The following build-script
Copy code
plugins {
    base
}

base {}
results in this exception (in addition to the one I posted above)
Copy code
Expression 'base' cannot be invoked as a function. The function 'invoke()' is not found
It’s part of a multi-project build, and in an included / applied script - if that makes a difference?
e
The issue here must be that it is an applied script. The
plugins {}
block is supported in project scripts only. It means you can’t use the static accessors in this case and must rely on explicit configuration by type:
Copy code
configure<BasePluginConvention> {
    archivesBaseName = ""
}
l
Ah okay, thank you very much 🙂
418 Views