Skip to content

Commit

Permalink
Merge pull request #4 from SSU-Plector/feat/#1-initial-setting
Browse files Browse the repository at this point in the history
[Feat/#1_initial_setting] 기초 세팅
  • Loading branch information
kangyuri1114 authored Mar 26, 2024
2 parents 9adb4da + 6738055 commit bfd72fb
Show file tree
Hide file tree
Showing 43 changed files with 986 additions and 86 deletions.
130 changes: 92 additions & 38 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,69 +1,123 @@
import com.zucchini.buildsrc.Constants

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
kotlin("android")
kotlin("kapt")
id("kotlin-parcelize")
id("dagger.hilt.android.plugin")
id("com.google.android.gms.oss-licenses-plugin")
}

android {
namespace = "com.zucchini.ssuplector"
compileSdk = 34
namespace = Constants.packageName
compileSdk = Constants.compileSdk

defaultConfig {
applicationId = "com.zucchini.ssuplector"
minSdk = 28
targetSdk = 34
versionCode = 1
versionName = "1.0"
applicationId = Constants.packageName
minSdk = Constants.minSdk
targetSdk = Constants.targetSdk
versionCode = Constants.versionCode
versionName = Constants.versionName

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}

// buildConfigField(
// "String",
// "NATIVE_APP_KEY",
// gradleLocalProperties(rootDir).getProperty("native.app.key"),
// )
// manifestPlaceholders["NATIVE_APP_KEY"] =
// gradleLocalProperties(rootDir).getProperty("nativeAppKey")
}

buildTypes {
debug {
// buildConfigField(
// "String",
// "BASE_URL",
// gradleLocalProperties(rootDir).getProperty("test.base.url")
// )
}
release {
// buildConfigField(
// "String",
// "BASE_URL",
// gradleLocalProperties(rootDir).getProperty("base.url")
// )
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
"proguard-rules.pro",
)
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = Versions.javaVersion
targetCompatibility = Versions.javaVersion
}

kotlinOptions {
jvmTarget = "1.8"
jvmTarget = Versions.jvmVersion
}

buildFeatures {
buildConfig = true
dataBinding = true
viewBinding = true
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.1"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

dependencies {
implementation(project(":core"))
implementation(project(":data"))
implementation(project(":domain"))
implementation(project(":feature:projects"))
implementation(project(":feature:devInfo"))
implementation(project(":feature:mypage"))

implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.activity:activity-compose:1.8.2")
implementation(platform("androidx.compose:compose-bom:2023.08.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2023.08.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
KotlinDependencies.run {
implementation(kotlin)
implementation(coroutines)
implementation(jsonSerialization)
}

AndroidXDependencies.run {
implementation(coreKtx)
implementation(appCompat)
implementation(hilt)
implementation(workManager)
implementation(hiltWorkManager)
implementation(constraintLayout)
}

KaptDependencies.run {
kapt(hiltCompiler)
kapt(hiltWorkManagerCompiler)
}

TestDependencies.run {
testImplementation(jUnit)
androidTestImplementation(androidTest)
androidTestImplementation(espresso)
}

ThirdPartyDependencies.run {
implementation(platform(okHttpBom))
implementation(okHttp)
implementation(okHttpLoggingInterceptor)
implementation(retrofit)
implementation(retrofitJsonConverter)
implementation(timber)
implementation(ossLicense)
}

ComposeDependencies.run {
implementation(composeUi)
implementation(composeActivity)
implementation(composeMaterial3)
implementation(composeTooling)
}
}
8 changes: 6 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".SSUPlectorApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand All @@ -16,10 +19,11 @@
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.SSUPlectorAndroid">
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">

<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand Down
51 changes: 13 additions & 38 deletions app/src/main/java/com/zucchini/ssuplector/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,46 +1,21 @@
package com.zucchini.ssuplector

import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.zucchini.ssuplector.ui.theme.SSUPlectorAndroidTheme
import androidx.appcompat.app.AppCompatActivity
import com.zucchini.ssuplector.databinding.ActivityMainBinding
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint

class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
binding = ActivityMainBinding.inflate(layoutInflater)
super.onCreate(savedInstanceState)
setContent {
SSUPlectorAndroidTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
Greeting("Android")
}
}
}
setContentView(binding.root)
// startActivity(Intent(this, LoginActivity::class.java))
// finish()
}
}

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

@Preview(showBackground = true)
@Composable
fun GreetingPreview() {
SSUPlectorAndroidTheme {
Greeting("Android")
}
}
18 changes: 18 additions & 0 deletions app/src/main/java/com/zucchini/ssuplector/SSUPlectorApplication.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.zucchini.ssuplector

import android.app.Application
import dagger.hilt.android.HiltAndroidApp
import timber.log.Timber

@HiltAndroidApp
class SSUPlectorApplication : Application() {
override fun onCreate() {
super.onCreate()

initTimber()
}
}

private fun initTimber() {
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())
}
6 changes: 6 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

</androidx.constraintlayout.widget.ConstraintLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">SSUPlector-Android</string>
<string name="app_name">SSUPlector</string>
</resources>
22 changes: 17 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.2.0" apply false
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
}
buildscript {
repositories {
google()
mavenCentral()
}

dependencies {
classpath(ClassPathPlugins.gradle)
classpath(ClassPathPlugins.kotlinGradle)
classpath(ClassPathPlugins.hilt)
classpath(ClassPathPlugins.oss)
}
}

tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
7 changes: 7 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
}
10 changes: 10 additions & 0 deletions buildSrc/src/main/java/com/zucchini/buildsrc/Constants.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.zucchini.buildsrc

object Constants {
const val packageName = "com.zucchini.ssuplector"
const val compileSdk = 34
const val minSdk = 28
const val targetSdk = 34
const val versionCode = 12
const val versionName = "1.0.0"
}
Loading

0 comments on commit bfd72fb

Please sign in to comment.