-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* updated gradle wrapper * updated launcher icon * updated gitignore * remove supress annotation in build files * switch to retrofit bom and retrofit provided kotlinx serialization lib * cleanup settings file * updated kotlin and ksp to v2.0.0 * cleanup code * cleanup build-logic dir * added info classes * cleanup * setup convention plugins properly * updated readme
- Loading branch information
Showing
79 changed files
with
514 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,3 +59,4 @@ Icon | |
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
/.kotlin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,15 @@ | ||
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed | ||
import com.nisrulz.example.spacexapi.info.ApplicationInfo | ||
|
||
plugins { | ||
id("app-convention") | ||
id("hilt-convention") | ||
alias(libs.plugins.spacexapi.android.application) | ||
alias(libs.plugins.spacexapi.android.app.hilt) | ||
} | ||
|
||
android { | ||
namespace = "com.nisrulz.example.spacexapi" | ||
|
||
defaultConfig { | ||
applicationId = "com.nisrulz.example.spacexapi" | ||
versionCode = 1 | ||
versionName = "1.0" | ||
} | ||
namespace = ApplicationInfo.BASE_NAMESPACE | ||
} | ||
|
||
dependencies { | ||
// Module Dependency | ||
implementation(projects.presentation) | ||
|
||
/** | ||
* @TODO: Remove this workaround when below issues are solved with AGP 8.3.0 | ||
* https://github.com/google/guava/issues/6618 | ||
* https://github.com/android/nowinandroid/pull/1140#issuecomment-1979431658 | ||
*/ | ||
modules { | ||
module("com.google.guava:listenablefuture") { | ||
replacedBy("com.google.guava:guava", "listenablefuture is part of guava") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<background android:drawable="@drawable/ic_launcher_background" /> | ||
<foreground android:drawable="@drawable/ic_launcher_foreground" /> | ||
<monochrome android:drawable="@drawable/ic_launcher_foreground" /> | ||
<background android:drawable="@mipmap/ic_launcher_background"/> | ||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/> | ||
<monochrome android:drawable="@mipmap/ic_launcher_monochrome"/> | ||
</adaptive-icon> |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
// Note: Replace with your package name | ||
group = "com.nisrulz.example.spacexapi" | ||
|
||
// https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support | ||
// Note: Setting a toolchain via the kotlin extension updates the toolchain for Java compile | ||
// tasks as well. | ||
kotlin { | ||
jvmToolchain(17) | ||
} | ||
|
||
tasks { | ||
validatePlugins { | ||
enableStricterValidation = true | ||
failOnWarning = true | ||
} | ||
} | ||
|
||
dependencies { | ||
// Android | ||
compileOnly(libs.android.gradle.plugin) | ||
compileOnly(libs.android.tools.common) | ||
compileOnly(libs.kotlin.gradle.plugin) | ||
|
||
// Compose | ||
compileOnly(libs.compose.gradle.plugin) | ||
|
||
// Hilt | ||
compileOnly(libs.symbol.processing.gradle.plugin) | ||
} | ||
|
||
// Register Convention Plugins | ||
gradlePlugin { | ||
plugins { | ||
|
||
register("androidApplication") { | ||
id = "spacexapi.android.application" | ||
implementationClass = "com.nisrulz.example.spacexapi.AndroidApplicationConventionPlugin" | ||
} | ||
|
||
register("androidLibrary") { | ||
id = "spacexapi.android.library" | ||
implementationClass = "com.nisrulz.example.spacexapi.AndroidLibraryConventionPlugin" | ||
} | ||
|
||
register("testing") { | ||
id = "spacexapi.android.testing" | ||
implementationClass = | ||
"com.nisrulz.example.spacexapi.TestingConventionPlugin" | ||
} | ||
|
||
register("hiltApp") { | ||
id = "spacexapi.android.app.hilt" | ||
implementationClass = | ||
"com.nisrulz.example.spacexapi.HiltAppConventionPlugin" | ||
} | ||
|
||
register("hiltLib") { | ||
id = "spacexapi.android.lib.hilt" | ||
implementationClass = | ||
"com.nisrulz.example.spacexapi.HiltLibConventionPlugin" | ||
} | ||
|
||
register("androidCompose") { | ||
id = "spacexapi.android.compose" | ||
implementationClass = | ||
"com.nisrulz.example.spacexapi.AndroidComposeConventionPlugin" | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...ntion/src/main/kotlin/com/nisrulz/example/spacexapi/AndroidApplicationConventionPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.nisrulz.example.spacexapi | ||
|
||
import com.nisrulz.example.spacexapi.ktx.configureAndroidApp | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
|
||
class AndroidApplicationConventionPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("com.android.application") | ||
apply("org.jetbrains.kotlin.android") | ||
} | ||
|
||
configureAndroidApp() | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...onvention/src/main/kotlin/com/nisrulz/example/spacexapi/AndroidComposeConventionPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.nisrulz.example.spacexapi | ||
|
||
import com.nisrulz.example.spacexapi.ktx.configureAndroidCompose | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
|
||
class AndroidComposeConventionPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("com.android.library") | ||
apply("org.jetbrains.kotlin.plugin.compose") | ||
} | ||
|
||
configureAndroidCompose() | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...onvention/src/main/kotlin/com/nisrulz/example/spacexapi/AndroidLibraryConventionPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.nisrulz.example.spacexapi | ||
|
||
import com.nisrulz.example.spacexapi.ktx.configureAndroidLibrary | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
|
||
class AndroidLibraryConventionPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("com.android.library") | ||
apply("org.jetbrains.kotlin.android") | ||
} | ||
|
||
configureAndroidLibrary() | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...logic/convention/src/main/kotlin/com/nisrulz/example/spacexapi/HiltAppConventionPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.nisrulz.example.spacexapi | ||
|
||
import com.android.build.api.dsl.ApplicationExtension | ||
import com.nisrulz.example.spacexapi.ktx.configureHilt | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
|
||
class HiltAppConventionPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("com.android.application") | ||
apply("com.google.devtools.ksp") | ||
apply("dagger.hilt.android.plugin") | ||
} | ||
|
||
extensions.configure<ApplicationExtension> { | ||
configureHilt(this) | ||
} | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...logic/convention/src/main/kotlin/com/nisrulz/example/spacexapi/HiltLibConventionPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.nisrulz.example.spacexapi | ||
|
||
import com.android.build.api.dsl.LibraryExtension | ||
import com.nisrulz.example.spacexapi.ktx.configureHilt | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
|
||
class HiltLibConventionPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("com.android.library") | ||
apply("com.google.devtools.ksp") | ||
apply("dagger.hilt.android.plugin") | ||
} | ||
|
||
extensions.configure<LibraryExtension> { | ||
configureHilt(this) | ||
} | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...logic/convention/src/main/kotlin/com/nisrulz/example/spacexapi/TestingConventionPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.nisrulz.example.spacexapi | ||
|
||
import com.nisrulz.example.spacexapi.ktx.configureTesting | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
|
||
class TestingConventionPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("com.android.library") | ||
} | ||
|
||
configureTesting() | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
build-logic/convention/src/main/kotlin/com/nisrulz/example/spacexapi/info/ApplicationInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.nisrulz.example.spacexapi.info | ||
|
||
object ApplicationInfo { | ||
const val VERSION_NAME = "1.0" | ||
const val VERSION_CODE = 1 | ||
const val BASE_NAMESPACE = "com.nisrulz.example.spacexapi" | ||
} |
8 changes: 8 additions & 0 deletions
8
build-logic/convention/src/main/kotlin/com/nisrulz/example/spacexapi/info/BuildSdkInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.nisrulz.example.spacexapi.info | ||
|
||
object BuildSdkInfo { | ||
const val COMPILE_SDK_VERSION = 34 | ||
const val MIN_SDK_VERSION = 21 | ||
const val TARGET_SDK_VERSION = 34 | ||
const val JVM_TARGET = 17 | ||
} |
29 changes: 29 additions & 0 deletions
29
...tion/src/main/kotlin/com/nisrulz/example/spacexapi/ktx/AndroidComposeProjectExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.nisrulz.example.spacexapi.ktx | ||
|
||
import com.android.build.api.dsl.LibraryExtension | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.assign | ||
import org.gradle.kotlin.dsl.configure | ||
import org.gradle.kotlin.dsl.dependencies | ||
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension | ||
|
||
/** | ||
* Configure Compose-specific options | ||
*/ | ||
internal fun Project.configureAndroidCompose() = configure<LibraryExtension> { | ||
buildFeatures { | ||
compose = true | ||
} | ||
|
||
dependencies { | ||
val bom = catalogLibrary("compose-bom") | ||
add("implementation", platform(bom)) | ||
add("androidTestImplementation", platform(bom)) | ||
add("implementation", catalogLibrary("ui-tooling-preview")) | ||
add("debugImplementation", catalogLibrary("ui-tooling")) | ||
} | ||
|
||
extensions.configure<ComposeCompilerGradlePluginExtension> { | ||
enableStrongSkippingMode = true | ||
} | ||
} |
Oops, something went wrong.