Quantcast
Channel: Gradle Forums - Latest posts
Browsing all 19870 articles
Browse latest View live

Apply inside of buildscript{}

You can see from the Project.buildscript(Closure) javadoc that The given closure is executed against this project’s ScriptHandler . The ScriptHandler is passed to the closure as the closure’s...

View Article


How to determine the deployment url, uploadArchive task will pick at runtime

For uploadArchive task, based on artifact version or release type . It can pick SnapshotURL or ReleaseURL. how to get the deployment URL at runtime. I want to get url in init.gradle ? Please suggest....

View Article


Gradle popularity vs Maven

Thank you so much for this! This is exactly what I was looking for as another point to make in my document about why we should switch to Gradle. I think it is something Gradle should think about...

View Article

Image may be NSFW.
Clik here to view.

Apply inside of buildscript{}

@Lance, thanks for your reply. Lance: println buildscript.class.name It is org.gradle.api.internal.initialization.DefaultScriptHandler: public class DefaultScriptHandler implements ScriptHandler,...

View Article

Image may be NSFW.
Clik here to view.

Defining Consumer from Groovy build.gradle

Steve_Ebersole: What I do not understand is that PROFILE_KEY is "profile" , but I cannot specify profile {} in the fragment. This is a difference between a convention and an extension. The convention...

View Article


Defining Consumer from Groovy build.gradle

Thanks again James. I really appreciate your help. This is not a simple series of questions, but your answers are really helpful. But I agree with you 100% that that is the DSL I like conceptually. I...

View Article

Image may be NSFW.
Clik here to view.

Apply inside of buildscript{}

explorer1680: What means “bubbles up”? Is this the syntax for groovy? A groovy Closure can have a delegate. Groovy will attempt to match method invocations defined inside the closure to the delegate....

View Article

Eay way to update Gradle in existing netbeans project

In a netbeans project, is there an easy way to update / upgrade Gradle. As example, I went from netbeans 11 to 12. One project was a native build (I think native is ant). I opened and worked with no...

View Article


Buildship interfering with simple run/debug launch

I have Java jar/war/ear projects building fine with Gradle via Jenkins. I’m running MyEclipse Enterprise Workbench 2020.5.18. I don’t want Buildship involved in any way. I’m getting this in .log when...

View Article


Dependency verification failing for dependencies of external dependencies

Hi, I’ve been running into an issue with the dependency verification feature I’m hoping someone can assist with. When I try to import my project into IntelliJ I’m getting an error that looks something...

View Article

Im trying to create a gradle jar which has a resource folder but when I build...

I get the null pointer error in both.

View Article

Apply inside of buildscript{}

Thanks Lance. I understand it now.

View Article

Custom JaCoCo Gradle Plugin - exclude files in report

I’m new to Gradle and Groovy. I have something like this in my build.gradle file: jacocoTestReport { afterEvaluate { classDirectories.setFrom(files(classDirectories.files.collect { fileTree(dir: it,...

View Article


Using org.gradle.api.tasks.testing.Test.beforeTest in java

Hi, How can I rewrite the following groovy code into java: Test test = .... test.beforeTest { descriptor -> println("Starting " + descriptor.toString()) } due to beforeTest method only can recieve...

View Article

Custom JaCoCo Gradle Plugin - exclude files in report

Meanwhile I solved it. def ex = ['aaa/bbb/*','ccc/ddd.*','eee/fff/*'] def ft = reportTask.classDirectories.asFileTree.matching { ex.each { exclude it } } I don’t know how it works, but it works. I...

View Article


Composite Build and Classifier

Since gradle 5.6 you can use testFixtures to solve the described problem: https://docs.gradle.org/current/userguide/java_testing.html#sec:java_test_fixtures

View Article

Defining Consumer from Groovy build.gradle

With what I was mentioning, you now have 3 ways to define a profile. Inline: databases { ... profiles { h2 { beforeEachTestAction { testDescriptor -> printf("Executing test `%s` against h2...

View Article


Using org.gradle.api.tasks.testing.Test.beforeTest in java

The beforeTest(Closure) method is just a shortcut you can use in Groovy. Ultimately, it maps the closure to receive broadcasts the same as the TestListener interface. You can clean up how you handle...

View Article

Image may be NSFW.
Clik here to view.

Defining Consumer from Groovy build.gradle

project.files(profileDirectory).filter { include '*.gradle' }.each { fragment -> project.apply(from: fragment, to: databases.profiles) } Ah, this was the piece I was missing - the to:. I actually...

View Article

Defining Consumer from Groovy build.gradle

I tried adding to: to the #apply call, but that did not work for me. if ( pathName.endsWith( ".profile" ) || pathName.endsWith( ".gradle" ) ) { project.apply( Helper.asMap( "from", path, "to",...

View Article
Browsing all 19870 articles
Browse latest View live