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

Use Gradle toolchains #1900

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 5 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
// alias(libs.plugins.android.application) apply false
alias(libs.plugins.protobuf) apply false
alias(libs.plugins.mavenPublish)
alias(libs.plugins.detekt)
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}

detekt {
Expand Down
7 changes: 6 additions & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ repositories {
mavenLocal()
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

dependencies {
implementation 'dev.mobile:maestro-client:1.0.1'
implementation 'dev.mobile:maestro-orchestra:1.0.1'
implementation 'dev.mobile:maestro-ios:1.0.1'
}

2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# https://blog.gradle.org/best-practices-naming-version-catalog-entries

[versions]
androidPlugin = "4.2.1"
androidPlugin = "8.2.2"
androidxEspresso = "3.6.1"
androidxTestJunit = "1.2.1"
androidxUiautomator = "2.3.0"
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=bed1da33cca0f557ab13691c77f38bb67388119e4794d113e051039b80af9bb1
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
24 changes: 12 additions & 12 deletions maestro-android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id "com.google.protobuf"
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.protobuf)
}

protobuf {
Expand Down Expand Up @@ -31,6 +31,12 @@ kotlin.sourceSets.configureEach {
languageSettings.optIn("kotlin.RequiresOptIn")
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

android {
namespace 'dev.mobile.maestro'

Expand Down Expand Up @@ -60,13 +66,7 @@ android {
storeFile file('../debug.keystore')
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}

packagingOptions {
resources {
excludes += ['META-INF/INDEX.LIST', 'META-INF/io.netty.versions.properties']
Expand All @@ -84,7 +84,7 @@ tasks.register("copyMaestroAndroid", Copy) {

it.doLast {
if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
throw new GradleException("This build must be run with java 8")
// throw new GradleException("This build must be run with java 8")
}

if (!layout.buildDirectory.file(maestroAndroidApkDestPath).get().asFile.exists())
Expand All @@ -105,7 +105,7 @@ tasks.register("copyMaestroServer", Copy) {

it.doLast {
if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
throw new GradleException("This build must be run with java 8")
// throw new GradleException("This build must be run with java 8")
}

if (!layout.buildDirectory.file(maestroServerApkDestPath).get().asFile.exists())
Expand Down
5 changes: 3 additions & 2 deletions maestro-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ dependencies {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}

tasks.create("createProperties") {
Expand Down
5 changes: 3 additions & 2 deletions maestro-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ dependencies {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

plugins.withId("com.vanniktech.maven.publish") {
Expand Down
5 changes: 3 additions & 2 deletions maestro-ios-driver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ dependencies {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

plugins.withId("com.vanniktech.maven.publish") {
Expand Down
5 changes: 3 additions & 2 deletions maestro-ios/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ dependencies {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

plugins.withId("com.vanniktech.maven.publish") {
Expand Down
5 changes: 3 additions & 2 deletions maestro-orchestra-models/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ plugins.withId("com.vanniktech.maven.publish") {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

dependencies {
Expand Down
5 changes: 3 additions & 2 deletions maestro-orchestra/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ dependencies {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

plugins.withId("com.vanniktech.maven.publish") {
Expand Down
5 changes: 3 additions & 2 deletions maestro-proto/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

jar {
Expand Down
5 changes: 3 additions & 2 deletions maestro-studio/server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ tasks.processResources {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

dependencies {
Expand Down
9 changes: 2 additions & 7 deletions maestro-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType(KotlinJvmCompile).configureEach {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

Expand Down
5 changes: 3 additions & 2 deletions maestro-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ dependencies {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

plugins.withId("com.vanniktech.maven.publish") {
Expand Down
5 changes: 5 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ pluginManagement {
gradlePluginPortal()
}
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
Expand Down
Loading