Menu
  • HOME
  • TAGS

Is it possible to customize gradle's test reports? (Integrate geb reports with gradle test reports)

Tag: gradle,spock,geb

I am using geb + spock + gradle for tests and I'd really like to integrate a link to geb's screenshots into the gradle report. For those not familiar with geb, essentially it organizes screenshots for each test into a folder structure that follows the project package structure, for example:

com
  domain
    tests
      package
        class1
          screenshot-of-test-method1.jpg
          screenshot-of-test-method2.jpg
        class2
          screenshot-of-test-method1.jpg

I realize I'd have to write some code to figure out what the path to the image should be, but does gradle provide a way to customize the test reports that would allow me to at least insert the link somehow into the appropriate class's test report?

If gradle does not offer direct customization what other options or general approaches would you recommend?

Best How To :

Gradle's HTML test reporting doesn't expose any customization hooks. You'd have to post-process the HTML on your own.

Gradle Jar structure is different than the real project structure

java,jar,gradle,build

When your project is managed by gradle you should always use standard layout introduced by maven or have a good excuse to using any different layout. Here you can find sample project that shows how to use the this layout and read the resources that will be later included in...

Install gradle on Centos

jenkins,gradle

... but when I unzipped I got gradle.bat file inside bin directory which tells me that this is for Windows. It also contains a file called gradle, which is a shell script. Your download is also suitable for running on any Linux or UNIX platform .... including CentOS....

Add project on outer level as dependency to module

android,intellij-idea,gradle

Add dependencies in the 'build.gradle' of your MainProject, like this: compile project(':proj1') compile project(':proj2') EDIT: And in the 'settings.gradle' this: include ':proj1' project(':proj1').projectDir = new File('../proj1') include ':proj2' project(':proj2').projectDir = new File('../proj2') ...

Spock Framework: problems with spying

java,unit-testing,groovy,spock,spock-spy

It should be: @Grab('org.spockframework:spock-core:0.7-groovy-2.0') @Grab('cglib:cglib-nodep:3.1') import spock.lang.* class CallingClassTest extends Specification { def "check that functionTwo calls functionOne"() { def c = Spy(CallingClass) when: def s = c.functionTwo() then: 1 * c.functionOne() >> "mocked function return" s == "some string mocked function return" } } public class CallingClass { public...

Is it possible to exclude specific build variant when using flavor Dimensions?

android,gradle

Since Gradle 0.9 you can apply a variant filter and iterate over them: productFlavors { freeapp { dimension "version" } x86 { dimension "abi" } paidapp { dimension "mips" } } // Loop variants android.variantFilter { variant -> // Loop flavors variant.getFlavors().each { flavor -> println variant.buildType.name + " "...

Paid and Free versions of android app

android,gradle,android-version

You could have two versions of the application in Play store. However, you would have to maintain these separately and it is frustrating to upgrade from free to paid with this approach. If you chose this way of maintaining your application, you would have to have two projects, one for...

Duplicate entry for class in gradle

java,android,android-studio,gradle

The above library is already on maven. Just remove the imported folder and add the code below to your dependencies: compile 'com.flaviofaria:kenburnsview:1.0.6' Sometimes due to downloading issues; the library fails to download. In that case ; just find your .gradle folder and clear cache inside it. Recompile and you are...

Gradle - Error:Failed to find: com.squareup.okhttp:okhttp:2.4.0

android,android-studio,gradle,okhttp

You need to add the following block to the build script: repositories { mavenCentral() } ...

Incorrect liferay-plugins dependency

gradle,dependencies,liferay,liferay-6.2

The 6.2 branch is mainly used for development, and those Gradle scripts are not designed to run on Liferay 6.2. Furthermore, they've been removed in the master branch, replaced by a series of Gradle plugins written in Java. Everything is still under active development, but anyway you're more than welcome...

Android build project error trying to build apps > 65K (65536) methods

android,android-studio,gradle,build,android-gradle

You need to reduce the size or include only the imports you need to for your application. You are hitting the dex limit of 65536 methods. Here's the link Building Apps with Over 65K Methods which might help....

Testing for the Default Value

grails,spock

You are correct, you will need to do this in an integration test, since not all the database components are wired up in a unit test.

Android studio gradle flavor dimensions build varients not working correctly

android-studio,gradle,android-gradle,build.gradle,android-productflavors

I think you misunderstood the concept of flavorDimension. A flavorDimension is something like a flavor category and every combination of a flavor from each dimension will produce a variant. In your case, you must define one flavorDimension named "type" and another dimension named "organization". It will produce, for each flavor...

Grails 2.3.9 - Error: ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType

grails,grails-plugin,spock,grails-2.3

for Grails 2.2+ try this code in your BuildConfig: grails.project.dependency.resolution = { repositories { grailsCentral() mavenCentral() } dependencies { test "org.spockframework:spock-grails-support:0.7-groovy-2.0" } plugins { test(":spock:0.7") { exclude "spock-grails-support" } } } for more info just check out: https://grails.org/plugin/spock...

Creating and referencing a library for Android project (using command line and gradle)

java,android,linux,opencv,gradle

I was finally able to create a library and use it in my Android project! The following links were helpful: http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Dependencies-Android-Libraries-and-Multi-project-setup https://docs.gradle.org/current/userguide/multi_project_builds.html http://www.petrikainulainen.net/programming/gradle/getting-started-with-gradle-creating-a-multi-project-build/ This whole process made me understand why most people just use Ecipse or Adnroid Studio. But if anyone else wants to try this, I will...

Issue building project on Android Studio - support-v4

android,gradle,android-gradle,build.gradle

Alrighty the solution was to update gradle on build.gradle of my project, not module // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.2.3' } } allprojects { repositories { jcenter() } } it was set...

How to use Library from GitHub in android App

android,github,gradle,libraries

You have add path to your aFileDialog library in your settings.gradle Make sure that folder you point to includes build.gradle file include ':app' include ':aFileDialog' project(':aFileDialog').projectDir = new File(settingsDir, 'aFileDialog') or (judging from the library folder structure on GitHub) project(':aFileDialog').projectDir = new File(settingsDir, 'aFileDialog/library') ...

Can't use RecyclerView in my Android library project

android,gradle,dependencies,recyclerview,android-library

Rebuilt the project and clean it

How to exclude dependencies of other subproject in Gradle build?

java,eclipse,gradle,dependencies,dependency-management

You could exclude all transitive dependencies of a dependency: compile('groupId:artifactId:version') { transitive = false } Or you could, but I do certainly not recommend this exclude every dependency by hand like this: compile('groupId:artifactId:version') { exclude module: 'groupId:artifactId:version' ... } ...

Spock's @Narrative and @Title annotations

groovy,spock

Title is expected to be a single line (short description) Narrative should be full paragraphs (using a Groovy multi-line string) They are mostly used in big projects where Narrative text could be read by business analysts, project managers e.t.c. As Opal said these will be more useful once some reporting...

How to create different build variants pointing to different Servers?

android,gradle

It is really easy to do with gradle. productFlavors { first_server { buildConfigField "String", "SERVER_URL", "\"https://first_server_url/\"" } second_server { buildConfigField "String", "SERVER_URL", "\"https://second_server_url/\"" } } You may want to find more information here. So later you can easy access this variable by BuildConfig.SERVER_URL...

Set variable to Gadle build file

gradle

That's because the line versionNameSuffix " branch: " + "$branch" is executed during the configuration phase, when all the tasks are configured. Then, when this phase is done and gradle knows all the tasks and their dependencies, setArgs is executed, and the following line is executed: branch = "$word1" You...

java.lang.AbstractMethodError: org.jboss.arquillian.config.descriptor.impl.EngineDefImpl.getDeploymentExportExploded()Ljava/lang/Boolean;

java,jboss,spock,wildfly-8,jboss-arquillian

The problem was an incompatible version of arquillian library. I've set all arquillian libs at 1.1.8.Final and now it works....

Spring Boot Actuator Info Endpoint Version from Gradle File

gradle,spring-boot

This exact use case is spelled out in the Boot docs: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#production-ready-application-info-automatic-expansion-gradle So in your build.gradle do this version = '0.0.1-SNAPSHOT' processResources { expand(project.properties) } Your application.yml info: build: version: ${version} Make sure to escape any spring placeholders so it doesn't conflict with Gradle. Both use ${} as the replacement...

Gradle: Adding sources.jar file within /lib folder of published dist.zip along with all my other dependencies

java,maven,jar,gradle

You need to tell the application plugin to include the output of your sourcesJar task in the distribution: distributions { main { contents { from sourcesJar } } } That will place it in the root, if you want it somewhere else you can do this: distributions { main {...

android studio “Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly”

android-studio,gradle,android-gradle

Have you had the project compile / work before? If so the issue is most likely your XML files having issues. Also try to make clean and make sure all of your dependencies are correct if you imported any. You haven't given much info besides the error code about your...

what is gradle missing to map hibernate?

java,hibernate,gradle

I think the problem is not really with gradle. It's with the fact that the JPA spec stupidly requires that the classes of the entities are in the same jar/directory as the persistence.xml file. And since Gradle doesn't store the "compiled" resources in the same output directory as the compiled...

Automatically copy .so files from NDK library project?

android-studio,gradle,android-ndk

I does not know if ther is a way to have you .so files copied as you want whiout wirtting anything. But you could have gradle doing it for you. In your gradle file, add a task that copy those .so files where you need them to be. android {...

Roboblender use annotation databases with multiple modules

android,gradle,dependency-injection,roboguice,roboblender

After some hours I found the problem. It was proguard. Adding the following line fixed the issue. -keep public class * extends com.google.inject.AnnotationDatabase You can check that the classes are being generated by running in the project folder: find . | grep -i AnnotationDatabaseImpl ...

Android Studio Best way import module from other repository

android,git,gradle,repository

I'd advice to use Jitpack Jitpack: Easy to use package repository for GitHub, just include it inside your gradle, and now you can deal with github project as a module Thanks Jitpack <3 For example: we have this repository: https://github.com/florent37/MaterialViewPager and with Jitpack in your gradle: repositories { maven {...

gradle execute task after build

gradle,build.gradle

What you need is finalizedBy, see the following script: apply plugin: 'java' task finalize << { println('finally!') } build.finalizedBy(finalize) Here are the docs....

Exclude Package From Gradle Dependency

java,web-services,rest,gradle

I found out that com.sun.jersey:jersey-core:1.19 doesn't bundle the javax.ws.rs class files and instead lists them as a compile-time dependency. Adding this snippet to my build.gradle fixed the issue. configurations.all { resolutionStrategy { // For a version that doesn't package javax.ws force 'com.sun.jersey:jersey-core:1.19' } } ...

How to download a library dependence on gradle for external use?

cordova,android-studio,gradle,android-gradle,cordova-plugins

What you're looking for is an aar file. You can copy this file to lib folder with the following script: apply plugin: 'java' repositories { mavenCentral() } dependencies { compile 'io.filepicker:filepicker-android:[email protected]' } task copyLibs(type: Copy) { from configurations.compile into 'lib' } ...

Gradle multi-project custom build.gradle file name

gradle,build,multi-project

A simple web search for "gradle rename build.gradle" renders the below example settings.gradle file: rootProject.buildFileName = 'epub-organizer.gradle' rootProject.children.each { project -> String fileBaseName = project.name.replaceAll("\p{Upper}") { "-${it.toLowerCase()}" } project.buildFileName = "${fileBaseName}.gradle" } Note that the author is here also renaming the root project's build script, which you may or may...

Android Studio work with module

java,android,android-studio,gradle

You need to check all Manifest files and ensure your modules are not providing activity with <intent-filter> used by Lauchers: <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> Also ensure your module's build.gradle for module is lists apply plugin: 'com.android.library' (as it should), and not apply plugin: 'com.android.application' (which is not correct)...

scala minecraft forgemod 'gradle runClient' gives runtime exception

scala,gradle,akka,minecraft,minecraft-forge

I figured it out. application.conf had: provider = "akka.cluster.ClusterActorRefProvider" cluster isn't part of akka-actor its part of akka-cluster. I've switched to provider = "akka.actor.LocalActorRefProvider" That works now. The other option is to add akka-cluster to the dependancies list. If your actually trying to use ClusterActorRefProvider...

Choosing specific ports on local development server for non-default modules

java,google-app-engine,android-studio,gradle,app-engine-modules

@crazystick answered it for Maven. Here's the same solution re-done for Gradle: apply plugin: ear ... appengine { downloadSdk = true httpAddress = "0.0.0.0" jvmFlags = ['-Dcom.google.appengine.devappserver_module.default.port=8080', '-Dcom.google.appengine.devappserver_module.module1.port=8081'] appcfg { email = "[email protected]" oauth2 = true } } ...

Proguard - also use proguard files from modules

android,android-studio,gradle,proguard,android-proguard

The solution is to add following line to the libraries build.gradle: consumerProguardFiles 'proguard-rules.pro' So my androKnife library looks like following: apply plugin: 'com.android.library' android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { minSdkVersion 15 targetSdkVersion 22 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' consumerProguardFiles...

Deploy closed source aar maven repo to github

android,git,maven,github,gradle

use the raw link, try changing blob for raw: http://downright-amazed.blogspot.com/2011/09/hosting-maven-repository-on-github-for.html...

Visualizing gradle dependencies in Intellij

intellij-idea,gradle,intellij-14

I did a small search in IDEA and Google and looks like there is not way to see Gradle dependency but I have found the plugin "Gradle View" which does what you need http://plugins.jetbrains.com/plugin/7150 You can open a ticket and maybe they will add a better Gradle support in IDEA...

Gradle Exec : Why it is not running in configuration phase?

gradle,exec,mkdir

Please have a look at AbstractExecTask from which Exec inherits. As you can see there are lots of getters and setters. What happens at configuration time is setting the values for that fields only, not running them. All the properties set will be used in only when exec() method annotated...

Android Studio and gradle

android,android-studio,gradle

So I have found the solution at this http://www.alonsoruibal.com/my-gradle-tips-and-tricks/. The trick is in your Java Library module's build.gradle file you need to include the following. apply plugin: 'java' sourceCompatibility = 1.6 targetCompatibility = 1.6 Wrong Java Compiler When Including a Java Module as Dependency in Android Studio...

Gradle : Cannot add task ‘:helloFromBuild1′ as a task with that name already exists

gradle

Task name collision may result from improperly importing files. For a better explanation see here.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException

android,android-studio,gradle,multidex

Try adding dexOptions{ incremental true javaMaxHeapSize "4g" } ...

Phonegap: Command failed with exit code 8

android,cordova,gradle

I have already managed to solve this problem, so, in case of anyone has a similar trouble, here it goes the situation I've gone through. When I performed the first build, phonegap attempted to download and extract it's own gradle distribution, and he was attempting to download it from the...

Using ant.replace in gradle

replace,ant,gradle

It should be: task writeVersion << { ant.replace( file: 'version.txt', token: 'versionNumber', value: '1.0.0' ) } and: version.number=versionNumber ...

Write Spock test cases for Spring boot application

java,spring,groovy,spock

Yes, you can write spock test cases for your spring application. Look at the official documentation for an example of Spock testing with Spring Boot 35.3.1 Using Spock to test Spring Boot applications A simple google search reveals a basic example of Using Spock to test Spring classes. Spock relies...

duplicate an android studio project

android,gradle,duplicates,project,sync

i think that i found the source of my problem it was a virtual machine problem. so the solution is : open file -> settings clic to : compiler in the VM option field put te following value: -Xmx512m That's all...

Adding Android AppWidget just for one Product Flavor

android,gradle,android-appwidget,android-productflavors

So we will have our example packages is as follows for your production and staging builds within the gradle product flavors. productFlavors { production { packageName "x(path).x(path).gradleexample" } staging { packageName "x(path).x(path).gradleexample.staging" } } Here is an example of your folder structure some of which may or may not apply...

Gradle Assemble Debug is Successful But Does Not Work [duplicate]

android,command-line,gradle

Look for build outputs under the app module. app/build/outputs/...

Gradle & Jacoco: Get jacoco reports for Test-type task other than “test”

java,gradle,jacoco

Turns out, this works: task integTestReport (type: JacocoReport) { executionData project.tasks.integTest sourceDirectories = project.files(project.sourceSets.test.allSource.srcDirs) classDirectories = project.sourceSets.test.output def reportDir = project.reporting.file("jacoco/integTest/html") reports { html.destination = reportDir } doLast { println "See report at: file://${reportDir.toURI().path}index.html" } } I hope this is helpful :) EDIT: This needs to be later in the...