├── templates
├── default
│ ├── app
│ │ ├── .gitignore
│ │ ├── src
│ │ │ ├── main
│ │ │ │ ├── res
│ │ │ │ │ ├── values
│ │ │ │ │ │ ├── strings.xml.kakava
│ │ │ │ │ │ ├── dimens.xml.kakava
│ │ │ │ │ │ ├── colors.xml.kakava
│ │ │ │ │ │ └── styles.xml.kakava
│ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ │ ├── mipmap-anydpi-v26
│ │ │ │ │ │ ├── ic_launcher.xml
│ │ │ │ │ │ └── ic_launcher_round.xml
│ │ │ │ │ ├── layout
│ │ │ │ │ │ ├── activity_main.xml.kakava
│ │ │ │ │ │ └── view_toolbar.xml.kakava
│ │ │ │ │ ├── values-v21
│ │ │ │ │ │ └── styles.xml.kakava
│ │ │ │ │ └── drawable
│ │ │ │ │ │ └── ic_launcher_background.xml
│ │ │ │ ├── java
│ │ │ │ │ └── kakavaroot
│ │ │ │ │ │ ├── App.java.kakava
│ │ │ │ │ │ └── activity
│ │ │ │ │ │ ├── MainActivity.java.kakava
│ │ │ │ │ │ ├── BackArrowActivity.java.kakava
│ │ │ │ │ │ └── BaseActivity.java.kakava
│ │ │ │ └── AndroidManifest.xml.kakava
│ │ │ ├── test
│ │ │ │ └── java
│ │ │ │ │ └── kakavaroot
│ │ │ │ │ └── ExampleUnitTest.java.kakava
│ │ │ └── androidTest
│ │ │ │ └── java
│ │ │ │ └── kakavaroot
│ │ │ │ └── ExampleInstrumentedTest.java.kakava
│ │ ├── proguard-rules.pro
│ │ └── build.gradle.kakava
│ ├── settings.gradle
│ ├── gradle.properties
│ ├── README.md
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties.kakava
│ ├── build.gradle.kakava
│ ├── .gitignore
│ ├── gradlew.bat
│ └── gradlew
├── advanced-kotlin
│ ├── app
│ │ ├── .gitignore
│ │ ├── src
│ │ │ ├── main
│ │ │ │ ├── res
│ │ │ │ │ ├── values
│ │ │ │ │ │ ├── strings.xml.kakava
│ │ │ │ │ │ ├── dimens.xml.kakava
│ │ │ │ │ │ ├── colors.xml.kakava
│ │ │ │ │ │ └── styles.xml.kakava
│ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ │ ├── mipmap-anydpi-v26
│ │ │ │ │ │ ├── ic_launcher.xml
│ │ │ │ │ │ └── ic_launcher_round.xml
│ │ │ │ │ ├── layout
│ │ │ │ │ │ ├── activity_main.xml.kakava
│ │ │ │ │ │ └── view_toolbar.xml.kakava
│ │ │ │ │ ├── values-v21
│ │ │ │ │ │ └── styles.xml.kakava
│ │ │ │ │ └── drawable
│ │ │ │ │ │ └── ic_launcher_background.xml
│ │ │ │ ├── kotlin
│ │ │ │ │ └── kakavaroot
│ │ │ │ │ │ ├── crash
│ │ │ │ │ │ └── CrashProvider.kt.kakava
│ │ │ │ │ │ ├── rconfig
│ │ │ │ │ │ └── RemoteConfigProvider.kt.kakava
│ │ │ │ │ │ ├── analytics
│ │ │ │ │ │ └── AnalyticsProvider.kt.kakava
│ │ │ │ │ │ ├── app
│ │ │ │ │ │ ├── main
│ │ │ │ │ │ │ └── MainActivity.kt.kakava
│ │ │ │ │ │ ├── BackArrowActivity.kt.kakava
│ │ │ │ │ │ ├── App.kt.kakava
│ │ │ │ │ │ └── BaseActivity.kt.kakava
│ │ │ │ │ │ ├── res
│ │ │ │ │ │ └── ResProvider.kt.kakava
│ │ │ │ │ │ ├── prefs
│ │ │ │ │ │ └── PrefsProvider.kt.kakava
│ │ │ │ │ │ └── logging
│ │ │ │ │ │ └── ReleaseTree.kt.kakava
│ │ │ │ └── AndroidManifest.xml.kakava
│ │ │ ├── test
│ │ │ │ └── kotlin
│ │ │ │ │ └── kakavaroot
│ │ │ │ │ └── ExampleUnitTest.kt.kakava
│ │ │ └── androidTest
│ │ │ │ └── kotlin
│ │ │ │ └── kakavaroot
│ │ │ │ └── ExampleInstrumentedTest.kt.kakava
│ │ ├── proguard-rules.pro
│ │ └── build.gradle.kakava
│ ├── settings.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties.kakava
│ ├── README.md
│ ├── build.gradle.kakava
│ ├── .gitignore
│ ├── gradlew.bat
│ └── gradlew
└── default-kotlin
│ ├── app
│ ├── .gitignore
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── values
│ │ │ │ │ ├── strings.xml.kakava
│ │ │ │ │ ├── dimens.xml.kakava
│ │ │ │ │ ├── colors.xml.kakava
│ │ │ │ │ └── styles.xml.kakava
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ ├── mipmap-anydpi-v26
│ │ │ │ │ ├── ic_launcher.xml
│ │ │ │ │ └── ic_launcher_round.xml
│ │ │ │ ├── layout
│ │ │ │ │ ├── activity_main.xml.kakava
│ │ │ │ │ └── view_toolbar.xml.kakava
│ │ │ │ ├── values-v21
│ │ │ │ │ └── styles.xml.kakava
│ │ │ │ └── drawable
│ │ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── kotlin
│ │ │ │ └── kakavaroot
│ │ │ │ │ ├── App.kt.kakava
│ │ │ │ │ └── activity
│ │ │ │ │ ├── MainActivity.kt.kakava
│ │ │ │ │ ├── BackArrowActivity.kt.kakava
│ │ │ │ │ └── BaseActivity.kt.kakava
│ │ │ └── AndroidManifest.xml.kakava
│ │ ├── test
│ │ │ └── kotlin
│ │ │ │ └── kakavaroot
│ │ │ │ └── ExampleUnitTest.kt.kakava
│ │ └── androidTest
│ │ │ └── kotlin
│ │ │ └── kakavaroot
│ │ │ └── ExampleInstrumentedTest.kt.kakava
│ ├── proguard-rules.pro
│ └── build.gradle.kakava
│ ├── settings.gradle
│ ├── gradle.properties
│ ├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties.kakava
│ ├── build.gradle.kakava
│ ├── .gitignore
│ ├── gradlew.bat
│ ├── README.md
│ └── gradlew
├── static
└── android_studio_import.png
├── lib_versions.json
├── .gitignore
├── README.md
├── kakava
└── LICENSE
/templates/default/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/templates/default/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
--------------------------------------------------------------------------------
/templates/default-kotlin/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/static/android_studio_import.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/static/android_studio_import.png
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/values/strings.xml.kakava:
--------------------------------------------------------------------------------
1 |
2 | ${appName}
3 |
4 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/values/strings.xml.kakava:
--------------------------------------------------------------------------------
1 |
2 | ${appName}
3 |
4 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/values/strings.xml.kakava:
--------------------------------------------------------------------------------
1 |
2 | ${appName}
3 |
4 |
--------------------------------------------------------------------------------
/templates/default/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.parallel=true
3 | org.gradle.jvmargs=-Xms2048m -Xmx4096m -XX:MaxPermSize=1024m
--------------------------------------------------------------------------------
/templates/default-kotlin/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.parallel=true
3 | org.gradle.jvmargs=-Xms2048m -Xmx4096m -XX:MaxPermSize=1024m
--------------------------------------------------------------------------------
/templates/advanced-kotlin/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.parallel=true
3 | org.gradle.jvmargs=-Xms2048m -Xmx4096m -XX:MaxPermSize=1024m
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/advanced-kotlin/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/advanced-kotlin/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default-kotlin/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default-kotlin/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default-kotlin/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/advanced-kotlin/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/advanced-kotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default-kotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default-kotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/advanced-kotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default-kotlin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default-kotlin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/values/dimens.xml.kakava:
--------------------------------------------------------------------------------
1 |
2 | 8dp
3 | 16dp
4 |
5 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/advanced-kotlin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/advanced-kotlin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/advanced-kotlin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/values/dimens.xml.kakava:
--------------------------------------------------------------------------------
1 |
2 | 8dp
3 | 16dp
4 |
5 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default-kotlin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default-kotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/values/dimens.xml.kakava:
--------------------------------------------------------------------------------
1 |
2 | 8dp
3 | 16dp
4 |
5 |
--------------------------------------------------------------------------------
/templates/default/README.md:
--------------------------------------------------------------------------------
1 | # default template
2 | Basically, it's the same as the [default-kotlin template](https://github.com/rozag/kakava/blob/master/templates/default-kotlin/README.md), but in Java.
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/advanced-kotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/advanced-kotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default-kotlin/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default-kotlin/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default-kotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/advanced-kotlin/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/advanced-kotlin/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/advanced-kotlin/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default-kotlin/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default-kotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/advanced-kotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/advanced-kotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rozag/kakava/HEAD/templates/default-kotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/templates/default/gradle/wrapper/gradle-wrapper.properties.kakava:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | org.gradle.jvmargs=-Xms512m -Xmx4608M
6 | distributionUrl=${_gradle_distribution_url}
7 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/gradle/wrapper/gradle-wrapper.properties.kakava:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | org.gradle.jvmargs=-Xms512m -Xmx4608M
6 | distributionUrl=${_gradle_distribution_url}
--------------------------------------------------------------------------------
/templates/default-kotlin/gradle/wrapper/gradle-wrapper.properties.kakava:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | org.gradle.jvmargs=-Xms512m -Xmx4608M
6 | distributionUrl=${_gradle_distribution_url}
--------------------------------------------------------------------------------
/templates/default/app/src/main/java/kakavaroot/App.java.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName};
2 |
3 | import android.app.Application;
4 |
5 | public class App extends Application {
6 |
7 | @Override
8 | public void onCreate() {
9 | super.onCreate();
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/kotlin/kakavaroot/App.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}
2 |
3 | import android.app.Application
4 |
5 | class App : Application() {
6 |
7 | override fun onCreate() {
8 | super.onCreate()
9 | // Do your stuff here (e.g. initialize libraries)
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/kotlin/kakavaroot/crash/CrashProvider.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.crash
2 |
3 | /**
4 | * An abstraction for the crash reporting tool.
5 | *
6 | * Implement it with something like FabricCrashProvider
7 | * or FirebaseCrashProvider.
8 | *
9 | * Feel free to extend it for your own needs.
10 | */
11 | interface CrashProvider {
12 | fun report(t: Throwable)
13 | }
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/kotlin/kakavaroot/rconfig/RemoteConfigProvider.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.rconfig
2 |
3 | /**
4 | * An abstraction for the remote config provider
5 | *
6 | * Implement it with something like FirebaseConfigProvider. Basically,
7 | * it's just a key-value storage for the remote app customization.
8 | *
9 | * Feel free to extend it for your own needs.
10 | */
11 | interface RemoteConfigProvider {
12 | }
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/kotlin/kakavaroot/analytics/AnalyticsProvider.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.analytics
2 |
3 | /**
4 | * An abstraction for the analytics provider.
5 | *
6 | * Implement it with something like GoogleAnalyticsProvider
7 | * or FirebaseAnalyticsProvider.
8 | *
9 | * Feel free to extend it for your own needs.
10 | */
11 | interface AnalyticsProvider {
12 | fun event(event: String, params: Map = hashMapOf())
13 | }
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/values/colors.xml.kakava:
--------------------------------------------------------------------------------
1 |
2 | #3f51b5
3 | #303f9f
4 | #c5cae9
5 | #ff4081
6 | #212121
7 | #757575
8 | #ffffff
9 | #bdbdbd
10 |
11 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/values/colors.xml.kakava:
--------------------------------------------------------------------------------
1 |
2 | #3f51b5
3 | #303f9f
4 | #c5cae9
5 | #ff4081
6 | #212121
7 | #757575
8 | #ffffff
9 | #bdbdbd
10 |
11 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/values/colors.xml.kakava:
--------------------------------------------------------------------------------
1 |
2 | #3f51b5
3 | #303f9f
4 | #c5cae9
5 | #ff4081
6 | #212121
7 | #757575
8 | #ffffff
9 | #bdbdbd
10 |
11 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/test/kotlin/kakavaroot/ExampleUnitTest.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}
2 |
3 | import org.junit.Assert.assertEquals
4 | import org.junit.Test
5 |
6 | /**
7 | * Example local unit test, which will execute on the development machine (host).
8 |
9 | * @see [Testing documentation](http://d.android.com/tools/testing)
10 | */
11 | class ExampleUnitTest {
12 | @Test
13 | @Throws(Exception::class)
14 | fun addition_isCorrect() {
15 | assertEquals(4, (2 + 2).toLong())
16 | }
17 | }
--------------------------------------------------------------------------------
/templates/default/app/src/test/java/kakavaroot/ExampleUnitTest.java.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName};
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/lib_versions.json:
--------------------------------------------------------------------------------
1 | {
2 | "_gradle_distribution_url": "https\\://services.gradle.org/distributions/gradle-4.4-all.zip",
3 | "_gradle_classpath": "com.android.tools.build:gradle:3.1.3",
4 | "_build_tools_version": "28.0.1",
5 | "_min_sdk": "21",
6 | "_compile_sdk": "27",
7 | "_target_sdk": "27",
8 | "_support_library_version": "27.1.1",
9 | "_kotlin_version": "1.1.51",
10 | "_junit_version": "4.12",
11 | "_espresso_core_version": "2.2.2",
12 | "_play_services_version": "11.8.0",
13 | "_timber_version": "4.3.1"
14 | }
15 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/test/kotlin/kakavaroot/ExampleUnitTest.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}
2 |
3 | import org.junit.Assert.assertEquals
4 | import org.junit.Test
5 |
6 | /**
7 | * Example local unit test, which will execute on the development machine (host).
8 |
9 | * @see [Testing documentation](http://d.android.com/tools/testing)
10 | */
11 | class ExampleUnitTest {
12 | @Test
13 | @Throws(Exception::class)
14 | fun addition_isCorrect() {
15 | assertEquals(4, (2 + 2).toLong())
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/layout/activity_main.xml.kakava:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
14 |
15 |
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/layout/activity_main.xml.kakava:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/kotlin/kakavaroot/activity/MainActivity.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.activity
2 |
3 | import android.os.Bundle
4 | import ${packageName}.R
5 |
6 | class MainActivity : BaseActivity() {
7 |
8 | override val layoutResourceId = R.layout.activity_main
9 | override val toolbarTitleId = R.string.app_name
10 | override val displayHomeAsUp = false
11 | override val homeButtonEnabled = false
12 |
13 | override fun onCreate(savedInstanceState: Bundle?) {
14 | super.onCreate(savedInstanceState)
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/layout/activity_main.xml.kakava:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/values/styles.xml.kakava:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/kotlin/kakavaroot/app/main/MainActivity.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.app.main
2 |
3 | import android.os.Bundle
4 | import ${packageName}.R
5 | import ${packageName}.app.BaseActivity
6 |
7 | class MainActivity : BaseActivity() {
8 |
9 | override val layoutResourceId = R.layout.activity_main
10 | override val toolbarTitleId = R.string.app_name
11 | override val displayHomeAsUp = false
12 | override val homeButtonEnabled = false
13 |
14 | override fun onCreate(savedInstanceState: Bundle?) {
15 | super.onCreate(savedInstanceState)
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/values/styles.xml.kakava:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/values/styles.xml.kakava:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 |
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/layout/view_toolbar.xml.kakava:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/layout/view_toolbar.xml.kakava:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/layout/view_toolbar.xml.kakava:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/kotlin/kakavaroot/res/ResProvider.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.res
2 |
3 | import android.support.annotation.StringRes
4 |
5 | /**
6 | * An abstraction for the app resources provider.
7 | *
8 | * Implement it with something like AndroidResProvider. You
9 | * can extend it with methods like getDimension(...), etc.
10 | *
11 | * We don't want to have Android framework imports in our
12 | * classes for better testing, so we'll use this interface.
13 | *
14 | * Feel free to extend it for your own needs.
15 | */
16 | interface ResProvider {
17 | fun getString(@StringRes stringId: Int): String
18 | }
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/values-v21/styles.xml.kakava:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/values-v21/styles.xml.kakava:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/values-v21/styles.xml.kakava:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/kotlin/kakavaroot/app/BackArrowActivity.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.app
2 |
3 | import android.os.Bundle
4 |
5 | /**
6 | * Simple base class for activities with home toolbar arrow.
7 | * [BackArrowActivity.onBackPressed] is invoked on the arrow click,
8 | * so you can override [BackArrowActivity.onBackPressed] for customization.
9 | */
10 | abstract class BackArrowActivity : BaseActivity() {
11 |
12 | override val displayHomeAsUp = true
13 | override val homeButtonEnabled = true
14 |
15 | override fun onCreate(savedInstanceState: Bundle?) {
16 | super.onCreate(savedInstanceState)
17 | toolbar?.setNavigationOnClickListener { onBackPressed() }
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/kotlin/kakavaroot/prefs/PrefsProvider.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.prefs
2 |
3 | /**
4 | * An abstraction for the preferences provider (like SharedPreferences).
5 | *
6 | * Implement it with something like AndroidPrefsProvider
7 | * or BinaryPrefsProvider (https://github.com/iamironz/binaryprefs).
8 | * The implementation of this interface can mimic the SharedPreferences
9 | * interface or it can contain more domain-related methods like uuid(), saveUuid(), etc.
10 | *
11 | * We don't want to have Android framework imports in our
12 | * classes for better testing, so we'll use this interface.
13 | *
14 | * Feel free to extend it for your own needs.
15 | */
16 | interface PrefsProvider {
17 | }
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/kotlin/kakavaroot/activity/BackArrowActivity.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.activity
2 |
3 | import android.os.Bundle
4 |
5 | /**
6 | * Simple base class for activities with home toolbar arrow.
7 | * [BackArrowActivity.onBackPressed] is invoked on the arrow click,
8 | * so you can override [BackArrowActivity.onBackPressed] for customization.
9 | */
10 | abstract class BackArrowActivity : BaseActivity() {
11 |
12 | override val displayHomeAsUp = true
13 | override val homeButtonEnabled = true
14 |
15 | override fun onCreate(savedInstanceState: Bundle?) {
16 | super.onCreate(savedInstanceState)
17 | toolbar?.setNavigationOnClickListener { onBackPressed() }
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/templates/default/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /media/alexey/Dev/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /media/alexey/Dev/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /media/alexey/Dev/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/templates/default/app/src/main/java/kakavaroot/activity/MainActivity.java.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.activity;
2 |
3 | import android.os.Bundle;
4 |
5 | import ${packageName}.R;
6 |
7 | public class MainActivity extends BaseActivity {
8 |
9 | @Override
10 | protected void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 | }
13 |
14 | @Override
15 | protected int layoutResourceId() {
16 | return R.layout.activity_main;
17 | }
18 |
19 | @Override
20 | protected int toolbarTitleId() {
21 | return R.string.app_name;
22 | }
23 |
24 | @Override
25 | protected boolean displayHomeAsUp() {
26 | return false;
27 | }
28 |
29 | @Override
30 | protected boolean homeButtonEnabled() {
31 | return false;
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/androidTest/kotlin/kakavaroot/ExampleInstrumentedTest.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}
2 |
3 | import android.support.test.InstrumentationRegistry
4 | import android.support.test.runner.AndroidJUnit4
5 | import org.junit.Assert.assertEquals
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | /**
10 | * Instrumentation test, which will execute on an Android device.
11 |
12 | * @see [Testing documentation](http://d.android.com/tools/testing)
13 | */
14 | @RunWith(AndroidJUnit4::class)
15 | class ExampleInstrumentedTest {
16 | @Test
17 | @Throws(Exception::class)
18 | fun useAppContext() {
19 | // Context of the app under test.
20 | val appContext = InstrumentationRegistry.getTargetContext()
21 |
22 | assertEquals("${packageName}.debug", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/androidTest/kotlin/kakavaroot/ExampleInstrumentedTest.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}
2 |
3 | import android.support.test.InstrumentationRegistry
4 | import android.support.test.runner.AndroidJUnit4
5 | import org.junit.Assert.assertEquals
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | /**
10 | * Instrumentation test, which will execute on an Android device.
11 |
12 | * @see [Testing documentation](http://d.android.com/tools/testing)
13 | */
14 | @RunWith(AndroidJUnit4::class)
15 | class ExampleInstrumentedTest {
16 | @Test
17 | @Throws(Exception::class)
18 | fun useAppContext() {
19 | // Context of the app under test.
20 | val appContext = InstrumentationRegistry.getTargetContext()
21 |
22 | assertEquals("${packageName}.debug", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/AndroidManifest.xml.kakava:
--------------------------------------------------------------------------------
1 |
4 |
5 |
13 |
14 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/templates/default/app/src/main/AndroidManifest.xml.kakava:
--------------------------------------------------------------------------------
1 |
4 |
5 |
13 |
14 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/AndroidManifest.xml.kakava:
--------------------------------------------------------------------------------
1 |
4 |
5 |
13 |
14 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/kotlin/kakavaroot/app/App.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.app
2 |
3 | import android.app.Application
4 | import ${packageName}.BuildConfig
5 | import ${packageName}.crash.CrashProvider
6 | import ${packageName}.logging.ReleaseTree
7 | import timber.log.Timber
8 |
9 | class App : Application() {
10 |
11 | override fun onCreate() {
12 | super.onCreate()
13 |
14 | /*
15 | * Initialize Timber logging.
16 | *
17 | * Later you should change object : CrashProvider {...} stuff to
18 | * something like FabricCrashProvider or FirebaseCrashProvider
19 | * */
20 | Timber.plant(if (BuildConfig.DEBUG) Timber.DebugTree() else ReleaseTree(object : CrashProvider {
21 | override fun report(t: Throwable) {}
22 | }))
23 |
24 | // Do your stuff here (e.g. initialize libraries)
25 | }
26 |
27 | }
--------------------------------------------------------------------------------
/templates/default/app/src/androidTest/java/kakavaroot/ExampleInstrumentedTest.java.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName};
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("${packageName}.debug", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/templates/default/app/src/main/java/kakavaroot/activity/BackArrowActivity.java.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.activity;
2 |
3 | import android.view.MenuItem;
4 |
5 | /**
6 | * Simple base class for activities with home toolbar arrow.
7 | * {@link BackArrowActivity#onBackPressed()} is invoked on the arrow click,
8 | * so you can override {@link BackArrowActivity#onBackPressed()} or
9 | * {@link BackArrowActivity#onOptionsItemSelected(MenuItem)} for customization.
10 | */
11 | public abstract class BackArrowActivity extends BaseActivity {
12 |
13 | @Override
14 | protected boolean displayHomeAsUp() {
15 | return true;
16 | }
17 |
18 | @Override
19 | protected boolean homeButtonEnabled() {
20 | return true;
21 | }
22 |
23 | @Override
24 | public boolean onOptionsItemSelected(MenuItem item) {
25 | if (item != null && item.getItemId() == android.R.id.home) {
26 | onBackPressed();
27 | }
28 | return super.onOptionsItemSelected(item);
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/templates/default/build.gradle.kakava:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | google()
7 | }
8 | dependencies {
9 | classpath "${_gradle_classpath}"
10 | }
11 | }
12 |
13 | allprojects {
14 | repositories {
15 | jcenter()
16 | google()
17 | }
18 |
19 | // Versions-of-everything, same for all modules
20 | ext {
21 | // App version information
22 | majorAppVersion = 1
23 | minorAppVersion = 0
24 | patchAppVersion = 0
25 | buildAppVersion = 0
26 |
27 | // Build tools, SDKs, etc.
28 | buildTools = "${_build_tools_version}"
29 | minSdk = ${_min_sdk}
30 | compileSdk = ${_compile_sdk}
31 | targetSdk = ${_target_sdk}
32 |
33 | // Libraries versions
34 | supportLibraryVersion = "${_support_library_version}"
35 | }
36 | }
37 |
38 | task clean(type: Delete) {
39 | delete rootProject.buildDir
40 | }
41 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/README.md:
--------------------------------------------------------------------------------
1 | # advanced-kotlin template
2 | The aim of this template is to provide ready interfaces for different things (analytics, crash reporting, remote config, etc.) to improve decoupling and overall architecture of an app. These interfaces are:
3 | * `AnalyticsProvider` - an abstraction for different mobile analytics services (FirebaseAnalytics, GoogleAnalytics, etc.)
4 | * `CrashProvider` - an abstraction for different mobile crash reporting services (Fabric, FirebaseCrash, etc.)
5 | * `PrefsProvider` - an abstraction for `SharedPreferences`. It prevents Android framework dependencies in your code and allows you to use different `SharedPreferences` implementations (e.g. [binaryprefs](https://github.com/iamironz/binaryprefs))
6 | * `RemoteConfigProvider` - an abstraction for the remote config services (e.g. FirebaseRemoteConfig)
7 | * `ResProvider` - an abstraction for `Resources`. Like `PrefsProvider` it prevents Android dependencies in your code
8 |
9 | Moreover, the [Timber](https://github.com/JakeWharton/timber) library with the `ReleaseTree` is already imported in this template.
10 |
11 | For more details on `BaseActivity` and `BackArrowActivity` check out [the default-kotlin template](https://github.com/rozag/kakava/tree/master/templates/default-kotlin).
12 |
--------------------------------------------------------------------------------
/templates/default-kotlin/build.gradle.kakava:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | // Versions-of-everything, same for all modules
5 | ext {
6 | // App version information
7 | majorAppVersion = 1
8 | minorAppVersion = 0
9 | patchAppVersion = 0
10 | buildAppVersion = 0
11 |
12 | // Build tools, SDKs, etc.
13 | buildTools = "${_build_tools_version}"
14 | minSdk = ${_min_sdk}
15 | compileSdk = ${_compile_sdk}
16 | targetSdk = ${_target_sdk}
17 |
18 | // Kotlin version
19 | kotlinVersion = "${_kotlin_version}"
20 |
21 | // Libraries versions
22 | supportLibraryVersion = "${_support_library_version}"
23 | }
24 |
25 | repositories {
26 | jcenter()
27 | google()
28 | mavenCentral()
29 | }
30 |
31 | dependencies {
32 | classpath '${_gradle_classpath}'
33 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
34 | }
35 | }
36 |
37 | allprojects {
38 | repositories {
39 | jcenter()
40 | google()
41 | mavenCentral()
42 | }
43 | }
44 |
45 | task clean(type: Delete) {
46 | delete rootProject.buildDir
47 | }
48 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/build.gradle.kakava:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | // Versions-of-everything, same for all modules
5 | ext {
6 | // App version information
7 | majorAppVersion = 1
8 | minorAppVersion = 0
9 | patchAppVersion = 0
10 | buildAppVersion = 0
11 |
12 | // Build tools, SDKs, etc.
13 | buildTools = "${_build_tools_version}"
14 | minSdk = ${_min_sdk}
15 | compileSdk = ${_compile_sdk}
16 | targetSdk = ${_target_sdk}
17 |
18 | // Kotlin version
19 | kotlinVersion = "${_kotlin_version}"
20 |
21 | // Libraries versions
22 | supportLibraryVersion = "${_support_library_version}"
23 | playServicesVersion = "${_play_services_version}"
24 | }
25 |
26 | repositories {
27 | jcenter()
28 | google()
29 | mavenCentral()
30 | }
31 |
32 | dependencies {
33 | classpath '${_gradle_classpath}'
34 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
35 | }
36 | }
37 |
38 | allprojects {
39 | repositories {
40 | jcenter()
41 | google()
42 | mavenCentral()
43 | }
44 | }
45 |
46 | task clean(type: Delete) {
47 | delete rootProject.buildDir
48 | }
49 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/kotlin/kakavaroot/app/BaseActivity.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.app
2 |
3 | import android.os.Bundle
4 | import android.support.v7.app.AppCompatActivity
5 | import android.support.v7.widget.Toolbar
6 | import ${packageName}.R
7 |
8 | /**
9 | * Simple base class for all activities in the app.
10 | * [BaseActivity] finds [Toolbar] by R.id.toolbar id and sets it up.
11 | */
12 | abstract class BaseActivity : AppCompatActivity() {
13 |
14 | /**
15 | * id of your activity layout. Return 0 if you don't want to provide the layout.
16 | */
17 | protected abstract val layoutResourceId: Int
18 |
19 | /**
20 | * id of your toolbar title. Return 0 if you don't want to provide the title.
21 | */
22 | protected abstract val toolbarTitleId: Int
23 |
24 | /**
25 | * whether home should be displayed as an "up" affordance.
26 | */
27 | protected abstract val displayHomeAsUp: Boolean
28 |
29 | /**
30 | * whether home button in the corner of [Toolbar] should be enabled
31 | */
32 | protected abstract val homeButtonEnabled: Boolean
33 |
34 | protected var toolbar: Toolbar? = null
35 |
36 | override fun onCreate(savedInstanceState: Bundle?) {
37 | super.onCreate(savedInstanceState)
38 | if (layoutResourceId != 0) {
39 | setContentView(layoutResourceId)
40 | }
41 | setUpToolbar()
42 | }
43 |
44 | protected fun setUpToolbar() {
45 | toolbar = findViewById(R.id.toolbar) as Toolbar?
46 | if (toolbar != null) {
47 | setSupportActionBar(toolbar)
48 | }
49 |
50 | if (toolbarTitleId != 0) {
51 | setTitle(toolbarTitleId)
52 | }
53 |
54 | supportActionBar?.setDisplayHomeAsUpEnabled(displayHomeAsUp)
55 | supportActionBar?.setHomeButtonEnabled(homeButtonEnabled)
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/kotlin/kakavaroot/activity/BaseActivity.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.activity
2 |
3 | import android.os.Bundle
4 | import android.support.v7.app.AppCompatActivity
5 | import android.support.v7.widget.Toolbar
6 | import ${packageName}.R
7 |
8 | /**
9 | * Simple base class for all activities in the app.
10 | * [BaseActivity] finds [Toolbar] by R.id.toolbar id and sets it up.
11 | */
12 | abstract class BaseActivity : AppCompatActivity() {
13 |
14 | /**
15 | * id of your activity layout. Return 0 if you don't want to provide the layout.
16 | */
17 | protected abstract val layoutResourceId: Int
18 |
19 | /**
20 | * id of your toolbar title. Return 0 if you don't want to provide the title.
21 | */
22 | protected abstract val toolbarTitleId: Int
23 |
24 | /**
25 | * whether home should be displayed as an "up" affordance.
26 | */
27 | protected abstract val displayHomeAsUp: Boolean
28 |
29 | /**
30 | * whether home button in the corner of [Toolbar] should be enabled
31 | */
32 | protected abstract val homeButtonEnabled: Boolean
33 |
34 | protected var toolbar: Toolbar? = null
35 |
36 | override fun onCreate(savedInstanceState: Bundle?) {
37 | super.onCreate(savedInstanceState)
38 | if (layoutResourceId != 0) {
39 | setContentView(layoutResourceId)
40 | }
41 | setUpToolbar()
42 | }
43 |
44 | protected fun setUpToolbar() {
45 | toolbar = findViewById(R.id.toolbar) as Toolbar?
46 | if (toolbar != null) {
47 | setSupportActionBar(toolbar)
48 | }
49 |
50 | if (toolbarTitleId != 0) {
51 | setTitle(toolbarTitleId)
52 | }
53 |
54 | supportActionBar?.setDisplayHomeAsUpEnabled(displayHomeAsUp)
55 | supportActionBar?.setHomeButtonEnabled(homeButtonEnabled)
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/kotlin/kakavaroot/logging/ReleaseTree.kt.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.logging
2 |
3 | import android.util.Log
4 | import ${packageName}.crash.CrashProvider
5 | import timber.log.Timber.Tree
6 |
7 | class ReleaseTree(val crash: CrashProvider) : Tree() {
8 |
9 | private val MAX_LOG_LENGTH = 8000
10 |
11 | override fun isLoggable(tag: String?, priority: Int): Boolean {
12 | return !listOf(Log.VERBOSE, Log.DEBUG, Log.INFO).contains(priority)
13 | }
14 |
15 | override fun log(priority: Int, tag: String?, message: String?, t: Throwable?) {
16 | if (isLoggable(tag, priority)) {
17 | if (priority == Log.ERROR && t != null) {
18 | t.printStackTrace()
19 | crash.report(t)
20 | }
21 |
22 | if (tag != null && message != null) {
23 | if (message.length < MAX_LOG_LENGTH) {
24 | if (priority == Log.ASSERT) {
25 | Log.wtf(tag, message)
26 | } else {
27 | Log.println(priority, tag, message)
28 | }
29 | return
30 | }
31 |
32 | var i = 0
33 | val length = message.length
34 | while (i < length) {
35 | var newLine = message.indexOf('\n', i)
36 | newLine = if (newLine != -1) newLine else length
37 | do {
38 | val end = Math.min(newLine, i + MAX_LOG_LENGTH)
39 | val part = message.substring(i, end)
40 | if (priority == Log.ASSERT) {
41 | Log.wtf(tag, part)
42 | } else {
43 | Log.println(priority, tag, part)
44 | }
45 | i = end
46 | } while (i < newLine)
47 | i++
48 | }
49 | }
50 | }
51 | }
52 |
53 | }
--------------------------------------------------------------------------------
/templates/default/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io/api/intellij,android,java
2 |
3 | ### Intellij ###
4 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
5 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
6 |
7 | # User-specific stuff:
8 | .idea
9 |
10 | # Mongo Explorer plugin:
11 | .idea/mongoSettings.xml
12 |
13 | ## File-based project format:
14 | *.iws
15 |
16 | ## Plugin-specific files:
17 |
18 | # IntelliJ
19 | /out/
20 |
21 | # mpeltonen/sbt-idea plugin
22 | .idea_modules/
23 |
24 | # JIRA plugin
25 | atlassian-ide-plugin.xml
26 |
27 | # Crashlytics plugin (for Android Studio and IntelliJ)
28 | com_crashlytics_export_strings.xml
29 | crashlytics.properties
30 | crashlytics-build.properties
31 | fabric.properties
32 |
33 | ### Intellij Patch ###
34 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
35 |
36 | # *.iml
37 | # modules.xml
38 | # .idea/misc.xml
39 | # *.ipr
40 |
41 |
42 | ### Android ###
43 | # Built application files
44 | *.apk
45 | *.ap_
46 |
47 | # Files for the ART/Dalvik VM
48 | *.dex
49 |
50 | # Java class files
51 | *.class
52 |
53 | # Generated files
54 | bin/
55 | gen/
56 | out/
57 |
58 | # Gradle files
59 | .gradle/
60 | build/
61 |
62 | # Local configuration file (sdk path, etc)
63 | local.properties
64 |
65 | # Proguard folder generated by Eclipse
66 | proguard/
67 |
68 | # Log Files
69 | *.log
70 |
71 | # Android Studio Navigation editor temp files
72 | .navigation/
73 |
74 | # Android Studio captures folder
75 | captures/
76 |
77 | # Intellij
78 | *.iml
79 | .idea/workspace.xml
80 | .idea/libraries
81 |
82 | # Keystore files
83 | *.jks
84 |
85 | ### Android Patch ###
86 | gen-external-apklibs
87 |
88 |
89 | ### Java ###
90 | *.class
91 |
92 | # Mobile Tools for Java (J2ME)
93 | .mtj.tmp/
94 |
95 | # Package Files #
96 | *.jar
97 | *.war
98 | *.ear
99 |
100 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
101 | hs_err_pid*
102 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io/api/intellij,android,java
2 |
3 | ### Intellij ###
4 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
5 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
6 |
7 | # User-specific stuff:
8 | .idea
9 |
10 | # Mongo Explorer plugin:
11 | .idea/mongoSettings.xml
12 |
13 | ## File-based project format:
14 | *.iws
15 |
16 | ## Plugin-specific files:
17 |
18 | # IntelliJ
19 | /out/
20 |
21 | # mpeltonen/sbt-idea plugin
22 | .idea_modules/
23 |
24 | # JIRA plugin
25 | atlassian-ide-plugin.xml
26 |
27 | # Crashlytics plugin (for Android Studio and IntelliJ)
28 | com_crashlytics_export_strings.xml
29 | crashlytics.properties
30 | crashlytics-build.properties
31 | fabric.properties
32 |
33 | ### Intellij Patch ###
34 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
35 |
36 | # *.iml
37 | # modules.xml
38 | # .idea/misc.xml
39 | # *.ipr
40 |
41 |
42 | ### Android ###
43 | # Built application files
44 | *.apk
45 | *.ap_
46 |
47 | # Files for the ART/Dalvik VM
48 | *.dex
49 |
50 | # Java class files
51 | *.class
52 |
53 | # Generated files
54 | bin/
55 | gen/
56 | out/
57 |
58 | # Gradle files
59 | .gradle/
60 | build/
61 |
62 | # Local configuration file (sdk path, etc)
63 | local.properties
64 |
65 | # Proguard folder generated by Eclipse
66 | proguard/
67 |
68 | # Log Files
69 | *.log
70 |
71 | # Android Studio Navigation editor temp files
72 | .navigation/
73 |
74 | # Android Studio captures folder
75 | captures/
76 |
77 | # Intellij
78 | *.iml
79 | .idea/workspace.xml
80 | .idea/libraries
81 |
82 | # Keystore files
83 | *.jks
84 |
85 | ### Android Patch ###
86 | gen-external-apklibs
87 |
88 |
89 | ### Java ###
90 | *.class
91 |
92 | # Mobile Tools for Java (J2ME)
93 | .mtj.tmp/
94 |
95 | # Package Files #
96 | *.jar
97 | *.war
98 | *.ear
99 |
100 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
101 | hs_err_pid*
102 |
--------------------------------------------------------------------------------
/templates/default-kotlin/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io/api/intellij,android,java
2 |
3 | ### Intellij ###
4 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
5 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
6 |
7 | # User-specific stuff:
8 | .idea
9 |
10 | # Mongo Explorer plugin:
11 | .idea/mongoSettings.xml
12 |
13 | ## File-based project format:
14 | *.iws
15 |
16 | ## Plugin-specific files:
17 |
18 | # IntelliJ
19 | /out/
20 |
21 | # mpeltonen/sbt-idea plugin
22 | .idea_modules/
23 |
24 | # JIRA plugin
25 | atlassian-ide-plugin.xml
26 |
27 | # Crashlytics plugin (for Android Studio and IntelliJ)
28 | com_crashlytics_export_strings.xml
29 | crashlytics.properties
30 | crashlytics-build.properties
31 | fabric.properties
32 |
33 | ### Intellij Patch ###
34 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
35 |
36 | # *.iml
37 | # modules.xml
38 | # .idea/misc.xml
39 | # *.ipr
40 |
41 |
42 | ### Android ###
43 | # Built application files
44 | *.apk
45 | *.ap_
46 |
47 | # Files for the ART/Dalvik VM
48 | *.dex
49 |
50 | # Java class files
51 | *.class
52 |
53 | # Generated files
54 | bin/
55 | gen/
56 | out/
57 |
58 | # Gradle files
59 | .gradle/
60 | build/
61 |
62 | # Local configuration file (sdk path, etc)
63 | local.properties
64 |
65 | # Proguard folder generated by Eclipse
66 | proguard/
67 |
68 | # Log Files
69 | *.log
70 |
71 | # Android Studio Navigation editor temp files
72 | .navigation/
73 |
74 | # Android Studio captures folder
75 | captures/
76 |
77 | # Intellij
78 | *.iml
79 | .idea/workspace.xml
80 | .idea/libraries
81 |
82 | # Keystore files
83 | *.jks
84 |
85 | ### Android Patch ###
86 | gen-external-apklibs
87 |
88 |
89 | ### Java ###
90 | *.class
91 |
92 | # Mobile Tools for Java (J2ME)
93 | .mtj.tmp/
94 |
95 | # Package Files #
96 | *.jar
97 | *.war
98 | *.ear
99 |
100 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
101 | hs_err_pid*
102 |
--------------------------------------------------------------------------------
/templates/default/app/src/main/java/kakavaroot/activity/BaseActivity.java.kakava:
--------------------------------------------------------------------------------
1 | package ${packageName}.activity;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.LayoutRes;
5 | import android.support.annotation.Nullable;
6 | import android.support.annotation.StringRes;
7 | import android.support.v7.app.ActionBar;
8 | import android.support.v7.app.AppCompatActivity;
9 | import android.support.v7.widget.Toolbar;
10 |
11 | import ${packageName}.R;
12 |
13 | /**
14 | * Simple base class for all activities in the app.
15 | * {@link BaseActivity} finds {@link Toolbar} by R.id.toolbar id and sets it up.
16 | */
17 | public abstract class BaseActivity extends AppCompatActivity {
18 |
19 | @Nullable
20 | protected Toolbar toolBar;
21 |
22 | @Override
23 | protected void onCreate(Bundle savedInstanceState) {
24 | super.onCreate(savedInstanceState);
25 | int layoutId = layoutResourceId();
26 | if (layoutId != 0) {
27 | setContentView(layoutId);
28 | }
29 | setUpToolbar();
30 | }
31 |
32 | protected void setUpToolbar() {
33 | toolBar = (Toolbar) findViewById(R.id.toolbar);
34 | if (toolBar != null) {
35 | setSupportActionBar(toolBar);
36 | int titleId = toolbarTitleId();
37 | if (titleId != 0) {
38 | setTitle(titleId);
39 | }
40 | }
41 |
42 | ActionBar actionBar = getSupportActionBar();
43 | if (actionBar != null) {
44 | actionBar.setDisplayHomeAsUpEnabled(displayHomeAsUp());
45 | actionBar.setHomeButtonEnabled(homeButtonEnabled());
46 | }
47 | }
48 |
49 | /**
50 | * @return id of your activity layout. Return 0 if you don't want to provide the layout.
51 | */
52 | @LayoutRes
53 | protected abstract int layoutResourceId();
54 |
55 | /**
56 | * @return id of your toolbar title. Return 0 if you don't want to provide the title.
57 | */
58 | @StringRes
59 | protected abstract int toolbarTitleId();
60 |
61 | /**
62 | * @return whether home should be displayed as an "up" affordance.
63 | */
64 | protected abstract boolean displayHomeAsUp();
65 |
66 | /**
67 | * @return whether home button in the corner of {@link Toolbar} should be enabled
68 | */
69 | protected abstract boolean homeButtonEnabled();
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/templates/default/app/build.gradle.kakava:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | android {
4 | compileSdkVersion compileSdk
5 | buildToolsVersion buildTools
6 |
7 | defaultConfig {
8 | applicationId "${packageName}"
9 |
10 | minSdkVersion minSdk
11 | targetSdkVersion targetSdk
12 |
13 | versionCode majorAppVersion * 10000 + minorAppVersion * 1000 + patchAppVersion * 100 + buildAppVersion
14 | versionName "${majorAppVersion}.${minorAppVersion}.${patchAppVersion}"
15 |
16 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
17 | }
18 |
19 | buildTypes {
20 | debug {
21 | minifyEnabled false
22 | debuggable true
23 | jniDebuggable true
24 | renderscriptDebuggable true
25 | pseudoLocalesEnabled false
26 | zipAlignEnabled true
27 | applicationIdSuffix ".debug"
28 | }
29 |
30 | release {
31 | minifyEnabled true
32 | debuggable false
33 | jniDebuggable false
34 | renderscriptDebuggable false
35 | pseudoLocalesEnabled false
36 | zipAlignEnabled true
37 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
38 | }
39 | }
40 |
41 | lintOptions {
42 | textReport true
43 | textOutput "stdout"
44 | fatal "UnusedResources"
45 | warningsAsErrors true
46 | abortOnError true
47 | }
48 |
49 | compileOptions {
50 | sourceCompatibility JavaVersion.VERSION_1_7
51 | targetCompatibility JavaVersion.VERSION_1_7
52 | }
53 |
54 | packagingOptions {
55 | exclude "META-INF/NOTICE"
56 | exclude "META-INF/NOTICE.txt"
57 | exclude "META-INF/LICENSE"
58 | exclude "META-INF/LICENSE.txt"
59 | exclude "META-INF/services/javax.annotation.processing.Processor"
60 | }
61 |
62 | dexOptions {
63 | javaMaxHeapSize "3g"
64 | jumboMode = true
65 | }
66 | }
67 |
68 | dependencies {
69 | // JUnit testing dependencies
70 | testImplementation "junit:junit:${_junit_version}"
71 |
72 | // Android testing dependencies
73 | androidTestImplementation "junit:junit:${_junit_version}"
74 | androidTestImplementation("com.android.support.test.espresso:espresso-core:${_espresso_core_version}", {
75 | exclude group: "com.android.support", module: "support-annotations"
76 | })
77 |
78 | // Android support library
79 | implementation "com.android.support:appcompat-v7:${supportLibraryVersion}"
80 |
81 | // Your dependencies go here...
82 | }
83 |
--------------------------------------------------------------------------------
/templates/default/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/templates/default-kotlin/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io/api/python,vim,pycharm
2 |
3 | ### Python ###
4 | # Byte-compiled / optimized / DLL files
5 | __pycache__/
6 | *.py[cod]
7 | *$py.class
8 |
9 | # C extensions
10 | *.so
11 |
12 | # Distribution / packaging
13 | .Python
14 | env/
15 | build/
16 | develop-eggs/
17 | dist/
18 | downloads/
19 | eggs/
20 | .eggs/
21 | lib/
22 | lib64/
23 | parts/
24 | sdist/
25 | var/
26 | *.egg-info/
27 | .installed.cfg
28 | *.egg
29 |
30 | # PyInstaller
31 | # Usually these files are written by a python script from a template
32 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
33 | *.manifest
34 | *.spec
35 |
36 | # Installer logs
37 | pip-log.txt
38 | pip-delete-this-directory.txt
39 |
40 | # Unit test / coverage reports
41 | htmlcov/
42 | .tox/
43 | .coverage
44 | .coverage.*
45 | .cache
46 | nosetests.xml
47 | coverage.xml
48 | *,cover
49 | .hypothesis/
50 |
51 | # Translations
52 | *.mo
53 | *.pot
54 |
55 | # Django stuff:
56 | *.log
57 | local_settings.py
58 |
59 | # Flask stuff:
60 | instance/
61 | .webassets-cache
62 |
63 | # Scrapy stuff:
64 | .scrapy
65 |
66 | # Sphinx documentation
67 | docs/_build/
68 |
69 | # PyBuilder
70 | target/
71 |
72 | # IPython Notebook
73 | .ipynb_checkpoints
74 |
75 | # pyenv
76 | .python-version
77 |
78 | # celery beat schedule file
79 | celerybeat-schedule
80 |
81 | # dotenv
82 | .env
83 |
84 | # virtualenv
85 | .venv/
86 | venv/
87 | ENV/
88 |
89 | # Spyder project settings
90 | .spyderproject
91 |
92 | # Rope project settings
93 | .ropeproject
94 |
95 |
96 | ### Vim ###
97 | # swap
98 | [._]*.s[a-w][a-z]
99 | [._]s[a-w][a-z]
100 | # session
101 | Session.vim
102 | # temporary
103 | .netrwhist
104 | *~
105 | # auto-generated tag files
106 | tags
107 |
108 |
109 | ### PyCharm ###
110 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
111 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
112 |
113 | # User-specific stuff:
114 | .idea
115 |
116 | ## File-based project format:
117 | *.iws
118 |
119 | ## Plugin-specific files:
120 |
121 | # IntelliJ
122 | /out/
123 |
124 | # mpeltonen/sbt-idea plugin
125 | .idea_modules/
126 |
127 | # JIRA plugin
128 | atlassian-ide-plugin.xml
129 |
130 | # Crashlytics plugin (for Android Studio and IntelliJ)
131 | com_crashlytics_export_strings.xml
132 | crashlytics.properties
133 | crashlytics-build.properties
134 | fabric.properties
135 |
136 | ### PyCharm Patch ###
137 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
138 |
139 | # *.iml
140 | # modules.xml
141 | # .idea/misc.xml
142 | # *.ipr
143 |
144 | util/
145 |
146 | ### macOS files ###
147 | *.DS_Store
148 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/build.gradle.kakava:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 | apply plugin: 'kotlin-android'
3 |
4 | android {
5 | compileSdkVersion compileSdk
6 | buildToolsVersion buildTools
7 |
8 | defaultConfig {
9 | applicationId "${packageName}"
10 |
11 | minSdkVersion minSdk
12 | targetSdkVersion targetSdk
13 |
14 | versionCode majorAppVersion * 10000 + minorAppVersion * 1000 + patchAppVersion * 100 + buildAppVersion
15 | versionName "${majorAppVersion}.${minorAppVersion}.${patchAppVersion}"
16 |
17 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
18 | }
19 |
20 | buildTypes {
21 | debug {
22 | minifyEnabled false
23 | debuggable true
24 | jniDebuggable true
25 | renderscriptDebuggable true
26 | pseudoLocalesEnabled false
27 | zipAlignEnabled true
28 | applicationIdSuffix ".debug"
29 | }
30 |
31 | release {
32 | minifyEnabled true
33 | debuggable false
34 | jniDebuggable false
35 | renderscriptDebuggable false
36 | pseudoLocalesEnabled false
37 | zipAlignEnabled true
38 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
39 | }
40 | }
41 |
42 | lintOptions {
43 | textReport true
44 | textOutput "stdout"
45 | fatal "UnusedResources"
46 | warningsAsErrors true
47 | abortOnError true
48 | }
49 |
50 | compileOptions {
51 | sourceCompatibility JavaVersion.VERSION_1_7
52 | targetCompatibility JavaVersion.VERSION_1_7
53 | }
54 |
55 | packagingOptions {
56 | exclude "META-INF/NOTICE"
57 | exclude "META-INF/NOTICE.txt"
58 | exclude "META-INF/LICENSE"
59 | exclude "META-INF/LICENSE.txt"
60 | exclude "META-INF/services/javax.annotation.processing.Processor"
61 | }
62 |
63 | dexOptions {
64 | javaMaxHeapSize "3g"
65 | jumboMode = true
66 | }
67 | sourceSets {
68 | main.java.srcDirs += "src/main/kotlin"
69 | androidTest.java.srcDirs += "src/androidTest/kotlin"
70 | test.java.srcDirs += "src/test/kotlin"
71 | }
72 | }
73 |
74 | dependencies {
75 | // JUnit testing dependencies
76 | testImplementation "junit:junit:${_junit_version}"
77 |
78 | // Android testing dependencies
79 | androidTestImplementation "junit:junit:${_junit_version}"
80 | androidTestImplementation("com.android.support.test.espresso:espresso-core:${_espresso_core_version}", {
81 | exclude group: "com.android.support", module: "support-annotations"
82 | })
83 |
84 | // Kotlin specific dependencies
85 | implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
86 |
87 | // Android support library
88 | implementation "com.android.support:appcompat-v7:${supportLibraryVersion}"
89 |
90 | // Your dependencies go here...
91 | }
92 |
--------------------------------------------------------------------------------
/templates/default-kotlin/README.md:
--------------------------------------------------------------------------------
1 | # default-kotlin template
2 | The main purpose of this template is to provide you with an environment which is more comfortable for fast prototypes and experiments than the default one provided by Android Studio. It consists of:
3 | * `App.kt` - an empty Application class
4 | * `BaseActivity.kt` - a convenient abstract parent Activity class
5 | * `BackArrowActivity.kt` - an abstract Activity class with basic "back button" functionality
6 | * `MainActivity.kt` - an empty Activity class for the fast start
7 |
8 | ## BaseActivity details
9 | This class provides basic Activity functions such as
10 | * Layout resource id
11 | * String resource id for the title
12 | * Boolean flags for the home button
13 |
14 | Here is the code:
15 | ```kotlin
16 | /**
17 | * Simple base class for all activities in the app.
18 | * [BaseActivity] finds [Toolbar] by R.id.toolbar id and sets it up.
19 | */
20 | abstract class BaseActivity : AppCompatActivity() {
21 |
22 | /**
23 | * id of your activity layout. Return 0 if you don't want to provide the layout.
24 | */
25 | protected abstract val layoutResourceId: Int
26 |
27 | /**
28 | * id of your toolbar title. Return 0 if you don't want to provide the title.
29 | */
30 | protected abstract val toolbarTitleId: Int
31 |
32 | /**
33 | * whether home should be displayed as an "up" affordance.
34 | */
35 | protected abstract val displayHomeAsUp: Boolean
36 |
37 | /**
38 | * whether home button in the corner of [Toolbar] should be enabled
39 | */
40 | protected abstract val homeButtonEnabled: Boolean
41 |
42 | protected var toolbar: Toolbar? = null
43 |
44 | override fun onCreate(savedInstanceState: Bundle?) {
45 | super.onCreate(savedInstanceState)
46 | if (layoutResourceId != 0) {
47 | setContentView(layoutResourceId)
48 | }
49 | setUpToolbar()
50 | }
51 |
52 | protected fun setUpToolbar() {
53 | toolbar = findViewById(R.id.toolbar) as Toolbar
54 | if (toolbar != null) {
55 | setSupportActionBar(toolbar)
56 | }
57 |
58 | if (toolbarTitleId != 0) {
59 | setTitle(toolbarTitleId)
60 | }
61 |
62 | supportActionBar?.setDisplayHomeAsUpEnabled(displayHomeAsUp)
63 | supportActionBar?.setHomeButtonEnabled(homeButtonEnabled)
64 | }
65 |
66 | }
67 | ```
68 |
69 | ## BackArrowActivity details
70 | This class extends the BaseActivity and provides home button related flags for you.
71 | Here is the code:
72 | ```kotlin
73 | /**
74 | * Simple base class for activities with home toolbar arrow.
75 | * [BackArrowActivity.onBackPressed] is invoked on the arrow click,
76 | * so you can override [BackArrowActivity.onBackPressed] for customization.
77 | */
78 | abstract class BackArrowActivity : BaseActivity() {
79 |
80 | override val displayHomeAsUp = true
81 | override val homeButtonEnabled = true
82 |
83 | override fun onCreate(savedInstanceState: Bundle?) {
84 | super.onCreate(savedInstanceState)
85 | toolbar?.setNavigationOnClickListener { onBackPressed() }
86 | }
87 |
88 | }
89 | ```
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/build.gradle.kakava:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 | apply plugin: "kotlin-android"
3 |
4 | android {
5 | compileSdkVersion compileSdk
6 | buildToolsVersion buildTools
7 |
8 | defaultConfig {
9 | applicationId "${packageName}"
10 |
11 | minSdkVersion minSdk
12 | targetSdkVersion targetSdk
13 |
14 | versionCode majorAppVersion * 10000 + minorAppVersion * 1000 + patchAppVersion * 100 + buildAppVersion
15 | versionName "${majorAppVersion}.${minorAppVersion}.${patchAppVersion}"
16 |
17 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
18 | }
19 |
20 | buildTypes {
21 | debug {
22 | minifyEnabled false
23 | debuggable true
24 | jniDebuggable true
25 | renderscriptDebuggable true
26 | pseudoLocalesEnabled false
27 | zipAlignEnabled true
28 | applicationIdSuffix ".debug"
29 | }
30 |
31 | release {
32 | minifyEnabled true
33 | debuggable false
34 | jniDebuggable false
35 | renderscriptDebuggable false
36 | pseudoLocalesEnabled false
37 | zipAlignEnabled true
38 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
39 | }
40 | }
41 |
42 | lintOptions {
43 | textReport true
44 | textOutput "stdout"
45 | fatal "UnusedResources"
46 | warningsAsErrors true
47 | abortOnError true
48 | }
49 |
50 | compileOptions {
51 | sourceCompatibility JavaVersion.VERSION_1_7
52 | targetCompatibility JavaVersion.VERSION_1_7
53 | }
54 |
55 | packagingOptions {
56 | exclude "META-INF/NOTICE"
57 | exclude "META-INF/NOTICE.txt"
58 | exclude "META-INF/LICENSE"
59 | exclude "META-INF/LICENSE.txt"
60 | exclude "META-INF/services/javax.annotation.processing.Processor"
61 | }
62 |
63 | dexOptions {
64 | javaMaxHeapSize "3g"
65 | jumboMode = true
66 | }
67 | sourceSets {
68 | main.java.srcDirs += "src/main/kotlin"
69 | androidTest.java.srcDirs += "src/androidTest/kotlin"
70 | test.java.srcDirs += "src/test/kotlin"
71 | }
72 | }
73 |
74 | dependencies {
75 | // JUnit testing dependencies
76 | testImplementation "junit:junit:${_junit_version}"
77 |
78 | // Android testing dependencies
79 | androidTestImplementation "junit:junit:${_junit_version}"
80 | androidTestImplementation("com.android.support.test.espresso:espresso-core:${_espresso_core_version}", {
81 | exclude group: "com.android.support", module: "support-annotations"
82 | })
83 |
84 | // Kotlin specific dependencies
85 | implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
86 |
87 | // Android support library
88 | implementation "com.android.support:appcompat-v7:${supportLibraryVersion}"
89 |
90 | // Timber logging library
91 | implementation "com.jakewharton.timber:timber:${_timber_version}"
92 |
93 | // Your dependencies go here...
94 | }
95 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # kakava
2 | Customizable Android app template generator. This tool allows you to generate an empty Android project with default/your own template. Checkout `templates/default/` or `templates/default-kotlin/` for more info.
3 |
4 | ## Motivations
5 | I've noticed that I spend ~15 minutes each time, when I need to create and set up a project for a new app or a prototype. Well, need to do a task more than once? Automate it! So, meet kakava!
6 |
7 | ## Requirements
8 | * `python3`
9 |
10 | ## Download
11 | Clone the repo:
12 | ```
13 | git clone --branch v1.5 git@github.com:rozag/kakava.git YOUR_PATH/kakava
14 | ```
15 | For convenience add it to your PATH. Put it to your `~/.bashrc`:
16 | ```
17 | PATH=$PATH:YOUR_PATH/kakava
18 | ```
19 |
20 | ## Sample usage
21 | * Super quick start (default project in current directory)
22 | ```
23 | kakava
24 | ```
25 | * Quick start
26 | ```
27 | kakava -d NEW_PROJECT_PATH
28 | ```
29 | * Custom package and app name
30 | ```
31 | kakava -d NEW_PROJECT_PATH -n MyApp -p com.example.app
32 | ```
33 | * Kotlin Android project
34 | ```
35 | kakava -d NEW_PROJECT_PATH -n MyApp -p com.example.app -t default-kotlin
36 | ```
37 | * Open it with AndroidStudio Import project option
38 |
39 | 
40 | * `kakava -h`
41 | ```
42 | usage: kakava [-h] [-d DESTINATION] [-p PACKAGE] [-n NAME] [-t TEMPLATE]
43 |
44 | optional arguments:
45 | -h, --help show this help message and exit
46 | -d DESTINATION, --destination DESTINATION
47 | output directory for the app
48 | -p PACKAGE, --package PACKAGE
49 | package name, e.g. com.example.app
50 | -n NAME, --name NAME app name, e.g. MyApp
51 | -t TEMPLATE, --template TEMPLATE
52 | template directory name in the templates/ dir
53 | ```
54 |
55 | ## Out-of-the-box templates
56 | * `default` - [default template](https://github.com/rozag/kakava/blob/master/templates/default/) for Java Android app
57 | * `default-kotlin` - [default template for Kotlin](https://github.com/rozag/kakava/blob/master/templates/default-kotlin/) Android app
58 | * `advanced-kotlin` - [advanced Kotlin template](https://github.com/rozag/kakava/blob/master/templates/advanced-kotlin/)
59 |
60 | ## How can I add my own template?
61 | Basically, what kakava does is iterate over all `*.kakava` files in the template and replace each variable substitution with desired value from the CLI params. See [currently supported variables](#currently-supported-params). Therefore to create new template you should:
62 | 1. Create and configure your desired project setup
63 | 2. Replace package names, class names or whatever you want with the `${variableName}` substitution
64 | 3. Add the `.kakava` extension to all files with such replacements
65 | 4. Reduce your `com/whatever/product` folder hierarchy to a simple `kakavaroot` folder
66 | 5. Put your new template into `templates/` folder with the desired name (e.g. `my-awesome-template`)
67 | 6. Smile, you're awesome :)
68 |
69 | ## Currently supported params
70 | * `${packageName}` - the package name for your app (e.g. `com.company.product`)
71 | * `${appName}` - your application name (e.g. `MyApp`)
72 |
73 | ## TODO (PR welcome)
74 | * Hackathon kotlin project template (hack-kotlin)
75 | * Custom templates support (custom CLI params parsing)
76 |
77 | ## License
78 |
79 | Copyright 2017 Alexey Mileev
80 |
81 | Licensed under the Apache License, Version 2.0 (the "License");
82 | you may not use this file except in compliance with the License.
83 | You may obtain a copy of the License at
84 |
85 | http://www.apache.org/licenses/LICENSE-2.0
86 |
87 | Unless required by applicable law or agreed to in writing, software
88 | distributed under the License is distributed on an "AS IS" BASIS,
89 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
90 | See the License for the specific language governing permissions and
91 | limitations under the License.
92 |
--------------------------------------------------------------------------------
/templates/default/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
18 |
23 |
28 |
33 |
38 |
43 |
48 |
53 |
58 |
63 |
68 |
73 |
78 |
83 |
88 |
93 |
98 |
103 |
108 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
18 |
23 |
28 |
33 |
38 |
43 |
48 |
53 |
58 |
63 |
68 |
73 |
78 |
83 |
88 |
93 |
98 |
103 |
108 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/templates/default-kotlin/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
18 |
23 |
28 |
33 |
38 |
43 |
48 |
53 |
58 |
63 |
68 |
73 |
78 |
83 |
88 |
93 |
98 |
103 |
108 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/templates/default/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/templates/advanced-kotlin/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/templates/default-kotlin/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/kakava:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | import argparse
3 | import json
4 | from os import makedirs, listdir, rmdir, walk, rename, getcwd, remove
5 | from os.path import realpath, basename, isdir, join
6 | from shutil import copytree, move
7 |
8 |
9 | def default_app_dir_name(destination):
10 | # If KakavaApp/ exists create KakavaApp1/ and so on...
11 | default_name = 'KakavaApp'
12 | number = ''
13 | i = 1
14 | while isdir(join(destination, default_name + number)):
15 | number = str(i)
16 | i += 1
17 | return default_name + number
18 |
19 |
20 | class AppConfig:
21 | def __init__(self,
22 | destination=None,
23 | package=None,
24 | name=None,
25 | template=None):
26 | self.destination = destination if destination else getcwd()
27 | self.package = package if package else 'com.company.product'
28 | self.name = name if name else default_app_dir_name(self.destination)
29 | self.template = template if template else 'default'
30 |
31 |
32 | def parse_args():
33 | parser = argparse.ArgumentParser()
34 | parser.add_argument(
35 | '-d',
36 | '--destination',
37 | help='output directory for the app'
38 | )
39 | parser.add_argument(
40 | '-p',
41 | '--package',
42 | help='package name, e.g. com.example.app'
43 | )
44 | parser.add_argument(
45 | '-n',
46 | '--name',
47 | help='app name, e.g. MyApp'
48 | )
49 | parser.add_argument(
50 | '-t',
51 | '--template',
52 | help='template directory name in the templates/ dir'
53 | )
54 | args = parser.parse_args()
55 | return AppConfig(args.destination, args.package, args.name, args.template)
56 |
57 |
58 | def create_package_structure(kakavaroot_path, package):
59 | # Get directories for creation from package
60 | dirs = package.split('.')
61 | dirs_to_create = dirs[0]
62 | for i in range(1, len(dirs)):
63 | dirs_to_create = join(dirs_to_create, dirs[i])
64 |
65 | # Create dir structure from package (com.example.app -> com/example/app)
66 | kakavaroot_index = kakavaroot_path.rfind('kakavaroot')
67 | kakavaroot_parent_path = kakavaroot_path[: kakavaroot_index]
68 | package_path = join(kakavaroot_parent_path, dirs_to_create)
69 | makedirs(package_path, exist_ok=True)
70 |
71 | # Move kakavaroot package into new structure (com/example/app/kakavaroot)
72 | move(kakavaroot_path, package_path)
73 |
74 | # Move kakavaroot/ content one level up and delete kakavaroot/
75 | kakavaroot_path = join(package_path, 'kakavaroot')
76 | for name in listdir(kakavaroot_path):
77 | move(join(package_path, 'kakavaroot', name), join(package_path, name))
78 | rmdir(kakavaroot_path)
79 |
80 |
81 | def replace_word_in_file(name, word, replacement):
82 | with open(name, 'r', encoding='utf-8') as file_read:
83 | lines = ''.join(file_read.readlines())
84 | lines = lines.replace(word, replacement)
85 | with open(name, 'w', encoding='utf-8') as file_write:
86 | file_write.write(lines)
87 |
88 |
89 | def replace_variables_in_file(name, app_cfg):
90 | replace_word_in_file(name, '${packageName}', app_cfg.package)
91 | replace_word_in_file(name, '${appName}', app_cfg.name)
92 |
93 |
94 | def replace_lib_versions_in_file(name, lib_versions):
95 | for flag, version in lib_versions.items():
96 | replace_word_in_file(name, '${%s}' % flag, version)
97 |
98 |
99 | def main():
100 | # Parse CL arguments
101 | app_config = parse_args()
102 |
103 | # Copy template folder to app_config.destination/app_config.name
104 | script_path = realpath(__file__)
105 | script_dir_path = script_path[: script_path.rfind(basename(__file__))]
106 | templates_dir_path = join(script_dir_path, 'templates')
107 | project_path = join(app_config.destination, app_config.name)
108 | default_template_path = join(templates_dir_path, app_config.template)
109 | copytree(default_template_path, project_path)
110 |
111 | # Create directories by splitting app_config.package
112 | # (kakavaroot/ -> com/example/app)
113 | for root, directories, filenames in walk(project_path):
114 | for directory in directories:
115 | dir_path = join(root, directory)
116 | if directory == 'kakavaroot' and isdir(dir_path):
117 | create_package_structure(dir_path, app_config.package)
118 |
119 | # Load lib_versions.json
120 | lib_versions_path = join(script_dir_path, 'lib_versions.json')
121 | with open(lib_versions_path, 'r') as lib_versions_file:
122 | lib_versions = json.load(lib_versions_file)
123 | if not lib_versions:
124 | lib_versions = {}
125 |
126 | # Change ${...} variables in source files according to given options
127 | for root, directories, filenames in walk(project_path):
128 | for filename in filenames:
129 | file_path = join(root, filename)
130 | if filename.endswith('.kakava'):
131 | replace_variables_in_file(file_path, app_config)
132 | replace_lib_versions_in_file(file_path, lib_versions)
133 | filename_without_postfix = filename[: filename.rfind('.kakava')]
134 | new_file_path = join(root, filename_without_postfix)
135 | rename(file_path, new_file_path)
136 | elif filename.endswith('README.md'):
137 | remove(file_path)
138 |
139 | # Success message
140 | print(app_config.package, 'project successfully created in', project_path)
141 |
142 |
143 | if __name__ == '__main__':
144 | main()
145 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------