Questions tagged [buildsrc]
21 questions
26
votes
3 answers
'buildSrc' cannot be used as a project name as it is a reserved name
After I upgrade my gradle gradle-5.4.1 to gradle-6.3, I got an error like 'buildSrc' cannot be used as a project name as it is a reserved name. I'm using buidleSrc for Gradle Dependency Management(link). I dont know how to solve this issue please…

Magesh Pandian
- 8,789
- 12
- 45
- 60
5
votes
1 answer
Use Kotlin plugins from buildSrc
How can I apply the Kotlin plugins from a buildSrc plugin?
I have a Kotlin project with a build.gradle.kts file containing this:
plugins {
application
kotlin("jvm")
kotlin("plugin.serialization")
}
I want to create a custom plugin in…

Jordi
- 2,055
- 1
- 16
- 34
4
votes
2 answers
buildSrc: Could not get unknown property for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler
I am trying to reorganize this Android (Java based) library to use the buildSrc folder to define all versions and dependencies as described in this article.
I already set this successfully up for several times for Kotlin bases projects. This time…

JJD
- 50,076
- 60
- 203
- 339
2
votes
0 answers
Switch Maven repository 'cache(http://cache)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols
I'm using a buildSrc module in my Android library project, and a jitpack build at jitci.com fails with the error message shown below. However, locally, the project builds and runs on my phone fine, and a jitpack build of the latest project release…

Raj Narayanan
- 2,443
- 4
- 24
- 43
2
votes
1 answer
Diagnosing Gradle upgrades and buildSrc errors
I currently have an issue where, after trying to switch from Gradle 6.9.3 to 7.3.3, my :buildSrc:compileGroovy target fails with a NoClassDefFoundError on LoggingManagerInternal, which was a class removed in Gradle 7. The stack trace does not have…

Kelvin Chung
- 1,327
- 1
- 11
- 23
1
vote
1 answer
Getting kotlin dependency issue in buildSrc when used with Firestore
I am using kotlin 1.7.20 as below
classpath ("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20")
When I acess below firebase code from a normal build.gradle, it gets compiled. But when used from inside of buildSrc, I get error as kotlin 1.5.1…

virat
- 43
- 3
1
vote
2 answers
How to apply Kotlin JVM gradle plugin from a buildSrc (shared) gradle script?
I'm trying to apply a plugin from a shared gradle script.
in my shared gradle script I have the following code:
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
…

caeus
- 3,084
- 1
- 22
- 36
1
vote
1 answer
How to pass @Input String in a task in buildSrc
This custom plugin exists in gradle's buildSrc/:
abstract class MyTask : DefaultTask() {
@get:Input
abstract val buildDir: Property
@TaskAction
fun someTask() {
// do stuff
}
}
class DevelopmentPlugin :…

Diolor
- 13,181
- 30
- 111
- 179
1
vote
0 answers
1
vote
1 answer
Unresolved reference JavaVersion in gradle buildSrc IntelliJ
I am facing a problem with two existing gradle projects that worked fine a couple of months ago but that show now an annoying error in the buildSrc folder, where I use the org.gradle.api.JavaVersion constant.
The project compiles correctly and is…

Simon
- 148
- 3
- 13
1
vote
0 answers
Android Studio - Test Business Logic in buildSrc (Gradle Kotlin DSL)
In my app, I 'd like to test the business logic I put in the buildSrc Code.
The construction of my app is like that :
+ root
+app
+ src
+ main
+ kotlin
+ res
+ test
+ kotlin
+ buildSrc
+ src
+…

Hervé Darritchon
- 431
- 3
- 15
0
votes
0 answers
Import registered task from BuildSrc to build.gradle.kts
I have achieved to migrate my gradle task performing RPM packages from as a custom script inside the buildSrc directory.
The file is located in : buildSrc/main/kotlin/rpm.gradle.kts
import com.netflix.gradle.plugins.rpm.Rpm
buildscript {
…

JPV
- 1,079
- 1
- 18
- 44
0
votes
0 answers
Custom scripts in kotlin dsl
I am trying to break my big build.gradle.kts file and use
apply(from=script1.gradle.kts)
apply(from=rpm.gradle.kts)
My rpm-gradle.kts looks like
import com.netflix.gradle.plugins.rpm.Rpm
val buildRpmTask2 by tasks.registering(Rpm::class) {
os =…

JPV
- 1,079
- 1
- 18
- 44
0
votes
1 answer
How to use java plugin with buildSrc code
I'm trying to move the "make fat (aka. uber) jar" code I use from my root build.gradle.kts
file into a file in the buildSrc directory. To that end I created a file buildSrc/src/main/kotlin/executableJar.kt:
import org.gradle.api.Project
import…

CodeClown42
- 11,194
- 1
- 32
- 67
0
votes
0 answers
buildSrc cannot find custom gradle plugin in mavenLocal
project structure
my-project
﹂ buildSrc
﹂ build.settings.kts
﹂ plugin
﹂ src
﹂ main
﹂ com
﹂ example
﹂ GreetingPlugin.kt
﹂ build.settings.kts
﹂ playground
﹂ build.settings.kts
settings.gradle.kts
I created a…

Arst
- 3,098
- 1
- 35
- 42