build.gradle

gradle task to zip multiple directories independently

梦想的初衷 提交于 2019-12-05 21:27:33
I am trying to create a task that looks inside a folder and zips all the folders within that folder to some output folder. Initial state: Folder1 -> project1 ->code //some more files within project1 -> project2 ->code Target state: Destination project1.zip project2.zip I tried using the below code, but it is zipping all the content within the folder1 task myZip(type: Zip) { from 'Folder1' archiveName 'Compress.zip' destinationDir file('build') } I probably might need to use some collections which contains the project1 and project2 info and iteratively zip to the destination folder. Having

android Volley library NegativeArraySizeException

冷暖自知 提交于 2019-12-05 21:20:55
I'm getting this NegativeArraySizeException from Volley library. This error started after I changed Volley android-library-module to a maven dependencies like compile 'com.android.volley:volley:1.0.0' I've this singleton pattern and I change the addToRequestQueue method to avoid double request bug with following link : public <T> void addToRequestQueue(Request<T> req) { req.setRetryPolicy(new DefaultRetryPolicy( 0, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); getRequestQueue().add(req); } I see that official Android-Volley does not getting any updates. So

Android Gradle Issue

家住魔仙堡 提交于 2019-12-05 19:43:26
I know there are 100's of questions/answers around this topic, but none of them seem to give me an answer. I know some(if not all) of my problems are around my lack of understanding of gradle in general. BUT, i'm hoping for some help. I've got my project working just fine on my desktop. I'm traveling this week, and wanted to work on it some on my laptop. I have all the files, and have the same version of Android Studio on both machines. I kept getting all kinds of gradle errors when opening my project. I think I've went on several wild goose chases at this point. So I decided to step back and

Gradle build dependancy throwing ClassNotFoundException

妖精的绣舞 提交于 2019-12-05 19:31:17
I am currently writing my first Gradle build script to help structure a simple Java app to be used from the command line. Below is the full build.gradle code apply plugin: 'java' apply plugin: 'eclipse' defaultTasks 'clean', 'build' repositories { mavenCentral() } jar { baseName = 'napier-deploy' version = '1' manifest {attributes 'Main-Class': 'com.Main'} } dependencies { compile 'org.apache.httpcomponents:fluent-hc:4.3.3' compile 'org.apache.httpcomponents:httpclient-cache:4.3.3' compile 'org.apache.httpcomponents:httpcore:4.1' compile 'org.apache.httpcomponents:httpmime:4.3.3' compile 'org

In gradle, should I exclude all dependencies under a branch or just the root is enough?

谁说我不能喝 提交于 2019-12-05 19:09:55
I've added following custom task into my build.gradle file In order to print out dependencies of a dependency. // This part is useful for finding conflict resolution(s) between dependencies in order to exclude them. // You can change the custom value and run following command in terminal: // ./gradlew passenger-sdk:dependencies --configuration custom configurations { custom } dependencies { custom 'com.google.android.gms:play-services-analytics:7.3.0' } So the result is: $ ./gradlew passenger-sdk:dependencies --configuration custom :passenger-sdk:dependencies ----------------------------------

Android Studio 3.0 submodule compile failed

有些话、适合烂在心里 提交于 2019-12-05 18:58:39
App level build gradle dependencies devCompile project(path: ':mymodule', configuration: 'devRelease') proCompile project(path: ':mymodule', configuration: 'proRelease') qaCompile project(path: ':mymodule', configuration: 'qaRelease') offlineCompile project(path: ':mymodule', configuration: 'offlineRelease') mentioned publishNonDefault true flavorDimensions "default" I have tried This accepted answer but didn't work. Update: Look at the library gradle flavor that I want to compile. I have the same flavor mentioned in my app's Module. dev { manifestPlaceholders = [facebookId: "SOME_FACEBOOK_ID

Upgrade issue in gradle build tools version from 1.2.3 to 1.3.1

只谈情不闲聊 提交于 2019-12-05 18:56:43
I've upgraded the gradle build tools from 1.2.3 to 1.3.1 and started seeing the following error on gradle sync. I had no issues with 1.2.3 version. I'm on gradleVersion 2.3. Is there anyway I can avoid this error? Error:Your project contains 2 or more modules with the same identification com.salesforce.android:AndroidCommon at ":AndroidCommon" and ":AndroidCommon:AndroidCommon". You must use different identification (either name or group) for each modules. AndroidCommon is one of the libraries that I'm using. I tried with versions 1.3 and 1.4 of Android Studio. Seems like the AS version doesn

gradle repository points to local directory with multiple libs

人走茶凉 提交于 2019-12-05 18:38:02
I have question regarding the build dependencies in the build.gradle for the local repository (i.e. using the local directory) dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') } Does it solve the dependencies in the libs directory only or it is resolves the dependencies on all the subfolders of lib directory? If it does not resolve the dependencies of subfolders/subdirectories, how to resolve the dependencies? Note: Our project depends on lot of jars files(instead of giving the full file name for each jars/libs), so wants to know any alternate way. It should depend on what

JaCoCo & Gradle - Filtering Options

ぃ、小莉子 提交于 2019-12-05 18:34:20
I'm currently using the Gradle plugin to run JaCoCo for code coverage repots. I wanted to specify in my build.gradle some filtering options; https://github.com/jacoco/jacoco/wiki/FilteringOptions I can see that this is possible from the Maven plugin; e.g. https://github.com/timezra/jacoco-scala-maven-plugin From the Gradle doco here there appears no clear way on how to do this. How can I set filtering options for JaCoCo when running as part of a build.gradle script? Gradle's JaCoCo plugin doesn't currently provide such filtering options. If you think it should, please file a feature request

Multiproject gradle duplicate dependencies in distribution ZIP

时间秒杀一切 提交于 2019-12-05 17:36:36
I have a gradle multi-project setup for which I wish to collect all the dependent and output JARs into a ZIP at the top level. I've got something working, however I end up with duplicates in the ZIP file. I've not found anything useful in the official documentation on multi project setups How can I remove the duplicates? Is there another approach I should take? Structure ./multi-project ./multi-project/build.gradle ./multi-project/settings.gradle ./multi-project/bar ./multi-project/bar/build.gradle ./multi-project/foo ./multi-project/foo/build.gradle Top level build.gradle apply plugin: 'java'