gradlew

Slow gradle build in Docker. Caching gradle build

一世执手 提交于 2019-12-21 14:24:11
问题 I am doing university project where we need to run multiple Spring Boot applications at once. I had already configured multi-stage build with gradle docker image and then run app in openjdk:jre image. Here is my Dockerfile: FROM gradle:5.3.0-jdk11-slim as builder USER root WORKDIR /usr/src/java-code COPY . /usr/src/java-code/ RUN gradle bootJar FROM openjdk:11-jre-slim EXPOSE 8080 WORKDIR /usr/src/java-app COPY --from=builder /usr/src/java-code/build/libs/*.jar ./app.jar ENTRYPOINT ["java", "

What does “Sync Project with Gradle File ” really mean?

╄→尐↘猪︶ㄣ 提交于 2019-12-20 19:24:31
问题 In Android Studio there is a button Sync Project with Gradle File , I always use it, and it's useful. It will download dependence packages and maybe something more. But what does it really mean? Is there a corresponding command in gradlew ? If I develop an app just using gradle, NO IDE, what commnd should I use ? 回答1: The button does what it says: it updates the Android Studio project model to match the contents of the Gradle build file. There is no corresponding gradlew command because there

How to retrieve path to ADB in build.gradle

邮差的信 提交于 2019-12-20 11:56:11
问题 I trying to start application via gradle task . task runDebug(dependsOn: ['installDebug', 'run']) { } task run(type: Exec) { commandLine 'adb', 'shell', 'am', 'start', '-n', 'com.example.myexample/.ui.SplashScreenActivity' } But this code don't work and i get error: a problem occurred starting process 'command 'adb'' However, when i specify the path to adb explicitly, application is started. task run(type: Exec) { commandLine 'D:\\android\\android-studio\\sdk\\platform-tools\\adb', 'shell',

Intellij Idea not showing errors in Message Tool Window after Gradle build

六眼飞鱼酱① 提交于 2019-12-18 19:06:12
问题 Intellij Idea 14.1.2, Gradle 2.3 I have a project with few java subprojects. Gradle builds works as expected but Intellij Idea does not capture the output of it and does not show the Messages Tool Window where you can click on the error and go to the source file. Steps to reproduce: Create new gradle project Create new class with one method Introduce intentionally one error Build using Gradle tool window Expected result: Message Tool window will show up showing the error. Actual result:

Gradle gets unexpected token, compile files

这一生的挚爱 提交于 2019-12-18 09:34:58
问题 What am I doing wrong ? I am referring to this build.gradle compile files('libs/redisson-1.3.2-SNAPSHOT.jar') ls libs/ $ ls libs/ redisson-1.3.2-SNAPSHOT.jar Error * Where: Build file '/myfolder/myproject/build.gradle' line: 162 * What went wrong: Could not compile build file '/myfolder/myproject/build.gradle'. > startup failed: build file '/myfolder/myproject/build.gradle': 162: unexpected token: redisson @ line 162, column 23. compile files('libs/redisson-1.3.2-SNAPSHOT.jar') ^ 1 error *

How to use gradle zip in local system without downloading when using gradle-wrapper

主宰稳场 提交于 2019-12-17 17:28:22
问题 I'm trying to build a gradle project with gradle-wrapper ( gradlew ). When I build with ./gradlew build , it outputs text Downloading http://services.gradle.org/distributions/gradle-1.11-bin.zip And I already got gradle-1.11-bin.zip downloaded separately and I don't want to be downloading it again when I build. So, where shall I put gradle-1.11-bin.zip in my project or system so that I don't have to download again? gradle/wrapper/gradle-wrapper.properties is as following. distributionBase

Can you deploy to a device via Gradle from the command line

China☆狼群 提交于 2019-12-17 17:24:35
问题 What the question says really - can you issue any commands directly to gradlew via the command line to build, package and deploy to a device? 回答1: $ gradle installDebug This will push the debug build apk to device, but you have to manually start the application. 回答2: Since you are using Gradle, you could simple add your own task in build.gradle task appStart(type: Exec, dependsOn: 'installDebug') { // linux commandLine 'adb', 'shell', 'am', 'start', '-n', 'com.example/.MyActivity' // windows

gradlew: Permission Denied

流过昼夜 提交于 2019-12-17 17:24:19
问题 I am attempting to run gradlew from my command line, but am constantly facing the following error. Brendas-MacBook-Pro:appx_android brendalogy$ ./gradlew compileDebug --stacktrace -bash: ./gradlew: Permission denied I am already running this command from my project directory. Need to run this command as I am facing the same (nondescriptive) error on Android Studio 0.2.x as encountered here: Android studio and gradle build error Am I doing something wrong and how do I get around this? 回答1: Try

Android Studio: “Use default gradle wrapper” vs. “Use customizable gradle wrapper”

妖精的绣舞 提交于 2019-12-17 08:18:23
问题 What exactly is the difference between Android Studio's Gradle options: Android Studio->Preferences->Gradle Use default gradle wrapper (recommended) and Use customizable gradle wrapper ? Background: I am working on an Android project in Android Studio and using a Gradle wrapper. However, when I use the Android Studio settings "Use customizable gradlew wrapper" every time my team members sync the Android Studio project using the gui command: they find the gradle/wrapper/gradle-wrapper

Could not find or load main class org.gradle.wrapper.GradleWrapperMain

核能气质少年 提交于 2019-12-17 08:08:09
问题 I cleaned the whole project by deleting local directories like ~/.gradle , ~/.m2 ~./android and ~/workspace/project/.gradle and chosing File -> Invalidate Caches / Restart... in Android Studio. Now execution of the command ./gradlew leads to the following output: usr$ ./gradlew tasks Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain Needless to say, I deleted too much, the question is how can it be repaired again? Do you have any ideas how to fix this? 回答1: gradlew