-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from monstar-lab-oss/refactor/modules-core-des…
…ignsystem Refactor/modules core designsystem
- Loading branch information
Showing
68 changed files
with
382 additions
and
166 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Build and Test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 17 | ||
|
||
- name: Spotless Check | ||
run: ./gradlew spotlessCheck | ||
|
||
- name: Detekt Check | ||
run: ./gradlew detekt | ||
|
||
- name: Run Tests | ||
run: ./gradlew test |
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
27 changes: 27 additions & 0 deletions
27
app/src/main/java/com/monstarlab/features/buildconfig/AppBuildConfiguration.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,27 @@ | ||
package com.monstarlab.features.buildconfig | ||
|
||
import com.monstarlab.BuildConfig | ||
import com.monstarlab.core.config.AppFlavour | ||
import com.monstarlab.core.config.AppVersion | ||
import com.monstarlab.core.config.BuildConfiguration | ||
import com.monstarlab.core.config.NetworkConfig | ||
import javax.inject.Inject | ||
|
||
class AppBuildConfiguration @Inject constructor() : BuildConfiguration { | ||
override val flavour: AppFlavour | ||
get() { | ||
return when (BuildConfig.FLAVOR) { | ||
"development" -> AppFlavour.Development | ||
"staging" -> AppFlavour.Staging | ||
"production" -> AppFlavour.Production | ||
else -> throw IllegalStateException( | ||
"Flavour ${BuildConfig.FLAVOR} is not supported", | ||
) | ||
} | ||
} | ||
override val version: AppVersion = AppVersion( | ||
versionName = BuildConfig.VERSION_NAME, | ||
buildNumber = BuildConfig.VERSION_CODE, | ||
) | ||
override val networkConfig: NetworkConfig = NetworkConfig(BuildConfig.API_URL) | ||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/monstarlab/features/buildconfig/BuildConfigurationModule.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.monstarlab.features.buildconfig | ||
|
||
import com.monstarlab.core.config.BuildConfiguration | ||
import dagger.Binds | ||
import dagger.Module | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
interface BuildConfigurationModule { | ||
|
||
@Binds | ||
@Singleton | ||
fun bindBuildConfiguration(appBuildConfiguration: AppBuildConfiguration): BuildConfiguration | ||
} |
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/monstarlab/features/nstack/domain/usecase/SetupNstackUseCase.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
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 @@ | ||
/build |
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,28 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
group = "com.monstarlab.buildlogic" | ||
|
||
|
||
dependencies { | ||
compileOnly(libs.android.gradle.plugin) | ||
compileOnly(libs.kotlin.gradle.plugin) | ||
} | ||
|
||
gradlePlugin { | ||
/** | ||
* Register convention plugins so they are available in the build scripts of the application | ||
*/ | ||
plugins { | ||
register("conventionAndroidLib") { | ||
id = "convention.android.library" | ||
implementationClass = "com.monstarlab.convention.AndroidLibConventionPlugin" | ||
} | ||
|
||
register("conventionAndroidApp") { | ||
id = "convention.android.application" | ||
implementationClass = "com.monstarlab.convention.AndroidAppConventionPlugin" | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...-logic/convention/src/main/kotlin/com/monstarlab/convention/AndroidAppConventionPlugin.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,28 @@ | ||
package com.monstarlab.convention | ||
|
||
import com.android.build.api.dsl.ApplicationExtension | ||
import com.monstarlab.convention.extensions.libs | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
|
||
class AndroidAppConventionPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
target.configure<ApplicationExtension> { | ||
compileSdk = AndroidConfiguration.COMPILE_SDK | ||
defaultConfig { | ||
targetSdk = AndroidConfiguration.TARGET_SDK | ||
minSdk = AndroidConfiguration.MIN_SDK | ||
} | ||
|
||
buildFeatures { | ||
compose = true | ||
buildConfig = true | ||
} | ||
composeOptions { | ||
kotlinCompilerExtensionVersion = target.rootProject.libs.findVersion("compose_compiler").get().toString() | ||
} | ||
} | ||
|
||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
build-logic/convention/src/main/kotlin/com/monstarlab/convention/AndroidConfig.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,9 @@ | ||
package com.monstarlab.convention | ||
|
||
|
||
internal object AndroidConfiguration { | ||
const val COMPILE_SDK = 34 | ||
const val TARGET_SDK = 34 | ||
const val MIN_SDK = 23 | ||
} | ||
|
27 changes: 27 additions & 0 deletions
27
...-logic/convention/src/main/kotlin/com/monstarlab/convention/AndroidLibConventionPlugin.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,27 @@ | ||
package com.monstarlab.convention | ||
|
||
import com.android.build.gradle.LibraryExtension | ||
import com.monstarlab.convention.extensions.libs | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
|
||
class AndroidLibConventionPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
extensions.configure<LibraryExtension> { | ||
compileSdk = AndroidConfiguration.COMPILE_SDK | ||
defaultConfig { | ||
minSdk = AndroidConfiguration.MIN_SDK | ||
} | ||
buildFeatures { | ||
compose = true | ||
buildConfig = true | ||
} | ||
composeOptions { | ||
kotlinCompilerExtensionVersion = target.rootProject.libs.findVersion("compose_compiler").get().toString() | ||
} | ||
} | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
build-logic/convention/src/main/kotlin/com/monstarlab/convention/extensions/Extensions.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,10 @@ | ||
package com.monstarlab.convention.extensions | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.artifacts.VersionCatalog | ||
import org.gradle.api.artifacts.VersionCatalogsExtension | ||
import org.gradle.kotlin.dsl.getByType | ||
|
||
|
||
internal val Project.libs: VersionCatalog get() = | ||
extensions.getByType<VersionCatalogsExtension>().named("libs") |
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,4 @@ | ||
# Gradle properties are not passed to included builds https://github.com/gradle/gradle/issues/2534 | ||
org.gradle.parallel=true | ||
org.gradle.caching=true | ||
org.gradle.configureondemand=true |
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,13 @@ | ||
dependencyResolutionManagement { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} | ||
|
||
include(":convention") |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Oops, something went wrong.