Skip to content

Commit

Permalink
Merge pull request #62 from Tiebe/dev
Browse files Browse the repository at this point in the history
Merge to main
  • Loading branch information
Tiebe authored May 24, 2023
2 parents 4facc63 + 7c0b512 commit 8c20c8d
Show file tree
Hide file tree
Showing 190 changed files with 5,893 additions and 1,287 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Android CI

on:
push:
workflow_dispatch:

jobs:
build:
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: iOS CI/CD

on:
workflow_dispatch:

jobs:
build:
name: Build and publish on app store
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build
run: ./gradlew linkPodReleaseFrameworkIosArm64

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
working-directory: 'iosApp'

- name: Fastlane Action
uses: maierj/fastlane-action@v3.0.0
with:
lane: release
subdirectory: iosApp
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
APPLE_KEY_ID: ${{ secrets.APPLE_KEY_ID }}
APPLE_KEY_ISSUER_ID: ${{ secrets.APPLE_KEY_ISSUER_ID }}
APPLE_KEY_CONTENT: ${{ secrets.APPLE_KEY_CONTENT }}

- name: Upload logs
if: always()
uses: actions/upload-artifact@v3.1.2
with:
name: build.log
path: /Users/runner/Library/Logs/gym/Otarium-iosApp.log

- name: Upload IPA
uses: actions/upload-artifact@v3.1.2
with:
name: Otarium.ipa
path: Otarium.ipa
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: iOS test

on:
workflow_dispatch:

jobs:
build:
name: Test
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- run: ./gradlew tasks
38 changes: 21 additions & 17 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
id("com.android.application")
kotlin("android")
id("kotlin-parcelize")
id("kotlinx-serialization")
id(libs.plugins.google.services.get().pluginId)
id(libs.plugins.firebase.crashlytics.get().pluginId)
}

android {
compileSdk = AndroidSdk.compile
compileSdk = libs.versions.android.sdk.compile.get().toInt()
namespace = "nl.tiebe.otarium.androidApp"
defaultConfig {
applicationId = "nl.tiebe.otarium"
minSdk = AndroidSdk.min
targetSdk = AndroidSdk.target
versionCode = Version.appVersionCode
versionName = Version.appVersion
minSdk = libs.versions.android.sdk.min.get().toInt()
targetSdk = libs.versions.android.sdk.compile.get().toInt()
versionCode = libs.versions.app.version.code.get().toInt()
versionName = libs.versions.app.version.string.get()
}
buildTypes {
getByName("release") {
Expand All @@ -33,25 +36,26 @@ android {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = Version.compose_compiler
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
}

dependencies {

implementation(project(":shared"))
implementation(Android.appcompat)
implementation(Android.material)
implementation(libs.android.appcompat)
implementation(libs.android.material)

implementation(Compose.activity)
implementation(Compose.runtime)
implementation(Compose.ui)
implementation(Compose.material3)
implementation(Compose.foundationLayout)
implementation(Compose.material)
implementation(libs.compose.activity)
implementation(libs.compose.runtime)
implementation(libs.compose.ui)
implementation(libs.compose.material3)
implementation(libs.compose.foundationlayout)
implementation(libs.compose.material)

implementation(Decompose.core)
implementation(libs.decompose.core)

implementation(project.dependencies.platform(Firebase.bom))
implementation(Firebase.analytics)
implementation(project.dependencies.platform(libs.firebase.bom))
implementation(libs.firebase.analytics)
implementation(libs.firebase.crashlytics)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ package nl.tiebe.otarium.androidApp

import android.content.Context
import android.content.res.Configuration
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.view.WindowManager
import androidx.activity.compose.setContent
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.systemBars
import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.core.view.WindowCompat
import com.arkivanov.decompose.defaultComponentContext
import nl.tiebe.otarium.RootView
import nl.tiebe.otarium.ui.theme.DarkColorScheme
import nl.tiebe.otarium.ui.theme.LightColorScheme
import nl.tiebe.otarium.utils.refreshGradesBackground
import nl.tiebe.otarium.utils.reloadTokensBackground
import nl.tiebe.otarium.utils.ui.Android
Expand All @@ -32,10 +34,6 @@ class MainActivity : AppCompatActivity() {
Android.requestPermissionLauncher = requestPermissionLauncher
Android.window = window

// has to be set in code or in theme
window.decorView.setBackgroundColor(Color.WHITE)
window.statusBarColor = Color.parseColor("#0F86E4")

reloadTokensBackground()
refreshGradesBackground()

Expand All @@ -53,13 +51,18 @@ class MainActivity : AppCompatActivity() {
dynamicColor && !darkMode -> {
dynamicLightColorScheme(Android.context)
}

darkMode -> DarkColorScheme
else -> LightColorScheme
else -> null
}
WindowCompat.setDecorFitsSystemWindows(window, false)


window.setFlags(
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
)

setContent {
RootView(rootComponentContext, colorScheme)
RootView(rootComponentContext, colorScheme, WindowInsets.Companion.systemBars.asPaddingValues())
}
}

Expand All @@ -83,10 +86,12 @@ class MainActivity : AppCompatActivity() {
private fun deleteDir(dir: File?): Boolean {
if (dir != null && dir.isDirectory) {
val children = dir.list()
for (i in children.indices) {
val success = deleteDir(File(dir, children[i]))
if (!success) {
return false
if (children != null) {
for (i in children.indices) {
val success = deleteDir(File(dir, children[i]))
if (!success) {
return false
}
}
}
}
Expand Down
33 changes: 20 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,37 +1,44 @@
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.complete.kotlin)
}

buildscript {
repositories {
gradlePluginPortal()
google()
mavenLocal()
mavenCentral()
mavenLocal()
maven("https://jitpack.io")
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
dependencies {
classpath(Kotlin.gradle)
classpath(Android.gradle)
classpath(Kotlin.serialization)
classpath(Moko.gradle)
classpath(BuildKonfig.gradle)
classpath(Firebase.classpath)
classpath(libs.kotlin.gradle)
classpath(libs.android.gradle)
classpath(libs.kotlin.gradle)
classpath(libs.kotlin.serialization)
classpath(libs.moko.gradle)
classpath(libs.buildkonfig.gradle)
classpath(libs.firebase.gradle)
classpath(libs.firebase.crashlyticsgradle)
}
}

allprojects {
repositories {
google()
mavenLocal()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://jitpack.io")

maven {
url = uri("https://maven.pkg.github.com/Tiebe/MagisterAPIKt")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
}

google()
mavenCentral()
mavenLocal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://jitpack.io")
}
}

Expand Down
1 change: 0 additions & 1 deletion buildSrc/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions buildSrc/build.gradle.kts

This file was deleted.

Loading

0 comments on commit 8c20c8d

Please sign in to comment.