yjxf vf
10/17/2025, 2:48 PMincludeBuild('../A') {
dependencySubstitution {
substitute module('me.myname:a') using project(':')
}
}
gradle will awayls use jar task's outputDaren Burke
10/17/2025, 3:22 PMimplementation "com.my-company:my-project:my-version:spec"
I haven't been able to find a way to declare the ':spec' specific jar within the confines of the version catalog -- any ideas?Kanstantsin Shautsou
10/17/2025, 5:38 PMMaksym Moroz
10/17/2025, 6:00 PMcompileOnly (I think my idea was mainly leaving root module plugins { } as a single source of truth for putting plugins on classpath
This approach seemed to work just fine until I decided to lift gcp build cache plugin out of settings.gradle.kts
Now all of the sudden my android library convention plugin fails to resolve classes like com.android.lint
How do I make sense of this and what’s the solution?
My current intuition is that gcp build cache plugin being applied to settings was maybe putting com.android.library on classpath?
Also if I decide to use implementation configuration for convention plugin dependencies does it mean I will need drop root module plugins with apply false and instead have versionless plugins in my build files?Caleb Cushing
10/17/2025, 9:34 PMMaksym Moroz
10/20/2025, 8:21 AMfeature-something-api that is consumed by feature-something-impl
Does anyone have any relevant links?Tanish
10/21/2025, 5:39 AMKanstantsin Shautsou
10/21/2025, 10:28 AMMaksym Moroz
10/21/2025, 3:55 PMincludeBuild() to see changes without publishing. However going through the motion of removing version from version catalog and then putting it back seems like a bad way and there is probably a better one. If anyone knows of a better way please share your expertise, thanksColton Idle
10/23/2025, 12:27 AMDaniel Svensson
10/23/2025, 1:57 PMbuild job that compiles everything, and then a couple of downstream jobs that does some stuff with the built artifacts. The build job starts with restoring ~/.gradle/shared_cache/modules-2 and sets the GRADLE_RO_DEP_CACHE environment variable to this and saves that path to CI cache at the end after having rsync'd any delta. Downstream jobs restore that shared cache and maintains their own cache of ~/.gradle/caches/modules-2 with for example runtime dependencies that aren't available in the shared cache. While this works nice I noticed that it's still pretty slow and with --info I noticed what it looks like http lookups of manifests for the dependency verification feature. I was under the impression that this would be a no-op given that I have a warm cache with all my dependencies now, so I put that to the test and added --offline argument to the build and this made the build fail with checksum is missing from verification metadata . So how do I avoid dependency verification needing network access? If I search my local ~/.gradle directory for .asc files, the modules-2 directory is the only one that matches, so these should be available in the cache already. Is this a current limitation that GRADLE_RO_DEP_CACHE doesn't allow for resolving dependency verification signatures? I'm using a checked-in keyring, and have keyservers disabled in the verification-metadata.xml with the goal of not needing network access.Elias Faraclas
10/23/2025, 8:43 PMColton Idle
10/23/2025, 9:43 PMVlastimil Brecka
10/24/2025, 12:12 AMsubprojects {
tasks.register("foo") { … }
}
ELI5 why does this break configuration avoidance? It's using register which makes task instantiation lazy.. so what's the problem?
Docs basically just say its bad because it injects code not visible at project build file (sure), and it introduces comfiguration time coupling (not sure what does it mean)
How exactly am I tanking perf by this?Fanish
10/24/2025, 2:10 PMBen Bader
10/24/2025, 3:52 PMdef myExtensionOutput = extensions.getByName("myExtension").outputFilePath
tasks.register("someTask") {
inputs.file(myExtensionOutput)
}
The reason they do this is because the file at the output path is expected to just be there as a result of a previous task execution. There is no implied dependency on the source task in the graph.
My question is, is this wrong? Why? It feels wrong to me but I can't think of any actual problem they'd encounter and I'd like to check my assumptions. (clearly the better solution is to pass the path in as a property/env-var/well-known-file, and that's what I've recommended)Colton Idle
10/24/2025, 7:14 PMimplementation is automatically also available in androidTestImplementation right?
Same goes for unit tests. So you don't have to redefine every dep to be implementation and testImplementation right?Vlastimil Brecka
10/24/2025, 7:43 PMsettings.gradle
But isn't there something more sophisticated?
Other than flipping it on its head, having per app builds & then one composite one (which I would not prefer)Colton Idle
10/26/2025, 5:31 AMcache github action and trying to cache certain downloads from gradle there.
i have 0 experience setting up github actions with a gradle+android project (i usually use bitrise) so im unsure if this sort of caching thing is just handled for free when using the official gradle step. thanks!Robert Elliot
10/26/2025, 11:48 AMcom.github.johnrengelman.shadow:8.1.1 to com.gradleup.shadow:9.2.2, and it breaks some of my existing gradle config. Details in thread.Colton Idle
10/26/2025, 7:57 PMPhilipp Nowak
10/27/2025, 7:34 AMisIncludeAndroidResources = false and failOnNoDiscoveredTests = false do not seem to work, I still get the same error
There are test sources present and no filters are applied, but the test task did not discover any tests to execute. This is likely due to a misconfiguration. Please check your test configuration. If this is not a misconfiguration, this error can be disabled by setting the 'failOnNoDiscoveredTests' property to false.
Upgrading AGP to an alpha 9.x is no option for us atm. Did anyone solve this problem?Rahul Srivastava
10/27/2025, 7:57 AM[ERROR] Failed to execute goal org.thingsboard:gradle-maven-plugin:1.0.12:invoke (default) on project edqs: org.gradle.tooling.BuildException: Could not execute build using connection to Gradle distribution '<https://services.gradle.org/distributions/gradle-7.3.3-bin.zip>'. -> [Help 1]
while looking deeper in the issue i got that it is not able to build the gradle.build file my gradle.buuld file looks like this
/**
* Copyright © 2016-2025 The Thingsboard Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <http://www.apache.org/licenses/LICENSE-2.0>
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id "nebula.ospackage" version "8.6.3"
}
buildDir = projectBuildDir
version = projectVersion
distsDirName = "./"
// OS Package plugin configuration
ospackage {
packageName = pkgName
version = "${project.version}"
release = 1
os = LINUX
type = BINARY
into pkgInstallFolder
user pkgUser
permissionGroup pkgUser
// Copy the actual .jar file
from(mainJar) {
// Strip the version from the jar filename
rename { String fileName ->
"${pkgName}.jar"
}
fileMode 0500
into "bin"
}
if("${pkgCopyInstallScripts}".equalsIgnoreCase("true")) {
// Copy the install files
from("${buildDir}/bin/install/install.sh") {
fileMode 0775
into "bin/install"
}
from("${buildDir}/bin/install/upgrade.sh") {
fileMode 0775
into "bin/install"
}
from("${buildDir}/bin/install/logback.xml") {
into "bin/install"
}
}
// Copy the config files
from("${buildDir}/conf") {
exclude "${pkgName}.conf"
fileType CONFIG | NOREPLACE
fileMode 0754
into "conf"
}
// Copy the data files
from("${buildDir}/data") {
fileType CONFIG | NOREPLACE
fileMode 0754
into "data"
}
// Copy the extensions files
from("${buildDir}/extensions") {
into "extensions"
}
}
// Configure our RPM build task
buildRpm {
arch = NOARCH
archiveVersion = projectVersion.replace('-', '')
archiveFileName = "${pkgName}.rpm"
requires("(java-17 or java-17-headless or jre-17 or jre-17-headless)") // .or() notation does work in RPM plugin
from("${buildDir}/conf") {
include "${pkgName}.conf"
filter(ReplaceTokens, tokens: ['pkg.platform': 'rpm'])
fileType CONFIG | NOREPLACE
fileMode 0754
into "${pkgInstallFolder}/conf"
}
preInstall file("${buildDir}/control/rpm/preinst")
postInstall file("${buildDir}/control/rpm/postinst")
preUninstall file("${buildDir}/control/rpm/prerm")
postUninstall file("${buildDir}/control/rpm/postrm")
user pkgUser
permissionGroup pkgUser
// Copy the system unit files
from("${buildDir}/control/template.service") {
addParentDirs = false
fileMode 0644
into "/usr/lib/systemd/system"
rename { String filename ->
"${pkgName}.service"
}
}
link("${pkgInstallFolder}/bin/${pkgName}.yml", "${pkgInstallFolder}/conf/${pkgName}.yml")
link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf")
}
// Same as the buildRpm task
buildDeb {
arch = "all"
archiveFileName = "${pkgName}.deb"
requires("openjdk-17-jre").or("java17-runtime").or("oracle-java17-installer").or("openjdk-17-jre-headless")
from("${buildDir}/conf") {
include "${pkgName}.conf"
filter(ReplaceTokens, tokens: ['pkg.platform': 'deb'])
fileType CONFIG | NOREPLACE
fileMode 0754
into "${pkgInstallFolder}/conf"
}
configurationFile("${pkgInstallFolder}/conf/${pkgName}.conf")
configurationFile("${pkgInstallFolder}/conf/${pkgName}.yml")
configurationFile("${pkgInstallFolder}/conf/logback.xml")
configurationFile("${pkgInstallFolder}/conf/actor-system.conf")
preInstall file("${buildDir}/control/deb/preinst")
postInstall file("${buildDir}/control/deb/postinst")
preUninstall file("${buildDir}/control/deb/prerm")
postUninstall file("${buildDir}/control/deb/postrm")
user pkgUser
permissionGroup pkgUser
// Copy the system unit files
from("${buildDir}/control/template.service") {
addParentDirs = false
fileMode 0644
into "/lib/systemd/system"
rename { String filename ->
"${pkgName}.service"
}
}
link("${pkgInstallFolder}/bin/${pkgName}.yml", "${pkgInstallFolder}/conf/${pkgName}.yml")
link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf")
}Rahul Srivastava
10/27/2025, 7:58 AMPhilip W
10/27/2025, 12:51 PMAndy Damevin
10/28/2025, 9:02 AMAlbert ten Napel
10/28/2025, 2:12 PMsource = fileTree("$projectDir").matching {
include("$javaSourceDirName/**/*.java")
excludedJavaFiles.forEach { exclude(it) }
}
This results in many errors such as:
Cannot infer source root(s) for source `file 'C:\...\Blabla.java'`. Supported types are `File` (directories only), `DirectoryTree` and `SourceDirectorySet`.
This seems to disable incremental compilation. How can I fix this code snippet?Zeynep Ozdemir
10/28/2025, 10:25 PMFailed to apply plugin 'com.facebook.react.rootproject'.> A problem occurred configuring project ':app'. > [CXX1101] NDK at C:\Users\zeyne\AppData\Local\Android\Sdk\ndk\27.1.12297006 did not have a source.properties file * Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to generate a Build Scan (Powered by Develocity).
Get more help at https://help.gradle.org.BUILD FAILED in 2s error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * Where: Bui ld file 'C:\cprg303\cprg303LabAssignments\android\build.gradle' line: 21 * What went wrong: A problem occurred evaluating root project 'cprg303LabAssignments'. > Failed to apply pl ugin 'com.facebook.react.rootproject'. > A problem occurred configuring project ':app'. > [CXX1101] NDK at C:\Users\zeyne\AppData\Local\Android\Sdk\ndk\27.1.12297006 did not have a source.properties file * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to generate a Build Scan (Powered by Develocity). > Get more help at https://help.gradle.org. BUILD FAILED in 2s. info Run CLI with --verbose flag for more details. hi how can I fix this build error I have a lab due on friday and having diffuculties
Caleb Cushing
10/29/2025, 1:19 AM./gradlew updateDaemonJvm --jvm-version=21
Configuration cache state could not be cached: field `__toolchainDownloadUrls__` of task `:updateDaemonJvm` of type `org.gradle.buildconfiguration.tasks.UpdateDaemonJvm`: error writing value of type 'org.gradle.api.internal.provider.DefaultMapProperty'Colton Idle
10/29/2025, 9:31 PMbuildSrc directory in your build
• separate included build (can be named build-logic for example
but an included build is also == composite build