gradle-plugin

Kotlin Test Coverage

允我心安 提交于 2019-12-06 20:24:13
问题 Does anyone know if a good test coverage tool (preferably Gradle plugin) exists for Kotlin? I've looked into JaCoCo a bit, but it doesn't seem to reliably support Kotlin. 回答1: As requested, here is an example build.gradle that uses Kotlin, and incorporates both Jacoco and Sonarqube integration, produces a jar and sources, and ties in Detekt for static analysis. I had to manually add a couple things as my work build has jacoco applied by an in-house plugin. plugins { id 'org.jetbrains.kotlin

Configuring nodeModulesDir in gradle-node-plugin

时光总嘲笑我的痴心妄想 提交于 2019-12-06 07:35:11
问题 I trying to set up caching of npm packages. This is my plugin configuration: node { version = '4.5.0' npmVersion = '3.10.6' distBaseUrl = 'https://nodejs.org/dist' download = true workDir = file("$webAppSourceAbsolute/nodejs") nodeModulesDir = file("$webAppSourceAbsolute/") } And this is my task: task npmCacheConfig(type: NpmTask) { description = "Configure the NPM cache" outputs.upToDateWhen { false } def npmCacheDir = "${gradle.getGradleUserHomeDir()}/caches/npm" outputs.files file

Duplicate Entry for ':app:transformClassesWithJarMergingForDebug'

百般思念 提交于 2019-12-06 07:14:10
问题 I am Importing my project from Eclipse , while building an APK i found following Error. Error:Execution failed for task com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/plus/PlusOneButton$OnPlusOneClickListener.class Error:Execution failed for task ':gruhini:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/games

Apply custom gradle plugin locally in the same project

女生的网名这么多〃 提交于 2019-12-06 05:23:14
I wrote a gradle plugin that I only want to use in my own project. Here's a simplified file structure: /root project | + build.gradle + settings.gradle + build/ + some module/ | + build.gradle + src/ + build/ + plugin/ | + build.gradle + src/ + build/ I add the plugin to the module by referencing the jar file // From '/some module/build.gradle' buildscript { dependencies { classpath files('./plugin/build/libs/payload-plugin-0.0.1-SNAPSHOT.jar') } } apply plugin: 'my-custom-plugin' It works fine at first, but there's a problem. If you clean the project and try to build it again, it fails,

How to view source code of Gradle tasks defined in plugins using Android Studio?

早过忘川 提交于 2019-12-06 03:44:39
In Android Studio Gradle tab I'm able to find run task from application plugin. I want to view source code of this task. Right click -> Jump to Source is disabled for this task. How to view source code of tasks defined in plugins using Android Studio? 来源: https://stackoverflow.com/questions/48796388/how-to-view-source-code-of-gradle-tasks-defined-in-plugins-using-android-studio

Not work: Android Studio 3.2 Canary11 + 3.2.0-alpha11 for kapt with com.android.databinding

老子叫甜甜 提交于 2019-12-05 21:02:58
Android Studio 3.2 Canary11 Gradle Tool 3.2.0-alpha11 com.android.databinding of kapt doesn't work with 3.2.0-alpha11, can not build / run apk. Meanwhile, it works max with 3.2.0-alpha10 ``` Execution failed for task ':app:kaptGenerateStubsDevDebugKotlin'. Could not resolve all files for configuration ':app:kapt'. Could not find com.android.databinding:compiler:3.2.0-alpha11. Searched in the following locations: file:/Users/xxxx/Library/Android/sdk/extras/m2repository/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom file:/Users/xxx/Library/Android/sdk/extras

How to get Android Studio main SourceSet with Gradle API?

会有一股神秘感。 提交于 2019-12-05 16:46:16
I'm working on developing a gradle plugin for Android Studio.Here is my problem How can I get Android Studio main SourceSet with Gradle API? I want to do some copy stuff with java source directory. Before asking this question, I found something useful but not work. SourceSet main = project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME) I get this error message Caused by: org.gradle.api.UnknownDomainObjectException: SourceSet with name 'main' not found. First,the code doesn't work because it's only for the java project with java

Gradle plugin doesn't work in Intellij IDEA (Calculate task graph)?

南楼画角 提交于 2019-12-05 06:47:34
The problem is that the Gradle plugin in Intellij IDEA doesn't work with my project. If I use "Gradle build" in the command line it works perfectly but if I try to build the project with the Gradle plugin in Intellij IDEA it doesn't work. It shows some error on the task "Calculate task graph". What is it? Why it doesn't work? Here is console output: 6:21:57 PM: Executing external tasks 'gradle build'... FAILURE: Build failed with an exception. * What went wrong: Task 'gradle' not found in root project 'upload-server'. * Try: Run gradle tasks to get a list of available tasks. Run with -

Gradle plugin for custom language

本小妞迷上赌 提交于 2019-12-05 02:24:16
问题 I have a custom language (let's say it is MyLang but it can be any language) and I would like to make a plugin for it. The plugin needs to be able to recognize the sourcesets for the language given with DSL be able to compile them using an executable (the compiler) I was able to create a plugin with a compile task (empty yet) and annotate a function with @LanguageType setting the language name to "mylang". How can I modify the plugin to be possible to add sourcesets from build.gradle files

Create custom Build init type - for Gradle Build Init Plugin?

点点圈 提交于 2019-12-05 01:08:38
I'm fairly new to gradle and I would like to create a custom type for with the Gradle Init Plugin. Moreover, I'd like to be able to do something like: gradle init --type jsp-library This would generate a project directory with the same structure as a Java web application (webapp, stylesheets, etc...). Yes, I have read this , and I know that only a limited amount of types are available. I just want to know if someone has or knows of some sort of work around for the time being. There are 3rd party plugins that allow you to create custom templates and generate new projects from templates. For