gradle

Gradle compileOnly and Maven provided

自闭症网瘾萝莉.ら 提交于 2020-05-16 22:30:08
问题 I have a simple project with the retrofit dependency. dependencies { ... implementation 'com.squareup.retrofit2:retrofit:2.8.1' } If i check the retrofit pom.xml I can find the OkHttp dependency as a compile maven scope that means the old compile gradle configuration as well. <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache

Where to put gradle dependencies block in kotlin native project generated by Intellij IDEA?

时光毁灭记忆、已成空白 提交于 2020-05-15 22:44:56
问题 I'm trying to make my first app in Kotlin Native. I want to add TornadoFX to my freshly created project. I need to add a dependency according to TornadoFX guide dependencies { compile 'no.tornado:tornadofx:x.y.z' } The issue is - I cant figure out where exactly do I put it . This is my build.gradle contents (generated by IntelliJ IDEA): plugins { id 'org.jetbrains.kotlin.multiplatform' version '1.3.60' } repositories { mavenCentral() } kotlin { // For ARM, should be changed to iosArm32 or

How to run a gradle task from a java code?

本小妞迷上赌 提交于 2020-05-15 10:27:00
问题 I need to run the gradle eclipse task to an external gradle project from a java method, is it possible to do it using the Gradle Tooling API ? 回答1: The Gradle forum gives a nice example for doing this programmatically but since it disregards the projects individual gradle wrapper, it can't gurantee the smooth execution of your build and even break your application. For more information why you always should rely on the gradle wrapper read here and here. Using the Gradle wrapper The

Gluon Mobile project does not work with gradle 6

瘦欲@ 提交于 2020-05-15 08:47:05
问题 I'm have a Gluon mobile project with a build.gradle like this: buildscript { repositories { jcenter() google() mavenCentral() maven { url 'http://nexus.gluonhq.com/nexus/content/repositories/releases' } } dependencies { classpath 'org.javafxports:jfxmobile-plugin:2.0.30' classpath 'com.google.gradle:osdetector-gradle-plugin:1.6.0' classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.2' } } repositories { jcenter() maven { url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'

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

How to enable helpful NullPointerExceptions in gradle test

拜拜、爱过 提交于 2020-05-14 18:16:46
问题 I want to put the flag -XX:+ShowCodeDetailsInExceptionMessages to enable helpful NPEs (https://openjdk.java.net/jeps/358) on the tests I tried tasks.withType<Test> { jvmArgs("-XX:+ShowCodeDetailsInExceptionMessages") testLogging { setExceptionFormat("full") // Prints the message of the exception } } But the NPEs have still no messages. Here's my java version java -version openjdk version "14.0.1" 2020-04-14 OpenJDK Runtime Environment (build 14.0.1+7) OpenJDK 64-Bit Server VM (build 14.0.1+7,

How to enable helpful NullPointerExceptions in gradle test

戏子无情 提交于 2020-05-14 18:16:27
问题 I want to put the flag -XX:+ShowCodeDetailsInExceptionMessages to enable helpful NPEs (https://openjdk.java.net/jeps/358) on the tests I tried tasks.withType<Test> { jvmArgs("-XX:+ShowCodeDetailsInExceptionMessages") testLogging { setExceptionFormat("full") // Prints the message of the exception } } But the NPEs have still no messages. Here's my java version java -version openjdk version "14.0.1" 2020-04-14 OpenJDK Runtime Environment (build 14.0.1+7) OpenJDK 64-Bit Server VM (build 14.0.1+7,

How to extend the behavior of a Gradle task for a new task type?

痞子三分冷 提交于 2020-05-14 17:20:35
问题 I would like to set a few things for a few test tasks. More specifically, I would like to add a few environment variables and a few system properties, maybe a few other things such as "dependencies" or "workingDir". With the regular Test task I can do this, task test1(type:Test, dependsOn:[testPrep,testPrep1]){ workingDir testWorkingPath systemProperty 'property','abs' environment.find { it.key ==~ /(?i)PATH/ }.value += (System.properties['path.separator'] + myLibPath) environment.LD_LIBRARY

How to extend the behavior of a Gradle task for a new task type?

倾然丶 夕夏残阳落幕 提交于 2020-05-14 17:20:12
问题 I would like to set a few things for a few test tasks. More specifically, I would like to add a few environment variables and a few system properties, maybe a few other things such as "dependencies" or "workingDir". With the regular Test task I can do this, task test1(type:Test, dependsOn:[testPrep,testPrep1]){ workingDir testWorkingPath systemProperty 'property','abs' environment.find { it.key ==~ /(?i)PATH/ }.value += (System.properties['path.separator'] + myLibPath) environment.LD_LIBRARY

Could not find method commandLine()

梦想与她 提交于 2020-05-14 14:46:28
问题 I'm attempting to add a pre-pre-build shell script to my gradle/Android-Studio build. I've added the following to app/build.gradle : task prePreBuild << { commandLine 'ls' } preBuild.dependsOn prePreBuild When I invoke my build with ./gradlew assembleDebug I get the following error: Could not find method commandLine() for arguments [ls] on project ':app' If I replace the commandLine line with something like println 'Hello' then it works fine, and I can see the output from my new task. I