Skip to content

Commit b68cc66

Browse files
committed
initial
0 parents  commit b68cc66

File tree

141 files changed

+3494
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+3494
-0
lines changed

.github/workflows/build_debug.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build Debug APK
2+
3+
on: pull_request
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Set Up JDK
13+
uses: actions/setup-java@v2
14+
with:
15+
distribution: "temurin"
16+
java-version: "11"
17+
18+
- name: Change wrapper permissions
19+
run: chmod +x ./gradlew
20+
21+
- name: Clean project
22+
run: ./gradlew clean
23+
24+
- name: Build Debug APK
25+
run: ./gradlew :app:assembleDebug
26+
27+
- name: Sign APK
28+
uses: r0adkll/sign-android-release@v1
29+
id: sign_app
30+
with:
31+
releaseDirectory: app/build/outputs/apk/debug
32+
signingKeyBase64: ${{ secrets.SIGN_KEY }}
33+
alias: ${{ secrets.SIGN_ALIAS }}
34+
keyStorePassword: ${{ secrets.SIGN_KEY_PASSWORD }}
35+
keyPassword: ${{ secrets.SIGN_KEY_PASSWORD }}
36+
37+
- name: Upload APK
38+
uses: actions/upload-artifact@v2
39+
with:
40+
name: apk-debug
41+
path: ${{ steps.sign_app.outputs.signedReleaseFile }}
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
Build_AAP:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Set Up JDK
19+
uses: actions/setup-java@v2
20+
with:
21+
distribution: "temurin"
22+
java-version: "11"
23+
24+
- name: Change wrapper permissions
25+
run: chmod +x ./gradlew
26+
27+
- name: Clean project
28+
run: ./gradlew clean
29+
30+
- name: Build Release AAP
31+
run: ./gradlew :app:bundleRelease
32+
33+
- name: Sign AAP
34+
uses: r0adkll/sign-android-release@v1
35+
id: sign_app
36+
with:
37+
releaseDirectory: app/build/outputs/bundle/release
38+
signingKeyBase64: ${{ secrets.SIGN_KEY }}
39+
alias: ${{ secrets.SIGN_ALIAS }}
40+
keyStorePassword: ${{ secrets.SIGN_KEY_PASSWORD }}
41+
keyPassword: ${{ secrets.SIGN_KEY_PASSWORD }}
42+
43+
- name: Upload AAP
44+
uses: actions/upload-artifact@v2
45+
with:
46+
name: aap-release
47+
path: ${{ steps.sign_app.outputs.signedReleaseFile }}
48+
49+
Build_Debug_APK:
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- uses: actions/checkout@v2
54+
55+
- name: Set Up JDK
56+
uses: actions/setup-java@v2
57+
with:
58+
distribution: "temurin"
59+
java-version: "11"
60+
61+
- name: Change wrapper permissions
62+
run: chmod +x ./gradlew
63+
64+
- name: Clean project
65+
run: ./gradlew clean
66+
67+
- name: Build Debug APK
68+
run: ./gradlew :app:assembleDebug
69+
70+
- name: Sign APK
71+
uses: r0adkll/sign-android-release@v1
72+
id: sign_app
73+
with:
74+
releaseDirectory: app/build/outputs/apk/debug
75+
signingKeyBase64: ${{ secrets.SIGN_KEY }}
76+
alias: ${{ secrets.SIGN_ALIAS }}
77+
keyStorePassword: ${{ secrets.SIGN_KEY_PASSWORD }}
78+
keyPassword: ${{ secrets.SIGN_KEY_PASSWORD }}
79+
80+
- name: Upload Debug Apk
81+
uses: actions/upload-artifact@v2
82+
with:
83+
name: apk-debug
84+
path: ${{ steps.sign_app.outputs.signedReleaseFile }}
85+
86+
Build_Release_APK:
87+
runs-on: ubuntu-latest
88+
89+
steps:
90+
- uses: actions/checkout@v2
91+
92+
- name: Set Up JDK
93+
uses: actions/setup-java@v2
94+
with:
95+
distribution: "temurin"
96+
java-version: "11"
97+
98+
- name: Change wrapper permissions
99+
run: chmod +x ./gradlew
100+
101+
- name: Clean project
102+
run: ./gradlew clean
103+
104+
- name: Build Release APK
105+
run: ./gradlew :app:assembleRelease
106+
107+
- name: Sign APK
108+
uses: r0adkll/sign-android-release@v1
109+
id: sign_app
110+
with:
111+
releaseDirectory: app/build/outputs/apk/release
112+
signingKeyBase64: ${{ secrets.SIGN_KEY }}
113+
alias: ${{ secrets.SIGN_ALIAS }}
114+
keyStorePassword: ${{ secrets.SIGN_KEY_PASSWORD }}
115+
keyPassword: ${{ secrets.SIGN_KEY_PASSWORD }}
116+
117+
- name: Upload Release Apk
118+
uses: actions/upload-artifact@v2
119+
with:
120+
name: apk-release
121+
path: ${{ steps.sign_app.outputs.signedReleaseFile }}
122+
123+
Release:
124+
needs: [Build_AAP, Build_Debug_APK, Build_Release_APK]
125+
126+
runs-on: ubuntu-latest
127+
128+
steps:
129+
- uses: actions/checkout@v2
130+
131+
- uses: actions/download-artifact@v2
132+
with:
133+
name: aap-release
134+
135+
- uses: actions/download-artifact@v2
136+
with:
137+
name: apk-debug
138+
139+
- uses: actions/download-artifact@v2
140+
with:
141+
name: apk-release
142+
143+
- name: Release
144+
uses: softprops/action-gh-release@v1
145+
with:
146+
files: |
147+
app-release.aab
148+
app-debug-signed.apk
149+
app-release-unsigned-signed.apk

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/
5+
.DS_Store
6+
build
7+
release
8+
/captures
9+
.externalNativeBuild
10+
.cxx
11+
local.properties

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'org.jetbrains.kotlin.android'
4+
id 'kotlin-kapt'
5+
}
6+
7+
android {
8+
compileSdk 32
9+
10+
defaultConfig {
11+
applicationId 'io.github.xtoolkit.mir'
12+
minSdk 21
13+
targetSdk 32
14+
versionCode 1
15+
versionName '1.0'
16+
17+
vectorDrawables {
18+
useSupportLibrary true
19+
}
20+
21+
lintOptions {
22+
checkReleaseBuilds false
23+
}
24+
}
25+
26+
buildTypes {
27+
release {
28+
shrinkResources true
29+
minifyEnabled true
30+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
31+
}
32+
33+
debug {
34+
debuggable true
35+
minifyEnabled false
36+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
37+
}
38+
}
39+
40+
compileOptions {
41+
sourceCompatibility JavaVersion.VERSION_1_8
42+
targetCompatibility JavaVersion.VERSION_1_8
43+
}
44+
45+
kotlinOptions {
46+
jvmTarget = '1.8'
47+
}
48+
49+
buildFeatures {
50+
compose true
51+
}
52+
53+
composeOptions {
54+
kotlinCompilerExtensionVersion dependency_version.compose
55+
}
56+
57+
packagingOptions {
58+
resources {
59+
excludes += '/META-INF/{AL2.0,LGPL2.1}'
60+
}
61+
}
62+
}
63+
64+
dependencies {
65+
implementation project(path: ':util')
66+
implementation project(path: ':user')
67+
implementation project(path: ':user:core')
68+
implementation project(path: ':level')
69+
implementation project(path: ':level:core')
70+
implementation project(path: ':playground')
71+
implementation project(path: ':playground:core')
72+
implementation dependency.android.core
73+
implementation dependency.android.material
74+
implementation dependency.android.fragment
75+
implementation dependency.android.collection
76+
implementation dependency.android.lifecycle.runtime
77+
implementation dependency.compose.ui
78+
implementation dependency.compose.material3
79+
implementation dependency.compose.themeAdapter
80+
implementation dependency.compose.preview
81+
implementation dependency.compose.activity
82+
implementation dependency.koin.android
83+
implementation dependency.room.runtime
84+
implementation dependency.room.ktx
85+
annotationProcessor dependency.room.compiler
86+
kapt dependency.room.compiler
87+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

app/src/main/AndroidManifest.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
package="io.github.xtoolkit.mir">
5+
6+
<application
7+
android:name=".framework.MainApplication"
8+
android:icon="@mipmap/ic_launcher"
9+
android:label="@string/app_name"
10+
android:roundIcon="@mipmap/ic_launcher_round"
11+
android:supportsRtl="true"
12+
tools:targetApi="31">
13+
<activity
14+
android:name=".presentation.main.MainActivity"
15+
android:exported="true"
16+
android:screenOrientation="portrait"
17+
android:theme="@style/Theme.Mir">
18+
<intent-filter>
19+
<action android:name="android.intent.action.MAIN" />
20+
21+
<category android:name="android.intent.category.LAUNCHER" />
22+
</intent-filter>
23+
</activity>
24+
</application>
25+
26+
</manifest>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package io.github.xtoolkit.mir.framework
2+
3+
import android.app.Application
4+
import com.google.android.material.color.DynamicColors
5+
import io.github.xtoolkit.mir.framework.di.appDatabasesModule
6+
import io.github.xtoolkit.mir.level.framework.levelKoinModules
7+
import io.github.xtoolkit.mir.playground.framework.playgroundKoinModules
8+
import io.github.xtoolkit.mir.user.framework.userKoinModules
9+
import org.koin.android.ext.koin.androidContext
10+
import org.koin.core.context.startKoin
11+
12+
class MainApplication : Application() {
13+
override fun onCreate() {
14+
super.onCreate()
15+
16+
DynamicColors.applyToActivitiesIfAvailable(this)
17+
18+
startKoin {
19+
androidContext(this@MainApplication)
20+
modules(
21+
appDatabasesModule,
22+
*userKoinModules,
23+
*playgroundKoinModules,
24+
*levelKoinModules
25+
)
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)