gradle-plugin

How to setup a Gradle plugin project in IntelliJ?

我们两清 提交于 2019-12-20 10:40:17
问题 I want to create a standalone Gradle plugin project as described in the Gradle documentation. I would like to use IntelliJ with code completion for Groovy and Gradle. Since there is no specialized wizard to create a Gradle plugin project I have to do it manually. I already managed to add the Groovy SDK (binary) in the IDE via: File / Other Settings / Default Project Structure as shown in the screenshot. To start with I created a new Gradle project which also contains the Gradle wrapper. I

How can the gradle plugin repository be changed?

你离开我真会死。 提交于 2019-12-18 03:49:13
问题 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

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

白昼怎懂夜的黑 提交于 2019-12-17 23:16:36
问题 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! 回答1: You can use the following code. jar { manifest { attributes( 'Main-Class': 'com

Original kapt is deprecated

喜你入骨 提交于 2019-12-14 03:43:46
问题 I have changed Kotlin version to 1.2.30. After the update I unable to run the project. I got the below error message. Error:Execution failed for task ':app:compileDevDebugJavaWithJavac'. > app: Original kapt is deprecated. Please add "apply plugin: 'kotlin-kapt'" to your build.gradle. How do I resolve this? 回答1: Source : Annotation Processing with Kotlin Source Link 1: https://kotlinlang.org/docs/reference/kapt.html Source Link 2:https://github.com/uber/NullAway/issues/75 Kotlin plugin doesn

What does _apply plugin: 'com.google.gms.google-services'_ do?

你。 提交于 2019-12-13 08:57:54
问题 What does exactly adding apply plugin: 'com.google.gms.google-services' do? If I comment this, my app still will compile and run. More about adding Firebase to the project here. 回答1: It reads resources out of your google-services.json file as described here. It also adds a compile dependency on firebase-core if not already present. That dependency will cause FirebaseInitProvider to get merged into your manifest, which is responsible for initializing a default FirebaseApp at app launch with

How to publish and use gradle plugin with dependencies on local project?

不问归期 提交于 2019-12-12 19:58:43
问题 I am creating gradle plugin which has dependency on my other local module. Some of its gradle build look like this: dependencies { compile gradleApi() compile project(":myDependencyProject") } publishing { publications { maven(MavenPublication) { groupId = 'org.my.gradle.plugin' artifactId = 'some-name' version = '1.0-SNAPSHOT' from components.java } } } gradlePlugin { plugins { jsonPlugin { id = 'org.my.gradle.plugin' implementationClass = 'my.implementation.class' } } } When I publish my

Debug localhost on app engine with Intellij Idea and gradle

别等时光非礼了梦想. 提交于 2019-12-12 19:14:29
问题 I am using IntelliJ community addition and building an app engine standard environment application with Gradle. I was using Android Studio before migrating to IntelliJ and endpoint framework. I am not able to debug my localhost. I added jvmFlags as explained here: https://cloud.google.com/appengine/docs/standard/java/tools/gradle appengine { run { jvmFlags = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005'] } } And deployed my app to local with debug button. But the

Library class (from Android sdk) depends on program class (again, Android sdk)

你说的曾经没有我的故事 提交于 2019-12-12 15:11:33
问题 We are migrating from Android Gradle plugin 2.3.3 to Gradle plugin 3.0.1. Our application consists of an Application module and a Library module. Several dependencies are transitive (connected using api keyword) but even making them non-transitive using implementation doesn't help. After changing all the compile -type dependencies to the new ones, debug build works well. However, release build with Proguard shows thousands of warnings (on 2.3.3 everything goes well) In particular, I don't get

Correct way to configure gradle plugin extensions with groups of dynamic objects

别等时光非礼了梦想. 提交于 2019-12-12 12:16:23
问题 I am trying to write my own gradle plugin and it needs to be able to configure a set of objects - how many of these objects and what they're called is up to the user. The doco for creating custom gradle plugins with advanced customisability is quite poor. It mentions project.container() method to do this kind of thing, but I couldn't figure out how to make it work in my usecase. This is an example of my plugin's configuration DSL as it stands: teregrin { terraformVersion = '0.6.6' root("dev")

How can Variant Outputs be manipulated using the Android Gradle Plugin 3.0.0+?

风流意气都作罢 提交于 2019-12-12 07:45:44
问题 The latest version (3.0.0) of the Android Plugin for Gradle has broken its API for manipulating Variant Outputs. This API was used for manipulating files creating during builds (such as AndroidManifest.xml), and has been removed to improve configuration times. What new APIs are available to manipulate Variant Outputs, and how do they differ to the 2.X APIs? 回答1: The changes to outputFiles has now been documented on the Android Developer site. Essentially, instead of accessing the outputFile