Skip to content

Commit

Permalink
Merge pull request #4 from KNUTICE/main
Browse files Browse the repository at this point in the history
Initial Draft Version of Application
  • Loading branch information
doyoonkim3312 authored Sep 30, 2024
2 parents 615a8e7 + f410948 commit 7d0c05b
Show file tree
Hide file tree
Showing 62 changed files with 2,510 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/GenerateBuildArtifact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Generate Build Artifact

on:
pull_request:
branches: ["main", "release"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Setup Java JDk
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'adopt'

- name: Change permissions of Wrapper
run: chmod +x ./gradlew

- name: Decode BASEURL
env:
BASEURL: ${{ secrets.BASEURL }}
run: echo BASEURL="$BASEURL" > ./local.properties

- name: Clean Project
run: ./gradlew clean

- name: Build with Gradle
run: ./gradlew

- name: Generate and upload a Build Artifact
uses: actions/[email protected]
with:
name: KNUTICE_RC.apk
path: app/build/outputs/apk/debug/app-debug.apk
32 changes: 32 additions & 0 deletions .github/workflows/ValidateDevelopmentForRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Validate Development for Release

on:
push:
branches: ["development"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Setup Java JDk
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'adopt'

- name: Change permissions of Wrapper
run: chmod +x ./gradlew

- name: Decode BASEURL
env:
BASEURL: ${{ secrets.BASEURL }}
run: echo BASEURL="$BASEURL" > ./local.properties

- name: Clean Project
run: ./gradlew clean

- name: Build with Gradle
run: ./gradlew build
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Log/OS Files
*.log

# Android Studio generated files and folders
captures/
.externalNativeBuild/
.cxx/
*.apk
output.json

# IntelliJ
*.iml
.idea/
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml

# Keystore files
*.jks
*.keystore

# Google Services (e.g. APIs or Firebase)
google-services.json

# Android Profiling
*.hprof
33 changes: 33 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Log/OS Files
*.log

# Android Studio generated files and folders
captures/
.externalNativeBuild/
.cxx/
*.apk
output.json

# IntelliJ
*.iml
.idea/
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml

# Keystore files
*.jks
*.keystore

# Google Services (e.g. APIs or Firebase)
google-services.json

# Android Profiling
*.hprof
108 changes: 108 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import java.io.FileInputStream
import java.util.Properties

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)

// Dagger-Hilt for Dependency Injection
id("kotlin-kapt")
id("com.google.dagger.hilt.android")
}

android {
namespace = "com.example.knutice"
compileSdk = 34

val properties = Properties().apply {
load(FileInputStream("${rootDir}/local.properties"))
}
val apiRoot = properties["api_root"] ?: ""

defaultConfig {
applicationId = "com.example.knutice"
minSdk = 29
targetSdk = 34
versionCode = 1
versionName = "1.0"

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

buildConfigField("String", "API_ROOT", "\"$apiRoot\"")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.1"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

dependencies {

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.ui)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.androidx.material)
testImplementation(libs.junit)
testImplementation(libs.kotlinx.coroutines.test) // Library to test coroutines in JUnit
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.ui.test.junit4)
debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)

// Coroutine for Android
implementation(libs.kotlinx.coroutines.android)
// Navigation for Compose
implementation(libs.androidx.navigation.compose)
// Coil
implementation(libs.coil.compose)

// Dagger Hilt for Dependency Injection
implementation(libs.hilt.android)
implementation(libs.androidx.hilt.navigation.compose) // With Compose Navigation
kapt(libs.hilt.android.compiler)

// Retrofit 2
implementation(libs.retrofit)
implementation(libs.converter.gson)

}

// Allow references to generated code
kapt {
correctErrorTypes = true
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.doyoonkim.knutice

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.knutice", appContext.packageName)
}
}
31 changes: 31 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<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="com.doyoonkim.knutice.MainApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.KNUTICE"
tools:targetApi="31">
<activity
android:name="com.doyoonkim.knutice.presentation.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.KNUTICE">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
16 changes: 16 additions & 0 deletions app/src/main/java/com/doyoonkim/knutice/MainApplication.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.doyoonkim.knutice

import android.app.Application
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class MainApplication : Application() {

override fun onCreate() {
super.onCreate()
}

override fun onTerminate() {
super.onTerminate()
}
}
Loading

0 comments on commit 7d0c05b

Please sign in to comment.