gradle

how to set the use --enable-preview compile and run flags from gradle?

狂风中的少年 提交于 2020-06-12 09:24:06
问题 Looking to use records from Java 14 in a gradle build, but am getting: thufir@dur:~/NetBeansProjects/FileWatcherHandler$ thufir@dur:~/NetBeansProjects/FileWatcherHandler$ gradle clean build > Task :compileJava FAILED /home/thufir/NetBeansProjects/FileWatcherHandler/src/main/java/net/bounceme/dur/files/FXOrder.java:3: error: records are a preview feature and are disabled by default. public record FXOrder(int units) {} ^ (use --enable-preview to enable records) 1 error FAILURE: Build failed

how to set the use --enable-preview compile and run flags from gradle?

北城以北 提交于 2020-06-12 09:24:03
问题 Looking to use records from Java 14 in a gradle build, but am getting: thufir@dur:~/NetBeansProjects/FileWatcherHandler$ thufir@dur:~/NetBeansProjects/FileWatcherHandler$ gradle clean build > Task :compileJava FAILED /home/thufir/NetBeansProjects/FileWatcherHandler/src/main/java/net/bounceme/dur/files/FXOrder.java:3: error: records are a preview feature and are disabled by default. public record FXOrder(int units) {} ^ (use --enable-preview to enable records) 1 error FAILURE: Build failed

Checkstyle - methods order by modifier

风格不统一 提交于 2020-06-12 07:54:39
问题 Is it possible add to checkstyle rule to have ordered methods in class by modifier. I mean public methods on the begining and private methods in the end ? 回答1: MethodsOrderCheck do this job. Check the documentation FYI : there is some logical issue about it. 回答2: Checkstyle has a check for that called DecralationOrderCheck - http://checkstyle.sourceforge.net/apidocs/com/puppycrawl/tools/checkstyle/checks/coding/DeclarationOrderCheck.html You may find it in the 'Coding' group. Please tell me

Run non main class of spring boot application through command line

橙三吉。 提交于 2020-06-12 05:21:58
问题 I have spring boot application packaged as executable jar. Application has one utility class with main method which I want to invoke through command line but it seems that command is unable to find the class in classpath. Command: java -cp client-stp-grid-publisher-SNAPSHOT.jar com.client.stp.util.JMXClientUtils I tried to set jar classpath in MANIFEST.MF using gradle jar task but no help: jar { baseName = 'client-stp-grid-publisher' manifest { attributes( 'Class-Path': "BOOT-INF/classes/*" )

How to fix INSTALL_FAILED_INVALID_APK error in Android Studio?

时光怂恿深爱的人放手 提交于 2020-06-12 05:03:53
问题 I have recently updated my Android Studio to 3.6.1, thereby also updating gradle plugin to 3.6.1 and the gradle wrapper to 5.6.4 When running the debug build, I keep getting this error Install failed: The application could not be installed: INSTALL_FAILED_INVALID_APK The APKs are invalid. I have checked my package and applicationId and it is the same I tried using android:extractNativeLibs="true" on the manifest <application> tag and it is still does not work Kept on cleaning and rebuilding

How to pass command line argument to Gradle Kotlin DSL

时间秒杀一切 提交于 2020-06-12 04:44:00
问题 Here's an example from Groovy that represents exactly what I would like to achieve: Command line : ./gradlew jib -PmyArg=hello build.gradle.kts task myTask { doFirst { println myArg ... do what you want } } Source of this example is here - option 3. How can I read pass and read myArg value in Kotlin DSL ? 回答1: After some time found an answer: build.gradle.kts val myArg: String by project // Command line argument is always a part of project task("myTask") { doFirst { if (project.hasProperty(

How to pass command line argument to Gradle Kotlin DSL

£可爱£侵袭症+ 提交于 2020-06-12 04:42:08
问题 Here's an example from Groovy that represents exactly what I would like to achieve: Command line : ./gradlew jib -PmyArg=hello build.gradle.kts task myTask { doFirst { println myArg ... do what you want } } Source of this example is here - option 3. How can I read pass and read myArg value in Kotlin DSL ? 回答1: After some time found an answer: build.gradle.kts val myArg: String by project // Command line argument is always a part of project task("myTask") { doFirst { if (project.hasProperty(

A problem occurred configuring root project 'android' When building the gradle both VSCode and Android Studio (Flutter)

心不动则不痛 提交于 2020-06-11 10:45:33
问题 Today I started learning Flutter and successfully downloaded everything. But when I run my app the Debugger (Both VSCode and Android Studio ) give me this error. Launching lib\main.dart on sdk gphone x86 in debug mode... FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'android'. > Could not resolve all artifacts for configuration ':classpath'. > Could not download builder.jar (com.android.tools.build:builder:3.5.0) > Could not get

Gradle 6.0 deprecation warning for JacocoReport configuration

会有一股神秘感。 提交于 2020-06-10 07:28:12
问题 The following Gradle task, which configures JacocoReportBase: task jacocoRootReport(type: JacocoReport) { ... sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs) additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs) classDirectories = files(subprojects.sourceSets.main.output) executionData = files(subprojects.jacocoTestReport.executionData) ... } produces these warnings, when building with ./gradlew assembleDebug --warning-mode all : The

Run Lint from console for only selected files

最后都变了- 提交于 2020-06-10 04:14:10
问题 I am trying to create a custom Git pre-commit hook that checks (using Lint from console, via "gradlew") for possible issues. However, I can't find how to run Lint only in provided files. If I run something like ./gradlew app:lint Lint analyzes all the project files, and this operation can take quite a bit of time. In this document, there is a "Incremental Lint" section, which covers something similar to what I am looking for. I also found this open issue, that is quite the same as my problem,