-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Kotlin to 1.8.20, all necessary accompanying changes (#138)
- Loading branch information
1 parent
356fb32
commit f5f5fd1
Showing
60 changed files
with
585 additions
and
483 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,4 @@ jobs: | |
- uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages | ||
folder: build/reflekt/dokka/htmlMultiModule | ||
folder: build/dokka/htmlMultiModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,32 +3,37 @@ import io.gitlab.arturbosch.detekt.DetektPlugin | |
import io.gitlab.arturbosch.detekt.extensions.DetektExtension | ||
import io.gitlab.arturbosch.detekt.report.ReportMergeTask | ||
import org.jetbrains.dokka.gradle.DokkaTaskPartial | ||
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile | ||
import org.jetbrains.reflekt.buildutils.* | ||
import java.net.URL | ||
|
||
@Suppress("DSL_SCOPE_VIOLATION") // https://youtrack.jetbrains.com/issue/KTIJ-19369 | ||
plugins { | ||
`maven-publish` | ||
alias(libs.plugins.kosogor) | ||
alias(libs.plugins.buildconfig) apply false | ||
alias(libs.plugins.dokka) | ||
id(libs.plugins.kotlin.jvm.get().pluginId) | ||
} | ||
|
||
val detektReportMerge by tasks.registering(ReportMergeTask::class) { | ||
output.set(rootProject.buildDir.resolve("reports/detekt/merge.sarif")) | ||
output = rootProject.layout.buildDirectory.file("reports/detekt/merge.sarif") | ||
} | ||
|
||
group = "org.jetbrains.reflekt" | ||
version = libs.versions.kotlin.asProvider().get() | ||
version = libs.versions.kotlin.get() | ||
description = "Reflekt is a compile-time reflection library that leverages the flows of the standard reflection approach and can find classes, objects " + | ||
"(singleton classes) or functions by some conditions in compile-time." | ||
|
||
allprojects { | ||
apply { | ||
plugin("kotlin") | ||
apply(plugin = "kotlin") | ||
|
||
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> { | ||
kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" | ||
} | ||
tasks.withType<KotlinCompile<*>> { | ||
kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" | ||
} | ||
|
||
java { | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
} | ||
|
||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all { | ||
|
@@ -39,34 +44,31 @@ allprojects { | |
|
||
repositories { | ||
mavenCentral() | ||
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") | ||
// Uncomment it for using the last kotlin compiler version | ||
// The full list of the build can be found here: | ||
// https://teamcity.jetbrains.com/buildConfiguration/Kotlin_KotlinPublic_BuildNumber?mode=builds&tag=bootstrap | ||
// (see builds with <boostrap> tag) | ||
// Note: uncomment it also in the settings.gradle.kts | ||
// maven { | ||
// url = uri("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") | ||
// } | ||
// maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") | ||
} | ||
|
||
// We should publish the project in the local maven repository before the tests running | ||
tasks.withType<Test> { | ||
dependsOn(tasks.withType<PublishToMavenLocal> {}, ":reflekt-plugin:jar", ":reflekt-dsl:jar") | ||
dependsOn(tasks.withType<PublishToMavenLocal>(), ":reflekt-plugin:jar", ":reflekt-dsl:jar") | ||
} | ||
|
||
configureDiktat() | ||
apply<DetektPlugin>() | ||
|
||
configure<DetektExtension> { | ||
config = rootProject.files("detekt.yml") | ||
config.setFrom(rootProject.files("detekt.yml")) | ||
buildUponDefaultConfig = true | ||
debug = true | ||
} | ||
|
||
tasks.withType<Detekt> { | ||
finalizedBy(detektReportMerge) | ||
reports.sarif.required.set(true) | ||
reports.sarif.required = true | ||
detektReportMerge.get().input.from(sarifReportFile) | ||
} | ||
} | ||
|
@@ -82,24 +84,55 @@ subprojects { | |
tasks.withType<DokkaTaskPartial> { | ||
dokkaSourceSets.configureEach { | ||
sourceLink { | ||
localDirectory.set(this@subprojects.file("src/main/kotlin")) | ||
localDirectory = this@subprojects.file("src/main/kotlin") | ||
|
||
remoteUrl.set( | ||
remoteUrl = | ||
URL("https://github.com/JetBrains-Research/${rootProject.name}/tree/master/${this@subprojects.name}/src/main/kotlin/") | ||
) | ||
} | ||
} | ||
} | ||
} | ||
|
||
if (this@subprojects.name != "gradle-plugin") { | ||
publishing { | ||
publications { | ||
@Suppress("unused") | ||
val mavenJava by creating(MavenPublication::class) { | ||
from(this@subprojects.components["java"]) | ||
|
||
pom { | ||
description = rootProject.description | ||
inceptionYear = "2020" | ||
url = "https://github.com/JetBrains-Research/${rootProject.name}" | ||
|
||
licenses { | ||
license { | ||
comments = "Open-source license" | ||
distribution = "repo" | ||
name = "Apache License" | ||
url = "https://github.com/JetBrains-Research/${rootProject.name}/blob/master/LICENSE" | ||
} | ||
} | ||
|
||
scm { | ||
connection = "scm:git:[email protected]:JetBrains-Research/${rootProject.name}.git" | ||
developerConnection = "scm:git:[email protected]:JetBrains-Research/${rootProject.name}.git" | ||
url = "[email protected]:JetBrains-Research/${rootProject.name}.git" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
repositories { | ||
maven { | ||
maven("https://packages.jetbrains.team/maven/p/reflekt/reflekt") { | ||
name = "SpacePackages" | ||
url = uri("https://packages.jetbrains.team/maven/p/reflekt/reflekt") | ||
|
||
credentials { | ||
username = System.getenv("JB_SPACE_CLIENT_ID")?.takeIf { it.isNotBlank() } ?: "" | ||
password = System.getenv("JB_SPACE_CLIENT_SECRET")?.takeIf { it.isNotBlank() } ?: "" | ||
username = System.getenv("JB_SPACE_CLIENT_ID").orEmpty() | ||
password = System.getenv("JB_SPACE_CLIENT_SECRET").orEmpty() | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ style: | |
active: false | ||
ReturnCount: | ||
max: 3 | ||
DestructuringDeclarationWithTooManyEntries: | ||
active: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,3 +154,5 @@ | |
enabled: false | ||
- name: IDENTIFIER_LENGTH | ||
enabled: false | ||
- name: KDOC_DUPLICATE_PROPERTY | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
import tanvd.kosogor.proxy.publishPlugin | ||
|
||
@Suppress("DSL_SCOPE_VIOLATION") // https://youtrack.jetbrains.com/issue/KTIJ-19369 | ||
plugins { | ||
`kotlin-dsl` | ||
alias(libs.plugins.kotlin.plugin.serialization) | ||
alias(libs.plugins.plugin.publish) | ||
} | ||
|
||
group = rootProject.group | ||
version = rootProject.version | ||
|
||
dependencies { | ||
implementation(kotlin("gradle-plugin-api")) | ||
implementation(embeddedKotlin("gradle-plugin-api")) | ||
implementation(projects.reflektCore) | ||
api(projects.reflektDsl) | ||
implementation(libs.kotlinx.serialization.protobuf) | ||
} | ||
|
||
publishPlugin { | ||
id = "org.jetbrains.reflekt" | ||
displayName = "Reflekt" | ||
implementationClass = "org.jetbrains.reflekt.plugin.ReflektSubPlugin" | ||
version = project.version.toString() | ||
|
||
info { | ||
description = "Compile-time reflection library" | ||
website = "https://github.com/JetBrains-Research/reflekt" | ||
vcsUrl = "https://github.com/JetBrains-Research/reflekt" | ||
tags.addAll(listOf("kotlin", "reflection", "reflekt")) | ||
gradlePlugin { | ||
website = "https://github.com/JetBrains-Research/reflekt" | ||
vcsUrl = "https://github.com/JetBrains-Research/reflekt" | ||
plugins { | ||
val reflekt by creating { | ||
id = "org.jetbrains.reflekt" | ||
displayName = "Gradle Reflekt plugin" | ||
description = rootProject.description | ||
implementationClass = "org.jetbrains.reflekt.plugin.ReflektSubPlugin" | ||
tags.addAll(listOf("kotlin", "reflection", "reflekt")) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.