Viacheslav Kazarenko
02/17/2022, 9:09 AMChris
02/17/2022, 2:20 PM./gradlew --stop
all the daemons and start fresh. Is this a known issue?Jeff Shaw
02/17/2022, 6:18 PMYou must be authenticated to access this page.
I'm trying to test a patch I made to to the Shadow plugin. https://github.com/johnrengelman/shadow/pull/756 I publish it.
./gradlew :publishPluginPublicationToMavenLocal
In my project I use pluginManagement
in settings.gradle
to have Gradle use my local published snapshot instead of the official Shadow publication. Then I run :shadowJar
on my project. I get,
> Failed to apply plugin [class 'com.github.jengelman.gradle.plugins.shadow.ShadowJavaPlugin']
> Could not create plugin of type 'ShadowJavaPlugin'.
> The constructor for type ShadowJavaPlugin should be annotated with @Inject.
I looked at the class in the jar in my local repo, and it does have the annotation. However, when I debug Gradle's InjectUtil
, the annotation is missing from the constructor. It's like Gradle's class loader is stripping it. Am I not doing the right thing? Or how do I get @Inject
to be included in the loaded class?Zak Taccardi
02/17/2022, 8:04 PMtasks.withType<Test> { }
which is an anti-pattern?Zak Taccardi
02/17/2022, 11:59 PMProvider<String>
to a TaskProvider<Task>
. I have a conditional task dependency based on a gradle property, and I want to avoid creating a ValueSource
Luke Collins
02/18/2022, 3:56 PMRobert Elliot
02/18/2022, 9:56 PMTom Gregory
02/21/2022, 4:48 PMZak Taccardi
02/22/2022, 5:06 PMplugins {
myApp.codeCoverage.aggregator
}
dependnecies {
codeCoverage(project(":some-android-lib"))
}
When project(":some-android-lib")
is added as a dependency to my plugin’s codeCoverage
configuration - I want to access code coverage reports for all project(..)
transitive dependencies of :some-android-lib
. How would I achieve this?Zak Taccardi
02/22/2022, 6:13 PMbuildSrc
? Trying to understand what I’d gain by effectively renaming buildSrc
to buildSource
(and using includeBuild(":buildSource")
)Javi
02/23/2022, 11:52 AMZak Taccardi
02/23/2022, 11:33 PMbuildSrc
function, defined as:
fun Project.whenModuleConfigAdded(action: Module.() -> Unit)
From a Groovy script?Sri Naga Sai Krishna Sanka
02/24/2022, 1:22 AMimplementation gradleApi()
it's taking a version of 6.4 which is giving 1.3.70 version for kotlin. How can I override it with 1.5.31 in build.gradle?
➜ proto-panda git:(master) ✗ ./gradlew -v
------------------------------------------------------------
Gradle 6.3
------------------------------------------------------------
Build time: 2020-03-24 19:52:07 UTC
Revision: bacd40b727b0130eeac8855ae3f9fd9a0b207c60
Kotlin: 1.3.70
Groovy: 2.5.10
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 11.0.11 (AdoptOpenJDK 11.0.11+9)
OS: Mac OS X 10.15.7 x86_64
Fritjof Höst
02/24/2022, 2:09 PMqp
that contains the following:
@Override
public Task mustRunAfter(Object... paths) {
return super.mustRunAfter(this.getProject().getTasks()
.stream()
.filter(it -> it instanceof Jar)
.map(Task::getPath).toArray());
}
With that I expect it to run after my Jar
task. But when I run gradle clean jar qp
the qp
task always runs after clean
but before Jar
. Am I not supposed to override mustRunAfter
? Is there some other way to do this?Deepthi Kodatham
02/24/2022, 7:27 PMSukhbir Singh
02/24/2022, 7:54 PMtest { // this is main test block in build.gradle file
useJUnitPlatform()
systemProperty("junit.jupiter.execution.parallel.enabled", true)
systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
finalizedBy jacocoTestReport
}
I have used jvm test suites plugin to place all smoke tests at one place, I tried applying same systemProperty in suites block for these smoke tests but it was not working. All smoke tests are runnning sequentially only.
This is what I am trying:-
testing {
suites {
test {
targets.all {
testTask.configure {
systemProperty("junit.jupiter.execution.parallel.enabled", true)
systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
}
}
}
}
}
If anyone got some idea. Please suggest !!Dileepkumar Siriki
02/25/2022, 6:35 AMAaron Todd
02/25/2022, 11:32 PMSourabh Singh Rawat
02/28/2022, 7:48 AMRobert Elliot
02/28/2022, 8:46 AMmy-project/
├── subproject1/
│ └── build/
└── project-collection/
├── subproject2/
│ └── build/
└── subproject3/
└── build/
I'd like to copy all those build
dirs up to the root project's build
dir:
my-project/
├── build/
│ ├── subproject1/
│ └── project-collection/
│ ├── subproject2/
│ └── subproject3/
├── subproject1/
│ └── test-results
└── project-collection/
├── subproject2/
│ └── build/
│ └── test-results
└── subproject3/
└── build/
└── test-results
I could do it myself, but don't want to duplicate the effort if someone already has.Zak Taccardi
02/28/2022, 6:05 PMproject(":some-subproject")
?Juan Paulo Breinlinger
02/28/2022, 8:33 PMgroovy
and my use case is very simple.
The plugin has to copy a single yaml file from the plugin to the build folder. It will then be consumed by another task.
Code screenshot provided... obviously doesn't work because it can't find the file. If I manually inspect the plugin jar file.. the yaml file is there though
I know I could use project.zipTree
but I have no clue how to specify the correct plugin jar path...
Any clues or better solution to what I'm trying to do?
Help is much appreciatedtony
02/28/2022, 10:59 PM.module
file is missing javadoc information. Dokka involved.
trying to publish a new library to maven central. It's written in Kotlin and I'm using Dokka to generate the documentation. I have
val dokkaJavadoc = tasks.named("dokkaJavadoc")
val javadocJar = tasks.register<Jar>("javadocJar") {
archiveClassifier.set("javadoc")
from(dokkaJavadoc)
}
and
publishing {
publications {
create<MavenPublication>("lib") {
from(components["java"])
artifact(javadocJar.get())
and when I publish this, the jar gets generated and published, as expected. However, the .module
file doesn't list this as one of the artifacts. I only see the sources jar in the module file (I use java.withSourcesJar()
). Is this expected or is something missing?Juan Paulo Breinlinger
03/01/2022, 11:25 AMinterface GreetingPluginExtension {
Property<String> getMessage()
Property<String> getGreeter()
}
class GreetingPlugin implements Plugin<Project> {
void apply(Project project) {
def extension = project.extensions.create('greeting', GreetingPluginExtension)
project.task('hello') {
doLast {
println "${extension.message.get()} from ${extension.greeter.get()}"
}
}
}
}
apply plugin: GreetingPlugin
// Configure the extension using a DSL block
greeter = 'test'
greeting {
message = 'Hi'
greeter = greeter
}
Chris
03/01/2022, 2:08 PMSu5eD
03/02/2022, 8:42 AMNo matching variant of de.jjohannes.gradleextra java module info0.11 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.3.3' but:
[...] Incompatible because this component declares an API of a component compatible with Java 9 and the consumer needed a runtime of a component compatible with Java 8Is there a way to alter variant selection on plugins to resolve this? (as a temporary workaround)
Martin
03/02/2022, 9:35 AMSoftwareComponent
. I understand Configuration
and Publication
but what does SoftwareComponent
bring to the table? Couldn't I add artifacts to a publication from a Configuration
directly? Why does it have to go through SoftwareComponents
?Georges-Etienne Legendre
03/03/2022, 7:49 PMtony
03/04/2022, 8:11 AM* What went wrong:
Execution failed for task ':some:android:module:testDebugUnitTest'.
> Process 'Gradle Test Executor 211' finished with non-zero exit value 134
This problem might be caused by incorrect test process configuration.
Please refer to the test execution section in the User Manual at <https://docs.gradle.org/7.4/userguide/java_testing.html#sec:test_execution>
Yash Arora
03/05/2022, 7:08 AM