build.gradle

What is the difference between Sync project with gradle files and Sync with File System?

醉酒当歌 提交于 2021-02-11 14:15:04
问题 I have been through various answers with respect to the Sync project with Gradle files . But I couldn't find the major difference between Gradle Files and File System . For making/building a project, we need to sync the project with Gradle files. But does it need to be done when are we using the Sync using File system ? 回答1: sync project with gradle files updates the Android Studio project model to match the contents of the Gradle build file. There is no corresponding gradlew command because

gradle with maven submodule

主宰稳场 提交于 2021-02-10 13:16:48
问题 There is any way to build gradle project with maven submodule ? I created a project in gradle but at now I must add module (that module used a maven) I don't have any idea how to used this. There is any good way? I will be very gratefull for any suggestions. 回答1: Either convert the Maven project to Gradle ( gradle init is a good start) and turn the Gradle build into a multi-project build, or publish the Maven build's artifact to the local or a remote Maven repository, and configure the Gradle

error: cannot find symbol in gradle compileTestJava

回眸只為那壹抹淺笑 提交于 2021-02-10 05:35:28
问题 I am getting lots of error: cannot find symbol errors when the compileTestJava task runs in my Gradle project. My code is in src/main/java and my tests are in src/test/java and the test classes cannot resolve any classes in src/main/java e.g.: C:\q\src\test\java\q\MainTest.java:14: error: cannot find symbol Main.main(new String[0]); ^ symbol: variable Main location: class MainTest But q\src\main\java\q\Main.java exists, compiles and is a public class in the same package. build.gradle: plugins

Gradle command line arguments to override properties in build.gradle

让人想犯罪 __ 提交于 2021-02-08 13:33:47
问题 Whenever an existing android project is imported, in most cases we need to change values following with our installed tools version number in project/build.gradle buildscript { ... dependencies { classpath 'com.android.tools.build:gradle:x.x.x' } } in project/app/build.gradle android { compileSdkVersion xx buildToolsVersion "xx.x.x" defaultConfig { applicationId "com.example.app.xyz" minSdkVersion xx targetSdkVersion xx versionCode x versionName "x.x" } ... } dependencies { compile fileTree

Gradle command line arguments to override properties in build.gradle

杀马特。学长 韩版系。学妹 提交于 2021-02-08 13:33:17
问题 Whenever an existing android project is imported, in most cases we need to change values following with our installed tools version number in project/build.gradle buildscript { ... dependencies { classpath 'com.android.tools.build:gradle:x.x.x' } } in project/app/build.gradle android { compileSdkVersion xx buildToolsVersion "xx.x.x" defaultConfig { applicationId "com.example.app.xyz" minSdkVersion xx targetSdkVersion xx versionCode x versionName "x.x" } ... } dependencies { compile fileTree

Include tests from other module

为君一笑 提交于 2021-02-08 08:42:14
问题 My project looks like this: ├───module1-test-cases │ └───src │ └───test │ └───groovy │ └───specs │ └───module1test └───module2-test-cases └───src └───test └───groovy └───specs └───module2test There is a lot different modules, each module has its own build.gradle file, so i can run tests for separate modules Example of build.gradle dependencies{ compile("org.codehaus.groovy:groovy-all:2.3.3") compile project(":core") compile("commons-codec:commons-codec:1.10") testCompile("junit:junit:4.11")

`runBlocking` coroutine builder is not resolved in the project (Other builders are resolved)

☆樱花仙子☆ 提交于 2021-02-08 08:20:52
问题 As the title suggest, the coroutine builder runBlocking is missing in the coroutine liblary I just added in my build.gradle. Funny thing is every other thing appears to be available, GlobalScope , CoroutineScope.launch CoroutineScope.async all present. runBlocking isn't. What am I doing wrong? here is my build.gradle buildscript { ext { ktor_version = "1.1.1" kotlin_version = "1.3.20-eap-52" } dependencies { classpath "org.jetbrains.kotlin:kotlin-frontend-plugin:0.0.44" classpath "org

`runBlocking` coroutine builder is not resolved in the project (Other builders are resolved)

隐身守侯 提交于 2021-02-08 08:20:03
问题 As the title suggest, the coroutine builder runBlocking is missing in the coroutine liblary I just added in my build.gradle. Funny thing is every other thing appears to be available, GlobalScope , CoroutineScope.launch CoroutineScope.async all present. runBlocking isn't. What am I doing wrong? here is my build.gradle buildscript { ext { ktor_version = "1.1.1" kotlin_version = "1.3.20-eap-52" } dependencies { classpath "org.jetbrains.kotlin:kotlin-frontend-plugin:0.0.44" classpath "org

Create Gradle Tasks that executes other gradle task with parameters

▼魔方 西西 提交于 2021-02-08 05:15:15
问题 I use this gradle command to execute my UI-tests: ./gradlew connectedDebugAndroidTest -PUiTest I want to define a custom gradle task that executes my UI-tests, so I could this: task runUiTests() { dependsOn("connectedDebugAndroidTest") } How can I pass the parameter -PUiTest in my custom gradle task to the connectedDebugAndroidTest task? 来源: https://stackoverflow.com/questions/59284240/create-gradle-tasks-that-executes-other-gradle-task-with-parameters

Create Gradle Tasks that executes other gradle task with parameters

馋奶兔 提交于 2021-02-08 05:11:29
问题 I use this gradle command to execute my UI-tests: ./gradlew connectedDebugAndroidTest -PUiTest I want to define a custom gradle task that executes my UI-tests, so I could this: task runUiTests() { dependsOn("connectedDebugAndroidTest") } How can I pass the parameter -PUiTest in my custom gradle task to the connectedDebugAndroidTest task? 来源: https://stackoverflow.com/questions/59284240/create-gradle-tasks-that-executes-other-gradle-task-with-parameters