├── .github └── workflows │ └── check.yml ├── .gitignore ├── README.md ├── app ├── .gitignore ├── build.gradle.kts ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── io │ │ └── github │ │ └── boguszpawlowski │ │ └── androidtemplate │ │ └── MainActivity.kt │ └── res │ ├── drawable-v24 │ └── ic_launcher_foreground.xml │ ├── drawable │ └── ic_launcher_background.xml │ ├── layout │ └── activity_main.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── values-night │ └── themes.xml │ └── values │ ├── colors.xml │ ├── strings.xml │ └── themes.xml ├── build.gradle.kts ├── buildSrc ├── build.gradle.kts └── src │ └── main │ └── kotlin │ ├── CommonAndroidPlugin.kt │ └── Dependencies.kt ├── detekt-config.yml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle.kts /.github/workflows/check.yml: -------------------------------------------------------------------------------- 1 | name: Check 2 | on: 3 | [pull_request] 4 | jobs: 5 | detekt: 6 | name: Detekt Check 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Checkout Repository 10 | uses: actions/checkout@v2 11 | 12 | - name: Cache Gradle 13 | uses: actions/cache@v2 14 | with: 15 | path: | 16 | ~/.gradle/caches/ 17 | ~/.gradle/wrapper/ 18 | key: cache-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }} 19 | restore-keys: cache-gradle- 20 | 21 | - name: Setup Java 14 22 | uses: actions/setup-java@v1 23 | with: 24 | java-version: '15' 25 | 26 | - name: Run Detekt 27 | run: ./gradlew detekt --stacktrace 28 | 29 | - name: Stop Gradle 30 | run: ./gradlew --stop 31 | unit-tests: 32 | name: Unit Tests 33 | runs-on: ubuntu-latest 34 | steps: 35 | - name: Checkout Repository 36 | uses: actions/checkout@v2 37 | 38 | - name: Cache Gradle 39 | uses: actions/cache@v2 40 | with: 41 | path: | 42 | ~/.gradle/caches/ 43 | ~/.gradle/wrapper/ 44 | key: cache-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }} 45 | restore-keys: cache-gradle- 46 | 47 | - name: Setup Java 14 48 | uses: actions/setup-java@v1 49 | with: 50 | java-version: '15' 51 | 52 | - name: Run Debug Unit Tests 53 | run: ./gradlew test --stacktrace 54 | 55 | - name: Stop Gradle 56 | run: ./gradlew --stop 57 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.aar 4 | *.ap_ 5 | *.aab 6 | 7 | # Files for the ART/Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | out/ 17 | # Uncomment the following line in case you need and you don't have the release build type files in your app 18 | # release/ 19 | 20 | # Gradle files 21 | .gradle/ 22 | build/ 23 | 24 | # Local configuration file (sdk path, etc) 25 | local.properties 26 | 27 | # Proguard folder generated by Eclipse 28 | proguard/ 29 | 30 | # Log Files 31 | *.log 32 | 33 | # Android Studio Navigation editor temp files 34 | .navigation/ 35 | 36 | # Android Studio captures folder 37 | captures/ 38 | 39 | # IntelliJ 40 | *.iml 41 | .idea/workspace.xml 42 | .idea/tasks.xml 43 | .idea/gradle.xml 44 | .idea/assetWizardSettings.xml 45 | .idea/dictionaries 46 | .idea/libraries 47 | # Android Studio 3 in .gitignore file. 48 | .idea/caches 49 | .idea/modules.xml 50 | # Comment next line if keeping position of elements in Navigation Editor is relevant for you 51 | .idea/navEditor.xml 52 | .idea/ 53 | 54 | # Keystore files 55 | # Uncomment the following lines if you do not want to check your keystore files in. 56 | #*.jks 57 | #*.keystore 58 | 59 | # External native build folder generated in Android Studio 2.2 and later 60 | .externalNativeBuild 61 | .cxx/ 62 | 63 | # Google Services (e.g. APIs or Firebase) 64 | # google-services.json 65 | 66 | # Freeline 67 | freeline.py 68 | freeline/ 69 | freeline_project_description.json 70 | 71 | # fastlane 72 | fastlane/report.xml 73 | fastlane/Preview.html 74 | fastlane/screenshots 75 | fastlane/test_output 76 | fastlane/readme.md 77 | 78 | # Version control 79 | vcs.xml 80 | 81 | # lint 82 | lint/intermediates/ 83 | lint/generated/ 84 | lint/outputs/ 85 | lint/tmp/ 86 | # lint/reports/ 87 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AndroidTemplate 2 | 3 | Template for Android projects, it includes: 4 | 5 | ## Dependencies provided via `buildSrc` 6 | Common Android dependencies are already defined in the `buildSrc` directory. \ 7 | For convenience of version bumping, the [Gradle Versions](https://github.com/ben-manes/gradle-versions-plugin) plugin is added. \ 8 | To check for any version updates, run: 9 | ``` 10 | gradle dependencyUpdates 11 | ``` 12 | 13 | ### Some of the defined dependencies: 14 | - Multiple AndroidX libraries 15 | - Compose + Accompanist 16 | - SqlDelight 17 | - Koin 18 | - Detekt 19 | - Firebase tools 20 | - Timber 21 | - Kotest 22 | 23 | ## Multi-module support 24 | Automatic module configuration provided by [auto-module](https://github.com/pablisco/auto-module) plugin. \ 25 | The `CommonAndroidPlugin` defined in the project takes care of tedious task of setting new android module. 26 | Example `build.gradle.kts` file, making use of this plugin: 27 | ```kotlin 28 | plugins { 29 | id(Android.LibraryPluginId) 30 | kotlin(Kotlin.AndroidPluginId) 31 | id("common-android-plugin") 32 | } 33 | 34 | dependencies { 35 | implementation(Kotlin.StdLib) 36 | implementation(Material.Core) 37 | implementation(AndroidX.AppCompat) 38 | debugImplementation(Debug.FoQA) 39 | } 40 | ``` 41 | ## Debug / QA tools 42 | [FoQA](https://github.com/DroidsOnRoids/FoQA) as a QA tools container. It includes: 43 | - [Chucker](https://github.com/ChuckerTeam/chucker) 44 | - Runtime font scaling 45 | - Database and SharedPrefs debugging tools 46 | 47 | And more, all available in the Hyperion menu. 48 | 49 | ## Basic CI configuration 50 | Project has basic Github Actions CI setup created. It will run unit tests and lint on any raised PR. 51 | 52 | ## Out of the box Compose support 53 | Template is ready for starting the development using Jetpack Compose. \ 54 | In case this is not needed, remove the lines marked by `// FIXME remove if not using compose` comments. 55 | 56 | ## Working on a stable version of Android Studio 57 | As this template is aimed at development using latest tools and Jetpack Compose, it is not compatible 58 | with stable version of AS. If you want to work on it, please remove Compose support as described in the 59 | previous paragraph and revert Android Gradle Plugin to latest stable version (in this moments it is 4.1.1): 60 | - Change AGP version in `Dependencies.kt`. 61 | - Change AGP version in `build.gradle.kts` of `buildSrc` directory. 62 | - Run `gradle wrapper` task. 63 | - Sync and rebuild the project. 64 | 65 | ## License 66 | 67 | Copyright 2021 Bogusz Pawłowski 68 | 69 | Licensed under the Apache License, Version 2.0 (the "License"); 70 | you may not use this file except in compliance with the License. 71 | You may obtain a copy of the License at 72 | 73 | http://www.apache.org/licenses/LICENSE-2.0 74 | 75 | Unless required by applicable law or agreed to in writing, software 76 | distributed under the License is distributed on an "AS IS" BASIS, 77 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 78 | See the License for the specific language governing permissions and 79 | limitations under the License. 80 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import org.ajoberstar.grgit.Grgit 2 | 3 | plugins { 4 | id(Android.ApplicationPluginId) 5 | kotlin(Kotlin.AndroidPluginId) 6 | id("common-android-plugin") 7 | id(SqlDelight.PluginId) 8 | } 9 | 10 | val commitsCount = Grgit.open(mapOf("dir" to rootDir)).log().size 11 | 12 | android { 13 | defaultConfig { 14 | versionCode = commitsCount 15 | versionName = App.VersionName 16 | } 17 | } 18 | 19 | dependencies { 20 | implementation(Kotlin.StdLib) 21 | 22 | implementation(Material.Core) 23 | 24 | implementation(AndroidX.AppCompat) 25 | implementation(AndroidX.ConstraintLayout) 26 | implementation(AndroidX.ComposeActivity) 27 | 28 | implementation(Compose.Runtime) // FIXME remove if not using compose 29 | implementation(Compose.Ui) // FIXME remove if not using compose 30 | implementation(Compose.Foundation) // FIXME remove if not using compose 31 | implementation(Compose.FoundationLayout) // FIXME remove if not using compose 32 | implementation(Compose.Material) // FIXME remove if not using compose 33 | 34 | implementation(Coroutines.Core) 35 | implementation(SqlDelight.AndroidDriver) 36 | 37 | implementation(KotlinXSerialization.Core) 38 | implementation(KotlinXSerialization.Json) 39 | 40 | implementation(Koin.Core) 41 | 42 | implementation(AndroidX.Activity) 43 | implementation(AndroidX.Startup) 44 | implementation(AndroidX.Lifecycle) 45 | 46 | implementation(platform(Firebase.Bom)) 47 | 48 | debugImplementation(Debug.LeakCanary) 49 | debugImplementation(Debug.FoQA) 50 | } 51 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle.kts. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/boguszpawlowski/androidtemplate/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package io.github.boguszpawlowski.androidtemplate 2 | 3 | import android.os.Bundle 4 | import androidx.activity.compose.setContent 5 | import androidx.appcompat.app.AppCompatActivity 6 | import androidx.compose.material.MaterialTheme 7 | import androidx.compose.material.Text 8 | import androidx.compose.runtime.Composable 9 | 10 | class MainActivity : AppCompatActivity() { 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | // setContentView(R.layout.activity_main) FIXME uncomment if not using Compose 14 | setContent { 15 | MainScreen() 16 | } 17 | } 18 | } 19 | 20 | @Composable 21 | fun MainScreen() { 22 | MaterialTheme { 23 | Text(text = "Hello") 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boguszpawlowski/AndroidTemplate/066679dc25888a6d29be5e39994a0fdba49c4993/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boguszpawlowski/AndroidTemplate/066679dc25888a6d29be5e39994a0fdba49c4993/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boguszpawlowski/AndroidTemplate/066679dc25888a6d29be5e39994a0fdba49c4993/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boguszpawlowski/AndroidTemplate/066679dc25888a6d29be5e39994a0fdba49c4993/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boguszpawlowski/AndroidTemplate/066679dc25888a6d29be5e39994a0fdba49c4993/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boguszpawlowski/AndroidTemplate/066679dc25888a6d29be5e39994a0fdba49c4993/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boguszpawlowski/AndroidTemplate/066679dc25888a6d29be5e39994a0fdba49c4993/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boguszpawlowski/AndroidTemplate/066679dc25888a6d29be5e39994a0fdba49c4993/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boguszpawlowski/AndroidTemplate/066679dc25888a6d29be5e39994a0fdba49c4993/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boguszpawlowski/AndroidTemplate/066679dc25888a6d29be5e39994a0fdba49c4993/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Android Template 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask 2 | import io.gitlab.arturbosch.detekt.Detekt 3 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile 4 | 5 | plugins { 6 | id(DetektLib.PluginId) version DetektLib.Version 7 | id(GradleVersions.PluginId) version GradleVersions.Version 8 | id(GrGit.PluginId) version GrGit.Version 9 | } 10 | 11 | buildscript { 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | jcenter() 17 | } 18 | dependencies { 19 | classpath(Android.GradlePlugin) 20 | classpath(Kotlin.GradlePlugin) 21 | classpath(SqlDelight.Plugin) 22 | classpath(DetektLib.Plugin) 23 | classpath(GradleVersions.Plugin) 24 | classpath(Firebase.CrashlyticsPlugin) 25 | } 26 | } 27 | 28 | allprojects { 29 | repositories { 30 | mavenCentral() 31 | google() 32 | maven("https://jitpack.io") 33 | jcenter() 34 | } 35 | 36 | tasks.withType { 37 | sourceCompatibility = "1.8" 38 | targetCompatibility = "1.8" 39 | } 40 | 41 | tasks.withType { 42 | kotlinOptions { 43 | jvmTarget = "1.8" 44 | languageVersion = "1.5" 45 | apiVersion = "1.5" 46 | freeCompilerArgs = freeCompilerArgs + listOf( 47 | "-progressive", 48 | "-Xopt-in=kotlin.RequiresOptIn", 49 | "-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", 50 | "-Xskip-prerelease-check", 51 | "-Xuse-experimental=kotlin.contracts.ExperimentalContracts", 52 | "-Xjvm-enable-preview" 53 | ) 54 | } 55 | } 56 | 57 | tasks.withType { 58 | useJUnitPlatform() 59 | testLogging { 60 | events("passed", "skipped", "failed") 61 | } 62 | } 63 | } 64 | 65 | dependencies { 66 | detekt(DetektLib.Formatting) 67 | detekt(DetektLib.Cli) 68 | } 69 | 70 | tasks.withType { 71 | parallel = true 72 | config.setFrom(rootProject.file("detekt-config.yml")) 73 | setSource(files(projectDir)) 74 | exclude(subprojects.map { "${it.buildDir.relativeTo(rootDir).path}/" }) 75 | exclude("**/.gradle/**") 76 | reports { 77 | xml { 78 | enabled = true 79 | destination = file("build/reports/detekt/detekt-results.xml") 80 | } 81 | html.enabled = false 82 | txt.enabled = false 83 | } 84 | } 85 | 86 | tasks.register("check") { 87 | group = "Verification" 88 | description = "Allows to attach Detekt to the root project." 89 | } 90 | 91 | tasks.withType { 92 | rejectVersionIf { 93 | isNonStable(candidate.version) && !isNonStable(currentVersion) 94 | } 95 | } 96 | 97 | fun isNonStable(version: String): Boolean { 98 | val regex = "^[0-9,.v-]+(-r)?$".toRegex() 99 | return !regex.matches(version) 100 | } 101 | -------------------------------------------------------------------------------- /buildSrc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `kotlin-dsl` 3 | } 4 | 5 | repositories { 6 | mavenCentral() 7 | google() 8 | } 9 | 10 | gradlePlugin { 11 | plugins { 12 | register("common-android-plugin") { 13 | id = "common-android-plugin" 14 | implementationClass = "CommonAndroidPlugin" 15 | } 16 | } 17 | } 18 | 19 | dependencies { 20 | implementation("com.android.tools.build:gradle:7.0.3") 21 | implementation(kotlin("gradle-plugin", "1.5.31")) 22 | } 23 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/CommonAndroidPlugin.kt: -------------------------------------------------------------------------------- 1 | import com.android.build.gradle.BaseExtension 2 | import org.gradle.api.JavaVersion.VERSION_11 3 | import org.gradle.api.Plugin 4 | import org.gradle.api.Project 5 | 6 | class CommonAndroidPlugin : Plugin { 7 | 8 | @Suppress("LongMethod") 9 | override fun apply(target: Project) { 10 | val androidExtension = target.extensions.getByName("android") 11 | 12 | (androidExtension as? BaseExtension)?.apply { 13 | compileSdkVersion(AndroidSdk.Compile) 14 | buildToolsVersion(AndroidSdk.BuildTools) 15 | defaultConfig { 16 | minSdk = AndroidSdk.Min 17 | targetSdk = AndroidSdk.Target 18 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 19 | } 20 | 21 | compileOptions { 22 | sourceCompatibility = VERSION_11 23 | targetCompatibility = VERSION_11 24 | isCoreLibraryDesugaringEnabled = true 25 | } 26 | 27 | buildFeatures.compose = true 28 | 29 | composeOptions { 30 | kotlinCompilerExtensionVersion = Compose.Version 31 | } 32 | 33 | target.dependencies.add("coreLibraryDesugaring", Kotlin.DesugarJdkLibs) 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/Dependencies.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("ObjectPropertyNaming", "ClassNaming", "UnderscoresInNumericLiterals") 2 | object App { 3 | private const val versionMajor = 0 4 | private const val versionMinor = 0 5 | private const val versionPatch = 1 6 | private val versionClassifier: String? = null 7 | private const val isSnapshot = true 8 | 9 | private fun generateVersionName(): String { 10 | val versionName = "$versionMajor.$versionMinor.$versionPatch" 11 | val classifier = if (versionClassifier == null && isSnapshot) { 12 | "-SNAPSHOT" 13 | } else versionClassifier ?: "" 14 | 15 | return "$versionName$classifier" 16 | } 17 | 18 | val VersionName = generateVersionName() 19 | } 20 | 21 | object MavenPublish { 22 | const val PluginId = "com.vanniktech.maven.publish" 23 | const val GradlePlugin = "com.vanniktech:gradle-maven-publish-plugin:0.13.0" 24 | } 25 | 26 | object AndroidSdk { 27 | const val Min = 24 28 | const val Compile = 30 29 | const val Target = Compile 30 | const val BuildTools = "30.0.2" 31 | } 32 | 33 | object Kotlin { 34 | const val Version = "1.5.31" 35 | 36 | const val GradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$Version" 37 | const val DokkaGradlePlugin = "org.jetbrains.dokka:dokka-gradle-plugin:1.4.32" 38 | 39 | const val StdLib = "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$Version" 40 | const val SafeArgsPlugin = "androidx.navigation:navigation-safe-args-gradle-plugin:2.2.0" 41 | 42 | const val AndroidPluginId = "android" 43 | const val KaptPluginId = "kapt" 44 | const val SafeArgsPluginId = "androidx.navigation.safeargs.kotlin" 45 | const val JvmPluginId = "jvm" 46 | 47 | const val DesugarJdkLibs = "com.android.tools:desugar_jdk_libs:1.1.5" 48 | } 49 | 50 | object Android { 51 | const val GradlePlugin = "com.android.tools.build:gradle:7.0.3" 52 | 53 | const val ApplicationPluginId = "com.android.application" 54 | const val LibraryPluginId = "com.android.library" 55 | } 56 | 57 | object GradleVersions { 58 | const val Version = "0.39.0" 59 | 60 | const val PluginId = "com.github.ben-manes.versions" 61 | const val Plugin = "com.github.ben-manes:gradle-versions-plugin:$Version" 62 | } 63 | 64 | object GrGit { 65 | const val Version = "4.1.0" 66 | 67 | const val PluginId = "org.ajoberstar.grgit" 68 | } 69 | 70 | object Coroutines { 71 | const val Version = "1.5.2" 72 | 73 | const val Core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:$Version" 74 | } 75 | 76 | object SqlDelight { 77 | const val Version = "1.5.2" 78 | 79 | const val PluginId = "com.squareup.sqldelight" 80 | const val Plugin = "com.squareup.sqldelight:gradle-plugin:$Version" 81 | 82 | const val AndroidDriver = "com.squareup.sqldelight:android-driver:$Version" 83 | const val JdbcDriver = "org.xerial:sqlite-jdbc:3.34.0" 84 | const val Driver = "com.squareup.sqldelight:sqlite-driver:$Version" 85 | 86 | const val CoroutineExtensions = "com.squareup.sqldelight:coroutines-extensions:$Version" 87 | } 88 | 89 | object Retrofit { 90 | const val Version = "2.9.0" 91 | 92 | const val Core = "com.squareup.retrofit2:retrofit:$Version" 93 | const val ConverterKotlinxSerialization = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:0.8.0" 94 | } 95 | 96 | object KotlinXSerialization { 97 | const val Version = "1.3.0" 98 | 99 | const val Core = "org.jetbrains.kotlinx:kotlinx-serialization-core:$Version" 100 | const val Json = "org.jetbrains.kotlinx:kotlinx-serialization-json:$Version" 101 | } 102 | 103 | object AndroidX { 104 | const val Version = "1.0.0" 105 | const val LifecycleVersion = "2.2.0" 106 | 107 | const val AppCompat = "androidx.appcompat:appcompat:1.3.1" 108 | const val Activity = "androidx.activity:activity-ktx:1.3.1" 109 | const val ConstraintLayout = "androidx.constraintlayout:constraintlayout:2.1.1" 110 | const val ComposeActivity = "androidx.activity:activity-compose:1.3.0" 111 | const val Lifecycle = "androidx.lifecycle:lifecycle-extensions:$LifecycleVersion" 112 | const val LifecycleRuntime = "androidx.lifecycle:lifecycle-runtime-ktx:$LifecycleVersion" 113 | const val LifecycleViewModel = "androidx.lifecycle:lifecycle-viewmodel-ktx:$LifecycleVersion" 114 | const val Startup = "androidx.startup:startup-runtime:1.1.0" 115 | const val ComposeLifecycle = "androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha03" 116 | } 117 | 118 | object Material { 119 | const val Core = "com.google.android.material:material:1.3.0" 120 | } 121 | 122 | object DetektLib { 123 | const val Version = "1.18.1" 124 | 125 | const val PluginId = "io.gitlab.arturbosch.detekt" 126 | const val Plugin = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$Version" 127 | 128 | const val Formatting = "io.gitlab.arturbosch.detekt:detekt-formatting:$Version" 129 | const val Cli = "io.gitlab.arturbosch.detekt:detekt-cli:$Version" 130 | } 131 | 132 | object Koin { 133 | const val Version = "2.2.2" 134 | 135 | const val Core = "org.koin:koin-core:$Version" 136 | const val Android = "org.koin:koin-android:$Version" 137 | const val ViewModel = "org.koin:koin-androidx-viewmodel:$Version" 138 | const val Compose = "org.koin:koin-androidx-compose:$Version" 139 | } 140 | 141 | object Timber { 142 | const val Version = "4.7.1" 143 | const val Core = "com.jakewharton.timber:timber:$Version" 144 | } 145 | 146 | object Compose { 147 | const val Version = "1.0.4" 148 | const val AccompanistVersion = "0.10.0" 149 | 150 | const val Runtime = "androidx.compose.runtime:runtime:$Version" 151 | const val Compiler = "androidx.compose.compiler:compiler:$Version" 152 | const val Foundation = "androidx.compose.foundation:foundation:$Version" 153 | const val FoundationLayout = "androidx.compose.foundation:foundation-layout:$Version" 154 | const val Material = "androidx.compose.material:material:$Version" 155 | const val Ui = "androidx.compose.ui:ui:$Version" 156 | const val UiTooling = "androidx.compose.ui:ui-tooling:$Version" 157 | const val MaterialIconsExtended = "androidx.compose.material:material-icons-extended:$Version" 158 | const val AccompanistCoil = "dev.chrisbanes.accompanist:accompanist-coil:$AccompanistVersion" 159 | const val Navigation = "androidx.navigation:navigation-compose:2.4.0-alpha02" 160 | const val Testing = "androidx.compose.ui:ui-test:$Version" 161 | const val JunitTesting = "androidx.compose.ui:ui-test-junit4:$Version" 162 | } 163 | 164 | object Firebase { 165 | const val CrashlyticsPlugin = "com.google.firebase:firebase-crashlytics-gradle:2.7.1" 166 | const val GoogleServicesPlugin = "com.google.gms:google-services:4.3.5" 167 | const val AppDistributionPlugin = "com.google.firebase:firebase-appdistribution-gradle:1.3.1" 168 | 169 | const val CrashlyticsPluginId = "com.google.firebase.crashlytics" 170 | const val GoogleServicesPluginId = "com.google.gms.google-services" 171 | const val AppDistributionPluginId = "com.google.firebase.appdistribution" 172 | 173 | const val Bom = "com.google.firebase:firebase-bom:28.1.0" 174 | 175 | const val Analytics = "com.google.firebase:firebase-analytics-ktx" 176 | const val Crashlytics = "com.google.firebase:firebase-crashlytics-ktx" 177 | } 178 | 179 | object Debug { 180 | const val LeakCanary = "com.squareup.leakcanary:leakcanary-android:2.7" 181 | const val FoQA = "pl.droidsonroids.foqa:foqa:0.2.1" 182 | } 183 | 184 | object Kotest { 185 | const val Version = "4.6.0" 186 | 187 | const val RunnerJunit5 = "io.kotest:kotest-runner-junit5-jvm:$Version" 188 | 189 | const val Assertions = "io.kotest:kotest-assertions-core-jvm:$Version" 190 | } 191 | 192 | object JUnit { 193 | const val Core = "junit:junit:4.13.2" 194 | } 195 | 196 | object CoroutineTest { 197 | const val Turbine = "app.cash.turbine:turbine:0.4.1" 198 | } 199 | 200 | object AndroidXTest { 201 | const val Runner = "androidx.test:runner:1.3.0" 202 | const val Rules = "androidx.test:rules:1.3.0" 203 | } 204 | 205 | object ComposeTest { 206 | const val Core = "androidx.compose.ui:ui-test-junit4:${Compose.Version}" 207 | } 208 | -------------------------------------------------------------------------------- /detekt-config.yml: -------------------------------------------------------------------------------- 1 | build: 2 | maxIssues: 0 3 | weights: 4 | 5 | complexity: 6 | active: true 7 | ComplexCondition: 8 | active: true 9 | threshold: 3 10 | ComplexInterface: 11 | active: true 12 | ComplexMethod: 13 | active: true 14 | threshold: 10 15 | ignoreSingleWhenExpression: true 16 | LargeClass: 17 | active: true 18 | threshold: 400 19 | LongMethod: 20 | active: true 21 | threshold: 20 22 | LongParameterList: 23 | active: true 24 | functionThreshold: 5 25 | constructorThreshold: 5 26 | NestedBlockDepth: 27 | active: true 28 | StringLiteralDuplication: 29 | active: false 30 | 31 | empty-blocks: 32 | active: true 33 | EmptyCatchBlock: 34 | active: true 35 | EmptyClassBlock: 36 | active: true 37 | EmptyDefaultConstructor: 38 | active: true 39 | EmptyDoWhileBlock: 40 | active: true 41 | EmptyElseBlock: 42 | active: true 43 | EmptyFinallyBlock: 44 | active: true 45 | EmptyForBlock: 46 | active: true 47 | EmptyFunctionBlock: 48 | active: true 49 | EmptyIfBlock: 50 | active: true 51 | EmptyInitBlock: 52 | active: true 53 | EmptyKtFile: 54 | active: true 55 | EmptySecondaryConstructor: 56 | active: true 57 | EmptyWhenBlock: 58 | active: true 59 | EmptyWhileBlock: 60 | active: true 61 | 62 | exceptions: 63 | active: true 64 | ExceptionRaisedInUnexpectedLocation: 65 | active: true 66 | methodNames: 'toString,hashCode,equals,finalize' 67 | InstanceOfCheckForException: 68 | active: true 69 | NotImplementedDeclaration: 70 | active: true 71 | PrintStackTrace: 72 | active: true 73 | RethrowCaughtException: 74 | active: true 75 | ReturnFromFinally: 76 | active: true 77 | SwallowedException: 78 | active: true 79 | ThrowingExceptionFromFinally: 80 | active: true 81 | ThrowingExceptionsWithoutMessageOrCause: 82 | active: true 83 | ThrowingNewInstanceOfSameException: 84 | active: true 85 | 86 | formatting: 87 | active: true 88 | ChainWrapping: 89 | active: true 90 | CommentSpacing: 91 | active: true 92 | ImportOrdering: 93 | active: true 94 | Indentation: 95 | active: true 96 | indentSize: 2 97 | continuationIndentSize: 4 98 | NoBlankLineBeforeRbrace: 99 | active: true 100 | NoConsecutiveBlankLines: 101 | active: true 102 | NoLineBreakBeforeAssignment: 103 | active: true 104 | NoMultipleSpaces: 105 | active: true 106 | NoSemicolons: 107 | active: true 108 | NoTrailingSpaces: 109 | active: true 110 | ParameterListWrapping: 111 | active: true 112 | indentSize: 2 113 | SpacingAroundColon: 114 | active: true 115 | SpacingAroundComma: 116 | active: true 117 | SpacingAroundCurly: 118 | active: true 119 | SpacingAroundKeyword: 120 | active: true 121 | SpacingAroundOperators: 122 | active: true 123 | SpacingAroundRangeOperator: 124 | active: true 125 | StringTemplate: 126 | active: true 127 | 128 | naming: 129 | active: true 130 | ClassNaming: 131 | active: true 132 | classPattern: '^[A-Z][a-z]+(?:[A-Z][a-z]+)*$' 133 | ConstructorParameterNaming: 134 | active: true 135 | parameterPattern: '^[a-z]+(?:[A-Z][a-z]+)*$' 136 | privateParameterPattern: '^[a-z]+(?:[A-Z][a-z]+)*$' 137 | EnumNaming: 138 | active: true 139 | enumEntryPattern: '^[A-Z][a-z]+(?:[A-Z][a-z]+)*$' 140 | FunctionNaming: 141 | active: true 142 | functionPattern: '^[a-z]+(?:[A-Z][a-z]+)*$' 143 | FunctionParameterNaming: 144 | active: true 145 | parameterPattern: '^[a-z]+(?:[A-Z][a-z]+)*$' 146 | MatchingDeclarationName: 147 | active: true 148 | MemberNameEqualsClassName: 149 | active: true 150 | ObjectPropertyNaming: 151 | active: true 152 | constantPattern: '^[A-Z][a-z]+(?:[A-Z][a-z]+)*$' 153 | propertyPattern: '^[A-Z][a-z]+(?:[A-Z][a-z]+)*$' 154 | privatePropertyPattern: '^[A-Z][a-z]+(?:[A-Z][a-z]+)*$' 155 | PackageNaming: 156 | active: true 157 | packagePattern: '^[a-z]+(\.[a-z][a-z]*)*$' 158 | TopLevelPropertyNaming: 159 | active: true 160 | constantPattern: '^[a-z]+(?:[A-Z][a-z]+)*$' 161 | propertyPattern: '^[a-z]+(?:[A-Z][a-z]+)*$' 162 | privatePropertyPattern: '^[a-z]+(?:[A-Z][a-z]+)*$' 163 | VariableNaming: 164 | active: true 165 | variablePattern: '^[a-z]+(?:[A-Z][a-z]+)*$' 166 | privateVariablePattern: '^[a-z]+(?:[A-Z][a-z]+)*$' 167 | 168 | performance: 169 | active: true 170 | ForEachOnRange: 171 | active: true 172 | UnnecessaryTemporaryInstantiation: 173 | active: true 174 | 175 | potential-bugs: 176 | active: true 177 | DuplicateCaseInWhenExpression: 178 | active: true 179 | EqualsAlwaysReturnsTrueOrFalse: 180 | active: false 181 | EqualsWithHashCodeExist: 182 | active: true 183 | ExplicitGarbageCollectionCall: 184 | active: true 185 | InvalidRange: 186 | active: true 187 | IteratorHasNextCallsNextMethod: 188 | active: true 189 | IteratorNotThrowingNoSuchElementException: 190 | active: true 191 | MissingWhenCase: 192 | active: true 193 | RedundantElseInWhen: 194 | active: true 195 | UnconditionalJumpStatementInLoop: 196 | active: true 197 | UnreachableCode: 198 | active: true 199 | UselessPostfixExpression: 200 | active: true 201 | WrongEqualsTypeParameter: 202 | active: true 203 | 204 | style: 205 | active: true 206 | CollapsibleIfStatements: 207 | active: true 208 | DataClassShouldBeImmutable: 209 | active: true 210 | EqualsNullCall: 211 | active: true 212 | EqualsOnSignatureLine: 213 | active: true 214 | ExplicitItLambdaParameter: 215 | active: true 216 | ForbiddenVoid: 217 | active: true 218 | LibraryCodeMustSpecifyReturnType: 219 | active: true 220 | LoopWithTooManyJumpStatements: 221 | active: false 222 | maxJumpCount: 1 223 | MaxLineLength: 224 | active: true 225 | maxLineLength: 120 226 | excludePackageStatements: true 227 | excludeImportStatements: true 228 | excludeCommentStatements: true 229 | MayBeConst: 230 | active: true 231 | ModifierOrder: 232 | active: true 233 | NewLineAtEndOfFile: 234 | active: true 235 | NoTabs: 236 | active: true 237 | OptionalAbstractKeyword: 238 | active: true 239 | OptionalWhenBraces: 240 | active: true 241 | PreferToOverPairSyntax: 242 | active: true 243 | ProtectedMemberInFinalClass: 244 | active: true 245 | RedundantVisibilityModifierRule: 246 | active: true 247 | excludes: ['**/library/**'] 248 | SafeCast: 249 | active: true 250 | SerialVersionUIDInSerializableClass: 251 | active: true 252 | SpacingBetweenPackageAndImports: 253 | active: true 254 | TrailingWhitespace: 255 | active: true 256 | UnderscoresInNumericLiterals: 257 | active: true 258 | acceptableDecimalLength: 3 259 | UnnecessaryAbstractClass: 260 | active: true 261 | UnnecessaryApply: 262 | active: true 263 | UnnecessaryInheritance: 264 | active: true 265 | UnnecessaryLet: 266 | active: true 267 | UnnecessaryParentheses: 268 | active: true 269 | UntilInsteadOfRangeTo: 270 | active: true 271 | UnusedImports: 272 | active: true 273 | UnusedPrivateClass: 274 | active: true 275 | UnusedPrivateMember: 276 | active: true 277 | UseArrayLiteralsInAnnotations: 278 | active: true 279 | UseCheckOrError: 280 | active: true 281 | UseIfInsteadOfWhen: 282 | active: true 283 | UseRequire: 284 | active: true 285 | UselessCallOnNotNull: 286 | active: true 287 | UtilityClassWithPublicConstructor: 288 | active: true 289 | VarCouldBeVal: 290 | active: true 291 | WildcardImport: 292 | active: true 293 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | android.useAndroidX=true 11 | android.enableJetifier=true 12 | kotlin.code.style=official 13 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boguszpawlowski/AndroidTemplate/066679dc25888a6d29be5e39994a0fdba49c4993/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MSYS* | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | 86 | # Determine the Java command to use to start the JVM. 87 | if [ -n "$JAVA_HOME" ] ; then 88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 89 | # IBM's JDK on AIX uses strange locations for the executables 90 | JAVACMD="$JAVA_HOME/jre/sh/java" 91 | else 92 | JAVACMD="$JAVA_HOME/bin/java" 93 | fi 94 | if [ ! -x "$JAVACMD" ] ; then 95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 96 | 97 | Please set the JAVA_HOME variable in your environment to match the 98 | location of your Java installation." 99 | fi 100 | else 101 | JAVACMD="java" 102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 103 | 104 | Please set the JAVA_HOME variable in your environment to match the 105 | location of your Java installation." 106 | fi 107 | 108 | # Increase the maximum file descriptors if we can. 109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 110 | MAX_FD_LIMIT=`ulimit -H -n` 111 | if [ $? -eq 0 ] ; then 112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 113 | MAX_FD="$MAX_FD_LIMIT" 114 | fi 115 | ulimit -n $MAX_FD 116 | if [ $? -ne 0 ] ; then 117 | warn "Could not set maximum file descriptor limit: $MAX_FD" 118 | fi 119 | else 120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 121 | fi 122 | fi 123 | 124 | # For Darwin, add options to specify how the application appears in the dock 125 | if $darwin; then 126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 127 | fi 128 | 129 | # For Cygwin or MSYS, switch paths to Windows format before running java 130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 133 | 134 | JAVACMD=`cygpath --unix "$JAVACMD"` 135 | 136 | # We build the pattern for arguments to be converted via cygpath 137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 138 | SEP="" 139 | for dir in $ROOTDIRSRAW ; do 140 | ROOTDIRS="$ROOTDIRS$SEP$dir" 141 | SEP="|" 142 | done 143 | OURCYGPATTERN="(^($ROOTDIRS))" 144 | # Add a user-defined pattern to the cygpath arguments 145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 147 | fi 148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 149 | i=0 150 | for arg in "$@" ; do 151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 153 | 154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 156 | else 157 | eval `echo args$i`="\"$arg\"" 158 | fi 159 | i=`expr $i + 1` 160 | done 161 | case $i in 162 | 0) set -- ;; 163 | 1) set -- "$args0" ;; 164 | 2) set -- "$args0" "$args1" ;; 165 | 3) set -- "$args0" "$args1" "$args2" ;; 166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 172 | esac 173 | fi 174 | 175 | # Escape application args 176 | save () { 177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 178 | echo " " 179 | } 180 | APP_ARGS=`save "$@"` 181 | 182 | # Collect all arguments for the java command, following the shell quoting and substitution rules 183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 184 | 185 | exec "$JAVACMD" "$@" 186 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.pablisco.gradle.automodule") version "0.14" 3 | } 4 | --------------------------------------------------------------------------------