Skip to content

Commit

Permalink
Fix NoBeanDefFoundException in EditModule + add ktlint gradle plugin …
Browse files Browse the repository at this point in the history
…+ update AGP
  • Loading branch information
shubertm authored and kirillt committed Jan 22, 2024
1 parent 0b56a78 commit 7e9b537
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .scripts/ktlint.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ task ktlint(type: JavaExec) {
logger.quiet("(KTLINT): auto correction is enabled")
args "-F"
}
}
}
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.21'
}

apply from: "$project.rootDir/.scripts/ktlint.gradle"
// apply from: "$project.rootDir/.scripts/ktlint.gradle"

android {
compileSdk 33
Expand Down Expand Up @@ -77,6 +77,7 @@ android {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
namespace 'dev.arkbuilders.arkretouch'
}

dependencies {
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="dev.arkbuilders.arkretouch">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/dev/arkbuilders/arkretouch/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dev.arkbuilders.arkretouch
import android.app.Application
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import dev.arkbuilders.arkretouch.common.CommonModule
import dev.arkbuilders.arkretouch.edition.EditionModule
import dev.arkbuilders.arkretouch.edition.EditModule
import org.acra.config.dialog
import org.acra.config.httpSender
import org.acra.data.StringFormat
Expand Down Expand Up @@ -50,7 +50,7 @@ class App : Application() {
androidContext(applicationContext)
androidLogger(Level.INFO)
modules(
EditionModule.create(),
EditModule.create(),
CommonModule.create(),
)
}
Expand Down
24 changes: 24 additions & 0 deletions app/src/main/java/dev/arkbuilders/arkretouch/edition/EditModule.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package dev.arkbuilders.arkretouch.edition

import com.etherean.app.common.di.InjectionModule
import dev.arkbuilders.arkretouch.edition.ui.main.EditViewModel
import dev.arkbuilders.arkretouch.storage.Resolution
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.dsl.module
import java.nio.file.Path

object EditModule : InjectionModule {

override fun create() = module {
viewModel {
(
primaryColor: Long,
launchedFromIntent: Boolean,
imagePath: Path?,
imageUri: String?,
maxResolution: Resolution
) ->
EditViewModel(primaryColor, launchedFromIntent, imagePath, imageUri, maxResolution, get())
}
}
}

This file was deleted.

5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.2.2' apply false
id 'com.android.library' version '7.2.2' apply false
id 'com.android.application' version '8.0.0' apply false
id 'com.android.library' version '8.0.0' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
id "org.jlleitschuh.gradle.ktlint" version "12.1.0"
}

task clean(type: Delete) {
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ kotlin.code.style=official
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Oct 18 23:46:27 ALMT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

0 comments on commit 7e9b537

Please sign in to comment.