Skip to content

Commit

Permalink
Upgrade gradle
Browse files Browse the repository at this point in the history
Gradle needed to be updated to be able to compile with newer Java and
Gradle version.

* add .idea and activecaptaincommunitysdk to .gitignore
* update compileSdk and targetSdk
* add android:exported to AndroidManifest.xml
* upgrade app dependencies
* use tasks.register instead of task in build.gradle
  • Loading branch information
atoth-garmin committed Apr 4, 2024
1 parent 652a774 commit 9cf0834
Show file tree
Hide file tree
Showing 15 changed files with 308 additions and 316 deletions.
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.idea/
.DS_Store
/build
/captures
/doc
.externalNativeBuild
.cxx
local.properties
activecaptaincommunitysdk/
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/compiler.xml

This file was deleted.

23 changes: 0 additions & 23 deletions .idea/gradle.xml

This file was deleted.

25 changes: 0 additions & 25 deletions .idea/jarRepositories.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/misc.xml

This file was deleted.

13 changes: 0 additions & 13 deletions .idea/vcs.xml

This file was deleted.

24 changes: 18 additions & 6 deletions activecaptaincommunitysdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ plugins {
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
compileSdk 34
namespace "com.garmin.marine.activecaptaincommunitysdk"

defaultConfig {
minSdkVersion 23
targetSdkVersion 30
minSdk 23
targetSdk 34
versionCode 1
versionName "2.0.3"
}
Expand All @@ -20,15 +20,27 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

publishing {
singleVariant('release') {
withSourcesJar()
withJavadocJar()
}
singleVariant('debug') {
withSourcesJar()
withJavadocJar()
}
}

externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
version "3.10.2"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

libraryVariants.all { variant ->
Expand Down
35 changes: 18 additions & 17 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ plugins {
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
namespace "com.garmin.marine.activecaptainsample"
compileSdk 34

defaultConfig {
applicationId "com.garmin.marine.activecaptainsample"
minSdkVersion 23
targetSdkVersion 30
minSdk 23
targetSdk 34
versionCode 1
versionName "1.0"

Expand All @@ -20,31 +20,32 @@ android {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}

dependencies {

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.11.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation project(path: ':activecaptaincommunitysdk')
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.annotation:annotation:1.7.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.7.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.security:security-crypto:1.0.0-rc04'
implementation 'androidx.security:security-crypto:1.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'
implementation 'androidx.webkit:webkit:1.4.0'
implementation 'androidx.webkit:webkit:1.10.0'
}
8 changes: 4 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
android:theme="@style/Theme.ActiveCaptainSample"
android:usesCleartextTraffic="true">

<activity android:name=".LoginActivity">
<activity android:name=".LoginActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name=".MainActivity" />
<activity android:name=".MainActivity" android:exported="false"/>

<activity android:name=".WebViewActivity" />
<activity android:name=".WebViewActivity" android:exported="false"/>

<activity android:name=".SearchActivity"/>
<activity android:name=".SearchActivity" android:exported="false"/>

</application>

Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.3"
classpath "com.android.tools.build:gradle:8.2.2"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -15,10 +15,10 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

task clean(type: Delete) {
tasks.register('clean', Delete) {
delete rootProject.buildDir
}
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Mon Feb 08 14:48:53 CST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
Loading

0 comments on commit 9cf0834

Please sign in to comment.