Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
// gradle versions
maven { url "https://github.com/ben-manes/gradle-versions-plugin/raw/mvnrepo" }
// crashlytics
maven { url 'http://download.crashlytics.com/maven' }
maven { url 'https://www.testfairy.com/maven' }
}
dependencies {
// android plugin
classpath 'com.android.tools.build:gradle:0.11.+'
// configuration for codegen dependencies (dagger-compiler)
classpath 'com.neenbedankt.gradle.plugins:android-apt:+'
// use Java 8 lambdas on android
classpath 'me.tatarka:gradle-retrolambda:1.3.3'
// gradle robolectric plugin
// classpath 'org.robolectric:robolectric-gradle-plugin:0.11+'
// downloading deps for CI
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.10.1'
// versions plugin
classpath 'com.github.ben-manes:gradle-versions-plugin:0.5-beta-5'
// crashlytics
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
classpath 'com.testfairy.plugins.gradle:testfairy:1.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.11'
}
configurations {
all*.exclude group: 'com.android.support', module: 'support-</code>v4'
}
apply plugin: 'android-sdk-manager'
apply plugin: 'android'
apply plugin: 'retrolambda'
apply plugin: 'crashlytics'
apply plugin: 'android-apt'
//apply plugin: 'robolectric'
apply plugin: 'testfairy'
apply plugin: 'versions'
android {
final APPLICATION_ID = "mercurievv.driftingjury.androidapp"
compileSdkVersion 19
buildToolsVersion '19.1'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
// applicationId APPLICATION_ID
versionCode 1
versionName '0.1.0'
testInstrumentationRunner "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner"
}
productFlavors {
staging {
buildConfigField "String", "API_URL", "\"https://example-staging.com\""
// applicationId "${APPLICATION_ID}.staging"
}
production {
buildConfigField "String", "API_URL", "\"https://example.com\""
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
final IS_TRAVIS = "true".equals(System.getenv("TRAVIS"))
final PRE_DEX_ENABLED = "true".equals(System.getProperty("pre-dex", "true"))
dexOptions {
preDexLibraries = PRE_DEX_ENABLED && !IS_TRAVIS
}
packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
lintOptions {
enable 'IconExpectedSize', 'EasterEgg', 'SelectableText', 'StopShip', 'TypographyQuotes', 'UnusedIds'
disable 'InvalidPackage'
warningsAsErrors true
lintConfig file("$projectDir/lint.xml")
abortOnError false
}
sourceSets {
main {
androidTest.setRoot('src/test')
}
}
testfairyConfig {
apiKey "0_o"
}
}
retrolambda {
jdk System.getenv("JAVA8_HOME")
oldJdk System.getenv("JAVA7_HOME")
javaVersion JavaVersion.VERSION_1_7
}
repositories {
// crashlytics
maven { url 'http://download.crashlytics.com/maven' }
}
final DAGGER_VERSION = '1.2.1'
//final ESPERANDRO_VERSION = '2.0.0'
dependencies {
androidTestCompile 'junit:junit:4.11'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
compile 'org.roboguice:roboguice:2.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.j256.ormlite:ormlite-android:4.42'
compile 'javax.persistence:persistence-api:1.0.2'
retrolambdaConfig 'net.orfjackal.retrolambda:retrolambda:1.3.0'
compile 'com.crashlytics.android:crashlytics:1.+'
compile "com.mixpanel.android:mixpanel-android:4.2.1@aar"
compile 'com.netflix.rxjava:rxjava-android:0.19.0' // FRP
compile 'com.jakewharton:butterknife:5.1.0' // view injection
compile 'com.jakewharton.timber:timber:2.4.0' // logging
compile 'com.squareup.retrofit:retrofit:1.6.0'
compile 'com.intellij:annotations:12.0' // @Nullable NotNull
//??? compile 'com.github.mttkay.memento:memento:0.2' // retaining objects in activity
androidTestCompile 'org.mockito:mockito-core:1.9.5'
androidTestCompile 'org.robolectric:robolectric:2.3'
androidTestCompile 'com.squareup:fest-android:1.0.8'
/*
androidTestCompile('com.jakewharton.espresso:espresso:1.1-r3') {
// TODO workaround for http://b.android.com/65445
exclude group:'com.google.guava', module:'guava'
}
androidTestCompile('com.jakewharton.espresso:espresso-support-v4:1.1-r3') {
// TODO workaround for http://b.android.com/65445
exclude group:'com.android.support', module:'support-v4'
exclude group:'com.google.guava', module:'guava'
}
*/
}
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
all*.exclude group: 'org.apache.maven', module: 'maven-ant-tasks'
all*.exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
dependencies {
compile group: 'org.hibernate', name: 'hibernate-core', version: '3.6.7.Final'
testCompile group: 'junit', name: 'junit', version: '4.+'
}
The build script also states that any junit >= 4.0 is required to compile the project's tests.
Боитесь ли вы Gradle так как боюсь его я?