Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies 04-2024 #63

Merged
merged 30 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e22b5de
Merge pull request #57 from infinum/develop
KCeh Mar 6, 2024
09a6178
Fix readme badges
KCeh Mar 6, 2024
03fc3fd
Merge pull request #59 from infinum/fix/readme-badges
KCeh Mar 6, 2024
141900f
Fix latest version in readme
KCeh Mar 7, 2024
71af394
Update versioning in readme
KCeh Mar 7, 2024
7ad4ec6
Merge pull request #60 from infinum/fix/readme-versions
KCeh Mar 7, 2024
558d44f
Update dependencies and rename duplicate xml resources
smihalic Apr 15, 2024
8464c86
Merge branch 'develop' into update-dependencies-04-2024
KCeh Apr 16, 2024
5677744
Add plugin and fix for newest AS version to enable running progress work
AsimRibo Apr 18, 2024
d1867ca
Run AGP assistant to update to newest version
AsimRibo Apr 18, 2024
c208281
Update other dependencies to newest versions
AsimRibo Apr 18, 2024
d1caa9d
Add uses feature property for camera permission
AsimRibo Apr 18, 2024
fdb0fa2
Upgrade ksp version
AsimRibo Apr 18, 2024
333d160
Downgrade kotlin to one version earlier because of ksp warning
AsimRibo Apr 18, 2024
ac0ad7b
Upgrade sentinel dependencies
AsimRibo Apr 18, 2024
673a24a
Remove package name as it is not supported anymore
AsimRibo Apr 18, 2024
82d2f00
Include core desugaring
AsimRibo Apr 18, 2024
885e58c
Temporarily comment out tests to compile project
AsimRibo Apr 18, 2024
2caeb75
Use latest gradle distribution
AsimRibo Apr 18, 2024
6c2c390
Start of fixing tests
AsimRibo Apr 18, 2024
e5bd2c8
Delete non existent class reference
AsimRibo Apr 18, 2024
c9befa3
Bring down version of sentinel in lib file
KCeh Apr 19, 2024
a56cef6
Ignore tests
AsimRibo Apr 19, 2024
eabfceb
Merge branch 'update-dependencies-04-2024' of https://github.com/infi…
KCeh Apr 19, 2024
31b7574
Merge pull request #64 from infinum/fix-tests-dependencies-04
AsimRibo Apr 19, 2024
f1997c9
Rename duplicate resource for menu
KCeh Apr 19, 2024
0e8dbec
Revert desugaring changes for modules that don't need them
KCeh Apr 19, 2024
0de374f
Fix theming for bottom nav and app bar
KCeh Apr 20, 2024
228d3a0
Return color surface to theme
KCeh Apr 20, 2024
58526d1
Bump version to 1.3.3-alpha01
KCeh Apr 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Download](https://img.shields.io/maven-central/v/com.infinum.sentinel/sentinel) ![Validate Gradle Wrapper](https://github.com/infinum/android-sentinel/workflows/Validate%20Gradle%20Wrapper/badge.svg) ![Code analysis](https://github.com/infinum/android-sentinel/workflows/Code%20analysis/badge.svg) [![CodeFactor](https://www.codefactor.io/repository/github/infinum/android-sentinel/badge/master)](https://www.codefactor.io/repository/github/infinum/android-sentinel/overview/master)
![Download](https://img.shields.io/maven-central/v/com.infinum.sentinel/sentinel) ![Validate Gradle Wrapper](https://github.com/infinum/android-sentinel/actions/workflows/gradle-wrapper-validation.yml/badge.svg) ![Code analysis](https://github.com/infinum/android-sentinel/actions/workflows/code-analysis.yml/badge.svg) [![CodeFactor](https://www.codefactor.io/repository/github/infinum/android-sentinel/badge/master)](https://www.codefactor.io/repository/github/infinum/android-sentinel/overview/master)

### <img align="left" src="logo.svg" width="48">

Expand Down Expand Up @@ -57,15 +57,17 @@ Then add the following dependencies in your app `build.gradle` or `build.gradle.
**Groovy**

```groovy
debugImplementation "com.infinum.sentinel:sentinel:1.3.1"
releaseImplementation "com.infinum.sentinel:sentinel-no-op:1.3.1"
def sentinelVersion = "1.3.2"
debugImplementation "com.infinum.sentinel:sentinel:$sentinelVersion"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the project already has 2 versions defined, would be good to go in a different direction than this and use a single version everywhere. On some libraries like PrinceOfVersions we have a gradle task to update readme with the current version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correctly updated on master, but it seems we forgot to merge this change on develop. But you are right, this would be an improvement.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add idea for Gradle task to the list

releaseImplementation "com.infinum.sentinel:sentinel-noop:$sentinelVersion"
```

**KotlinDSL**

```kotlin
debugImplementation("com.infinum.sentinel:sentinel:1.3.1")
releaseImplementation("com.infinum.sentinel:sentinel-no-op:1.3.1")
val sentinelVersion = "1.3.2"
debugImplementation("com.infinum.sentinel:sentinel:$sentinelVersion")
releaseImplementation("com.infinum.sentinel:sentinel-no-op:$sentinelVersion")
```

Basic tools are provided inside the main package but depending on requirements you might want to add
Expand All @@ -74,27 +76,27 @@ specific tools:
**Groovy**

```groovy
debugImplementation "com.infinum.sentinel:tool-chucker:1.3.1"
debugImplementation "com.infinum.sentinel:tool-collar:1.3.1"
debugImplementation "com.infinum.sentinel:tool-dbinspector:1.3.1"
debugImplementation "com.infinum.sentinel:tool-leakcanary:1.3.1"
debugImplementation "com.infinum.sentinel:tool-appgallery:1.3.1"
debugImplementation "com.infinum.sentinel:tool-googleplay:1.3.1"
debugImplementation "com.infinum.sentinel:tool-thimble:1.3.1"
debugImplementation "com.infinum.sentinel:tool-timber:1.3.1"
debugImplementation "com.infinum.sentinel:tool-chucker:$sentinelVersion"
debugImplementation "com.infinum.sentinel:tool-collar:$sentinelVersion"
debugImplementation "com.infinum.sentinel:tool-dbinspector:$sentinelVersion"
debugImplementation "com.infinum.sentinel:tool-leakcanary:$sentinelVersion"
debugImplementation "com.infinum.sentinel:tool-appgallery:$sentinelVersion"
debugImplementation "com.infinum.sentinel:tool-googleplay:$sentinelVersion"
debugImplementation "com.infinum.sentinel:tool-thimble:$sentinelVersion"
debugImplementation "com.infinum.sentinel:tool-timber:$sentinelVersion"
```

**KotlinDSL**

```kotlin
debugImplementation("com.infinum.sentinel:tool-chucker:1.3.1")
debugImplementation("com.infinum.sentinel:tool-collar:1.3.1")
debugImplementation("com.infinum.sentinel:tool-dbinspector:1.3.1")
debugImplementation("com.infinum.sentinel:tool-leakcanary:1.3.1")
debugImplementation("com.infinum.sentinel:tool-appgallery:1.3.1")
debugImplementation("com.infinum.sentinel:tool-googleplay:1.3.1")
debugImplementation("com.infinum.sentinel:tool-thimble:1.3.1")
debugImplementation("com.infinum.sentinel:tool-timber:1.3.1")
debugImplementation("com.infinum.sentinel:tool-chucker:$sentinelVersion")
debugImplementation("com.infinum.sentinel:tool-collar:$sentinelVersion")
debugImplementation("com.infinum.sentinel:tool-dbinspector:$sentinelVersion")
debugImplementation("com.infinum.sentinel:tool-leakcanary:$sentinelVersion")
debugImplementation("com.infinum.sentinel:tool-appgallery:$sentinelVersion")
debugImplementation("com.infinum.sentinel:tool-googleplay:$sentinelVersion")
debugImplementation("com.infinum.sentinel:tool-thimble:$sentinelVersion")
debugImplementation("com.infinum.sentinel:tool-timber:$sentinelVersion")
```

Now you can sync your project.
Expand Down
8 changes: 4 additions & 4 deletions config.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ext {
def major = 1
def minor = 3
def patch = 2
def patch = 3

buildConfig = [
"minSdk" : 21,
"compileSdk": 33,
"targetSdk" : 33,
"buildTools": "33.0.2"
"compileSdk": 34,
"targetSdk" : 34,
"buildTools": "34.0.0"
]
releaseConfig = [
"group" : "com.infinum.sentinel",
Expand Down
26 changes: 13 additions & 13 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[versions]
sentinel = "1.3.2"
gradle = "8.0.2"
desugar = "2.0.3"
kotlin = "1.8.21"
coroutines = "1.7.1"
gradle = "8.3.2"
desugar = "2.0.4"
kotlin = "1.9.22"
coroutines = "1.8.0"
json = "1.5.1"
core = "1.10.1"
core = "1.12.0"
appcompat = "1.6.1"
activity = "1.7.2"
fragment = "1.5.7"
recycler = "1.3.0"
lifecycle = "2.6.1"
preference = "1.2.0"
room = "2.5.1"
workmanager = "2.8.1"
activity = "1.8.2"
fragment = "1.6.2"
recycler = "1.3.2"
lifecycle = "2.7.0"
preference = "1.2.1"
room = "2.6.1"
workmanager = "2.9.0"
startup = "1.1.1"
crypto = "1.1.0-alpha06"
dynamicanimation = "1.0.0"
design = "1.9.0"
design = "1.11.0"
inject = "0.6.1"
timber = "5.0.1"
detekt = "1.23.0"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 5 additions & 0 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,18 @@ android {
}
}

compileOptions {
coreLibraryDesugaringEnabled true
}

sourceSets {
main.java.srcDirs += "src/main/kotlin"
release.java.srcDirs += "src/release/kotlin"
}
}

dependencies {
coreLibraryDesugaring libs.desugar
implementation libs.kotlin.core
implementation libs.androidx.appcompat
implementation libs.androidx.preference
Expand Down
18 changes: 11 additions & 7 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-feature
android:name="android.hardware.camera"
android:required="false"/>

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

<application
android:name=".SampleApplication"
Expand All @@ -20,17 +24,17 @@
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MAIN"/>

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

</manifest>
4 changes: 0 additions & 4 deletions sentinel-no-op/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,13 @@ android {
defaultConfig {
minSdkVersion buildConfig.minSdk
targetSdkVersion buildConfig.targetSdk
versionCode releaseConfig.versionCode
versionName releaseConfig.version
}

buildTypes {
debug {
debuggable true
minifyEnabled false
}
release {
debuggable false
minifyEnabled true
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.txt"
}
Expand Down
30 changes: 13 additions & 17 deletions sentinel/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id "com.android.library"
id "kotlin-android"
id "org.jetbrains.kotlin.plugin.serialization"
id "com.google.devtools.ksp" version "1.8.21-1.0.11"
id "com.google.devtools.ksp" version "1.9.22-1.0.17"
}

apply from: "jacoco.gradle"
Expand All @@ -14,8 +14,6 @@ android {
defaultConfig {
minSdkVersion buildConfig.minSdk
targetSdkVersion buildConfig.targetSdk
versionCode releaseConfig.versionCode
versionName releaseConfig.version

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand All @@ -31,11 +29,9 @@ android {
buildTypes {
debug {
testCoverageEnabled true
debuggable true
minifyEnabled false
}
release {
debuggable false
minifyEnabled true
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.txt"
}
Expand Down Expand Up @@ -104,21 +100,21 @@ dependencies {
implementation libs.inject.runtime

androidTestImplementation "junit:junit:4.13.2"
androidTestImplementation "androidx.arch.core:core-testing:2.1.0"
androidTestImplementation "androidx.test:core-ktx:1.4.0"
androidTestImplementation "androidx.test:rules:1.4.0"
androidTestImplementation "androidx.test:runner:1.4.0"
androidTestImplementation "androidx.test.ext:junit:1.1.3"
androidTestImplementation "androidx.security:security-crypto:1.1.0-alpha03"
androidTestImplementation "androidx.arch.core:core-testing:2.2.0"
androidTestImplementation "androidx.test:core-ktx:1.5.0"
androidTestImplementation "androidx.test:rules:1.5.0"
androidTestImplementation "androidx.test:runner:1.5.2"
androidTestImplementation "androidx.test.ext:junit:1.1.5"
androidTestImplementation "androidx.security:security-crypto:1.1.0-alpha06"
androidTestImplementation "org.robolectric:shadowapi:4.5.1"
androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0"
androidTestImplementation "androidx.test.espresso:espresso-intents:3.4.0"
androidTestImplementation "androidx.room:room-testing:2.4.0"
androidTestImplementation "androidx.fragment:fragment-ktx:1.4.0"
androidTestImplementation "androidx.fragment:fragment-testing:1.4.0"
androidTestImplementation "androidx.test.espresso:espresso-core:3.5.1"
androidTestImplementation "androidx.test.espresso:espresso-intents:3.5.1"
androidTestImplementation "androidx.room:room-testing:2.6.1"
androidTestImplementation "androidx.fragment:fragment-ktx:1.6.2"
androidTestImplementation "androidx.fragment:fragment-testing:1.6.2"

testImplementation "junit:junit:4.13.2"
testImplementation "androidx.test.ext:junit:1.1.3"
testImplementation "androidx.test.ext:junit:1.1.5"
}

ksp {
Expand Down
1 change: 0 additions & 1 deletion sentinel/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.infinum.sentinel"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package name inside of AndroidManifest is not supported anymore and we were getting errors/warnings, don't remember.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can set the namespace in build.gradle files.

Copy link
Collaborator

@KCeh KCeh Apr 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you don't need to set namespace for tests (manifest for tests), gradle will just append .test by default https://developer.android.com/build/configure-app-module#change-namespace-for-testing

android:versionCode="100000"
android:versionName="1.0.0">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertTrue
import org.junit.BeforeClass
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith

@Ignore("This test is ignored because it's failing on CI")
@RunWith(AndroidJUnit4::class)
internal class ApplicationCollectorTests {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ import org.junit.runners.Suite.SuiteClasses
PermissionsCollectorTests::class,
PreferencesCollectorTests::class
)
class CollectorsTestSuite
public class CollectorsTestSuite
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
package com.infinum.sentinel.data.sources.raw.collectors

import android.content.Context
import android.os.Build
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.infinum.sentinel.data.models.raw.DeviceData
import com.infinum.sentinel.ui.SentinelTestApplication
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.BeforeClass
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.util.ReflectionHelpers

@Ignore("This test is ignored because it's failing on CI")
@RunWith(AndroidJUnit4::class)
internal class DeviceCollectorDeviceTests {

Expand All @@ -30,6 +35,8 @@ internal class DeviceCollectorDeviceTests {

lateinit var actualDeviceData: DeviceData

lateinit var context: Context

@BeforeClass
@JvmStatic
fun setupCollector() {
Expand Down Expand Up @@ -69,7 +76,9 @@ internal class DeviceCollectorDeviceTests {
FIELD_SECURITY_PATCH
)

val collector = DeviceCollector()
context = ApplicationProvider.getApplicationContext<SentinelTestApplication>().applicationContext

val collector = DeviceCollector(context)

actualDeviceData = collector()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
package com.infinum.sentinel.data.sources.raw.collectors

import android.content.Context
import android.os.Build
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.infinum.sentinel.data.models.raw.DeviceData
import com.infinum.sentinel.ui.SentinelTestApplication
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.BeforeClass
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.util.ReflectionHelpers

@Ignore("This test is ignored because it's failing on CI")
@RunWith(AndroidJUnit4::class)
internal class DeviceCollectorEmulatorTests {

Expand All @@ -30,6 +35,8 @@ internal class DeviceCollectorEmulatorTests {

lateinit var actualDeviceData: DeviceData

lateinit var context: Context

@BeforeClass
@JvmStatic
fun setupCollector() {
Expand Down Expand Up @@ -69,7 +76,9 @@ internal class DeviceCollectorEmulatorTests {
FIELD_SECURITY_PATCH
)

val collector = DeviceCollector()
context = ApplicationProvider.getApplicationContext<SentinelTestApplication>().applicationContext

val collector = DeviceCollector(context)

actualDeviceData = collector()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ import org.junit.runners.Suite.SuiteClasses

@RunWith(Suite::class)
@SuiteClasses(DeviceCollectorDeviceTests::class, DeviceCollectorEmulatorTests::class)
class DeviceCollectorTestSuite
public class DeviceCollectorTestSuite
Loading
Loading