Dev #5

Merged
altavir merged 24 commits from dev into master 2020-12-28 09:44:15 +03:00
2 changed files with 54 additions and 45 deletions
Showing only changes of commit be571a9028 - Show all commits

View File

@ -112,7 +112,7 @@ open class KScienceCommonPlugin : Plugin<Project> {
afterEvaluate {
extensions.findByType<JavaPluginExtension>()?.apply {
targetCompatibility = KScienceVersions.JVM_TARGET
withSourcesJar()
//withSourcesJar()
//withJavadocJar()
}

View File

@ -3,6 +3,8 @@ package ru.mipt.npm.gradle
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.invoke
import org.jetbrains.kotlin.gradle.dsl.KotlinJsProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
enum class DependencyConfiguration {
@ -37,39 +39,41 @@ internal fun Project.useDependency(
}
}
}
}
}
pairs.find { it.first == "jvm" }?.let { dep ->
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
sourceSets.findByName(dependencySourceSet.setName)?.apply {
dependencies.apply {
val configurationName = when (dependencyConfiguration) {
DependencyConfiguration.API -> apiConfigurationName
DependencyConfiguration.IMPLEMENTATION -> implementationConfigurationName
DependencyConfiguration.COMPILE_ONLY -> compileOnlyConfigurationName
}
add(configurationName, dep.second)
}
}
}
}
pairs.find { it.first == "js" }?.let { dep ->
pluginManager.withPlugin("org.jetbrains.kotlin.js") {
sourceSets.findByName(dependencySourceSet.setName)?.apply {
dependencies.apply {
val configurationName = when (dependencyConfiguration) {
DependencyConfiguration.API -> apiConfigurationName
DependencyConfiguration.IMPLEMENTATION -> implementationConfigurationName
DependencyConfiguration.COMPILE_ONLY -> compileOnlyConfigurationName
}
add(configurationName, dep.second)
pairs.find { it.first == "jvm" }?.let { dep ->
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
configure<KotlinJvmProjectExtension> {
sourceSets.findByName(dependencySourceSet.setName)?.apply {
dependencies.apply {
val configurationName = when (dependencyConfiguration) {
DependencyConfiguration.API -> apiConfigurationName
DependencyConfiguration.IMPLEMENTATION -> implementationConfigurationName
DependencyConfiguration.COMPILE_ONLY -> compileOnlyConfigurationName
}
add(configurationName, dep.second)
}
}
}
}
}
pairs.find { it.first == "js" }?.let { dep ->
pluginManager.withPlugin("org.jetbrains.kotlin.js") {
configure<KotlinJsProjectExtension> {
sourceSets.findByName(dependencySourceSet.setName)?.apply {
dependencies.apply {
val configurationName = when (dependencyConfiguration) {
DependencyConfiguration.API -> apiConfigurationName
DependencyConfiguration.IMPLEMENTATION -> implementationConfigurationName
DependencyConfiguration.COMPILE_ONLY -> compileOnlyConfigurationName
}
add(configurationName, dep.second)
}
}
}
}
}
}
@ -89,29 +93,34 @@ internal fun Project.useCommonDependency(
}
}
}
}
}
withPlugin("org.jetbrains.kotlin.jvm") {
sourceSets.findByName(dependencySourceSet.setName)?.apply {
dependencies.apply {
val configurationName = when (dependencyConfiguration) {
DependencyConfiguration.API -> apiConfigurationName
DependencyConfiguration.IMPLEMENTATION -> implementationConfigurationName
DependencyConfiguration.COMPILE_ONLY -> compileOnlyConfigurationName
}
add(configurationName, dep)
withPlugin("org.jetbrains.kotlin.jvm") {
configure<KotlinJvmProjectExtension> {
sourceSets.findByName(dependencySourceSet.setName)?.apply {
dependencies.apply {
val configurationName = when (dependencyConfiguration) {
DependencyConfiguration.API -> apiConfigurationName
DependencyConfiguration.IMPLEMENTATION -> implementationConfigurationName
DependencyConfiguration.COMPILE_ONLY -> compileOnlyConfigurationName
}
add(configurationName, dep)
}
}
withPlugin("org.jetbrains.kotlin.js") {
sourceSets.findByName(dependencySourceSet.setName)?.apply {
dependencies.apply {
val configurationName = when (dependencyConfiguration) {
DependencyConfiguration.API -> apiConfigurationName
DependencyConfiguration.IMPLEMENTATION -> implementationConfigurationName
DependencyConfiguration.COMPILE_ONLY -> compileOnlyConfigurationName
}
add(configurationName, dep)
}
}
withPlugin("org.jetbrains.kotlin.js") {
configure<KotlinJsProjectExtension> {
sourceSets.findByName(dependencySourceSet.setName)?.apply {
dependencies.apply {
val configurationName = when (dependencyConfiguration) {
DependencyConfiguration.API -> apiConfigurationName
DependencyConfiguration.IMPLEMENTATION -> implementationConfigurationName
DependencyConfiguration.COMPILE_ONLY -> compileOnlyConfigurationName
}
add(configurationName, dep)
}
}
}