gradle-plugin

How do I change unixStartScriptGenerator.template in the createStartScripts task so that distTar uses my custom template file in build.gradle?

我们两清 提交于 2020-05-14 20:44:27
问题 I need to modify the start script that gradle generates for the distTar task. I seem to be able to set unixStartScriptGenerator.template as shown below, but when I unpack the script from the tar my changes are not there. This is my full build.gradle : apply plugin: 'java' apply plugin: 'war' // to use the main method in Main, which uses Jetty apply plugin: 'application' mainClassName = 'com.example.Main' project.version = '2017.0.0.0' repositories { mavenLocal() mavenCentral() } task

Configure Jacoco with gradle and kotlin DSL

江枫思渺然 提交于 2020-05-11 19:02:02
问题 I'm trying to configure Jacoco to exclude some classes from analysis but can't find any working example :( I found some samples with afterEvaluate but no success 回答1: src/main/java/org/example/A.java : package org.example; class A { } src/main/java/org/example/B.java : package org.example; class B { } src/test/java/org/example/ExampleTest.java : package org.example; public class ExampleTest { @org.junit.Test public void test() { new A(); new B(); } } build.gradle.kts : plugins { java jacoco }

Configure Jacoco with gradle and kotlin DSL

拟墨画扇 提交于 2020-05-11 18:56:13
问题 I'm trying to configure Jacoco to exclude some classes from analysis but can't find any working example :( I found some samples with afterEvaluate but no success 回答1: src/main/java/org/example/A.java : package org.example; class A { } src/main/java/org/example/B.java : package org.example; class B { } src/test/java/org/example/ExampleTest.java : package org.example; public class ExampleTest { @org.junit.Test public void test() { new A(); new B(); } } build.gradle.kts : plugins { java jacoco }

How to import a helper class in buildSrc/build.gradle.kts, settings.gradle.kts, and build.gradle.kts?

故事扮演 提交于 2020-03-21 06:43:49
问题 I'd like to create a class to help me loading different types of properties ( local.properties , gradle.properties , $GRADLE_HOME/gradle.properties , environment variables, system properties, and custom properties files (maybe in other formats like yml , xml , etc.). Also, I'd like to use this in my buildSrc/build.gradle.kts , settings.gradle.kts , and build.gradle.kts . Please consider that we are using Gradle 6.+ . A simple implementation of this class would be (the full implementation

Android multi module test dependency

这一生的挚爱 提交于 2020-03-18 03:28:06
问题 With Android Studio 3.0 / android_gradle_version = '3.0.1' / gradle-4.5 Let's say I have two android modules module-base module-a When I want to access sources from module-base in module-a , I just need to write this in my module-a.gradle dependencies { implementation project(path: ':module-base') } But, what if I want to access test sources from module-base in test of module-a ? Here does not work approach like above dependencies { testImplementation project(path: ':module-base') } I found

Android multi module test dependency

为君一笑 提交于 2020-03-18 03:28:02
问题 With Android Studio 3.0 / android_gradle_version = '3.0.1' / gradle-4.5 Let's say I have two android modules module-base module-a When I want to access sources from module-base in module-a , I just need to write this in my module-a.gradle dependencies { implementation project(path: ':module-base') } But, what if I want to access test sources from module-base in test of module-a ? Here does not work approach like above dependencies { testImplementation project(path: ':module-base') } I found

Migrating project to new experimental gradle plugin 0.6.0-alpha3 -> 0.6.0-alpha5

笑着哭i 提交于 2020-03-05 07:54:09
问题 I try to migrate my Android project to new experimental gradle plugin. I followed instructions at this page. I made changes in required files, but I have an error when I try to Sync project with gradle files. Error:Exception thrown while executing model rule: BaseComponentModelPlugin.Rules#createBinaryTasks apply plugin: 'com.android.model.application' def opencv_modules = ["shape", "stitching", "objdetect", "superres", "videostab", "calib3d", "features2d", "highgui", "videoio", "imgcodecs",

Could not resolve com.android.tools.build:gradle:3.3.2

我的梦境 提交于 2020-02-29 10:49:48
问题 I was trying to add firebase auth to my android project but getting this error. I have tried adding 'com.google.firebase:firebase-core:16.0.3' too but its taking more than 40 mins and still not syncing the gradle. This is build.gradle file: apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 28 defaultConfig { applicationId "myaid.startup" minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "1.0"

Use Custom gradle plugin module in another module

末鹿安然 提交于 2020-02-05 07:37:06
问题 I am developing a custom plugin that I want to be able to deploy to a repository at a later stage so I've created a stand alone module for it. Before I do any formal TDD on it, I wanna do certain exploratory tests manually so, I've created a demo module that uses the given plugin in. The only way I've found so far to do this was to deploy the plugin into a local repository and then import it on the other module. But this is very tedious and it's quite easy to forget to deploy it. I was

In Android Studio 2.1.3 is experimental gradle not working?

北城以北 提交于 2020-02-03 08:24:46
问题 I have a project where I mix and match regular Android Gradle Plugin: apply plugin: 'com.android.library' and Experimental Gradle Plugin as a library: apply plugin: 'com.android.model.library' In my overall build.gradle I have the following dependencies: buildscript { repositories { jcenter() } dependencies { classpath 'com.google.gms:google-services:3.0.0' classpath 'com.android.tools.build:gradle-experimental:0.7.2' classpath 'com.android.tools.build:gradle:2.1.3' } } And now after upgrade