From 3a22a1127e9c45ad3a02104bad79d4ed85be5614 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Fri, 7 May 2021 13:18:48 +0300 Subject: [PATCH] Gradle upgrade --- android/build.gradle.kts | 4 ++++ build.gradle.kts | 2 +- core/src/com/unciv/logic/city/CityInfo.kt | 18 ++++++++++++------ gradle/wrapper/gradle-wrapper.properties | 2 +- tests/build.gradle.kts | 1 + 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/android/build.gradle.kts b/android/build.gradle.kts index a678b40cc2..5a34a30fd5 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -64,6 +64,10 @@ android { lintOptions { disable("MissingTranslation") } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_7 + targetCompatibility = JavaVersion.VERSION_1_7 + } } diff --git a/build.gradle.kts b/build.gradle.kts index 44422807ed..11449ba140 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -20,7 +20,7 @@ buildscript { dependencies { classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${com.unciv.build.BuildConfig.kotlinVersion}") classpath("de.richsource.gradle.plugins:gwt-gradle-plugin:0.6") - classpath("com.android.tools.build:gradle:4.1.3") + classpath("com.android.tools.build:gradle:4.2.0") classpath("com.mobidevelop.robovm:robovm-gradle-plugin:2.3.1") // This is for wrapping the .jar file into a standalone executable diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index c9a0206304..e7894d64ac 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -24,7 +24,7 @@ class CityInfo { lateinit var civInfo: CivilizationInfo @Transient - lateinit private var centerTileInfo: TileInfo // cached for better performance + private lateinit var centerTileInfo: TileInfo // cached for better performance @Transient val range = 2 @@ -123,9 +123,11 @@ class CityInfo { val cityName = nationCities[cityNameIndex] val cityNameRounds = civInfo.citiesCreated / nationCities.size - val cityNamePrefix = if (cityNameRounds == 0) "" - else if (cityNameRounds == 1) "New " - else "Neo " + val cityNamePrefix = when (cityNameRounds) { + 0 -> "" + 1 -> "New " + else -> "Neo " + } name = cityNamePrefix + cityName } @@ -520,8 +522,12 @@ class CityInfoReligionManager: Counter() { } fun getAffectedBySurroundingCities() { - val allCitiesWithin10Tiles = cityInfo.civInfo.gameInfo.civilizations.asSequence().flatMap { it.cities } - .filter { it != cityInfo && it.getCenterTile().aerialDistanceTo(cityInfo.getCenterTile()) <= 10 } + val allCitiesWithin10Tiles = + cityInfo.civInfo.gameInfo.civilizations.asSequence().flatMap { it.cities } + .filter { + it != cityInfo && it.getCenterTile() + .aerialDistanceTo(cityInfo.getCenterTile()) <= 10 + } for (city in allCitiesWithin10Tiles) { val majorityReligionOfCity = city.religion.getMajorityReligion() if (majorityReligionOfCity == null) continue diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 10b3ee8967..f7493acd03 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip diff --git a/tests/build.gradle.kts b/tests/build.gradle.kts index cb93b530f0..5895c253d9 100644 --- a/tests/build.gradle.kts +++ b/tests/build.gradle.kts @@ -7,6 +7,7 @@ plugins { java { sourceCompatibility = JavaVersion.VERSION_1_6 + targetCompatibility = JavaVersion.VERSION_1_7 } tasks {