gradle

Is it possible for Instrumented tests to create coverage for a library module?

被刻印的时光 ゝ 提交于 2021-01-27 21:05:51
问题 I am in the process of modularising the app I am working on and my coverage has dropped over 20% since splitting my instrumentation tests into the app module. The app is being split into app , core , custom , where core is an android library and the other 2 modules are apps. The majority of the app's functionality will live in core and it is currently mostly tested through instrumentation tests which now reside in app . Is there a way that instrumentation tests in an application module can

Gradle project name starting with a '.'

人走茶凉 提交于 2021-01-27 18:12:32
问题 When the name of a current directory starts with a '.' (e.g. /home/you/.gproject ), gradle build returns The project name .gproject starts or ends with a '.' . This has been deprecated and is scheduled to be removed in Gradle 5.0. Set the rootProject.name or adjust the include statement (see https://docs.gradle.org/4.3/dsl/org.gradle.api.initialization.Settings.html#org.gradle.api.initialization.Settings:include(java.lang.String[]) for more details). How can I fix it? Should I avoid such

How to include the client from openapi-generator in a gradle java application?

拜拜、爱过 提交于 2021-01-27 17:39:29
问题 I want to create a gradle java application that generates a client from an openAPI specification file and uses that client. So I created a java application with gradle init (type:application, language:Java, DSL:groovy, test-framework:Junit Jupiter, project-name:simple-java-app, package-structure: a.aa ). Small example of what works: I can create a new source folder second/loc/src/main/java with a package b.bb and a class Foo . And with the following build.gradle plugins { id 'java' id

How to create Micronaut's fat-jar without shadow plugin?

最后都变了- 提交于 2021-01-27 17:20:01
问题 What started as a roadblock to setup a new Micronaut project with corporate repo, is now more about curiosity of how Embedded server is bootstrapped. I have a Micronaut CLI generated project with com.github.johnrengelman.shadow gradle plugin which works fine when I run the jar using- $ java -Dmicronaut.environments=E1 -jar build/appBundle/app.jar build.gradle - plugins { id "com.github.johnrengelman.shadow" version "5.0.0" } ... shadowJar { mergeServiceFiles() } When I replace shadow plugin

How to include the client from openapi-generator in a gradle java application?

ⅰ亾dé卋堺 提交于 2021-01-27 17:19:40
问题 I want to create a gradle java application that generates a client from an openAPI specification file and uses that client. So I created a java application with gradle init (type:application, language:Java, DSL:groovy, test-framework:Junit Jupiter, project-name:simple-java-app, package-structure: a.aa ). Small example of what works: I can create a new source folder second/loc/src/main/java with a package b.bb and a class Foo . And with the following build.gradle plugins { id 'java' id

How to create Micronaut's fat-jar without shadow plugin?

自作多情 提交于 2021-01-27 17:15:47
问题 What started as a roadblock to setup a new Micronaut project with corporate repo, is now more about curiosity of how Embedded server is bootstrapped. I have a Micronaut CLI generated project with com.github.johnrengelman.shadow gradle plugin which works fine when I run the jar using- $ java -Dmicronaut.environments=E1 -jar build/appBundle/app.jar build.gradle - plugins { id "com.github.johnrengelman.shadow" version "5.0.0" } ... shadowJar { mergeServiceFiles() } When I replace shadow plugin

Eclipse : How to set env variables for Gradle run

不羁的心 提交于 2021-01-27 17:13:33
问题 I am using the buildship plugin to build gradle projects. I need to use some env variables in my build script to connect to some external repositories. When i run the gradle build from command line, it works fine as I have the required env variables. I would like to run the build from eclipse. I do not see an Environment tab in the run configuration window. How do i set env variables for gradle build in eclipse? Here is where i need the env variables repositories { mavenCentral() maven { def

Gradle 'error: package com.google.common.collect does not exist'

泪湿孤枕 提交于 2021-01-27 14:54:03
问题 I am following a little test script and providing it with the first piece of code to make it green. The code is java and the testing is gradle with java. Java is version "1.8.0_60" on Mac OSX "El Capitan". gradle is version 2.8. After using gradle build , here is the error shown: $ gradle build :compileJava /Users/rsalazar/exercism/java/etl/src/main/java/Etl.java:1: error: package com.google.common.collect does not exist import com.google.common.collect.ImmutableMap; ^ /Users/rsalazar

Could not determine java version from '12.0.2'

故事扮演 提交于 2021-01-27 14:50:57
问题 I followed this React Native error: "Could not determine java version from '9.0.1'." and changed to distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip in PROJECT_PATH/android/gradle/wrapper/gradle-wrapper.properties but this didn't slved my problem it showed me new error Cannot add task 'wrapper' as a task with that name already exists. 回答1: Support for JDK 12 was added in Gradle 5.4 so you need to update accordingly. The latest version however is 5.5.1 if you would

Disabling Gradle daemon in a specific project

北慕城南 提交于 2021-01-27 14:44:58
问题 I'd like to build certain projects without the use of of Gradle daemon. I've read that this can be done either by command-line argument --no-daemon or by changing Gradle properties under .gradle/ . I need to disable it for just some of the projects I build under the root project though. Is it possible via settings.gradle / build.gradle settings or am I better off making custom build script? 回答1: You can simply add org.gradle.daemon=false to a gradle.properties file in the project root folder.