Skip to content

Commit 316ae6a

Browse files
authored
Feature/sdk update (#33)
* Fix compiler warnings in Utils.kt * Upgrade compile SDK and targetSDK to version 34. * Upgrade Gradle version * Fix Github action and use Java version 17 * Fix Github action and use Java version 17 in unit-test-gradle.yml * Surpress UnsafeOptInUsageError for for MediaStreamHandlerMessageEvents.kt
1 parent d56ca35 commit 316ae6a

File tree

11 files changed

+225
-146
lines changed

11 files changed

+225
-146
lines changed

.github/workflows/deploy-package.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
packages: write
1414
steps:
1515
- uses: actions/checkout@v3
16-
- uses: actions/setup-java@v3
16+
- uses: actions/setup-java@v4
1717
with:
18-
java-version: '11'
19-
distribution: 'adopt'
18+
java-version: '17'
19+
distribution: 'oracle'
2020
- name: Validate Gradle wrapper
2121
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
2222
- name: Publish package

.github/workflows/unit-test-gradle.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ jobs:
2121

2222
steps:
2323
- uses: actions/checkout@v3
24-
- name: Set up JDK 11
25-
uses: actions/setup-java@v3
24+
- name: Set up JDK 17
25+
uses: actions/setup-java@v4
2626
with:
27-
java-version: '11'
28-
distribution: 'temurin'
27+
java-version: '17'
28+
distribution: 'oracle'
2929
- name: Build with Gradle
3030
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
3131
with:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
/.idea/modules.xml
99
/.idea/workspace.xml
1010
/.idea/navEditor.xml
11+
/.idea/compiler.xml
12+
/.idea/misc.xml
13+
/.idea/gradle.xml
1114
/.idea/assetWizardSettings.xml
1215
.DS_Store
1316
/build

app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ plugins {
77

88
android {
99
namespace 'com.fivegmag.a5gmscommonlibrary'
10-
compileSdk 32
10+
compileSdk 34
1111

1212
defaultConfig {
1313
minSdk 29
14-
targetSdk 32
14+
targetSdk 34
1515
versionCode 1
16-
versionName "1.2.0"
16+
versionName "1.2.1"
1717

1818
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1919
}
@@ -38,7 +38,7 @@ publishing {
3838
release(MavenPublication) {
3939
groupId = 'com.fivegmag'
4040
artifactId = 'a5gmscommonlibrary'
41-
version = '1.2.0'
41+
version = '1.2.1'
4242

4343
afterEvaluate {
4444
from components.release

app/src/main/java/com/fivegmag/a5gmscommonlibrary/eventbus/MediaStreamHandlerMessageEvents.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ program. If this file is missing then the license can be retrieved from
77
https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view
88
*/
99

10+
@file:Suppress("UnsafeOptInUsageError")
11+
1012
package com.fivegmag.a5gmscommonlibrary.eventbus
1113

1214
import android.telephony.CellInfo
@@ -29,6 +31,7 @@ class LoadStartedEvent(
2931
val loadEventInfo: LoadEventInfo,
3032
val mediaLoadData: MediaLoadData
3133
)
34+
3235
class LoadCompletedEvent(
3336
val eventTime: EventTime,
3437
val loadEventInfo: LoadEventInfo,

app/src/main/java/com/fivegmag/a5gmscommonlibrary/helpers/Utils.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ class Utils {
130130
while (addresses.hasMoreElements()) {
131131
val address = addresses.nextElement()
132132
if (!address.isLoopbackAddress && address.isSiteLocalAddress) {
133-
if ((ipVer == 4 && address.hostAddress.contains(".")) ||
134-
(ipVer == 6 && address.hostAddress.contains(":"))
133+
if ((ipVer == 4 && address?.hostAddress?.contains(".") == true) ||
134+
(ipVer == 6 && address?.hostAddress?.contains(":") == true)
135135
) {
136136
return address.hostAddress?.toString()
137137
}
@@ -171,10 +171,10 @@ class Utils {
171171

172172
fun getPort(url: String): Int? {
173173
try {
174-
val url = URL(url)
175-
val port = url.port
174+
val urlInstance = URL(url)
175+
val port = urlInstance.port
176176
if (port == -1) {
177-
return url.defaultPort
177+
return urlInstance.defaultPort
178178
}
179179

180180
return port

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
id 'com.android.application' version '7.3.1' apply false
4-
id 'com.android.library' version '7.3.1' apply false
3+
id 'com.android.application' version '8.7.3' apply false
4+
id 'com.android.library' version '8.7.3' apply false
55
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
66
}

gradle/wrapper/gradle-wrapper.jar

-15.3 KB
Binary file not shown.
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#Thu Mar 02 17:08:26 CET 2023
21
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
42
distributionPath=wrapper/dists
5-
zipStorePath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)