Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates and new libraries #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ It includes libraries
- [Crashlytics](https://try.crashlytics.com/)
- [Realm](https://realm.io/)
- [Picasso](http://square.github.io/picasso/)
- [Materialize](https://github.com/mikepenz/Materialize)
- [MaterialDrawer](https://github.com/mikepenz/MaterialDrawer)
- [Glide](https://github.com/bumptech/glide)
- [AnKo](https://github.com/Kotlin/anko)
- [Parceler](https://github.com/johncarl81/parceler)

**You can choose which library you want to include in your project**

Expand Down
11 changes: 9 additions & 2 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@
"author": "General Mobile",
"email": "[email protected]",
"version": "1.0.0",
"fabric_api": "",
"splash_screen": "n",
"retrofit": "n",
"realm": "n",
"picasso": "n",
"kotlin_android_extensions": "n"
"image_downloader": ["none", "picasso", "glide"],
"materialize": "n",
"material_drawer": "n",
"kotlin_android_extensions": "n",
"kotlin_anko": "n",
"architecture": "s",
"room": "s",
"parceler": "n"
}
101 changes: 77 additions & 24 deletions {{cookiecutter.repo_name}}/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repositories {

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion "25.0.3"
buildToolsVersion "26.0.0-rc2"

defaultConfig {
applicationId "{{ cookiecutter.package_name }}"
Expand Down Expand Up @@ -58,55 +58,108 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['*.jar'])

//supportLib
compile rootProject.ext.supportLib
compile rootProject.ext.supportLibAppCompat
compile rootProject.ext.supportLibDesign
compile rootProject.ext.supportLibRecyclerview
compile rootProject.ext.supportLibCardview
implementation rootProject.ext.supportLib
implementation rootProject.ext.supportLibAppCompat
implementation rootProject.ext.supportLibDesign
implementation rootProject.ext.supportLibRecyclerview
implementation rootProject.ext.supportLibCardview

//timber
compile rootProject.ext.timber
implementation rootProject.ext.timber

//crashlytics
compile (rootProject.ext.crashlytics){
implementation (rootProject.ext.crashlytics){
transitive = true;
}

//di
compile rootProject.ext.dagger
implementation rootProject.ext.dagger
kapt rootProject.ext.daggerApt
//compile rootProject.ext.daggerSupport
//implementation rootProject.ext.daggerSupport
//annotationProcessor rootProject.ext.daggerAnnotation

//rx
compile rootProject.ext.rxJava
compile rootProject.ext.rxAndroid
compile rootProject.ext.rxKotlin
implementation rootProject.ext.rxJava
implementation rootProject.ext.rxAndroid
implementation rootProject.ext.rxKotlin

{% if cookiecutter.retrofit == "y" %}
//net
compile rootProject.ext.retrofit
compile rootProject.ext.okHttp
compile rootProject.ext.gson
compile rootProject.ext.rxJavaAdapter
compile rootProject.ext.gsonConverter
implementation rootProject.ext.retrofit
implementation rootProject.ext.okHttp
implementation rootProject.ext.gson
implementation rootProject.ext.rxJavaAdapter
implementation rootProject.ext.gsonConverter
{% endif %}

{% if cookiecutter.picasso == "y" %}
{% if cookiecutter.image_downloader == "picasso" %}
//picasso
compile rootProject.ext.picasso
implementation rootProject.ext.picasso
{% elif cookiecutter.image_downloader == "glide" %}
//glide
implementation rootProject.ext.glide
implementation rootProject.ext.glideAnnotation
{% endif %}

{% if cookiecutter.materialize == "y" %}
// Mike Penz - Materialize
implementation rootProject.ext.materialize
{% endif %}

{% if cookiecutter.material_drawer == "y" %}
// Mike Penz - Material Drawer
implementation(rootProject.ext.materialDrawer) {
transitive = true
}
{% endif %}

{% if cookiecutter.kotlin_anko == "y" %}
// Anko
implementation rootProject.ext.ankoCommonV4Support
implementation rootProject.ext.ankoCommonV4SupportCommon
implementation rootProject.ext.ankoCommon
implementation rootProject.ext.ankoCompat
implementation rootProject.ext.ankoCompatCoroutines
implementation rootProject.ext.ankoCardView
implementation rootProject.ext.ankoDesign
implementation rootProject.ext.ankoDesignCoroutines
implementation rootProject.ext.ankoGridLayout
implementation rootProject.ext.ankoPercent
implementation rootProject.ext.ankoRecyclerView
implementation rootProject.ext.ankoRecyclerViewCoroutines
{% endif %}

//lifecycles, licedata, viewmodel
{% if cookiecutter.architecture == "y" %}
implementation rootProject.ext.architectureLifecycleRuntime = "android.arch.lifecycle:runtime:$architectureVersion"
implementation rootProject.ext.architectureLifecycleExtensions = "android.arch.lifecycle:extensions:$architectureVersion"
annotationProcessor rootProject.ext.architectureLifecycleAnnotation = "android.arch.lifecycle:compiler:$architectureVersion"

{% if cookiecutter.room == "y" %}
// Room
implementation rootProject.ext.roomRuntime
implementation rootProject.ext.roomRx
annotationProcessor rootProject.ext.roomAnnotation
{% endif %}
{% endif %}


{% if cookiecutter.parceler == "y" %}
// Parceler
implementation rootProject.ext.parcelerAPI
annotationProcessor rootProject.ext.parcelerAnnotation
{% endif %}

//test
testCompile 'junit:junit:4.12'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.google.code.findbugs'
})
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<!--TODO:put your fabric api key here-->
<meta-data
android:name="io.fabric.ApiKey"
android:value="" />
android:value="{{ cookiecutter.fabric_api }}" />
</application>

</manifest>
52 changes: 48 additions & 4 deletions {{cookiecutter.repo_name}}/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.1.2-3'
ext.kotlin_version = '1.1.2-4'
repositories {
maven { url 'https://maven.google.com' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
{% if cookiecutter.realm == "y" %}
classpath "io.realm:realm-gradle-plugin:3.1.1"
Expand All @@ -27,12 +27,12 @@ allprojects {

ext{

buildToolsVersion = '25.0.2'
buildToolsVersion = '26.0.0-rc2'
compileSdkVersion = {{ cookiecutter.target_sdk }}
targetSdkVersion = {{ cookiecutter.target_sdk }}
minSdkVersion = {{ cookiecutter.min_sdk }}

supportLibVersion = '25.3.1'
supportLibVersion = '6.0.0-alpha1'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't that be 26.0.0-alpha1?

rxJavaVersion = '2.0.1'
rxKotlinVersion = '2.0.3'
timberVersion = '4.5.1'
Expand All @@ -43,6 +43,12 @@ ext{
picassoVersion = '2.5.2'
crashlyticsVersion = '2.6.8'
gsonVersion = '2.8.0'
glideVersion = '4.0.0-RC0'
materializeVersion = '1.0.1'
materialDrawerVersion = '5.9.1'
ankoVersion = '0.10'
architectureVersion = '1.0.0-alpha1'
parcelerVersion = '1.1.8'

//supportLib
supportLib = "com.android.support:support-v4:$supportLibVersion"
Expand Down Expand Up @@ -81,6 +87,44 @@ ext{
//picasso
picasso = "com.squareup.picasso:picasso:$picassoVersion"

//materialize
materialize = "com.mikepenz:materialize:$materializeVersion@aar"

//materialDrawer
materialDrawer = "com.mikepenz:materialdrawer:$materialDrawerVersion@aar"

//glide
glide = "com.github.bumptech.glide:glide:$glideVersion"
glideAnnotation = "com.github.bumptech.glide:compiler:$glideVersion"

//kotlin-anko
ankoCommonV4Support = "org.jetbrains.anko:anko-support-v4:$ankoVersion"
ankoCommonV4SupportCommon = "org.jetbrains.anko:anko-support-v4-commons:$ankoVersion"
ankoCommon = "org.jetbrains.anko:anko-appcompat-v7-commons:$ankoVersion"
ankoCompat = "org.jetbrains.anko:anko-appcompat-v7:$ankoVersion"
ankoCompatCoroutines = "org.jetbrains.anko:anko-coroutines:$ankoVersion"
ankoCardView = "org.jetbrains.anko:anko-cardview-v7:$ankoVersion"
ankoDesign = "org.jetbrains.anko:anko-design:$ankoVersion"
ankoDesignCoroutines = "org.jetbrains.anko:anko-design-coroutines:$ankoVersion"
ankoGridLayout = "org.jetbrains.anko:anko-gridlayout-v7:$ankoVersion"
ankoPercent = "org.jetbrains.anko:anko-percent:$ankoVersion"
ankoRecyclerView = "org.jetbrains.anko:anko-recyclerview-v7:$ankoVersion"
ankoRecyclerViewCoroutines = "org.jetbrains.anko:anko-recyclerview-v7-coroutines:$ankoVersion"

//architecture
architectureLifecycleRuntime = "android.arch.lifecycle:runtime:$architectureVersion"
architectureLifecycleExtensions = "android.arch.lifecycle:extensions:$architectureVersion"
architectureLifecycleAnnotation = "android.arch.lifecycle:compiler:$architectureVersion"

//room
roomRuntime = "android.arch.persistence.room:runtime:$architectureVersion"
roomAnnotation = "android.arch.persistence.room:compiler:$architectureVersion"
roomRx = "android.arch.persistence:room.room:rxjava2:$architectureVersion"

//parceler
parcelerAPI = "org.parceler:parceler-api:$parcelerVersion"
parcelerAnnotation = "org.parceler:parceler:$parcelerVersion"

buildTime = new Date().format("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC"))
}

Expand Down