Skip to content

Commit f2e6c05

Browse files
committed
feat(abg)!: replace data class perks by code generation in bindings
1 parent 6e0c383 commit f2e6c05

File tree

41 files changed

+3800
-664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3800
-664
lines changed

.github/workflows/bindings-server.main.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ workflow(
101101

102102
cleanMavenLocal()
103103

104+
run(
105+
name = "Execute the script using the bindings from the server with v2 route",
106+
command = """
107+
mv .github/workflows/test-script-consuming-jit-bindings-v2.main.do-not-compile.kts .github/workflows/test-script-consuming-jit-bindings-v2.main.kts
108+
.github/workflows/test-script-consuming-jit-bindings-v2.main.kts
109+
""".trimIndent(),
110+
)
111+
112+
cleanMavenLocal()
113+
104114
run(
105115
name = "Execute the script using bindings but without dependency on library",
106116
command = """

.github/workflows/bindings-server.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,22 @@ jobs:
6565
name: 'Clean Maven Local to fetch required POMs again'
6666
run: 'rm -rf ~/.m2/repository/'
6767
- id: 'step-9'
68+
name: 'Execute the script using the bindings from the server with v2 route'
69+
run: |-
70+
mv .github/workflows/test-script-consuming-jit-bindings-v2.main.do-not-compile.kts .github/workflows/test-script-consuming-jit-bindings-v2.main.kts
71+
.github/workflows/test-script-consuming-jit-bindings-v2.main.kts
72+
- id: 'step-10'
73+
name: 'Clean Maven Local to fetch required POMs again'
74+
run: 'rm -rf ~/.m2/repository/'
75+
- id: 'step-11'
6876
name: 'Execute the script using bindings but without dependency on library'
6977
run: |-
7078
mv .github/workflows/test-served-bindings-depend-on-library.main.do-not-compile.kts .github/workflows/test-served-bindings-depend-on-library.main.kts
7179
.github/workflows/test-served-bindings-depend-on-library.main.kts
72-
- id: 'step-10'
80+
- id: 'step-12'
7381
name: 'Fetch maven-metadata.xml for top-level action'
7482
run: 'curl --fail http://localhost:8080/actions/checkout/maven-metadata.xml | grep ''<version>v4</version>'''
75-
- id: 'step-11'
83+
- id: 'step-13'
7684
name: 'Fetch maven-metadata.xml for nested action'
7785
run: 'curl --fail http://localhost:8080/actions/cache__save/maven-metadata.xml | grep ''<version>v4</version>'''
7886
deploy:

.github/workflows/test-script-consuming-jit-bindings-v1.main.do-not-compile.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env kotlin
22
@file:Repository("https://repo.maven.apache.org/maven2/")
3-
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:1.13.0")
3+
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:3.0.0")
44

55
@file:Repository("http://localhost:8080/v1")
66

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env kotlin
2+
@file:Repository("https://repo.maven.apache.org/maven2/")
3+
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:3.0.0")
4+
5+
@file:Repository("http://localhost:8080/v2")
6+
7+
// Regular, top-level action.
8+
@file:DependsOn("actions:checkout:v4")
9+
10+
// Nested action.
11+
@file:DependsOn("gradle:actions__setup-gradle:v3")
12+
13+
// Using specific version.
14+
@file:DependsOn("actions:cache:v3.3.3")
15+
16+
// Always untyped action.
17+
@file:DependsOn("typesafegithub:always-untyped-action-for-tests:v1")
18+
19+
import io.github.typesafegithub.workflows.actions.actions.Cache
20+
import io.github.typesafegithub.workflows.actions.actions.Checkout
21+
import io.github.typesafegithub.workflows.actions.actions.Checkout_Untyped
22+
import io.github.typesafegithub.workflows.actions.gradle.ActionsSetupGradle
23+
import io.github.typesafegithub.workflows.actions.typesafegithub.AlwaysUntypedActionForTests_Untyped
24+
25+
println(Checkout_Untyped(fetchTags_Untyped = "false"))
26+
println(Checkout(fetchTags = false))
27+
println(Checkout(fetchTags_Untyped = "false"))
28+
println(AlwaysUntypedActionForTests_Untyped(foobar_Untyped = "baz"))
29+
println(ActionsSetupGradle())
30+
println(Cache(path = listOf("some-path"), key = "some-key"))
31+
32+
// Ensure that 'copy(...)' method is exposed.
33+
Checkout(fetchTags = false).copy(fetchTags = true)

.github/workflows/test-script-consuming-jit-bindings.main.do-not-compile.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env kotlin
22
@file:Repository("https://repo.maven.apache.org/maven2/")
3-
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:1.13.0")
3+
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:3.0.0")
44

55
@file:Repository("http://localhost:8080")
66

action-binding-generator/api/action-binding-generator.api

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ public abstract interface class io/github/typesafegithub/workflows/actionbinding
181181

182182
public final class io/github/typesafegithub/workflows/actionbindinggenerator/versioning/BindingVersion : java/lang/Enum {
183183
public static final field V1 Lio/github/typesafegithub/workflows/actionbindinggenerator/versioning/BindingVersion;
184+
public static final field V2 Lio/github/typesafegithub/workflows/actionbindinggenerator/versioning/BindingVersion;
184185
public static fun getEntries ()Lkotlin/enums/EnumEntries;
185186
public final fun getLibraryVersion ()Ljava/lang/String;
186187
public final fun isDeprecated ()Z

action-binding-generator/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ dependencies {
1616
implementation("com.charleskorn.kaml:kaml:0.61.0")
1717
implementation(projects.sharedInternal)
1818

19+
testImplementation("io.kotest:kotest-framework-datatest")
20+
testImplementation(kotlin("reflect"))
1921
testImplementation(projects.githubWorkflowsKt)
2022
}
2123

0 commit comments

Comments
 (0)