Skip to content

Commit

Permalink
Kotlin Tooling Update (#159)
Browse files Browse the repository at this point in the history
## Changes

- Set Kotlin language and api version to 1.7 to align with Nimbus Android
- Updated Android compileSdk to 35
- Enabled parallel configuration cache and incremental native support
- Enable iosArm64 and iosSimulatorArm64 on all builds

## Library Updates

- Android Gradle Plugin: 8.7.2
- Android Build Tools: Removed in favor of Android Gradle Plugin default
- Dokka 1.9.20
- Gradle: 8.11.1
- Kotlin Serialization: Prefer 1.7.3; Min 1.4 to align with Kotlin 1.7
- Kotest: 6.0.0.M1
  • Loading branch information
JasonSznol authored Nov 26, 2024
1 parent 53ce09c commit 1ec9320
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 56 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
workflows/ @timehop/nimbus-admin
57 changes: 37 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,52 @@
# Standard
bin/
gen/
classes/
build/
captures/
classes/
gen/
schemas/
.build/

# Gradle
.gradle

# Windows / MacOS
.externalNativeBuild/
.gradle/
.kotlin/
.navigation/
*.aab
*.aar
*.apk
*.framework
*.generated.swift
*.hmap
*.ipa
*.keystore
*.log
*.xcframework
*.zip

# OS
.DS_Store

# Intellij / Android Studio / Rider
*.iml
# Intellij / Android Studio / Rider / Fleet
.fleet/
.idea/

# Android
.vscode/
*Caches/
xcuserdata/
*.iml
*.user
*.xcworkspace
local.properties

# Cocoapods
*.podspec

# Nuget
obj/
packages/
*.dll
*.nupkg
*.p7s
obj/
packages/

# Rider
*.user
_ReSharper.Caches/

# Cocoapods
Pods/
Podfile.lock

# Swift Package Manager
Packages/
Package.resolved
9 changes: 5 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Project-wide Gradle settings.
org.gradle.jvmargs=-Xmx6g -XX:+UseParallelGC -Dkotlin.daemon.jvm.options=-Xmx2g,XX:+UseParallelGC
org.gradle.jvmargs=-Xmx6g -XX:+UseParallelGC -Dfile.encoding=UTF-8
org.gradle.caching=true
org.gradle.configureondemand=true
org.gradle.parallel=true

# The configuration cache remains disabled due to publishing tasks not working with it
org.gradle.configuration-cache=true
org.gradle.configuration-cache.parallel=true
org.gradle.configuration-cache-problems=warn
org.gradle.configuration-cache.max-problems=5

group=com.adsbynimbus.openrtb
version=0.13.0
version=0.17.0

## Android Build Settings
android.defaults.buildfeatures.resvalues=false
Expand All @@ -20,8 +21,8 @@ android.useAndroidX=true

## Kotlin Build Settings
kotlin.code.style=official
kotlin.daemon.jvmargs=-Xmx2g -XX:+UseParallelGC
kotlin.daemon.jvmargs=-Xmx2g -XX:+UseParallelGC -Dfile.encoding=UTF-8
kotlin.incremental.multiplatform=true
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.incremental.native=true
kotlin.native.ignoreDisabledTargets=true
kotlin.stdlib.default.dependency=false
11 changes: 5 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[versions]
android = "8.6.0"
android-buildtools = "34.0.0"
dokka = "1.9.10"
kotest = "5.8.0"
kotlin = "2.0.20"
serialization = { require = "[1.3.3, 2.0[", prefer = "1.7.2" }
android = "8.7.2"
dokka = "1.9.20"
kotest = "6.0.0.M1"
kotlin = "2.0.21"
serialization = { require = "[1.4, 2.0[", prefer = "1.7.3" }

[plugins]
android = { id = "com.android.library", version.ref = "android" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
32 changes: 12 additions & 20 deletions kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.dsl.*

plugins {
alias(libs.plugins.android)
Expand All @@ -9,12 +10,8 @@ plugins {
`maven-publish`
}

val androidOnly: Boolean = providers.gradleProperty("android.injected.invoked.from.ide")
.map { it.toBoolean() }.getOrElse(false)

android {
buildToolsVersion = libs.versions.android.buildtools.get()
compileSdk = 34
compileSdk = 35
defaultConfig {
minSdk = 21
consumerProguardFile("src/androidMain/consumer-proguard-rules.pro")
Expand All @@ -24,27 +21,24 @@ android {

kotlin {
explicitApi()
applyDefaultHierarchyTemplate()

androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
compilations.configureEach {
compileTaskProvider.configure {
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
}
}
publishLibraryVariants("release")
}

/* Apple deployments in rough dependency order */
if (!androidOnly) {
iosArm64()
iosSimulatorArm64()
}
iosArm64()
iosSimulatorArm64()

sourceSets {
configureEach {
languageSettings {
apiVersion = "1.6"
languageVersion = "1.6"
apiVersion = KotlinVersion.KOTLIN_1_7.version
languageVersion = KotlinVersion.KOTLIN_1_7.version
optIn("kotlinx.serialization.ExperimentalSerializationApi")
}
}
Expand All @@ -54,10 +48,8 @@ kotlin {
commonTest.dependencies {
implementation(libs.bundles.test.common)
}
val androidUnitTest by getting {
dependencies {
implementation(libs.bundles.test.android)
}
androidUnitTest.dependencies {
implementation(libs.bundles.test.android)
}
}
}
Expand Down
23 changes: 21 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,36 @@

pluginManagement {
repositories {
google()
google {
mavenContent {
includeGroupAndSubgroups("androidx")
includeGroupAndSubgroups("com.android")
includeGroupAndSubgroups("com.google")
}
}
mavenCentral()
gradlePluginPortal()
}
}

val androidGradleOverride = with(providers) {
gradleProperty("android.studio.version").flatMap { gradleProperty("android.gradle") }
}

dependencyResolutionManagement {
repositories {
google()
google {
mavenContent {
includeGroupAndSubgroups("androidx")
includeGroupAndSubgroups("com.android")
includeGroupAndSubgroups("com.google")
}
}
mavenCentral()
}
versionCatalogs.configureEach {
if (androidGradleOverride.isPresent) version("android", androidGradleOverride.get())
}
}

rootProject.name = "nimbus-openrtb"
Expand Down

0 comments on commit 1ec9320

Please sign in to comment.