Skip to content

Commit

Permalink
Hack to remove org.jetbrains.kotlin.platform.type from utils .module
Browse files Browse the repository at this point in the history
Signed-off-by: utzcoz <utzcoz@outlook.com>
  • Loading branch information
utzcoz committed Sep 16, 2022
1 parent 3d4b521 commit 9017ec2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gradle.properties
Expand Up @@ -33,3 +33,5 @@ kotlinVersion=1.7.10

autoServiceVersion=1.0-rc6
multidexVersion=2.0.1

kotlin.stdlib.default.dependency=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 1 addition & 0 deletions integration_tests/mockito-kotlin/build.gradle
Expand Up @@ -17,6 +17,7 @@ dependencies {

testCompileOnly AndroidSdk.MAX_SDK.coordinates
testRuntimeOnly AndroidSdk.MAX_SDK.coordinates
testCompileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
testImplementation "androidx.test.ext:junit:$axtJunitVersion"
testImplementation "junit:junit:$junitVersion"
testImplementation "com.google.truth:truth:$truthVersion"
Expand Down
3 changes: 3 additions & 0 deletions shadowapi/build.gradle
Expand Up @@ -3,6 +3,9 @@ import org.robolectric.gradle.RoboJavaModulePlugin

apply plugin: RoboJavaModulePlugin
apply plugin: DeployedRoboJavaModulePlugin
// workaround for https://github.com/gradle/gradle/issues/20145
// KMP plugin(1.8+) will apply this and then we can remove the following line.
apply plugin: JvmEcosystemPlugin

dependencies {
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
Expand Down
22 changes: 22 additions & 0 deletions utils/build.gradle
@@ -1,3 +1,4 @@
import org.gradle.api.internal.provider.DefaultProvider
import org.robolectric.gradle.DeployedRoboJavaModulePlugin
import org.robolectric.gradle.RoboJavaModulePlugin

Expand All @@ -13,6 +14,26 @@ spotless {
}
}

// Workaround for https://youtrack.jetbrains.com/issue/KT-52987
afterEvaluate {
configurations {
[runtimeElements, apiElements].each {cnf ->
cnf.attributes {attrs ->
attrs.keySet().each { attribute ->
if (attribute.name == "org.jetbrains.kotlin.platform.type"
|| attribute.name == "org.gradle.jvm.environment") {
attrs.attributeProvider(attribute, new DefaultProvider<?>({ 1 }))
def method = attrs.getClass().getDeclaredMethod(
'removeLazyAttributeIfPresent', attribute.getClass())
method.setAccessible(true)
method.invoke(attrs, attribute)
}
}
}
}
}
}

dependencies {
api project(":annotations")
api project(":pluginapi")
Expand All @@ -24,6 +45,7 @@ dependencies {
compileOnly "com.google.code.findbugs:jsr305:3.0.2"

testCompileOnly "com.google.auto.service:auto-service-annotations:$autoServiceVersion"
testCompileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
testAnnotationProcessor "com.google.auto.service:auto-service:$autoServiceVersion"
testAnnotationProcessor "com.google.errorprone:error_prone_core:$errorproneVersion"
implementation "com.google.errorprone:error_prone_annotations:$errorproneVersion"
Expand Down

0 comments on commit 9017ec2

Please sign in to comment.