build.gradle

How do I import a class in gradle outside of build.gradle in a apply from: file

蹲街弑〆低调 提交于 2019-11-30 04:06:30
问题 I am having a wired issue I am using gradle 1.9 I cannot seem to import a class from outside build.gradle The following works build.gradle buildscript { repositories { mavenLocal() } dependencies { classpath(group: 'com.foo', name: 'gradle-local-eureka', version: '1.0-SNAPSHOT') } } import com.foo.my.awesome.package.AwesomeService The following errors out build.gradle buildscript { repositories { mavenLocal() } dependencies { classpath(group: 'com.foo', name: 'gradle-local-eureka', version:

Set a global variable in gradle that can use in manifest file

徘徊边缘 提交于 2019-11-30 03:56:06
I want to create a global variable similar with applicationId. It is set value in build.gradle and will be used in manifest. Is it possible? You can set them, for instance I'm setting it for different product flavors productFlavors { production { applicationId = "com.myapp.app" resValue "string", "authority", "com.facebook.app.FacebookContentProvider5435651423234" } development { applicationId = "com.myapp.development" resValue "string", "authority", "com.facebook.app.FacebookContentProvider2134564533421" } qa { applicationId = "com.myapp.qa" resValue "string", "authority", "com.facebook.app

Disable all JavaDoc in Gradle

﹥>﹥吖頭↗ 提交于 2019-11-30 03:46:57
General Update, after some research I want to build my project running gradle 2.0 with gradle build in the console I get stuck at the JavaDoc generation. I'm using Java 8, precisly jdk1.8.0_66 and jre1.8.0_66 . Now when I want to build my project typing gradle build in my powershell I get this error: 5 errors 10 warnings :my-subproject1:javadoc FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':my-subproject1:javadoc'. > Javadoc generation failed. One sample error and one sample warning: C:\some\long\path\MyClass.java:37: error: @param name not found

Is it possible to define an Android string-array resource in Gradle?

怎甘沉沦 提交于 2019-11-30 03:08:17
问题 In Gradle for Android, I'm trying to generate the equivalent of this string-array resource... <resources> <string-array name="url_array"> <item>http://www.url1.com</item> <item>http://www.url2.com</item> <item>http://www.url3.com</item> </string-array> </resources> ...in my app's build.gradle config file. I don't want to hardcode these values in res/values/arrays.xml, since I want to be able to generate different array contents for different build variants (dev vs. prod). I know there are

uses-sdk element cannot have a “tools:node” attribute

谁都会走 提交于 2019-11-30 03:08:13
I've updated Android Studio last night to 0.9.0, buildToolsVersion to 21.1.0 and gradle to 0.14.0, after that I'm receiving this error Error:Execution failed for task ':app:processDebugManifest'. Manifest merger failed : uses-sdk element cannot have a "tools:node" attribute I've spent the last night looking for a solution, I found this: <uses-sdk tools:node="replace" /> But unfortunately, added one more error! Error:(10, 5) uses-sdk element cannot have a "tools:node" attribute Error:(10, 5) Execution failed for task ':app:processDebugManifest'. Manifest merger failed : uses-sdk element cannot

Gradle: Exclude file from Android assets folder

≯℡__Kan透↙ 提交于 2019-11-30 03:08:12
Please, do you know a way how to exclude some file from Android project assets folder before multiple assets folders are merged or during the merge? For example: android { sourceSets { main { assets.srcDirs = [fileTree(dir: 'assets1', exclude: 'myfile.txt'), 'assets2'] // does not work assets.exclude 'assets1/myfile.txt' // does not work assets.exclude '**/*.txt' // does not work assets.exclude '*.txt' // does not work } } packagingOptions { exclude 'assets1/myfile.txt' // does not work exclude '**/*.txt' // does not work exclude '*.txt' // does not work either } aaptOptions {

java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.jdbc.JndiDataSourceAutoConfiguration

六月ゝ 毕业季﹏ 提交于 2019-11-30 03:05:37
问题 I am trying to write a standalone executable jar (fat jar) . I am using spring boot gradle plugin and writing a SpringBoot App to do this. Here is my Application.java file @Configuration @EnableAutoConfiguration @EnableRabbit @EntityScan("persistence.domain") @EnableJpaRepositories("persistence.repository") @ComponentScan(basePackages = {"common","service"}) public class Application { public static void main(final String[] args) { final SpringApplicationBuilder appBuilder = new

Android Studio update 0.5.3 - platform 'android-19' not found

家住魔仙堡 提交于 2019-11-30 02:42:47
Yesterday I opened Android Studio and it asked me to be updated. I now have v0.5.3, SDK 19 fully installed and gradle 0.9.+. I think this information is correct but I'm not fully aware how the gradle strategy works. The problem is that my gradle apps stopped syncing and even when I create a brand new project it does not sync. Here are the details: Project's build.gradle: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.9.+' } } allprojects

Error:(1, 0) Gradle DSL method not found: 'android()'

自古美人都是妖i 提交于 2019-11-30 02:39:57
What should i do to fix this issue? I am getting this error when i ever i run my project in android studio0.9.1 android {compileSdkVersion 17 buildToolsVersion "19.1.0" defaultConfig { applicationId "com.example.nearby" minSdkVersion 11 targetSdkVersion 19 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } }}dependencies { compile 'com.android.support:support-v4:19.0.0' compile 'com.google.android.gms:play-services:+' compile 'com.android.support:appcompat-v7:19.0.0' compile files('libs/google-play-services.jar')} I

How to create the fat jar with gradle kotlin script

两盒软妹~` 提交于 2019-11-30 01:37:39
As titled, I'd like to know how to modify the gradle.build.kts in order to have a task to create a unique jar with all the dependencies (kotlin lib included) inside. I found this sample in Groovy: //create a single Jar with all dependencies task fatJar(type: Jar) { manifest { attributes 'Implementation-Title': 'Gradle Jar File Example', 'Implementation-Version': version, 'Main-Class': 'com.mkyong.DateUtils' } baseName = project.name + '-all' from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } with jar } But I have no idea how I could write that in kotlin, other than