Skip to content

Commit

Permalink
CXAN-482 Update JDK, Kotlin and other deps (#630)
Browse files Browse the repository at this point in the history
* Update JDK, Kotlin and other deps

* Fix models generation

* Revert Kotlin poet

* Remove unneeded line
  • Loading branch information
RomanMinenok authored Aug 8, 2023
1 parent f82128a commit 3c96373
Show file tree
Hide file tree
Showing 20 changed files with 45 additions and 47 deletions.
6 changes: 3 additions & 3 deletions api-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ dependencies {

compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_11
}
}

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
6 changes: 3 additions & 3 deletions auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ dependencies {

compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_11
}
}

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
4 changes: 2 additions & 2 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ android {
}
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildFeatures {
viewBinding true
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[versions]
detekt = "1.19.0"
moshi = "1.13.0"
kotlin = "1.6.10"
kotlin = "1.8.10"
retrofit = "2.9.0"

[plugins]
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
ben-manes = { id = "com.github.ben-manes.versions", version = "0.42.0" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version = "1.6.10-1.0.4" }
ksp = { id = "com.google.devtools.ksp", version = "1.8.10-1.0.9" }

[libraries]

#Plugins
android-gradle = { module = "com.android.tools.build:gradle", version = "7.1.3" }
android-gradle = { module = "com.android.tools.build:gradle", version = "7.4.2" }
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
bintray-gradle = { module = "com.jfrog.bintray.gradle:gradle-bintray-plugin", version = "1.8.5" }

Expand Down
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 @@
#Mon Apr 11 14:29:44 EDT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
4 changes: 2 additions & 2 deletions model-generator/integrations/models-input/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ dependencies {
ksp libs.moshi.codegen
}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
4 changes: 2 additions & 2 deletions model-generator/integrations/models-output/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ dependencies {
testImplementation libs.podam
}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
4 changes: 2 additions & 2 deletions model-generator/plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ dependencies {
implementation libs.moshi.kotlin
}

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

gradlePlugin {
plugins {
Expand Down
2 changes: 0 additions & 2 deletions model-generator/plugin/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
enableFeaturePreview("VERSION_CATALOGS")

dependencyResolutionManagement {
versionCatalogs {
libs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ class GenerateModelsPlugin : Plugin<Project> {
project.pluginManager.withPlugin(KOTLIN_JVM) {
registerTask(project, extension)

project.afterEvaluate {
project.tasks.findByName(KSP_KOTLIN)?.dependsOn(project.tasks.findByName(GENERATE_MODELS))
}

// kaptGenerateStubsKotlin is used as the set up task instead of build
// because kapt code generation happens before build is called and
// we need to generate the models prior to kapt so the Moshi adapters
Expand Down Expand Up @@ -52,6 +56,7 @@ class GenerateModelsPlugin : Plugin<Project> {
private const val KAPT_GENERATE_STUBS = "kaptGenerateStubsKotlin"
private const val COMPILE_KOTLIN = "compileKotlin"
private const val PRE_BUILD = "preBuild"
private const val KSP_KOTLIN = "kspKotlin"
private const val EXTENSION_NAME = "generated"
private const val KOTLIN_JVM = "org.jetbrains.kotlin.jvm"
private const val KOTLIN_ANDROID = "kotlin-android"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ internal fun createConstructorParams(
it.validateName,
createTypeName(it.typeReference, packageName)
)
.addIfConditionMet(it.modifierList?.isOverridden == true) {
addModifiers(KModifier.OVERRIDE)
}
.addIfConditionMet(it.defaultValue != null) {
defaultValue("%L", it.defaultValue?.text)
}
Expand Down
6 changes: 3 additions & 3 deletions models-annotations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ dependencies {

compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_11
}
}

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
6 changes: 3 additions & 3 deletions models-parcelable/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = JavaVersion.VERSION_11
}
}

Expand Down
4 changes: 2 additions & 2 deletions models-serializable/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ dependencies {
testImplementation libs.robolectric
}

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
6 changes: 3 additions & 3 deletions models/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ dependencies {

compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_11
}
}

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
4 changes: 2 additions & 2 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ allprojects {
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}

Expand Down
4 changes: 2 additions & 2 deletions publish_android.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ allprojects {
}
}


task androidSourcesJar(type: Jar) {
classifier = 'sources'
dependsOn 'generateModels'
archiveClassifier = 'sources'
from android.sourceSets.main.java.source
}

Expand Down
6 changes: 3 additions & 3 deletions request/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ dependencies {

compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_11
}
}

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
2 changes: 0 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
enableFeaturePreview("VERSION_CATALOGS")

includeBuild('model-generator/plugin')
include ':vimeo-networking',
':auth',
Expand Down
8 changes: 4 additions & 4 deletions vimeo-networking/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apply plugin: 'kotlin'
apply from: '../publish.gradle'

compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

tasks.withType(Javadoc).all { enabled = true }

Expand Down

0 comments on commit 3c96373

Please sign in to comment.