Skip to content

Commit 6cda2bb

Browse files
committed
Initial commit
0 parents  commit 6cda2bb

File tree

20 files changed

+745
-0
lines changed

20 files changed

+745
-0
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[*]
2+
indent_style = space
3+
indent_size = 2

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+
10+
# Binary files should be left untouched
11+
*.jar binary
12+

.gitignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
.fleet
2+
.gradle
3+
4+
# Idea
5+
**/.idea/*
6+
!**/.idea/codeStyles
7+
!**/.idea/icon.png
8+
!**/.idea/runConfigurations
9+
!**/.idea/scopes
10+
!**/.idea/dictionaries
11+
*.iml
12+
13+
# Generated files
14+
build
15+
/reports
16+
.kotlin
17+
18+
# Place where the Android SDK path is set
19+
local.properties
20+
21+
# Secret used by sample apps
22+
github_token
23+
24+
# XCode
25+
xcuserdata
26+
project.xcworkspace
27+
28+
# Mac OS Finder
29+
.DS_Store
30+
Thumbs.db
31+
db.json
32+
*.log
33+
34+
# Docs
35+
node_modules/
36+
/docs/public
37+
/docs/.cache
38+
!docs/public/_redirects
39+
.deploy*/
40+
docs.json
41+
**/.project
42+
.vscode/**
43+
**/bin
44+
.sqldelight
45+
46+
# Local Netlify folder
47+
.netlify
48+
/ref-docs/

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Kctf
2+
3+
Kctf is a Gradle Plugin for the Kotlin Compiler Test Framework (Kctf).
4+
5+
It factors some of the Gradle configuration and boilerplate needed to setup tests for your Kotlin compiler plugin.
6+
7+
## Get started
8+
9+
Configure your build
10+
11+
```kotlin
12+
plugins {
13+
id("org.jetbrains.kotlin.jvm")
14+
id("com.gradleup.kctf").version("2.2.20-RC-0.0.0")
15+
}
16+
17+
dependencies {
18+
// Add the kctf runtime, it pulls the kotlin test framework transitively
19+
testImplementation(libs.kctf.runtime)
20+
}
21+
```
22+
23+
Write your abstract tests:
24+
25+
```kotlin
26+
@TestMetadata("compiler-tests/src/test/data/box")
27+
open class AbstractBoxTest : AbstractFirLightTreeBlackBoxCodegenTest() {
28+
override fun createKotlinStandardLibrariesPathProvider(): KotlinStandardLibrariesPathProvider {
29+
return ClasspathBasedStandardLibrariesPathProvider
30+
}
31+
32+
override fun configure(builder: TestConfigurationBuilder) {
33+
super.configure(builder)
34+
35+
with(builder) {
36+
configurePlugin()
37+
38+
defaultDirectives {
39+
+FULL_JDK
40+
+WITH_STDLIB
41+
+IGNORE_DEXING
42+
}
43+
}
44+
}
45+
}
46+
```
47+
48+
Kctf generates your test in `src/test/java`.

build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import com.gradleup.librarian.gradle.Librarian
2+
3+
plugins {
4+
alias(libs.plugins.kgp)
5+
alias(libs.plugins.librarian)
6+
alias(libs.plugins.gratatouille)
7+
alias(libs.plugins.ksp)
8+
}
9+
10+
Librarian.root(project)

gradle.properties

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file was generated by the Gradle 'init' task.
2+
# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
3+
4+
org.gradle.configuration-cache=true
5+
org.gradle.parallel=true
6+
org.gradle.caching=true
7+

gradle/libs.versions.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[versions]
2+
kotlin-compiler="2.2.20-RC"
3+
4+
[libraries]
5+
gradle-api = { group = "dev.gradleplugins", name = "gradle-api", version = "8.0" }
6+
kotlin-compiler-internal-test-framework = { module = "org.jetbrains.kotlin:kotlin-compiler-internal-test-framework", version.ref = "kotlin-compiler" }
7+
kotlin-compiler = { module = "org.jetbrains.kotlin:kotlin-compiler", version.ref = "kotlin-compiler" }
8+
kotlin-test-junit5 = { module = "org.jetbrains.kotlin:kotlin-test-junit5", version.ref = "kotlin-compiler" }
9+
kgp-compile-only = "org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0"
10+
clikt = "com.github.ajalt.clikt:clikt:5.0.1"
11+
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin-compiler" }
12+
kotlin-script-runtime = { module = "org.jetbrains.kotlin:kotlin-script-runtime", version.ref = "kotlin-compiler" }
13+
kotlin-annotations-jvm = { module = "org.jetbrains.kotlin:kotlin-annotations-jvm", version.ref = "kotlin-compiler" }
14+
15+
[plugins]
16+
kgp = { id = "org.jetbrains.kotlin.jvm", version = "2.2.20-RC" }
17+
librarian = { id = "com.gradleup.librarian", version = "0.1.1-SNAPSHOT-a596fab8122088023d823b38401a018acb5ece43" }
18+
gratatouille = { id = "com.gradleup.gratatouille", version = "0.1.0" }
19+
ksp = { id = "com.google.devtools.ksp", version = "2.2.20-RC-2.0.2" }

gradle/wrapper/gradle-wrapper.jar

44.4 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)