Skip to content

Commit

Permalink
Merge pull request #43 from kwmt/feature/legacy-module
Browse files Browse the repository at this point in the history
appモジュール整理
  • Loading branch information
kwmt authored Jan 7, 2024
2 parents 39f2af7 + f092e66 commit 42aae3a
Show file tree
Hide file tree
Showing 170 changed files with 650 additions and 537 deletions.
9 changes: 7 additions & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 5 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,19 @@ plugins {
}

android {
namespace 'net.kwmt27.jetpackcomposeplayground'
defaultConfig {
applicationId "net.kwmt27.jetpackcomposeplayground"
versionCode 1
versionName "0.0.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
namespace 'net.kwmt27.jetpackcomposeplayground'
}

dependencies {
implementation project(":camerax")
implementation(projects.core.ui)
implementation(projects.slideContents)
implementation(projects.feature.samples)
implementation(projects.feature.camerax)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.material)
implementation(libs.constraintlayout)
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.JetpackComposePlayGround">
<activity
android:name=".livedata.MutableLiveDataSampleActivity"
android:exported="false" />
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.compositeOver
import androidx.compose.ui.tooling.preview.Preview
import androidx.navigation.compose.rememberNavController
import net.kwmt27.jetpackcomposeplayground.ui.theme.JetpackComposePlayGroundTheme
import net.kwmt27.jetpackcomposeplayground.utils.LocalSysUiController
import net.kwmt27.jetpackcomposeplayground.utils.SystemUiController
import net.kwmt27.jetpackcomposeplayground.core.ui.theme.JetpackComposePlayGroundTheme
import net.kwmt27.jetpackcomposeplayground.core.ui.utils.LocalSysUiController
import net.kwmt27.jetpackcomposeplayground.core.ui.utils.SystemUiController

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
Expand Down
48 changes: 24 additions & 24 deletions app/src/main/java/net/kwmt27/jetpackcomposeplayground/NavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import net.kwmt27.camerax.CameraXScreen
import com.github.kwmt.slide.SlideApp
import net.kwmt27.jetpackcomposeplayground.Destinations.INSTAGRAM_SEARCH_LIST
import net.kwmt27.jetpackcomposeplayground.Destinations.LAYOUT_TAB
import net.kwmt27.jetpackcomposeplayground.Destinations.MAIN
Expand All @@ -47,31 +47,31 @@ import net.kwmt27.jetpackcomposeplayground.Destinations.SAMPLES_VERTICAL_LIST
import net.kwmt27.jetpackcomposeplayground.Destinations.SLIDE_POTATOTIPS82
import net.kwmt27.jetpackcomposeplayground.Destinations.SLIDE_SHIBUYAAPK43
import net.kwmt27.jetpackcomposeplayground.Destinations.UPDATABLE_ITEM_LIST
import net.kwmt27.jetpackcomposeplayground.animation.AnimateAsStateDemo
import net.kwmt27.jetpackcomposeplayground.animation.AnimatedContentSizeDemo
import net.kwmt27.jetpackcomposeplayground.animation.AnimatedVisibilityDemo
import net.kwmt27.jetpackcomposeplayground.animation.AutoRollingTextSample
import net.kwmt27.jetpackcomposeplayground.animation.CrossFadeDemo
import net.kwmt27.jetpackcomposeplayground.animation.UpdateTransitionDemo
import net.kwmt27.jetpackcomposeplayground.bottomsheet.BottomSheetLongDataSample
import net.kwmt27.jetpackcomposeplayground.bottomsheet.BottomSheetSample
import net.kwmt27.jetpackcomposeplayground.box.BoxSample
import net.kwmt27.jetpackcomposeplayground.button.ButtonSample
import net.kwmt27.jetpackcomposeplayground.coroutine.CancellationExceptionSample
import net.kwmt27.jetpackcomposeplayground.edittext.OutlinedTextFieldSample
import net.kwmt27.jetpackcomposeplayground.icon.UpIconSample
import net.kwmt27.jetpackcomposeplayground.image.CircleImageSample
import net.kwmt27.jetpackcomposeplayground.list.ListWithUpdatableItem
import net.kwmt27.jetpackcomposeplayground.list.SampleHorizontalList
import net.kwmt27.jetpackcomposeplayground.list.SampleVerticalList
import net.kwmt27.jetpackcomposeplayground.list.StickyListSample
import net.kwmt27.jetpackcomposeplayground.list.instagram.SampleInstagramSearchListLayout
import net.kwmt27.jetpackcomposeplayground.livedata.SampleMutableLiveDataScreen
import net.kwmt27.jetpackcomposeplayground.slide.SlideApp
import net.kwmt27.jetpackcomposeplayground.feature.camerax.CameraXScreen
import net.kwmt27.jetpackcomposeplayground.feature.samples.animation.AnimateAsStateDemo
import net.kwmt27.jetpackcomposeplayground.feature.samples.animation.AnimatedContentSizeDemo
import net.kwmt27.jetpackcomposeplayground.feature.samples.animation.AnimatedVisibilityDemo
import net.kwmt27.jetpackcomposeplayground.feature.samples.animation.AutoRollingTextSample
import net.kwmt27.jetpackcomposeplayground.feature.samples.animation.CrossFadeDemo
import net.kwmt27.jetpackcomposeplayground.feature.samples.animation.UpdateTransitionDemo
import net.kwmt27.jetpackcomposeplayground.feature.samples.bottomsheet.BottomSheetLongDataSample
import net.kwmt27.jetpackcomposeplayground.feature.samples.bottomsheet.BottomSheetSample
import net.kwmt27.jetpackcomposeplayground.feature.samples.box.BoxSample
import net.kwmt27.jetpackcomposeplayground.feature.samples.button.ButtonSample
import net.kwmt27.jetpackcomposeplayground.feature.samples.coroutine.CancellationExceptionSample
import net.kwmt27.jetpackcomposeplayground.feature.samples.edittext.OutlinedTextFieldSample
import net.kwmt27.jetpackcomposeplayground.feature.samples.icon.UpIconSample
import net.kwmt27.jetpackcomposeplayground.feature.samples.image.CircleImageSample
import net.kwmt27.jetpackcomposeplayground.feature.samples.list.ListWithUpdatableItem
import net.kwmt27.jetpackcomposeplayground.feature.samples.list.SampleHorizontalList
import net.kwmt27.jetpackcomposeplayground.feature.samples.list.SampleVerticalList
import net.kwmt27.jetpackcomposeplayground.feature.samples.list.StickyListSample
import net.kwmt27.jetpackcomposeplayground.feature.samples.list.instagram.SampleInstagramSearchListLayout
import net.kwmt27.jetpackcomposeplayground.feature.samples.livedata.SampleMutableLiveDataScreen
import net.kwmt27.jetpackcomposeplayground.feature.samples.state.ExpandableCardSample
import net.kwmt27.jetpackcomposeplayground.feature.samples.tablayout.TabLayoutSample
import net.kwmt27.jetpackcomposeplayground.slide.contents.potatotips82.PotatoTips82
import net.kwmt27.jetpackcomposeplayground.slide.contents.shibuyaapk43.ShibuyaApk43Presentation
import net.kwmt27.jetpackcomposeplayground.state.ExpandableCardSample
import net.kwmt27.jetpackcomposeplayground.tablayout.TabLayoutSample

private data class Group(
val groupLabel: String,
Expand Down

This file was deleted.

This file was deleted.

12 changes: 8 additions & 4 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ tasks.withType<KotlinCompile>().configureEach {

dependencies {
compileOnly(libs.android.gradlePlugin)
// compileOnly(libs.android.tools.common)
// compileOnly(libs.firebase.crashlytics.gradlePlugin)
// compileOnly(libs.firebase.performance.gradlePlugin)
compileOnly(libs.kotlin.gradlePlugin)
// compileOnly(libs.ksp.gradlePlugin)
}

gradlePlugin {
Expand All @@ -31,9 +27,17 @@ gradlePlugin {
id = "net.kwmt27.jetpackcomposeplayground.application.compose"
implementationClass = "AndroidApplicationComposeConventionPlugin"
}
register("androidLibraryCompose") {
id = "net.kwmt27.jetpackcomposeplayground.library.compose"
implementationClass = "AndroidLibraryComposeConventionPlugin"
}
register("androidApplication") {
id = "net.kwmt27.jetpackcomposeplayground.application"
implementationClass = "AndroidApplicationConventionPlugin"
}
register("androidLibrary") {
id = "net.kwmt27.jetpackcomposeplayground.library"
implementationClass = "AndroidLibraryConventionPlugin"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,14 @@ class AndroidApplicationConventionPlugin : Plugin<Project> {
with(pluginManager) {
apply("com.android.application")
apply("org.jetbrains.kotlin.android")
// apply("nowinandroid.android.lint")
// apply("com.dropbox.dependency-guard")
}

extensions.configure<ApplicationExtension> {
configureKotlinAndroid(this)
defaultConfig.targetSdk = 34
// configureGradleManagedDevices(this)
defaultConfig {
targetSdk = 34
}
}
// extensions.configure<ApplicationAndroidComponentsExtension> {
// configurePrintApksTask(this)
// configureBadgingTasks(extensions.getByType<BaseExtension>(), this)
// }
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import com.android.build.api.dsl.LibraryExtension
import internal.configureAndroidCompose
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.getByType

class AndroidLibraryComposeConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("com.android.library")
}
val extension = extensions.getByType<LibraryExtension>()
configureAndroidCompose(extension)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import com.android.build.api.dsl.LibraryExtension
import internal.configureKotlinAndroid
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure

class AndroidLibraryConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("com.android.library")
apply("org.jetbrains.kotlin.android")
}

extensions.configure<LibraryExtension> {
configureKotlinAndroid(this)
}
}
}
}
34 changes: 10 additions & 24 deletions build-logic/convention/src/main/kotlin/internal/KotlinAndroid.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ package internal
import com.android.build.api.dsl.CommonExtension
import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Expand All @@ -21,35 +18,24 @@ internal fun Project.configureKotlinAndroid(

defaultConfig {
minSdk = 23
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

compileOptions {
// Up to Java 11 APIs are available through desugaring
// https://developer.android.com/studio/write/java11-minimal-support-table
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
// isCoreLibraryDesugaringEnabled = true
}
}

configureKotlin()

dependencies {
// add("coreLibraryDesugaring", libs.findLibrary("android.desugarJdkLibs").get())
}
}

/**
* Configure base Kotlin options for JVM (non-Android)
*/
internal fun Project.configureKotlinJvm() {
extensions.configure<JavaPluginExtension> {
// Up to Java 11 APIs are available through desugaring
// https://developer.android.com/studio/write/java11-minimal-support-table
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
buildTypes {
getByName("release") {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
}

configureKotlin()
}

Expand Down
15 changes: 7 additions & 8 deletions build.gradle → build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.


// Top-level build file where you can add configuration options core to all sub-projects/modules.
buildscript {
dependencies {
classpath libs.android.gradlePlugin
classpath(libs.android.gradlePlugin)
}
}

plugins {
id 'com.diffplug.spotless' version '5.15.1'
id("com.diffplug.spotless") version "5.15.1"
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.android.library) apply false
}

spotless {
kotlin {
target '**/*.kt'
target("**/*.kt")
targetExclude("$buildDir/**/*.kt")
targetExclude('bin/**/*.kt')
targetExclude("bin/**/*.kt")
ktlint("0.42.1")
}
}

apply(from = rootProject.file("gradle/projectDependencyGraph.gradle"))
8 changes: 0 additions & 8 deletions camerax/src/main/java/net/kwmt27/camerax/ui/theme/Color.kt

This file was deleted.

Loading

0 comments on commit 42aae3a

Please sign in to comment.