Questions tagged [gradle-task]

Gradle has a set of standard tasks provided by common plugins, but also allows defining custom tasks. A gradle task is an atomic unit of work that is scheduled before or other after tasks depending on task ordering constraints.

154 questions
0
votes
0 answers

Having trouble running my flutter project on my android device in flutter VS Code

running my first flutter project on VS Code connected to my android device, I get stuck on Gradle task 'assembleDebug' and noticed that it duplicates some sdkmanager packages like "emulator-2" and "v4-2" (inside Patcher folder). //inside vs Code…
0
votes
1 answer

How do you set up a property in a custom gradle task?

I want to write a task that takes a directory from , does something with the files in it and writes the result into some other directory to. I've been led to believe this was the way to define such a task (kotlin dsl): package my.app abstract class…
User1291
  • 7,664
  • 8
  • 51
  • 108
0
votes
1 answer

Execute builds only for some gradle modules in project

I have a project utilities with a build.gradle. utilities has some modules named util, util2, util3, ... In a task I want to execute first :util2:build and :util5:build. But I do not know how to write such a task. This fails: task executePreBuild()…
beub
  • 43
  • 11
0
votes
1 answer

Gradle task : Git with dynamic values & specific treatment automation

i'm trying to build tasks to help my team. i have 2 mains branch for front & back and if the developper working on back and need to update front i want to cherry pick all commits from front and vice versa for front to back. I'm using gradle…
Ruskof
  • 5
  • 4
0
votes
1 answer

In gradle, how to make an existing task "build" depending on the publishing tasks of another module?

When I try to declare the task "build" depends on another task like this: task("build").dependsOn( gradle.includedBuild("splain").task("publishToMavenLocal") ) I got the following error: FAILURE: Build failed with an exception. * Where: Build…
tribbloid
  • 4,026
  • 14
  • 64
  • 103
0
votes
0 answers

IntelliJ is not stopping at a breakpoint in a Gradle task

I have IntelliJ 2022.1 CE, Gradle 7.4.2, and Java 11. I'm working on a Gradle task, and I want to put a breakpoint in the task. JetBrains' documentation says this is perfectly doable, but I can't get it to stop at the breakpoint. The task is as…
spartanhooah
  • 183
  • 4
  • 15
0
votes
2 answers

Gradle 7: get effective dependency version in a task

I need to have a list of dependencies for each subproject with effective dependency versions. There are some version conflicts for some transitive dependencies and higher version is used. So if I execute gradle dependencies I see smth like…
0
votes
1 answer

How to run a JavaExec gradle task with arguments when the task is called in finalizedBy?

I created a JavaExec task that connects to a db and does some checks. In my flyway build.gradle I call the task like this: flywayMigrate.finalizedBy(rootProject.checkOracleStandards) The task works fine, but the problem is that the connection url,…
Dinu Nicolae
  • 1,019
  • 2
  • 17
  • 42
0
votes
1 answer

Configuring tasks via Gradle plugin using Kotlin DSL

I'm trying to convert some task configuration in my Gradle plugin from Groovy to Kotlin. All of the examples I've found are about normal build scripts, and that approach doesn't seem to directly translate to plugin usage. My attempt below: class…
Brad Mace
  • 27,194
  • 17
  • 102
  • 148
0
votes
1 answer

How do we properly create an execution phase tasks?

this is what the ideal build script I have: I do want to execute tasks "unzip_natives_os" manually. But it seems it only works at config phase. And when I take a test run with this set-up it gives me an error: "java.lang.UnsatisfiedLinkError" but…
0
votes
2 answers

How to annotate Output result that is not a file or directory

Cross post of https://discuss.gradle.org/t/how-to-annotate-output-result-that-is-not-a-file-or-directory/40515 I have a plugin that I am updating for Gradle 7 and need to annotate all of the properties with Input or Output. I first blanketed…
Justin Pihony
  • 66,056
  • 18
  • 147
  • 180
0
votes
1 answer

Gradle systemProperty in custom task not setting Spring Profile

I'm trying to selectively deactive tests if there is a spring profile called "unit", which is working: @DisabledIfEnvironmentVariable(named = "SPRING_PROFILES_ACTIVE", matches = "unit") If I run SPRING_PROFILES_ACTIVE=unit ./gradlew clean test this…
jeffrey.d.m
  • 616
  • 8
  • 23
0
votes
0 answers

Gradle Tool Bar not showing project root

I have to extract the SHA key but in Gradle tool bar task is not shwingenter image description here
0
votes
1 answer

Can a standalone gradle plugin export a custom task type?

I have a standalone Gradle plugin that includes a custom task type: gradle-conventions/build.gradle plugins { id 'groovy-gradle-plugin' id 'maven-publish' } group = 'com.example' version = '1.0' publishing { repositories { maven { …
hertzsprung
  • 9,445
  • 4
  • 42
  • 77
0
votes
1 answer

how to correct this error : Gradle task assembleDebug failed with exit code 1?

can someone tell me why i keep having this bug in android studio , i installed the latest gradle and still can't fix it and also i ran flutter doctor -v , the output is below .i also tried flutter clean but couldn't find the rebuild option . here's…
shrooma
  • 53
  • 1
  • 7