Skip to content

Commit

Permalink
Gradle update
Browse files Browse the repository at this point in the history
  • Loading branch information
newmanw committed Mar 28, 2024
1 parent c017e31 commit ef8e679
Show file tree
Hide file tree
Showing 14 changed files with 343 additions and 392 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'com.android.application' version '8.2.0' apply false
id 'com.android.library' version '8.2.0' apply false
id 'com.android.application' version '8.3.0' apply false
id 'com.android.library' version '8.3.0' apply false
id 'org.jetbrains.kotlin.android' version '1.9.10' apply false
id 'com.google.dagger.hilt.android' version '2.49' apply false
id 'com.google.dagger.hilt.android' version '2.51' apply false
}

tasks.register('clean', Delete) {
Expand Down
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 @@
#Thu May 06 13:38:17 MDT 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
41 changes: 26 additions & 15 deletions mage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ ext {
buildToolsVersion = "28.0.3"
androidxLibVersion = "1.0.0"
extTruthVersion = '1.2.0'
coreVersion = "1.2.0"
extJUnitVersion = "1.1.1"
runnerVersion = "1.2.0"
espressoVersion = "3.2.0"
coreVersion = "1.5.0"
extJUnitVersion = "1.1.5"
runnerVersion = "1.5.2"
espressoVersion = "3.5.1"
}

kapt {
Expand All @@ -34,6 +34,7 @@ def googleMapsApiDebugKey = hasProperty('DEBUG_MAPS_API_KEY') ? DEBUG_MAPS_API_K

android {
compileSdk 34
namespace 'mil.nga.giat.mage'

dataBinding {
enabled = true
Expand Down Expand Up @@ -71,6 +72,16 @@ android {
kotlinCompilerExtensionVersion = "1.5.3"
}

packagingOptions {
resources {
excludes += [
'META-INF/INDEX.LIST',
'META-INF/LICENSE.md',
'META-INF/LICENSE-notice.md'
]
}
}

defaultConfig {
applicationId "mil.nga.giat.mage"
versionName project.version
Expand Down Expand Up @@ -139,7 +150,6 @@ android {
useLibrary 'android.test.runner'
useLibrary 'android.test.base'
useLibrary 'android.test.mock'
namespace 'mil.nga.giat.mage'
}

dependencies {
Expand All @@ -164,9 +174,9 @@ dependencies {

implementation 'androidx.browser:browser:1.8.0'

implementation "com.google.dagger:hilt-android:2.49"
implementation "com.google.dagger:hilt-android:2.51"
implementation 'androidx.hilt:hilt-navigation-compose:1.2.0'
kapt "com.google.dagger:hilt-compiler:2.48.1"
kapt "com.google.dagger:hilt-compiler:2.51"
implementation 'androidx.hilt:hilt-work:1.2.0'
kapt 'androidx.hilt:hilt-compiler:1.2.0'
annotationProcessor 'androidx.hilt:hilt-compiler:1.2.0'
Expand Down Expand Up @@ -235,14 +245,15 @@ dependencies {
implementation files ('libs/sanselanandroid.jar')

// Testing-only dependencies
androidTestImplementation 'androidx.test:core:' +coreVersion
androidTestImplementation 'androidx.test:core-ktx:' + coreVersion
androidTestImplementation 'androidx.test.ext:junit:' + extJUnitVersion
androidTestImplementation 'androidx.test.ext:junit-ktx:' + extJUnitVersion
androidTestImplementation 'androidx.test:runner:' + runnerVersion
androidTestImplementation 'androidx.test:rules:' + runnerVersion
androidTestImplementation 'androidx.test.espresso:espresso-core:' +espressoVersion
androidTestImplementation 'androidx.test.espresso:espresso-contrib:' + espressoVersion
androidTestImplementation "androidx.test:core:$coreVersion"
androidTestImplementation "androidx.test:core-ktx:$coreVersion"
androidTestImplementation "androidx.test.ext:junit:$extJUnitVersion"
androidTestImplementation "androidx.test.ext:junit-ktx:$extJUnitVersion"
androidTestImplementation "androidx.test:runner:$runnerVersion"
androidTestImplementation "androidx.test:rules:1.5.0"
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion"
androidTestImplementation "io.mockk:mockk-android:1.13.8"
}

tasks.register('androidArtifactVersion') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class IdpLoginFragment : Fragment() {
private lateinit var viewModel: LoginViewModel

@Inject
protected lateinit var preferences: SharedPreferences
lateinit var preferences: SharedPreferences

private lateinit var strategy: JSONObject
private lateinit var strategyName: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class LdapLoginFragment: Fragment() {
private lateinit var viewModel: LoginViewModel

@Inject
protected lateinit var preferences: SharedPreferences
lateinit var preferences: SharedPreferences

private lateinit var strategy: JSONObject
private lateinit var strategyName: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ open class MageLoginFragment : Fragment() {
}

@Inject
protected lateinit var preferences: SharedPreferences
lateinit var preferences: SharedPreferences

private lateinit var binding: FragmentAuthenticationMageBinding

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CacheProvider @Inject constructor(
fun onCacheOverlay(cacheOverlays: List<CacheOverlay>)
}

private fun getCacheOverlays(): List<CacheOverlay> {
fun getCacheOverlays(): List<CacheOverlay> {
var copy: List<CacheOverlay>
synchronized(cacheOverlays) {
copy = cacheOverlays.values.toList()
Expand Down
7 changes: 2 additions & 5 deletions mage/tests/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="mil.nga.giat.mage.tests"
android:versionCode="6"
android:versionName="4.0.0">

Expand All @@ -19,10 +18,8 @@

<application>
<uses-library android:name="android.test.runner" />
<uses-library android:name="android.test.base"
android:required="false" />
<uses-library android:name="android.test.mock"
android:required="false" />
<uses-library android:name="android.test.base" android:required="false" />
<uses-library android:name="android.test.mock" android:required="false" />
</application>

</manifest>
106 changes: 0 additions & 106 deletions mage/tests/src/mil/nga/giat/mage/map/cache/CacheProviderTest.java

This file was deleted.

86 changes: 86 additions & 0 deletions mage/tests/src/mil/nga/giat/mage/map/cache/CacheProviderTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
package mil.nga.giat.mage.map.cache

import io.mockk.mockk
import junit.framework.TestCase
import java.util.concurrent.Semaphore

class CacheProviderTest : TestCase() {
private lateinit var cacheProvider: CacheProvider
private lateinit var testOverlay: CacheOverlay

@Throws(Exception::class)
public override fun setUp() {
super.setUp()

cacheProvider = CacheProvider(
application = mockk(),
layerLocalDataSource = mockk(),
eventLocalDataSource = mockk(),
preferences = mockk()
)

testOverlay = object : CacheOverlay("test", CacheOverlayType.XYZ_DIRECTORY, false) {
override fun removeFromMap() {}
}

ourLock.drainPermits()
}

public override fun tearDown() {}

fun testGetOverlay() {
val overlay = cacheProvider.getOverlay("doesNotExist")
assertNull(overlay)
}

@Throws(Exception::class)
fun testAddCacheOverlay() {
cacheProvider.addCacheOverlay(testOverlay)
assertNotNull(cacheProvider.getOverlay(testOverlay.cacheName))

val foundOverlays: MutableList<CacheOverlay> = ArrayList()
val listener = object : CacheProvider.OnCacheOverlayListener {
override fun onCacheOverlay(cacheOverlays: List<CacheOverlay>) {
foundOverlays.addAll(cacheOverlays)
ourLock.release()
}
}
cacheProvider.registerCacheOverlayListener(listener)
ourLock.acquire()
assertTrue(foundOverlays.size == 1)
assertTrue(foundOverlays[0] === testOverlay)
cacheProvider.unregisterCacheOverlayListener(listener)
}

@Throws(Exception::class)
fun testRemoveCacheOverlay() {
cacheProvider.addCacheOverlay(testOverlay)
assertNotNull(cacheProvider.getOverlay(testOverlay.cacheName))

val foundOverlays: MutableList<CacheOverlay> = ArrayList()
val listener = object : CacheProvider.OnCacheOverlayListener {
override fun onCacheOverlay(cacheOverlays: List<CacheOverlay>) {
foundOverlays.addAll(cacheOverlays)
ourLock.release()
}
}
cacheProvider.registerCacheOverlayListener(listener)
ourLock.acquire()
assertTrue(foundOverlays.size == 1)
assertTrue(foundOverlays[0] === testOverlay)
foundOverlays.clear()
cacheProvider.unregisterCacheOverlayListener(listener)
cacheProvider.removeCacheOverlay(testOverlay.cacheName)
cacheProvider.registerCacheOverlayListener(listener)
ourLock.acquire()
assertTrue(foundOverlays.isEmpty())
cacheProvider.unregisterCacheOverlayListener(listener)
}

companion object {
/**
* Used to control synchronization with the callbacks
*/
private val ourLock = Semaphore(1)
}
}
Loading

0 comments on commit ef8e679

Please sign in to comment.