Skip to content

Commit

Permalink
Merge pull request #194 from Kotlin/feat/add-bcv-api-checker
Browse files Browse the repository at this point in the history
Add BCV API dumps
  • Loading branch information
adam-enko authored Apr 9, 2024
2 parents 7c8f85c + c05d099 commit 5d0b4d1
Show file tree
Hide file tree
Showing 24 changed files with 1,206 additions and 81 deletions.
25 changes: 25 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ buildscript {
}
}

plugins {
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.15.0-Beta.1"
}

apply plugin: 'kotlinx.team.infra'

infra {
Expand All @@ -35,15 +39,36 @@ repositories {
mavenCentral()
}

// region Workarounds for https://github.com/gradle/gradle/issues/22335
tasks.register("apiDump") {
it.dependsOn(gradle.includedBuild("plugin").task(":apiDump"))
}

afterEvaluate {
gradle.includedBuilds.forEach { included ->
project(":kotlinx-benchmark-runtime").tasks.named("publishToMavenLocal") { dependsOn(included.task(":publishToMavenLocal")) }
}
}
//endregion

allprojects {
logger.info("Using Kotlin $kotlin_version for project $it")
repositories {
KotlinCommunity.addDevRepositoryIfEnabled(delegate, project)
}
}

apiValidation {
ignoredProjects += [
"examples",
"java",
"kotlin",
"kotlin-kts",
"kotlin-multiplatform",
"integration",
]

klib {
it.enabled = true
}
}
220 changes: 220 additions & 0 deletions plugin/api/kotlinx-benchmark-plugin.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
public class kotlinx/benchmark/gradle/BenchmarkConfiguration {
public final fun advanced (Ljava/lang/String;Ljava/lang/Object;)V
public final fun exclude (Ljava/lang/String;)V
public final fun getAdvanced ()Ljava/util/Map;
public final fun getExcludes ()Ljava/util/List;
public final fun getIncludes ()Ljava/util/List;
public final fun getIterationTime ()Ljava/lang/Long;
public final fun getIterationTimeUnit ()Ljava/lang/String;
public final fun getIterations ()Ljava/lang/Integer;
public final fun getMode ()Ljava/lang/String;
public final fun getName ()Ljava/lang/String;
public final fun getOutputTimeUnit ()Ljava/lang/String;
public final fun getParams ()Ljava/util/Map;
public final fun getReportFormat ()Ljava/lang/String;
public final fun getWarmups ()Ljava/lang/Integer;
public final fun include (Ljava/lang/String;)V
public final fun param (Ljava/lang/String;[Ljava/lang/Object;)V
public final fun setAdvanced (Ljava/util/Map;)V
public final fun setExcludes (Ljava/util/List;)V
public final fun setIncludes (Ljava/util/List;)V
public final fun setIterationTime (Ljava/lang/Long;)V
public final fun setIterationTimeUnit (Ljava/lang/String;)V
public final fun setIterations (Ljava/lang/Integer;)V
public final fun setMode (Ljava/lang/String;)V
public final fun setOutputTimeUnit (Ljava/lang/String;)V
public final fun setParams (Ljava/util/Map;)V
public final fun setReportFormat (Ljava/lang/String;)V
public final fun setWarmups (Ljava/lang/Integer;)V
}

public class kotlinx/benchmark/gradle/BenchmarkTarget {
public final fun getName ()Ljava/lang/String;
public final fun getWorkingDir ()Ljava/lang/String;
public final fun setWorkingDir (Ljava/lang/String;)V
}

public class kotlinx/benchmark/gradle/BenchmarksExtension {
public final fun configurations (Lgroovy/lang/Closure;)Lorg/gradle/api/NamedDomainObjectContainer;
public final fun getBenchsDescriptionDir ()Ljava/lang/String;
public final fun getBuildDir ()Ljava/lang/String;
public final fun getConfigurations ()Lorg/gradle/api/NamedDomainObjectContainer;
public final fun getProject ()Lorg/gradle/api/Project;
public final fun getReportsDir ()Ljava/lang/String;
public final fun getTargets ()Lorg/gradle/api/NamedDomainObjectContainer;
public final fun getVersion ()Ljava/lang/String;
public final fun setBenchsDescriptionDir (Ljava/lang/String;)V
public final fun setBuildDir (Ljava/lang/String;)V
public final fun setReportsDir (Ljava/lang/String;)V
public final fun targets (Lgroovy/lang/Closure;)Lorg/gradle/api/NamedDomainObjectContainer;
}

public final class kotlinx/benchmark/gradle/BenchmarksExtensionKt {
public static final fun benchmark (Lorg/gradle/api/Project;Lorg/gradle/api/Action;)V
}

public abstract class kotlinx/benchmark/gradle/BenchmarksPlugin : org/gradle/api/Plugin {
public static final field ASSEMBLE_BENCHMARKS_TASKNAME Ljava/lang/String;
public static final field BENCHMARKS_TASK_GROUP Ljava/lang/String;
public static final field BENCHMARK_COMPILATION_SUFFIX Ljava/lang/String;
public static final field BENCHMARK_COMPILE_SUFFIX Ljava/lang/String;
public static final field BENCHMARK_EXEC_SUFFIX Ljava/lang/String;
public static final field BENCHMARK_EXTENSION_NAME Ljava/lang/String;
public static final field BENCHMARK_GENERATE_SUFFIX Ljava/lang/String;
public static final field BENCHMARK_JAR_SUFFIX Ljava/lang/String;
public static final field Companion Lkotlinx/benchmark/gradle/BenchmarksPlugin$Companion;
public static final field JMH_CORE_DEPENDENCY Ljava/lang/String;
public static final field JMH_GENERATOR_DEPENDENCY Ljava/lang/String;
public static final field PLUGIN_ID Ljava/lang/String;
public static final field PLUGIN_VERSION Ljava/lang/String;
public static final field RUN_BENCHMARKS_TASKNAME Ljava/lang/String;
public synthetic fun apply (Ljava/lang/Object;)V
public fun apply (Lorg/gradle/api/Project;)V
}

public final class kotlinx/benchmark/gradle/BenchmarksPlugin$Companion {
}

public final class kotlinx/benchmark/gradle/JavaBenchmarkTarget : kotlinx/benchmark/gradle/JvmBenchmarkTarget {
}

public class kotlinx/benchmark/gradle/JmhBytecodeGeneratorTask : org/gradle/api/DefaultTask {
public field inputClassesDirs Lorg/gradle/api/file/FileCollection;
public field inputCompileClasspath Lorg/gradle/api/file/FileCollection;
public field outputResourcesDir Ljava/io/File;
public field outputSourcesDir Ljava/io/File;
public field runtimeClasspath Lorg/gradle/api/file/FileCollection;
public final fun generate ()V
public final fun getExecutableProvider ()Lorg/gradle/api/provider/Provider;
public final fun getInputClassesDirs ()Lorg/gradle/api/file/FileCollection;
public final fun getInputCompileClasspath ()Lorg/gradle/api/file/FileCollection;
public final fun getOutputResourcesDir ()Ljava/io/File;
public final fun getOutputSourcesDir ()Ljava/io/File;
public final fun getRuntimeClasspath ()Lorg/gradle/api/file/FileCollection;
public final fun setExecutableProvider (Lorg/gradle/api/provider/Provider;)V
public final fun setInputClassesDirs (Lorg/gradle/api/file/FileCollection;)V
public final fun setInputCompileClasspath (Lorg/gradle/api/file/FileCollection;)V
public final fun setOutputResourcesDir (Ljava/io/File;)V
public final fun setOutputSourcesDir (Ljava/io/File;)V
public final fun setRuntimeClasspath (Lorg/gradle/api/file/FileCollection;)V
}

public final class kotlinx/benchmark/gradle/JsBenchmarkTarget : kotlinx/benchmark/gradle/BenchmarkTarget {
public final fun getJsBenchmarksExecutor ()Lkotlinx/benchmark/gradle/JsBenchmarksExecutor;
public final fun setJsBenchmarksExecutor (Lkotlinx/benchmark/gradle/JsBenchmarksExecutor;)V
}

public final class kotlinx/benchmark/gradle/JsBenchmarksExecutor : java/lang/Enum {
public static final field BenchmarkJs Lkotlinx/benchmark/gradle/JsBenchmarksExecutor;
public static final field BuiltIn Lkotlinx/benchmark/gradle/JsBenchmarksExecutor;
public static fun valueOf (Ljava/lang/String;)Lkotlinx/benchmark/gradle/JsBenchmarksExecutor;
public static fun values ()[Lkotlinx/benchmark/gradle/JsBenchmarksExecutor;
}

public class kotlinx/benchmark/gradle/JsSourceGeneratorTask : org/gradle/api/DefaultTask {
public field inputClassesDirs Lorg/gradle/api/file/FileCollection;
public field inputDependencies Lorg/gradle/api/file/FileCollection;
public field outputResourcesDir Ljava/io/File;
public field outputSourcesDir Ljava/io/File;
public field title Ljava/lang/String;
public final fun generate ()V
public final fun getInputClassesDirs ()Lorg/gradle/api/file/FileCollection;
public final fun getInputDependencies ()Lorg/gradle/api/file/FileCollection;
public final fun getOutputResourcesDir ()Ljava/io/File;
public final fun getOutputSourcesDir ()Ljava/io/File;
public final fun getTitle ()Ljava/lang/String;
public final fun getUseBenchmarkJs ()Z
public final fun setInputClassesDirs (Lorg/gradle/api/file/FileCollection;)V
public final fun setInputDependencies (Lorg/gradle/api/file/FileCollection;)V
public final fun setOutputResourcesDir (Ljava/io/File;)V
public final fun setOutputSourcesDir (Ljava/io/File;)V
public final fun setTitle (Ljava/lang/String;)V
public final fun setUseBenchmarkJs (Z)V
}

public abstract class kotlinx/benchmark/gradle/JvmBenchmarkTarget : kotlinx/benchmark/gradle/BenchmarkTarget {
public final fun getJmhVersion ()Ljava/lang/String;
public final fun setJmhVersion (Ljava/lang/String;)V
}

public class kotlinx/benchmark/gradle/KotlinJvmBenchmarkTarget : kotlinx/benchmark/gradle/JvmBenchmarkTarget {
}

public class kotlinx/benchmark/gradle/NativeBenchmarkExec : org/gradle/api/DefaultTask {
public field benchProgressPath Ljava/lang/String;
public field benchsDescriptionDir Ljava/io/File;
public field configFile Ljava/io/File;
public field executable Ljava/io/File;
public field reportFile Ljava/io/File;
public final fun getBenchProgressPath ()Ljava/lang/String;
public final fun getBenchsDescriptionDir ()Ljava/io/File;
public final fun getConfigFile ()Ljava/io/File;
public final fun getExecutable ()Ljava/io/File;
public final fun getNativeFork ()Ljava/lang/String;
public final fun getReportFile ()Ljava/io/File;
public final fun getWorkingDir ()Ljava/lang/String;
public final fun run ()V
public final fun setBenchProgressPath (Ljava/lang/String;)V
public final fun setBenchsDescriptionDir (Ljava/io/File;)V
public final fun setConfigFile (Ljava/io/File;)V
public final fun setExecutable (Ljava/io/File;)V
public final fun setNativeFork (Ljava/lang/String;)V
public final fun setReportFile (Ljava/io/File;)V
public final fun setWorkingDir (Ljava/lang/String;)V
}

public final class kotlinx/benchmark/gradle/NativeBenchmarkTarget : kotlinx/benchmark/gradle/BenchmarkTarget {
}

public class kotlinx/benchmark/gradle/NativeSourceGeneratorTask : org/gradle/api/DefaultTask {
public field inputClassesDirs Lorg/gradle/api/file/FileCollection;
public field inputDependencies Lorg/gradle/api/file/FileCollection;
public field nativeTarget Ljava/lang/String;
public field outputResourcesDir Ljava/io/File;
public field outputSourcesDir Ljava/io/File;
public field title Ljava/lang/String;
public final fun generate ()V
public final fun getInputClassesDirs ()Lorg/gradle/api/file/FileCollection;
public final fun getInputDependencies ()Lorg/gradle/api/file/FileCollection;
public final fun getNativeTarget ()Ljava/lang/String;
public final fun getOutputResourcesDir ()Ljava/io/File;
public final fun getOutputSourcesDir ()Ljava/io/File;
public final fun getTitle ()Ljava/lang/String;
public final fun setInputClassesDirs (Lorg/gradle/api/file/FileCollection;)V
public final fun setInputDependencies (Lorg/gradle/api/file/FileCollection;)V
public final fun setNativeTarget (Ljava/lang/String;)V
public final fun setOutputResourcesDir (Ljava/io/File;)V
public final fun setOutputSourcesDir (Ljava/io/File;)V
public final fun setTitle (Ljava/lang/String;)V
}

public final class kotlinx/benchmark/gradle/UtilsKt$sam$i$org_gradle_api_Action$0 : org/gradle/api/Action {
public fun <init> (Lkotlin/jvm/functions/Function1;)V
public final synthetic fun execute (Ljava/lang/Object;)V
}

public final class kotlinx/benchmark/gradle/WasmBenchmarkTarget : kotlinx/benchmark/gradle/BenchmarkTarget {
}

public class kotlinx/benchmark/gradle/WasmSourceGeneratorTask : org/gradle/api/DefaultTask {
public field inputClassesDirs Lorg/gradle/api/file/FileCollection;
public field inputDependencies Lorg/gradle/api/file/FileCollection;
public field outputResourcesDir Ljava/io/File;
public field outputSourcesDir Ljava/io/File;
public field title Ljava/lang/String;
public final fun generate ()V
public final fun getInputClassesDirs ()Lorg/gradle/api/file/FileCollection;
public final fun getInputDependencies ()Lorg/gradle/api/file/FileCollection;
public final fun getOutputResourcesDir ()Ljava/io/File;
public final fun getOutputSourcesDir ()Ljava/io/File;
public final fun getTitle ()Ljava/lang/String;
public final fun setInputClassesDirs (Lorg/gradle/api/file/FileCollection;)V
public final fun setInputDependencies (Lorg/gradle/api/file/FileCollection;)V
public final fun setOutputResourcesDir (Ljava/io/File;)V
public final fun setOutputSourcesDir (Ljava/io/File;)V
public final fun setTitle (Ljava/lang/String;)V
}

public abstract interface annotation class kotlinx/benchmark/gradle/internal/KotlinxBenchmarkPluginInternalApi : java/lang/annotation/Annotation {
}

27 changes: 19 additions & 8 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask

buildscript {
ext.kotlinDevUrl = rootProject.properties["kotlin_repo_url"]
repositories {
Expand All @@ -11,17 +14,17 @@ buildscript {
classpath "kotlinx.team:kotlinx.team.infra:$infra_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

}

plugins {
id 'java-gradle-plugin'
id 'maven-publish'
id 'com.gradle.plugin-publish' version '0.21.0'
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.15.0-Beta.2"
}

apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'kotlinx.team.infra'
apply(plugin: 'org.jetbrains.kotlin.jvm')
apply(plugin: 'kotlinx.team.infra')

infra {
teamcity {
Expand Down Expand Up @@ -75,10 +78,14 @@ sourceSets {
}
}

compileKotlin {
kotlinOptions {
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
apiVersion = "1.4" // the version of Kotlin embedded in Gradle
tasks.named("compileKotlin", KotlinCompilationTask.class) {
compilerOptions {
optIn.addAll(
"kotlinx.benchmark.gradle.internal.KotlinxBenchmarkPluginInternalApi",
"kotlin.RequiresOptIn",
)
//noinspection GrDeprecatedAPIUsage
apiVersion = KotlinVersion.KOTLIN_1_4 // the version of Kotlin embedded in Gradle
}
}

Expand All @@ -90,7 +97,7 @@ dependencies {
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-util-klib-metadata', version: kotlin_version
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-util-klib', version: kotlin_version
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-util-io', version: kotlin_version

compileOnly group: 'org.jetbrains.kotlin.multiplatform', name: 'org.jetbrains.kotlin.multiplatform.gradle.plugin', version: kotlin_version
compileOnly "org.jetbrains.kotlin:kotlin-compiler-embeddable:$kotlin_version"
compileOnly "org.openjdk.jmh:jmh-generator-bytecode:$jmhVersion" // used in worker
Expand Down Expand Up @@ -130,3 +137,7 @@ if (project.findProperty("publication_repository") == "space") {
}
}
}

apiValidation {
nonPublicMarkers += ["kotlinx.benchmark.gradle.internal.KotlinxBenchmarkPluginInternalApi"]
}
Loading

0 comments on commit 5d0b4d1

Please sign in to comment.