Skip to content

Commit

Permalink
add makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
quanda-0562 committed Oct 20, 2022
1 parent 4cb6ccc commit 4b6742c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 10 deletions.
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Android Studio plugin https://plugins.jetbrains.com/plugin/9333-makefile-language

.PHONY: run-devDebug
run-devDebug:
./gradlew installDevDebug
adb shell am start -n com.example.moviedb.dev/com.example.moviedb.compose.main.ComposeActivity

.PHONY: run-devBeta
run-devBeta:
./gradlew installDevBeta
adb shell am start -n com.example.moviedb.dev/com.example.moviedb.compose.main.ComposeActivity

.PHONY: run-devRelease
run-devRelease:
./gradlew installDevRelease
adb shell am start -n com.example.moviedb.dev/com.example.moviedb.compose.main.ComposeActivity

.PHONY: run-prdDebug
run-prdDebug:
./gradlew installPrdDebug
adb shell am start -n com.example.moviedb.dev/com.example.moviedb.compose.main.ComposeActivity

.PHONY: run-prdRelease
run-prdRelease:
./gradlew installPrdRelease
adb shell am start -n com.example.moviedb.dev/com.example.moviedb.compose.main.ComposeActivity

.PHONY: build-apk-devDebug
build-apk-devDebug:
./gradlew :app:assembleDevDebug
open app/build/outputs/apk/dev/debug

.PHONY: build-bundle-prdRelease
build-bundle-prdRelease:
./gradlew :app:bundlePrdRelease
open app/build/outputs/bundle/prdRelease
12 changes: 6 additions & 6 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ android {
}
signingConfig = signingConfigs.getByName("debug-key")
}
create("beta") {
/*create("beta") {
isDebuggable = true
isMinifyEnabled = true
isShrinkResources = true
Expand All @@ -78,7 +78,7 @@ android {
}
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.getByName("debug-key")
}
}*/
getByName("release") {
isDebuggable = false
isMinifyEnabled = true
Expand Down Expand Up @@ -169,7 +169,7 @@ dependencies {
implementation("androidx.compose.foundation:foundation:1.2.1")
// Material Design
implementation("androidx.compose.material:material:1.2.1")
implementation("androidx.compose.material3:material3:1.0.0-beta03")
implementation("androidx.compose.material3:material3:1.0.0-rc01")
// Material design icons
implementation("androidx.compose.material:material-icons-core:1.2.1")
implementation("androidx.compose.material:material-icons-extended:1.2.1")
Expand Down Expand Up @@ -244,8 +244,8 @@ dependencies {
kapt("com.github.bumptech.glide:compiler:4.12.0")

// dagger hilt
implementation("com.google.dagger:hilt-android:2.42")
kapt("com.google.dagger:hilt-android-compiler:2.42")
implementation("com.google.dagger:hilt-android:2.44")
kapt("com.google.dagger:hilt-android-compiler:2.44")
implementation("androidx.hilt:hilt-navigation-fragment:1.0.0")
// implementation("androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03")
kapt("androidx.hilt:hilt-compiler:1.0.0")
Expand Down Expand Up @@ -279,7 +279,7 @@ dependencies {
testImplementation("io.mockk:mockk:1.10.2")
testImplementation("androidx.arch.core:core-testing:2.1.0")
testImplementation("com.squareup.okhttp3:mockwebserver:5.0.0-alpha.2")
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:1.7.10")
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:1.7.20")
// testImplementation("org.robolectric:robolectric:4.3")

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.example.moviedb.BuildConfig
import com.example.moviedb.compose.theme.ComposeAppTheme

class ComposeActivity : ComponentActivity() {
Expand All @@ -22,7 +23,7 @@ class ComposeActivity : ComponentActivity() {
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
Greeting("Android")
Greeting("Android Compose ${BuildConfig.FLAVOR}${BuildConfig.BUILD_TYPE}")
}
}
}
Expand All @@ -31,7 +32,7 @@ class ComposeActivity : ComponentActivity() {

@Composable
fun Greeting(name: String) {
Text(text = "Hello $name!")
Text(text = "Hello $name")
}

@Preview(showBackground = true)
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.0")
classpath("com.android.tools.build:gradle:7.3.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10")
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.5.2")
classpath("com.google.dagger:hilt-android-gradle-plugin:2.42")
classpath("com.google.dagger:hilt-android-gradle-plugin:2.44")
// classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Libs.kotlinVersion}")
// classpath("androidx.navigation:navigation-safe-args-gradle-plugin:${Libs.navigationVersion}")
// classpath("com.google.dagger:hilt-android-gradle-plugin:${Libs.daggerHiltVersion}")
Expand Down

0 comments on commit 4b6742c

Please sign in to comment.