Skip to content

Commit

Permalink
Tech upgrade gradle (#613)
Browse files Browse the repository at this point in the history
* TECH: Upgrade gradle

* TECH: Use docker image with JDK17

* TECH: bump JDK; resolve gradle warnings

* TECH: bump JDK in github flows

* TECH: replace deprecated JVM flag

* TECH: bump compile SDK

* TECH: bump kotlin

* TECH: bump compose

* TECH: resolve warning

* TECH: lint

* TECH: lint

* TECH: fix ADB server configuration
  • Loading branch information
Nikitae57 committed Jan 9, 2024
1 parent 433c769 commit 05eaf26
Show file tree
Hide file tree
Showing 38 changed files with 83 additions and 54 deletions.
6 changes: 3 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ check_android_30_task:
skip: "changesIncludeOnly('NOTICE.txt', 'LICENSE.txt', '**.{md,html}')"

container:
image: cirrusci/android-sdk:33
image: ghcr.io/cirruslabs/flutter:latest
kvm: true
cpu: 8
memory: 24G
Expand Down Expand Up @@ -74,7 +74,7 @@ check_android_33_task:
skip: "changesIncludeOnly('NOTICE.txt', 'LICENSE.txt', '**.{md,html}')"

container:
image: cirrusci/android-sdk:33
image: ghcr.io/cirruslabs/flutter:latest
kvm: true
cpu: 8
memory: 24G
Expand Down Expand Up @@ -138,7 +138,7 @@ check_android_21_task:
skip: "changesIncludeOnly('NOTICE.txt', 'LICENSE.txt', '**.{md,html}')"

container:
image: cirrusci/android-sdk:33
image: ghcr.io/cirruslabs/flutter:latest
kvm: true
cpu: 8
memory: 24G
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publication_maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 11
java-version: 17
- name: Tests
run: make unit_tests
- name: Assemble build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 11
java-version: 17
- name: Run static analysis
run: make static_analysis
- name: Run unit tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snapshot_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 11
java-version: 17
- name: Assemble projects
run: ./gradlew -Pkaspresso.snapshotVersion=${{ inputs.kaspressoVersion }} assembleDebugAndroidTest
- name: Check legal documents
Expand Down
7 changes: 7 additions & 0 deletions adb-server/adbserver-desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,11 @@ tasks.withType<Jar>().configureEach {
}
exclude("NOTICE.txt")
exclude("LICENSE.txt")

mustRunAfter(
":adb-server:adb-server-desktop-device-connection:jar",
":adb-server:adb-server-command-types:jar",
":adb-server:adb-server-connection:jar",
":adb-server:adb-server-common:jar"
)
}
4 changes: 4 additions & 0 deletions allure-support/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ plugins {
id("convention.legal-documents")
}

android {
namespace = "com.kaspersky.components.alluresupport"
}

publish {
artifactId.set("kaspresso-allure-support")
}
Expand Down
2 changes: 1 addition & 1 deletion allure-support/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="com.kaspersky.components.alluresupport" />
<manifest />
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id("com.android.application")
id("kotlin-android")
id("convention.kotlin-base")
id("convention.android-base")
kotlin("android")
}

android {
Expand All @@ -29,7 +29,7 @@ android {
viewBinding = true // for the samples
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
kotlin {
jvmToolchain(JavaVersion.VERSION_17.majorVersion.toInt())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import com.android.build.gradle.BaseExtension
@Suppress("MagicNumber")
configure<BaseExtension> {

compileSdkVersion(33)
compileSdkVersion(34)

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

defaultConfig {
Expand All @@ -16,9 +16,9 @@ configure<BaseExtension> {
}

packagingOptions {
merges.apply {
add("META-INF/LGPL2.1")
add("META-INF/AL2.0")
resources {
merges.add("META-INF/LGPL2.1")
merges.add("META-INF/AL2.0")
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id("com.android.library")
id("kotlin-android")
id("convention.kotlin-base")
id("convention.android-base")
kotlin("android")
}

androidComponents {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

val kotlinLanguageVersion = "1.7"
val kotlinLanguageVersion = "1.9"

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {

jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = JavaVersion.VERSION_17.toString()

// TODO: fix all warnings before
// allWarningsAsErrors = true
Expand Down
2 changes: 0 additions & 2 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
enableFeaturePreview("VERSION_CATALOGS")

rootProject.name = "build-logic"

include("android")
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ val detektAll = tasks.register<Detekt>("detektAll") {
exclude("**/resources/**")
exclude("**/build/**")
reports {
xml.enabled = false
html.enabled = false
xml.required.set(false)
html.required.set(false)
}
}
4 changes: 4 additions & 0 deletions compose-support/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ plugins {
id("convention.legal-documents")
}

android {
namespace = "com.kaspersky.components.composesupport"
}

publish {
artifactId.set("kaspresso-compose-support")
}
Expand Down
2 changes: 1 addition & 1 deletion compose-support/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="com.kaspersky.components.composesupport" />
<manifest />
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.caching=true

Expand All @@ -7,3 +7,4 @@ kotlin.code.style=official
android.useAndroidX = true

kaspresso.version=1.5.3
kaspresso.snapshotVersion=1.5.3-SNAPSHOT
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[versions]
kotlin = "1.7.10"
kotlin = "1.9.20"
detekt = "1.21.0"
espresso = "3.5.1"
kakao = "3.4.1"
kakaoCompose = "0.2.3"
kakaoExtClicks = "1.0.0"
allure = "2.4.0"
compose = "1.3.1"
composeCompiler = "1.3.1"
compose = "1.5.4"
composeCompiler = "1.5.4"
activityCompose = "1.4.0"
androidXTest = "1.5.0"
testOrchestrator = "1.4.2"
Expand All @@ -17,8 +17,8 @@ thirdPartyReport = "0.18.956"
[libraries]
# plugins
kotlinPlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
androidPlugin = "com.android.tools.build:gradle:7.2.2"
versionsPlugin = "com.github.ben-manes:gradle-versions-plugin:0.39.0"
androidPlugin = "com.android.tools.build:gradle:8.1.4"
versionsPlugin = "com.github.ben-manes:gradle-versions-plugin:0.50.0"
thirdPartyReportPlugin = { module = "com.kaspersky.gradle:third-party-report", version.ref = "thirdPartyReport" }
airPlugin = { module = "com.kaspersky.gradle:air", version.ref = "thirdPartyReport" }

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-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 4 additions & 0 deletions kaspresso/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ plugins {
id("convention.legal-documents")
}

android {
namespace = "com.kaspersky.kaspresso"
}

publish {
artifactId.set("kaspresso")
}
Expand Down
3 changes: 1 addition & 2 deletions kaspresso/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kaspersky.kaspresso">
<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.ACCESS_WIFI_STATE"/>
Expand Down
4 changes: 4 additions & 0 deletions kautomator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ plugins {
id("convention.legal-documents")
}

android {
namespace = "com.kaspersky.components.kautomator"
}

publish {
artifactId.set("kautomator")
}
Expand Down
2 changes: 1 addition & 1 deletion kautomator/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="com.kaspersky.components.kautomator" />
<manifest />
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface UiScrollableActions : UiBaseActions {
} while (scrollable.scrollForward())
do {
if (findObject(to.view.interaction.selector.bySelector) != null)
return@perform
return@perform
} while (scrollable.scrollBackward())
to.isDisplayed()
}
Expand Down
1 change: 1 addition & 0 deletions samples/adbserver-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
}

android {
namespace = "com.kaspersky.adbserver.sample"
defaultConfig {
applicationId = "com.kaspersky.adbserver.sample"
}
Expand Down
3 changes: 1 addition & 2 deletions samples/adbserver-sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.kaspersky.adbserver.sample">
xmlns:tools="http://schemas.android.com/tools">

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

Expand Down
1 change: 1 addition & 0 deletions samples/kaspresso-allure-support-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
}

android {
namespace = "com.kaspersky.kaspresso.alluresupport.sample"
defaultConfig {
applicationId = "com.kaspersky.kaspresso.alluresupport.sample"
testInstrumentationRunner = "com.kaspersky.kaspresso.runner.KaspressoRunner"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.kaspersky.kaspresso.alluresupport.sample">
xmlns:tools="http://schemas.android.com/tools">

<!-- This permission is required to get access to /sdcard/allure-results -->
<uses-permission
Expand Down
1 change: 1 addition & 0 deletions samples/kaspresso-compose-support-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
}

android {
namespace = "com.kaspersky.kaspresso.composesupport.sample"
defaultConfig {
minSdk = 21

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.kaspersky.kaspresso.composesupport.sample">
xmlns:tools="http://schemas.android.com/tools">

<application
android:label="@string/app_name"
Expand Down
1 change: 1 addition & 0 deletions samples/kaspresso-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
}

android {
namespace = "com.kaspersky.kaspressample"
defaultConfig {
applicationId = "com.kaspersky.kaspressample"
testInstrumentationRunner = "com.kaspersky.kaspresso.runner.KaspressoRunner"
Expand Down
7 changes: 5 additions & 2 deletions samples/kaspresso-sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.kaspersky.kaspressample">
xmlns:tools="http://schemas.android.com/tools">

<uses-feature
android:name="android.hardware.telephony"
android:required="false" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
Expand Down
1 change: 1 addition & 0 deletions samples/kautomator-sample-app-upgrade/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
}

android {
namespace = "com.kaspersky.kaspresso.upgradesample"
defaultConfig {
applicationId = "com.kaspersky.kaspresso.sample_upgrade_tests"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.kaspersky.kaspresso.upgradesample">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Expand Down
1 change: 1 addition & 0 deletions samples/kautomator-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
}

android {
namespace = "com.kaspersky.kaspresso.kautomatorsample"
defaultConfig {
applicationId = "com.kaspersky.kaspresso.kautomatorsample"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
3 changes: 1 addition & 2 deletions samples/kautomator-sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.kaspersky.kaspresso.kautomatorsample">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Expand Down
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
rootProject.name = "kaspresso-framework"

enableFeaturePreview("VERSION_CATALOGS")
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

pluginManagement {
Expand Down
Loading

0 comments on commit 05eaf26

Please sign in to comment.