| /* |
| * Copyright 2017-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. |
| */ |
| |
| apply plugin: 'java' // Needed for protobuf plugin only |
| apply plugin: 'kotlin-multiplatform' |
| apply plugin: 'kotlinx-serialization' |
| apply plugin: 'com.google.protobuf' |
| apply from: rootProject.file("gradle/native-targets.gradle") |
| apply from: rootProject.file("gradle/configure-source-sets.gradle") |
| |
| protobuf { |
| protoc { |
| // Download from repositories |
| artifact = 'com.google.protobuf:protoc:3.17.3' |
| } |
| } |
| |
| clean { |
| delete protobuf.generatedFilesBaseDir |
| } |
| |
| kotlin { |
| sourceSets { |
| configureEach { |
| languageSettings.optIn("kotlinx.serialization.internal.CoreFriendModuleApi") |
| } |
| |
| commonMain { |
| dependencies { |
| api project(":kotlinx-serialization-core") |
| } |
| } |
| |
| jvmTest { |
| kotlin.srcDirs += file("${protobuf.generatedFilesBaseDir}/test/java") |
| dependencies { |
| implementation 'com.google.protobuf:protobuf-java:3.17.3' |
| implementation 'io.kotlintest:kotlintest:2.0.7' |
| } |
| } |
| } |
| } |
| |
| sourceSets.test.proto { |
| srcDirs = ['testProto', 'jvmTest/resources/common'] |
| } |
| |
| compileTestKotlinJvm { |
| dependsOn 'generateTestProto' |
| } |
| |
| Java9Modularity.configureJava9ModuleInfo(project) |