Skip to content

Commit

Permalink
Merge pull request #18 from teogor/bug/workflow-lint
Browse files Browse the repository at this point in the history
Fixed github workflow
  • Loading branch information
teogor authored Oct 27, 2022
2 parents e352b91 + da23d8e commit 918fa7e
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 45 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Make Gradle executable
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew build
2 changes: 0 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,5 @@ jobs:
run: chmod +x ./gradlew
- name: Release build
run: ./gradlew assemble --scan
- name: Source jar and dokka
run: ./gradlew androidSourcesJar javadocJar --scan
- name: Publish to MavenCentral
run: ./gradlew publishAllPublicationsToMavenCentralRepository --max-workers 1
2 changes: 1 addition & 1 deletion .zeobot/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ enforce_branch_merge:
# branches that contains files without license will not be merged
license_checker:
# if enabled, LC will work for this repository
enabled: true
enabled: false
# allowed parameters
allowed:
# people/organisations who own the license
Expand Down
18 changes: 7 additions & 11 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import dev.teogor.ceres.Configuration
import dev.teogor.ceres.Dependencies
import dev.teogor.ceres.Versions

plugins {
// android
Expand All @@ -14,10 +15,7 @@ plugins {
id("com.google.firebase.crashlytics")
id("com.google.firebase.firebase-perf")
id("com.google.firebase.appdistribution")
// dagger
// todo once a higher version of ´dagger´ accepts the new
// plugin id apply it -> id("com.google.dagger.hilt.android")
id("dagger.hilt.android.plugin")
id("com.google.dagger.hilt.android")
// safe args
id("androidx.navigation.safeargs.kotlin")
}
Expand Down Expand Up @@ -113,9 +111,9 @@ dependencies {
implementation("androidx.appcompat:appcompat:1.5.1")
implementation("androidx.core:core-splashscreen:1.0.0")
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.fragment:fragment-ktx:1.5.3")
implementation("androidx.navigation:navigation-fragment-ktx:2.5.2")
implementation("androidx.navigation:navigation-ui-ktx:2.5.2")
implementation("androidx.fragment:fragment-ktx:1.5.4")
implementation("androidx.navigation:navigation-fragment-ktx:2.5.3")
implementation("androidx.navigation:navigation-ui-ktx:2.5.3")
implementation("androidx.multidex:multidex:2.0.1")
//---------------------------------------------------------------------

Expand All @@ -133,10 +131,8 @@ dependencies {
//---------------------------------------------------------------------

//------------------------------ DAGGER -------------------------------
//noinspection GradleDependency todo ´dagger´ conflicts with memo
implementation("com.google.dagger:hilt-android:2.40.5")
//noinspection GradleDependency todo ´dagger´ conflicts with memo
kapt("com.google.dagger:hilt-compiler:2.40.5")
implementation("com.google.dagger:hilt-android:${Versions.DaggerHilt}")
kapt("com.google.dagger:hilt-compiler:${Versions.DaggerHilt}")
//---------------------------------------------------------------------

implementation("dev.chrisbanes.insetter:insetter:0.6.1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ import androidx.navigation.NavDirections
import dagger.hilt.android.lifecycle.HiltViewModel
import dev.teogor.ceres.components.toolbar.ToolbarType
import dev.teogor.ceres.m3.app.BaseViewModelM3
import dev.teogor.ceres.presentation.memo.AppMemo
import javax.inject.Inject

@HiltViewModel
class SplashViewModel @Inject constructor(
private val appData: dev.teogor.ceres.presentation.memo.AppDataMemo
private val appMemo: AppMemo
) : BaseViewModelM3() {

override fun onFragmentCreated() {
Expand All @@ -37,7 +38,7 @@ class SplashViewModel @Inject constructor(
}

private fun getNextFragment(): NavDirections {
return if (appData.onboardingApproved) {
return if (appMemo.onboardingApproved) {
SplashFragmentDirections.actionFromSplashToHome()
} else {
SplashFragmentDirections.actionFromSplashToHome()
Expand Down
55 changes: 55 additions & 0 deletions app/src/main/java/dev/teogor/ceres/presentation/memo/AppMemo.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2022 teogor (Teodor Grigor) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package dev.teogor.ceres.presentation.memo

import androidx.`annotation`.NonNull
import com.zeoflow.memo.Memo
import com.zeoflow.memo.NoEncryption
import javax.inject.Inject
import kotlin.Boolean

/**
* Code generated by Memo's Compiler. @see [link](https://github.com/zeoflow/memo)
*
* Code generated based on the [AppData]
*/
class AppMemo @Inject constructor() {
init {
Memo.init().withEncryption(NoEncryption()).build()
}

@NonNull
var developerModeEnabled: Boolean = FalseBooleanDefault().value()
get() = Memo["developerModeEnabled", field]
set(`value`) {
Memo.put("developerModeEnabled", value)
}

@NonNull
var initialCheckCompleted: Boolean = FalseBooleanDefault().value()
get() = Memo["initialCheckCompleted", field]
set(`value`) {
Memo.put("initialCheckCompleted", value)
}

@NonNull
var onboardingApproved: Boolean = FalseBooleanDefault().value()
get() = Memo["onboardingApproved", field]
set(`value`) {
Memo.put("onboardingApproved", value)
}
}
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.vanniktech.maven.publish.SonatypeHost
import dev.teogor.ceres.Configuration
import dev.teogor.ceres.Versions
import org.jetbrains.dokka.gradle.DokkaTaskPartial

plugins {
Expand All @@ -15,13 +16,13 @@ buildscript {
maven("https://plugins.gradle.org/m2/")
}
dependencies {
classpath("com.google.dagger:hilt-android-gradle-plugin:2.40.5")
classpath("com.google.dagger:hilt-android-gradle-plugin:${dev.teogor.ceres.Versions.DaggerHilt}")
classpath("com.google.gms:google-services:4.3.14")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.2")
classpath("com.google.firebase:firebase-appdistribution-gradle:3.0.3")
classpath("com.google.firebase:perf-plugin:1.4.2")
classpath("com.google.android.gms:oss-licenses-plugin:0.10.5")
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.5.2")
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3")
classpath("com.android.tools.build:gradle:7.3.1")
classpath(dev.teogor.ceres.Dependencies.spotlessGradlePlugin)
}
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/dev/teogor/ceres/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ object Dependencies {
"com.diffplug.spotless:spotless-plugin-gradle:${Versions.ANDROID_GRADLE_SPOTLESS}"

const val GoogleMaterial = "com.google.android.material:material:${Versions.GoogleMaterial}"
const val DaggerHilt = "com.google.android.material:material:${Versions.DaggerHilt}"
}
4 changes: 3 additions & 1 deletion buildSrc/src/main/kotlin/dev/teogor/ceres/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package dev.teogor.ceres

internal object Versions {
object Versions {
internal const val KOTLIN = "1.7.20"
internal const val ANDROID_GRADLE_SPOTLESS = "6.7.0"

internal const val GoogleMaterial = "1.8.0-alpha01"

const val DaggerHilt = "2.44"
}
17 changes: 7 additions & 10 deletions ceres-components/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import dev.teogor.ceres.Configuration
import dev.teogor.ceres.Dependencies
import dev.teogor.ceres.Versions

plugins {
// android
Expand All @@ -9,9 +10,7 @@ plugins {
id("kotlin-kapt")
id("kotlin-parcelize")
// dagger
// todo once a higher version of ´dagger´ accepts the new
// plugin id apply it -> id("com.google.dagger.hilt.android")
id("dagger.hilt.android.plugin")
id("com.google.dagger.hilt.android")
// safe args
id("androidx.navigation.safeargs.kotlin")
}
Expand Down Expand Up @@ -65,15 +64,13 @@ dependencies {
implementation("androidx.appcompat:appcompat:1.5.1")
implementation("androidx.core:core-splashscreen:1.0.0")
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.fragment:fragment-ktx:1.5.3")
implementation("androidx.navigation:navigation-fragment-ktx:2.5.2")
implementation("androidx.navigation:navigation-ui-ktx:2.5.2")
implementation("androidx.fragment:fragment-ktx:1.5.4")
implementation("androidx.navigation:navigation-fragment-ktx:2.5.3")
implementation("androidx.navigation:navigation-ui-ktx:2.5.3")
//---------------------------------------------------------------------

//------------------------------ DAGGER -------------------------------
//noinspection GradleDependency todo ´dagger´ conflicts with memo
implementation("com.google.dagger:hilt-android:2.40.5")
//noinspection GradleDependency todo ´dagger´ conflicts with memo
kapt("com.google.dagger:hilt-compiler:2.40.5")
implementation("com.google.dagger:hilt-android:${Versions.DaggerHilt}")
kapt("com.google.dagger:hilt-compiler:${Versions.DaggerHilt}")
//---------------------------------------------------------------------
}
11 changes: 4 additions & 7 deletions ceres-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import dev.teogor.ceres.Configuration
import dev.teogor.ceres.Dependencies
import dev.teogor.ceres.Versions

plugins {
// android
Expand All @@ -9,9 +10,7 @@ plugins {
id("kotlin-kapt")
id("kotlin-parcelize")
// dagger
// todo once a higher version of ´dagger´ accepts the new
// plugin id apply it -> id("com.google.dagger.hilt.android")
id("dagger.hilt.android.plugin")
id("com.google.dagger.hilt.android")
// safe args
id("androidx.navigation.safeargs.kotlin")
}
Expand Down Expand Up @@ -80,9 +79,7 @@ dependencies {
//---------------------------------------------------------------------

//------------------------------ DAGGER -------------------------------
// todo ´dagger´ conflicts with memo
implementation("com.google.dagger:hilt-android:2.40.5")
// todo ´dagger´ conflicts with memo
kapt("com.google.dagger:hilt-compiler:2.40.5")
implementation("com.google.dagger:hilt-android:${Versions.DaggerHilt}")
kapt("com.google.dagger:hilt-compiler:${Versions.DaggerHilt}")
//---------------------------------------------------------------------
}
11 changes: 4 additions & 7 deletions ceres-firebase/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import dev.teogor.ceres.Configuration
import dev.teogor.ceres.Versions

plugins {
// android
Expand All @@ -8,9 +9,7 @@ plugins {
id("kotlin-kapt")
id("kotlin-parcelize")
// dagger
// todo once a higher version of ´dagger´ accepts the new
// plugin id apply it -> id("com.google.dagger.hilt.android")
id("dagger.hilt.android.plugin")
id("com.google.dagger.hilt.android")
}

android {
Expand Down Expand Up @@ -50,10 +49,8 @@ dependencies {
//---------------------------------------------------------------------

//------------------------------ DAGGER -------------------------------
//noinspection GradleDependency todo ´dagger´ conflicts with memo
implementation("com.google.dagger:hilt-android:2.40.5")
//noinspection GradleDependency todo ´dagger´ conflicts with memo
kapt("com.google.dagger:hilt-compiler:2.40.5")
implementation("com.google.dagger:hilt-android:${Versions.DaggerHilt}")
kapt("com.google.dagger:hilt-compiler:${Versions.DaggerHilt}")
//---------------------------------------------------------------------

implementation("androidx.core:core-ktx:1.9.0")
Expand Down
1 change: 1 addition & 0 deletions ceres-firebase/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

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

<application>
Expand Down

0 comments on commit 918fa7e

Please sign in to comment.