Chris
04/06/2022, 8:00 PMAttributeDisambigutationRule
instances interact with each other. In the following example it seems logical to me that it should pick the apiElements
variant but it doesn’t:
> Could not resolve project :foo.
Required by:
project :bar
> The consumer was configured to find an API of a library compatible with Java 8, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally. However we cannot choose between the following variants of project :terracotta:store-client:
- apiElements
- runtimeElements
- unshadedRuntimeElements
All of them match the consumer attributes:
- Variant 'apiElements' capability foo:version declares an API of a library compatible with Java 8, packaged as a jar, and its dependencies bundled (fat jar):
- Unmatched attribute:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Variant 'runtimeElements' capability foo:version declares a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies bundled (fat jar):
- Unmatched attribute:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Variant 'unshadedRuntimeElements' capability foo:version declares a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally:
- Unmatched attribute:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
Aurimas Liutikas
04/06/2022, 8:53 PMCould not load entry 1e141399748456c40418c175664943cf from remote build cache: Connect to <http://gradle-remote-cache.XXX.XXX:999|gradle-remote-cache.XXX.XXX:999>
and continues building without the cache. Ideally, we fail the build and tell the user to rerun the auth commandGagan
04/07/2022, 1:07 PMTask appmainApkListPersistenceRelease
Task appbundleReleaseJsAndAssetswarn The following packages use deprecated "rnpm" config that will stop working from next release: - react-native-fetch-blob: https://npmjs.com/package/react-native-fetch-blob Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide. warning: the transform cache was reset. warn The following packages use deprecated "rnpm" config that will stop working from next release: - react-native-fetch-blob: https://npmjs.com/package/react-native-fetch-blob Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide. Loading dependency graph, done. error node_modules\react-native\Libraries\Blob\URL.js: Unexpected token punc «:», expected punc «,» in file node_modules\react-native\Libraries\Blob\URL.js at 102:30. Run CLI with --verbose flag for more details. Error: Unexpected token punc «:», expected punc «,» in file node_modules\react-native\Libraries\Blob\URL.js at 102:30 at D\a\1\s\node modules\metro\src\JSTransformer\worker.js415:17 at Generator.next (<anonymous>) at asyncGeneratorStep (D\a\1\s\node modules\metro\src\JSTransformer\worker.js75:24) at _next (D\a\1\s\node modules\metro\src\JSTransformer\worker.js95:9) at D\a\1\s\node modules\metro\src\JSTransformer\worker.js100:7 at new Promise (<anonymous>) at D\a\1\s\node modules\metro\src\JSTransformer\worker.js92:12 at JsTransformer._minifyCode (D\a\1\s\node modules\metro\src\JSTransformer\worker.js422:7) at D\a\1\s\node modules\metro\src\JSTransformer\worker.js356:33
Chris Lee
04/07/2022, 1:53 PMDavid Chang
04/08/2022, 1:09 AMabstract class SdkPluginExtension {
abstract val message: Property<String>
init {
message.convention("this should be overridden")
}
}
class SdkPlugin : Plugin<Project> {
override fun apply(project: Project) {
// Add the 'greeting' extension object
val extension = project.extensions.create<SdkPluginExtension>(
"dropboxSdkJava",
SdkPluginExtension::class.java
)
project.rootProject.extra["message"] = extension.message.get()
// Add a task that uses configuration from the extension object
project.task("hello") {
doLast {
println(extension.message.get())
}
}
}
}
I’m applying it in my project like this
apply plugin: 'com.my.plugin'
hello {
message = "hey, I did it"
}
I want to be able to get the “hey, I did it” phrase in the configuration phaseAaron Todd
04/08/2022, 1:49 PMCannot change dependencies of dependency configuration 'aws runtimedokkaGfmPlugin' after it has been resolved.Project builds fine from cli but intellij won't load the project. I've tried clearing every cache I know of, upgrading plugins, downgrading plugins, restarting the computer, doing a rain dance, etc. Anyone have any insights how to solve?
S S
04/08/2022, 4:48 PMproject.extensions.extraProperties
here
then i reference those when i use the plugin hereCesar Roman
04/08/2022, 4:56 PMapplicationVariants.configureEach{v-> logger.error("CESAR: Variant configured: " + v.getName())}
I was hoping that when running ./gradlew assembleFullRelease
, then it should only log for current variant, which is FullRelease.
Instead it logs:
android-test-suite % ./gradlew assembleFullRelease
> Configure project :app
CESAR: Variant configured: demoDebug
CESAR: Variant configured: fullDebug
CESAR: Variant configured: demoRelease
CESAR: Variant configured: fullRelease
CESAR: Variant configured: demoBenchmark
CESAR: Variant configured: fullBenchmark
which are all of my variants. This is important since my configuration script is getting performed for all variants, which takes a lot more time. I thought that was the whole point of using configureEach
I tried removing all plugins from my gradle file, just in case they were introducing some noise, still no luck.
any ideas?Eli Graber
04/08/2022, 5:51 PMDomainObjectCollection.configureEach
preferable over DomainObjectCollection.all
from a laziness perspective?Michal
04/11/2022, 10:21 AMIwo Polański
04/11/2022, 11:31 AMMaxim Alov
04/11/2022, 4:45 PMincludeBuild
to replace 3rd-party binary plugin with the same plugin taken from the local filesystem?
Let's say, i apply org.sonarqube
plugin (in some convention plugin):
plugins {
id("org.sonarqube")
}
this is fetched from some known gradle plugin portal. But now I've cloned open-source repo with that plugin (from https://github.com/SonarSource/sonar-scanner-gradle) and put to the local directory:
/Users/mymac/Soft/OPENSOURCE/sonar-scanner-gradle
I want my main project to start using this local copy instead of binary plugin, so I do in `settings.gradle`:
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
google()
}
includeBuild("/Users/mymac/Soft/OPENSOURCE/sonar-scanner-gradle") { name = "sonarmax" }
resolutionStrategy {
eachPlugin {
if (requested.id.id.startsWith("org.sonarqube")) {
useModule("sonarmax")
}
}
}
}
also, instead of renaming included build to sonarmax
, I tried to use it's name (given by group:projectName
):
org.sonarsource.scanner.gradle:sonarqube-gradle-plugin
i.e.:
pluginManagement {
...
includeBuild("/Users/mymac/Soft/OPENSOURCE/sonar-scanner-gradle")
resolutionStrategy {
eachPlugin {
if (requested.id.id.startsWith("org.sonarqube")) {
useModule("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin")
}
}
}
}
to verify, I've added some changes and logs in my local version of that org.sonarqube
plugin. However, when I configure my main project, I can't see any changes. Looks like original binary plugin has not been replaced.
Am I doing it wrong? How to replace binary plugin for local one provided the sources (using included build), with the least possible actions? Thank youIwo Polański
04/12/2022, 8:40 AMandroid-library-convention.gradle.kts
and android-application-convention.gradle.kts
because Android uses 4 types of plugin and those plugins share a lot of configuration, I'm trying to not end up 2 places where I have to modify those by having something like base-android-convention.gradle.kts
The problem is base does not have any plugin applied yet, but I figured out I might use extensions.configure<BaseExtension>
and import base extension, problem is BaseExtension
does not have all configuration options and things are becoming a bit messy - like I said a bit of Android plugin question (and why things are done the way they are)Mathieu Bouffé
04/12/2022, 11:18 AM====12/04/2022 13:07:33====PERFORMING FINAL APK PACKAGE OPERATION=====-armv7===========================================
Copied file C:\Users\matb2\Documents\Unreal Projects\benefit\Intermediate\Android\armv7\gradle\app\src\main\assets\UE4CommandLine.txt.
Creating rungradle.bat to work around commandline length limit (using unused drive letter Z:)
Making .apk with Gradle...
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: <https://docs.gradle.org/6.1.1/userguide/gradle_daemon.html>.
Daemon will be stopped at the end of the build stopping after processing
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :downloader_library:preBuild UP-TO-DATE
> Task :downloader_library:preDebugBuild UP-TO-DATE
> Task :downloader_library:compileDebugAidl NO-SOURCE
> Task :permission_library:preBuild UP-TO-DATE
> Task :permission_library:preDebugBuild UP-TO-DATE
> Task :permission_library:compileDebugAidl NO-SOURCE
> Task :app:compileDebugAidl FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugAidl'.
> 1 exception was raised by workers:
java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\matb2\AppData\Local\Android\Sdk\build-tools\32.1.0-rc1\aidl.exe with arguments {-pC:\Users\matb2\AppData\Local\Android\Sdk\platforms\android-32\framework.aidl -oZ:\app\build\generated\aidl_source_output_dir\debug\out -IZ:\app\src\main\java -IZ:\app\src\debug\aidl -IC:\Users\matb2\.gradle\caches\transforms-2\files-2.1\ffc4098914b91b7860907277c6a73623\media-1.0.0\aidl -IC:\Users\matb2\.gradle\caches\transforms-2\files-2.1\f88df7c86cbc989e82020e686162bad6\core-1.0.0\aidl -IC:\Users\matb2\.gradle\caches\transforms-2\files-2.1\f1bc45fa819a5ff15e81f37590dd5bea\versionedparcelable-1.0.0\aidl -IZ:\downloader_library\build\intermediates\aidl_parcelable\debug\out -IZ:\permission_library\build\intermediates\aidl_parcelable\debug\out -dC:\Users\matb2\AppData\Local\Temp\aidl8542636975991179076.d Z:\app\src\main\java\com\android\vending\licensing\ILicenseResultListener.aidl}
* 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 get full insights.
* Get more help at <https://help.gradle.org>
BUILD FAILED in 8s
1 actionable task: 1 executed
ERROR: cmd.exe failed with args /c "C:\Users\matb2\Documents\Unreal Projects\benefit\Intermediate\Android\armv7\gradle\rungradle.bat" :app:assembleDebug
(see C:\Users\matb2\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.27\Log.txt for full exception trace)
AutomationTool exiting with ExitCode=1 (Error_Unknown)
BUILD FAILED
Geetha Priya
04/12/2022, 11:50 AMLilly
04/12/2022, 6:20 PMVlastimil Brecka
04/12/2022, 7:25 PMMaxim Alov
04/13/2022, 8:16 AMplugins {
id("com.vanniktech.android.junit.jacoco")
id("org.sonarqube")
}
the first one - here https://github.com/vanniktech/gradle-android-junit-jacoco-plugin - iterates over each subproject and applies jacoco
plugin for each subproject in suproject.afterEvaluate {}
block. Then, there are tasks:
• jacocoTestReport - for pure Java / Kotlin subprojects
• jacocoTestReportDebug, jacocoTestReportRelease - for Android subprojects (w/o flavors)
then, sonarqube plugin - here https://github.com/SonarSource/sonar-scanner-gradle - also iterates over each subproject, collecting properties to populate SonarQubeTask
- root project's task. It also have the following statement:
sonarQubeTask.mustRunAfter(getJacocoTasks(rootProject));
which actually iterates over subprojects, collecting tasks withType<JacocoReport>()
and sets main SonarQubeTask
to run after all those jacoco-report tasks.
-----
What I need - is to make root project's SonarQubeTask
to depend on all those jacoco-report tasks from every subproject, not just "run after them". Because I would like to just run a single task sonarqube
and let it run the rest of the jacocoTestReport**
tasks - because I don't know in advance all the names of these tasks for Android subprojects, which are based on build variants.
How could I make sonarqube
task depend on all those jacocoTestReport**
tasks from all subprojects?
-----
I've tried the following way in my root `build.gradle.kts`:
plugins {
id("com.vanniktech.android.junit.jacoco")
id("org.sonarqube")
}
tasks.withType<SonarQubeTask>().configureEach {
val jacocoTestReportTasks = rootProject.subprojects.stream()
.filter { p ->
val sonarQubeExtension = p.extensions.findByType<SonarQubeExtension>()
p.plugins.hasPlugin(JacocoPlugin::class) &&
sonarQubeExtension != null && !sonarQubeExtension.isSkipProject
}
.map { p -> p.tasks.withType<JacocoReport>() }
.flatMap(Collection<JacocoReport>::stream)
.collect(Collectors.toList())
println(jacocoTestReportTasks.joinToString(prefix = "JACOCO TASKS"))
dependsOn(jacocoTestReportTasks)
}
however, it prints no tasks after prefix "JACOCO TASKS". I've figured out that the check
p.plugins.hasPlugin(JacocoPlugin::class)
is always false
for each subprojects at the root project's configuration phase, despite I made sure that every subproject has jacoco
plugin applied
plugins {
...
id("jacoco")
}
I believe, there is some kind of timing problem - maybe I misuse the phase. Tried to put the whole block inside rootProject.afterEvaluate {}
, but it didn't help. Also, tried to collect tasks from each subproject inside subproject.afterEvaluate {}
block, like this:
tasks.withType<SonarQubeTask>().configureEach {
val jacocoTestReportTasks = mutableListOf<JacocoReport>()
rootProject.subprojects.forEach { p ->
p.afterEvaluate {
val sonarQubeExtension = p.extensions.findByType<SonarQubeExtension>()
if (p.plugins.hasPlugin(JacocoPlugin::class) &&
sonarQubeExtension != null && !sonarQubeExtension.isSkipProject
) {
p.tasks.withType<JacocoReport>().let {
jacocoTestReportTasks.addAll(it)
}
}
}
}
println(jacocoTestReportTasks.joinToString(prefix = "JACOCO TASKS"))
dependsOn(jacocoTestReportTasks)
}
but then I fall into another problem:
Project#afterEvaluate(Action) on project ':<very first subproject>' cannot be executed in the current context.
also, moving the whole code snippet under rootProject.afterEvaluate {}
didn't help.Ramesh Vangala
04/13/2022, 12:31 PMPrashan Dharmasena
04/13/2022, 10:29 PM./gradlew --stop
) - I'm not quite sure what is going on. I suspect that they are running out of memory? But I am not able to verify the heap/metaspace sizes, because jcmd
is unable to connect to the daemon. Via debug logs I do see the JVM args being passed into the daemon:
Connected to daemon DaemonInfo{pid=2230, address=[378e2fa2-c1ac-470e-9c97-d7ffd5296401 port:49411, addresses:[/127.0.0.1]], state=Busy, lastBusy=1649888157743, context=DefaultDaemonContext[uid=27da1b3c-a6ba-4b61-8cdc-cda46571705f,javaHome=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home,daemonRegistryDir=/Users/prashan/.gradle/daemon,pid=2230,idleTimeout=10800000,priority=NORMAL,daemonOpts=-XX:MaxMetaspaceSize=512m,-XX:GCTimeLimit=20,--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.base/java.lang=ALL-UNNAMED,--add-opens,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.base/java.nio.charset=ALL-UNNAMED,--add-opens,java.base/java.net=ALL-UNNAMED,--add-opens,java.base/java.util.concurrent.atomic=ALL-UNNAMED,-Xmx8g,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]}
So it does look like -Xmx8g
is being set, but in Activity Monitor I'm only seeing ~800MB of memory being used. This is also only on command line, IDE builds work fine.
Any ideas?Wizard
04/13/2022, 10:44 PMTom Gregory
04/14/2022, 10:52 AM./gradlew jacocoTestReport
and see 2 files:
• build/jacoco/test.exec
• build/jacoco/integrationTest.exec
How does the integrationTest.exec get generated since there is only a single jacocoTestReport task?
Observation 2
This project configures XML reports with xml.required = true
.
There is a build/reports/jacoco/test/jacocoTestReport.xml but no build/reports/jacoco/integrationTest/jacocoTestReport.xml.
Why?
Observation 3
When I try to configure jacocoTestReport task to include integration test data:
jacocoTestReport {
executionData tasks.named('integrationTest')
// other stuff
}
When I run ./gradlew jacocoTestReport
it fails with error:
Unable to read execution data file C:\workspace\sonarqube-jacoco-code-coverage\build\test-results\integrationTest\binaryDoes this directory exist? Sure does! Stacktrace shows:
Caused by: java.nio.file.AccessDeniedException: C:\workspace\integration-tests-with-jacoco-issue\build\test-results\integrationTest\binaryAny guidance is appreciated. Thanks.
Mike Cumings
04/14/2022, 9:34 PMproject.tasks.configureEach
. I'm confused as to how this can even happen?Pratik Patel
04/15/2022, 10:13 AMWelcome to Gradle 7.4.2!
Here are the highlights of this release:
- Aggregated test and JaCoCo reports
- Marking additional test source directories as tests in IntelliJ
- Support for Adoptium JDKs in Java toolchains
For more details see <https://docs.gradle.org/7.4.2/release-notes.html>
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* Where:
Build file '/home/ambition/Project/SuperCryptoKart/android/build.gradle' line: 28
* What went wrong:
A problem occurred evaluating root project 'android'.
> No signature of method: build_8t96hrjez70rp7nrthgxwqsl7.android() is applicable for argument types: (build_8t96hrjez70rp7nrthgxwqsl7$_run_closure2) values: [build_8t96hrjez70rp7nrthgxwqsl7$_run_closure2@458b6415]
* 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 get full insights.
* Get more help at <https://help.gradle.org>
Pratik Patel
04/15/2022, 10:14 AMGiuseppe Barbieri
04/16/2022, 6:54 AMXmx
on the compileKotlin
Gradle task via
kotlinOptions {
freeCompilerArgs += listOf("-J-Xmx2g")
}
but I get:
Invalid argument: -J-Xmx2gSyntax should be right
elect@5800x:~$ kotlinc -help
..
-J<option> Pass an option directly to JVMAlso googling around looks correct, I saw another example with
-J-Xmx1000m
So the error must be somewhere elseAriel Oliveira
04/18/2022, 11:40 AMZak Taccardi
04/18/2022, 4:18 PMgroupId
is com.android.support
.
What built in gradle mechanism can I leverage here?Laurence Gonsalves
04/18/2022, 7:04 PMJohn
04/18/2022, 7:26 PMCould not apply requested plugin [id: xxx, version: vvv] as it does not provide a plugin with id xxx. This is caused by an incorrect plugin implementation. Please contact the plugin author(s).
> Plugin with id xxx not found.