gradle-plugin

DriverManager doesn't see dependency in gradle custom plugin's task

筅森魡賤 提交于 2019-11-29 07:57:56
I'm writing some gradle plugin and now I've faced with a problem that DriverManager doesn't see JDBC driver defined in buildscript dependency: I have next build.gradle file: buildscript { repositories { mavenCentral() } dependencies { classpath("com.h2database:h2:1.4.196") } } plugins { id "someplugin" } apply plugin: 'groovy' And when I invoke command defined in task that extends DefaultTask DriverManager.getConnection("jdbc:h2:mem:", "sa", "") I receive exception No suitable driver found for jdbc:h2:mem: There is no problem when I unit-test these classes - it happens only when I invoke

How can the gradle plugin repository be changed?

人走茶凉 提交于 2019-11-29 02:57:29
I work at a big company with a strict policy forbidding the unfiltered use of outside libraries. We have to pull everything from blessed corporate repositories, and not the bare internet, including gradle.org. Using gradle's original apply plugin syntax, in conjunction with a buildscript block, I can add (blessed) plugins to our repo and use them in builds. In other words: buildscript { repositories { maven { url "https://privaterepo.myemployer.com" } } dependencies { // various dependencies classpath "org.something:some-plugin:1.0" ... } apply plugin: "someplugin" Instead, I want to be able

How do I create an executable fat jar with Gradle with implementation dependencies

送分小仙女□ 提交于 2019-11-29 01:05:58
I've got a simple project in Gradle 4.6 and would like to make an executable jar of it. I've tried shadow , gradle-fatjar-plugin , gradle-one-jar , spring-boot-gradle-plugin plugins but neither of them adds my dependencies declared as implementation (I don't have any compile ones). It works with compile e.g. for gradle-one-jar plugin but I would like to have implementation dependencies. Thank you very much! miskender You can use the following code. jar { manifest { attributes( 'Main-Class': 'com.package.YourClass' ) } from { configurations.runtimeClasspath.collect { it.isDirectory() ? it :

Gradle sync failed: 'com.android.build.gradle.BasePlugin' does not implement the Plugin interface

我只是一个虾纸丫 提交于 2019-11-28 21:13:11
问题 Environment : Android Studio 2.1 Project : Android SDK + Cordova Android Studio throws the following error during Gradle Sync : Gradle sync failed: 'com.android.build.gradle.BasePlugin' does not implement the Plugin interface 回答1: Faced the same issue after upgrading to android studio 2.1 from 1.5 Managed to resolve by updating the dependencies version if the gradle.gradleVersion >= 2.1 in the build.gradle file under buildscript {} OLD Configuration if (gradle.gradleVersion >= "2.2") {

build failing during merge resources with Android Gradle plugin 3.3.0

偶尔善良 提交于 2019-11-28 18:18:07
I have a lot of different flavors for my build that have specific resources and I don't want to clutter my src directory in my project with a bunch of flavor-specific directories, so I add the source sets from another folder in my project prior to the mergeResources task (mergeResources.doFirst). This has always worked for the past several versions of the Android Gradle plug-in (3.1.0-3.2.0 and some of the 3.3.0-alpha versions), but at a certain point, the 3.3.0-alpha AGP started causing build failures during this mergeResources task. Now I keep getting: BUILD FAILED in 35s 16 actionable tasks

What the difference in applying gradle plugin

给你一囗甜甜゛ 提交于 2019-11-28 15:45:50
I don't understand gradle plugins block apply plugin: 'someplugin1' apply plugin: 'maven' and other one: plugins { id 'org.hidetake.ssh' version '1.1.2' } In first block We have some plugin name. in second one package and version. I don't understand where I should use first block and when second one. The plugins block is the newer method of applying plugins, and they must be available in the Gradle plugin repository . The apply approach is the older, yet more flexible method of adding a plugin to your build. The new plugins method does not work in multi-project configurations ( subprojects ,

how to prevent jacoco instrumenting production code?

隐身守侯 提交于 2019-11-28 11:02:19
问题 i use jacoco plugin for gradle: apply plugin: 'kotlin' jacoco { toolVersion = "0.7.9" } jacocoTestReport { reports { xml.enabled true html.enabled false csv.enabled false } } and then i want to build a package for production ./gradlew build jacocoTestReport the question is: will the generated package be instrumented by jacoco? if yes, how can build package NOT instrumented = ready for production? and having code coverage run? do i have to run build twice? is it impossible to build code once

Can't use Android Gradle Plugin 3.0.+ with IntelliJ IDEA

陌路散爱 提交于 2019-11-28 08:03:03
问题 When I'm trying to use Android Gradle Plugin 3.0.+ with Intellij IDEA, I'm getting error: Error:This Gradle plugin requires Studio 3.0 minimum But my version of IntelliJ is higher than 2017.2 and it should work with gradle plugin for AS 3.0. 回答1: It can be fixed by adding this option to your gradle.properties : android.injected.build.model.only.versioned=3 Explanation: From Reddit /r/androiddev A version check is in place in ModelBuilder that is fed by Gradle properties inserted by the IDE

While Android Studio Updated to v3.3 getting API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'

帅比萌擦擦* 提交于 2019-11-28 00:15:46
Getting this Warning (Even when variant.getAssemble() is not used anywhere): API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'. I have updated following components: Android Studio v3.3 Gradle PlugIn v3.3 Gradle Distribution URL (gradle-wrapper.properties) distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip gradle.properties android.debug.obsoleteApi=true variant.assemble has been deprecated and replaced by a new provider API. If for example you are using it as next: variant.outputs.all { output -> variant.assemble

Not able to copy configurations dependencies after upgrading Gradle plugin for Android Studio to 3.0.1 and Gradle to 4.1

倖福魔咒の 提交于 2019-11-27 20:56:12
问题 I used to copy 'compile' dependencies to a specific folder using this simple gradle task : task copyLibs(type: Copy) { from configurations.compile into "$project.rootDir/reports/libs/" } But it stopped working just after upgrading my Android project using gradle plugin 3.0.1 for Android Studio and Gradle tool to 4.1. As the dependency configuration 'compile' is now deprecated by https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#new_configurations I changed it to