Skip to content

Commit

Permalink
Merge pull request #10 from adsf117/ads.f117/Unifydependecies
Browse files Browse the repository at this point in the history
Ads.f117/unifydependecies
  • Loading branch information
andresserranodev committed Apr 12, 2018
2 parents 21c6b6a + 691ad84 commit e2364be
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 58 deletions.
43 changes: 24 additions & 19 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'realm-android'


android {
compileSdkVersion 26
def globalConfiguration = rootProject.extensions.getByName("ext")

compileSdkVersion globalConfiguration.getAt("androidCompileSdkVersion")
defaultConfig {
applicationId "com.puzzlebench.clean_marvel_kotlin"
minSdkVersion 15
targetSdkVersion 26
minSdkVersion globalConfiguration.getAt("androidMinSdkVersion")
targetSdkVersion globalConfiguration.getAt("androidTargetSdkVersion")
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -29,21 +30,25 @@ dependencies {
implementation project(':domain')
implementation project(':data')

implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:recyclerview-v7:26.1.0'
// Picasso
implementation 'com.squareup.picasso:picasso:2.5.2'
//event Rx
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.7'
// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"

testImplementation 'org.mockito:mockito-core:2.10.0'
testImplementation 'junit:junit:4.12'

def generalDependencies = rootProject.ext.generalDependencies
def generalTestDependencies = rootProject.ext.generalTestDependencies
def appDependencies = rootProject.ext.appDependencies

implementation generalDependencies.rxAndroid,
generalDependencies.rxJava,
generalDependencies.appSupport,
generalDependencies.kotlin


implementation appDependencies.picasso,
appDependencies.recyclerView,
appDependencies.constraintLayout

testImplementation generalTestDependencies.mockito,
generalTestDependencies.junit,
generalTestDependencies.kotlinTest

}

android.testOptions.unitTests.all {
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply from: 'buildsystem/dependencies.gradle'

buildscript {
ext.kotlin_version = '1.2.10'
Expand Down
57 changes: 57 additions & 0 deletions buildsystem/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
ext {
//Android
androidMinSdkVersion = 15
androidTargetSdkVersion = 26
androidCompileSdkVersion = 26

//Genral dependencies version
appSupportVersion = '26.1.0'
rxAndroidVersion = '2.0.1'
rxJavaVersion = '2.1.7'

//app dependencies version
picassoVersion = '2.5.2'
recyclerViewVersion = '26.1.0'
constraintLayoutVersion = '1.0.2'

//data dependencies version
retrofitVersion = '2.3.0'
retrofitConverterGsonVersion = '2.3.0'

//test dependencies
mockitoVersion = '2.10.0'
jUnitVersion = '4.12'



generalDependencies = [
rxAndroid : "io.reactivex.rxjava2:rxandroid:${rxAndroidVersion}",
rxJava : "io.reactivex.rxjava2:rxjava:${rxJavaVersion}",
appSupport : "com.android.support:appcompat-v7:${appSupportVersion}",
kotlin : "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"


]

generalTestDependencies = [
mockito : "org.mockito:mockito-core:${mockitoVersion}",
junit : "junit:junit:${jUnitVersion}",
kotlinTest : "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version",

]

appDependencies = [
picasso : "com.squareup.picasso:picasso:${picassoVersion}",
recyclerView : "com.android.support:recyclerview-v7:${recyclerViewVersion}",
constraintLayout : "com.android.support.constraint:constraint-layout:${constraintLayoutVersion}"

]

dataDependencies = [
retrofit : "com.squareup.retrofit2:retrofit:${retrofitVersion}",
retrofitConverter : "com.squareup.retrofit2:converter-gson:${retrofitConverterGsonVersion}",

]


}
42 changes: 20 additions & 22 deletions data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'realm-android'

android {
compileSdkVersion 26
def globalConfiguration = rootProject.extensions.getByName("ext")

compileSdkVersion globalConfiguration.getAt("androidCompileSdkVersion")
defaultConfig {
minSdkVersion 15
targetSdkVersion 26
minSdkVersion globalConfiguration.getAt("androidMinSdkVersion")
targetSdkVersion globalConfiguration.getAt("androidTargetSdkVersion")
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {
debug {
buildConfigField "String", "PRIVATE_API_KEY_VALUE", '"your-private-apikey"'
buildConfigField "String", "PUBLIC_API_KEY_VALUE", '"your-public-apikey"'
buildConfigField "String", "PRIVATE_API_KEY_VALUE", '"d6e634e314a819ca1c0f0078344acb70"'
buildConfigField "String", "PUBLIC_API_KEY_VALUE", '"504e22423d24b530dd878fdf808fc001"'
buildConfigField "String", "MARVEL_BASE_URL", '"http://gateway.marvel.com/public/"'

}
Expand All @@ -40,24 +39,23 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':domain')

implementation 'com.android.support:appcompat-v7:26.1.0'
def generalDependencies = rootProject.ext.generalDependencies
def dataDependencies = rootProject.ext.dataDependencies
def generalTestDependencies = rootProject.ext.generalTestDependencies

implementation generalDependencies.rxAndroid,
generalDependencies.rxJava,
generalDependencies.appSupport,
generalDependencies.kotlin


// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"

// RX
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.7'
testImplementation generalTestDependencies.junit,
generalTestDependencies.kotlinTest

// Retrofit & OkHttp
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
compile dataDependencies.retrofit,
dataDependencies.retrofitConverter

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

android.testOptions.unitTests.all {
Expand Down
35 changes: 18 additions & 17 deletions domain/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 26
def globalConfiguration = rootProject.extensions.getByName("ext")

compileSdkVersion globalConfiguration.getAt("androidCompileSdkVersion")
defaultConfig {
minSdkVersion 15
targetSdkVersion 26
minSdkVersion globalConfiguration.getAt("androidMinSdkVersion")
targetSdkVersion globalConfiguration.getAt("androidTargetSdkVersion")
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {
release {
minifyEnabled false
Expand All @@ -27,17 +26,19 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:appcompat-v7:26.1.0'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.10.0'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.7'

def generalDependencies = rootProject.ext.generalDependencies
def generalTestDependencies = rootProject.ext.generalTestDependencies

implementation generalDependencies.rxAndroid,
generalDependencies.rxJava,
generalDependencies.appSupport,
generalDependencies.kotlin

testImplementation generalTestDependencies.mockito,
generalTestDependencies.junit,
generalTestDependencies.kotlinTest

}

android.testOptions.unitTests.all {
Expand Down

0 comments on commit e2364be

Please sign in to comment.