Skip to content

Commit

Permalink
Merge pull request #75 from bitPogo/feature/bump-gradle
Browse files Browse the repository at this point in the history
Bump Gradle
  • Loading branch information
bitPogo authored Mar 28, 2022
2 parents 67fe620 + f3e3c80 commit 0b590c4
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ toc::[]

=== Bumped

* Gradle 7.2 -> 7.4.1

=== Deprecated

=== Migration
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ KMock has the following dependencies:
* link:https://github.com/touchlab/Stately[Touchlab's Stately 1.2.1]
* link:https://square.github.io/kotlinpoet/[Square KotlinPoet 1.10.2]
* link:https://github.com/google/ksp[Kotlin Symbol Processing (KSP) 1.6.10-1.0.4]
* link:https://gradle.org/[Gradle 7.2]
* link:https://gradle.org/[Gradle 7.4.1]

=== Additional Requirements

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ allprojects {
}

tasks.named<Wrapper>("wrapper") {
gradleVersion = "7.2"
gradleVersion = "7.4.1"
distributionType = Wrapper.DistributionType.ALL
}
7 changes: 7 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import tech.antibytes.gradle.kmock.dependency.Dependency
import tech.antibytes.gradle.kmock.dependency.addCustomRepositories
import tech.antibytes.gradle.kmock.dependency.ensureKotlinVersion

plugins {
`kotlin-dsl`
Expand All @@ -18,6 +19,7 @@ repositories {
mavenCentral()
google()
addCustomRepositories()
ensureKotlinVersion("1.5.31")
}

dependencies {
Expand All @@ -29,3 +31,8 @@ dependencies {
implementation(Dependency.gradle.runtimeConfig)
implementation(Dependency.gradle.ksp)
}

with(extensions.getByType<JavaPluginExtension>()) {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ kotlin.native.osVersionMin.ios_arm64=13.0
# Android
android.useAndroidX=true
android.enableJetifier=false
android.disableAutomaticComponentCreation=true
# see: https://github.com/robolectric/robolectric/issues/6521
android.jetifier.ignorelist=bcprov
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 5 additions & 0 deletions gradlePlugin/kmock-dependency/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ gradlePlugin {
implementationClass = "tech.antibytes.gradle.kmock.dependency.DependencyPlugin"
}
}

with(extensions.getByType<JavaPluginExtension>()) {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2022 Matthias Geisler (bitPogo) / All rights reserved.
*
* Use of this source code is governed by Apache License, Version 2.0
*/

package tech.antibytes.gradle.kmock.dependency

import org.gradle.api.Project

private val modules = listOf(
"kotlin-stdlib-jdk7",
"kotlin-stdlib-jdk8",
"kotlin-stdlib",
"kotlin-stdlib-common",
"kotlin-reflect"
)

fun Project.ensureKotlinVersion(version: String? = null) {
configurations.all {
resolutionStrategy.eachDependency {
if (requested.group == "org.jetbrains.kotlin" && requested.name in modules) {
useVersion(version ?: Version.kotlin)
because("Avoid resolution conflicts")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ package tech.antibytes.gradle.kmock.dependency
object Version {

val gradle = Gradle
const val kotlin = "1.6.10"

object Gradle {
/**
* [Kotlin](https://github.com/JetBrains/kotlin)
*/
val kotlin = "1.6.10"
const val kotlin = Version.kotlin

/**
* [AnitBytes GradlePlugins](https://github.com/bitPogo/gradle-plugins)
*/
const val antibytes = "6731cef"
const val antibytes = "4137039"

/**
* [Spotless](https://plugins.gradle.org/plugin/com.diffplug.gradle.spotless)
Expand All @@ -30,7 +31,7 @@ object Version {
val antibytes = Antibytes

object Antibytes {
const val test = "c3e5acf"
const val test = "7281fe2"
}

val google = Google
Expand Down

0 comments on commit 0b590c4

Please sign in to comment.