Skip to content

Commit

Permalink
CAMEL-20888 - Remove Kotlin DSL
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Pupier <apupier@redhat.com>
  • Loading branch information
apupier committed Sep 9, 2024
1 parent fefa0e7 commit 0b347cc
Show file tree
Hide file tree
Showing 21 changed files with 2 additions and 543 deletions.
1 change: 0 additions & 1 deletion docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
** xref:languages/groovy.adoc[Groovy]
** xref:languages/javascript.adoc[Javascript]
** xref:languages/jsh.adoc[JSheel]
** xref:languages/kotlin.adoc[Kotlin]
* xref:configuration/configuration.adoc[Configuration]
** xref:configuration/dependencies.adoc[Dependencies]
** xref:configuration/build-time-properties.adoc[Build time properties]
Expand Down
124 changes: 0 additions & 124 deletions docs/modules/ROOT/pages/languages/kotlin.adoc

This file was deleted.

1 change: 0 additions & 1 deletion docs/modules/ROOT/pages/languages/languages.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Camel K supports multiple languages for writing integrations:
| xref:languages/xml.adoc[XML] | Integrations written in plain XML DSL are supported (Spring XML with <beans> or Blueprint XML with <blueprint> not supported)
| xref:languages/yaml.adoc[YAML] | Integrations written in YAML DSL are supported
| xref:languages/groovy.adoc[Groovy] | Groovy `.groovy` files are supported (experimental)
| xref:languages/kotlin.adoc[Kotlin] | Kotlin Script `.kts` files are supported (experimental)
| xref:languages/jsh.adoc[JShell] | JShell (Java Shell) `.jsh` files are supported (experimental)
| xref:languages/javascript.adoc[JavaScript] | JavaScript `.js` files are supported (experimental)
|=======================
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/troubleshooting/debugging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ As you can see in the logs, the CLI has configured the integration in debug mode

The JVM is suspended and waits for a debugger to attach by default: this behavior can be turned off using the `--suspend=false` option.

Last thing to do is, to start a remote debugger on `localhost:5005` with the **integration file (if using Java, Groovy or Kotlin), the Apache Camel project, or the Camel K Runtime project**, opened on your IDE.
Last thing to do is, to start a remote debugger on `localhost:5005` with the **integration file (if using Java or Groovy), the Apache Camel project, or the Camel K Runtime project**, opened on your IDE.

The following picture shows the configuration of a remote debugger in IntelliJ IDEA:

Expand Down
23 changes: 0 additions & 23 deletions e2e/common/languages/files/kotlin.kts

This file was deleted.

47 changes: 0 additions & 47 deletions e2e/common/languages/kotlin_test.go

This file was deleted.

21 changes: 0 additions & 21 deletions e2e/native/files/Kotlin.kts

This file was deleted.

13 changes: 0 additions & 13 deletions e2e/native/native_with_sources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,5 @@ func TestNativeHighMemoryIntegrations(t *testing.T) {

g.Eventually(IntegrationLogs(t, ctx, ns, name), TestTimeoutShort).Should(ContainSubstring("Groovy Magicstring!"))
})

t.Run("kotlin native support", func(t *testing.T) {
name := RandomizedSuffixName("kotlin-native")
g.Expect(KamelRun(t, ctx, ns, "files/Kotlin.kts", "--name", name, "-t", "quarkus.build-mode=native", "-t", "builder.tasks-limit-memory=quarkus-native:9.5Gi").Execute()).To(Succeed())

g.Eventually(IntegrationPodPhase(t, ctx, ns, name), TestTimeoutVeryLong).Should(Equal(corev1.PodRunning))
g.Eventually(IntegrationPod(t, ctx, ns, name), TestTimeoutShort).
Should(WithTransform(getContainerCommand(), MatchRegexp(".*camel-k-integration-\\d+\\.\\d+\\.\\d+[-A-Za-z]*-runner.*")))
g.Eventually(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutShort).
Should(Equal(corev1.ConditionTrue))

g.Eventually(IntegrationLogs(t, ctx, ns, name), TestTimeoutShort).Should(ContainSubstring("Kotlin Magicstring!"))
})
})
}
3 changes: 0 additions & 3 deletions pkg/apis/camel/v1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,6 @@ const (
LanguageJavaScript Language = "js"
// LanguageXML used for XML.
LanguageXML Language = "xml"
// LanguageKotlin used for Kotlin.
LanguageKotlin Language = "kts"
// LanguageYaml used for YAML.
LanguageYaml Language = "yaml"
// LanguageKamelet used for Kamelets.
Expand All @@ -517,7 +515,6 @@ var Languages = []Language{
LanguageGroovy,
LanguageJavaScript,
LanguageXML,
LanguageKotlin,
LanguageYaml,
LanguageKamelet,
LanguageJavaShell,
Expand Down
1 change: 0 additions & 1 deletion pkg/apis/camel/v1/integration_types_support_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func TestAllLanguages(t *testing.T) {
assert.Contains(t, Languages, LanguageJavaSource)
assert.Contains(t, Languages, LanguageJavaScript)
assert.Contains(t, Languages, LanguageGroovy)
assert.Contains(t, Languages, LanguageKotlin)
assert.Contains(t, Languages, LanguageXML)
assert.Contains(t, Languages, LanguageYaml)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/completion_bash.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ __kamel_dependency_type() {
}
__kamel_languages() {
local type_list="js groovy kotlin java xml"
local type_list="js groovy java xml"
COMPREPLY=( $( compgen -W "${type_list}" -- "$cur") )
}
Expand Down
31 changes: 0 additions & 31 deletions pkg/metadata/metadata_dependencies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,37 +502,6 @@ func TestRestClosureDependencyGroovy(t *testing.T) {
meta.Dependencies.List())
}

func TestRestClosureDependencyKotlin(t *testing.T) {
code := v1.SourceSpec{
DataSpec: v1.DataSpec{
Name: "Request.groovy",
Content: `
rest {
}
from("http:test")
.to("log:info")
`,
},
Language: v1.LanguageKotlin,
}

catalog, err := camel.DefaultCatalog()
require.NoError(t, err)

meta, err := extract(catalog, code)
require.NoError(t, err)

assert.ElementsMatch(
t,
[]string{
"camel:http",
"camel:log",
"mvn:org.apache.camel.quarkus:camel-quarkus-rest",
"mvn:org.apache.camel.quarkus:camel-quarkus-platform-http",
},
meta.Dependencies.List())
}

func TestXMLCircuitBreakerDependency(t *testing.T) {
code := v1.SourceSpec{

Expand Down
38 changes: 0 additions & 38 deletions pkg/metadata/metadata_uri_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,44 +199,6 @@ func TestXml1(t *testing.T) {
assert.Len(t, metadata.ToURIs, 3)
}

func TestKotlin1(t *testing.T) {
source := v1.SourceSpec{
DataSpec: v1.DataSpec{
Name: "test",
Content: `
from( "timer:tick")
.setBody().constant("aa")
.to ("log:info?skipBodyLineSeparator=false").to(
"http://url" )
from("direct:2")
.setBody().constant("aa")
.to("direct:3")
.toD("direct:4")
.toF("direct:%s", 5)
`,
},
Language: v1.LanguageKotlin,
}

catalog, err := camel.DefaultCatalog()
require.NoError(t, err)

metadata, err := extract(catalog, source)
require.NoError(t, err)

assert.Contains(t, metadata.FromURIs, "timer:tick")
assert.Contains(t, metadata.FromURIs, "direct:2")
assert.Len(t, metadata.FromURIs, 2)
assert.Contains(t, metadata.ToURIs, "log:info?skipBodyLineSeparator=false")
assert.Contains(t, metadata.ToURIs, "http://url")
assert.Contains(t, metadata.ToURIs, "direct:3")
assert.Contains(t, metadata.ToURIs, "direct:4")
assert.Contains(t, metadata.ToURIs, "direct:%s") // resolution not supported yet
assert.Len(t, metadata.ToURIs, 5)
}

func TestJavascript1(t *testing.T) {
source := v1.SourceSpec{
DataSpec: v1.DataSpec{
Expand Down
1 change: 0 additions & 1 deletion pkg/platform/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import "strings"
var DefaultKits = []string{
"platform-integration-kit-jvm.yaml",
"platform-integration-kit-groovy.yaml",
"platform-integration-kit-kotlin.yaml",
}

// KnativeKits --.
Expand Down
Loading

0 comments on commit 0b347cc

Please sign in to comment.