You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2019/11/04 16:10:43 UTC

[camel-k] 19/38: feat(quarkus): Rely on Build runtime properties to source dependencies versions

This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 8e62c2584fbd97e0410862c9cc071e10c0516b6f
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Thu Oct 24 12:21:41 2019 +0200

    feat(quarkus): Rely on Build runtime properties to source dependencies versions
---
 pkg/builder/runtime/main.go      |  4 ++--
 pkg/builder/runtime/main_test.go |  4 ++++
 pkg/builder/runtime/quarkus.go   | 16 +++++++---------
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/pkg/builder/runtime/main.go b/pkg/builder/runtime/main.go
index 03fddda..e525cc7 100644
--- a/pkg/builder/runtime/main.go
+++ b/pkg/builder/runtime/main.go
@@ -60,14 +60,14 @@ func generateProject(ctx *builder.Context) error {
 	p.DependencyManagement.Dependencies = append(p.DependencyManagement.Dependencies, maven.Dependency{
 		GroupID:    "org.apache.camel",
 		ArtifactID: "camel-bom",
-		Version:    ctx.Catalog.Version,
+		Version:    ctx.Build.CamelVersion,
 		Type:       "pom",
 		Scope:      "import",
 	})
 	p.DependencyManagement.Dependencies = append(p.DependencyManagement.Dependencies, maven.Dependency{
 		GroupID:    "org.apache.camel.k",
 		ArtifactID: "camel-k-runtime-bom",
-		Version:    ctx.Catalog.RuntimeVersion,
+		Version:    ctx.Build.RuntimeVersion,
 		Type:       "pom",
 		Scope:      "import",
 	})
diff --git a/pkg/builder/runtime/main_test.go b/pkg/builder/runtime/main_test.go
index 89c3d56..cbddc8d 100644
--- a/pkg/builder/runtime/main_test.go
+++ b/pkg/builder/runtime/main_test.go
@@ -35,6 +35,7 @@ func TestNewProject(t *testing.T) {
 	ctx := builder.Context{
 		Catalog: catalog,
 		Build: v1alpha1.BuildSpec{
+			CamelVersion:   catalog.Version,
 			RuntimeVersion: catalog.RuntimeVersion,
 			Platform: v1alpha1.IntegrationPlatformSpec{
 				Build: v1alpha1.IntegrationPlatformBuildSpec{
@@ -97,6 +98,7 @@ func TestGenerateJvmProject(t *testing.T) {
 	ctx := builder.Context{
 		Catalog: catalog,
 		Build: v1alpha1.BuildSpec{
+			CamelVersion:   catalog.Version,
 			RuntimeVersion: catalog.RuntimeVersion,
 			Platform: v1alpha1.IntegrationPlatformSpec{
 				Build: v1alpha1.IntegrationPlatformBuildSpec{
@@ -154,6 +156,7 @@ func TestGenerateGroovyProject(t *testing.T) {
 	ctx := builder.Context{
 		Catalog: catalog,
 		Build: v1alpha1.BuildSpec{
+			CamelVersion:   catalog.Version,
 			RuntimeVersion: catalog.RuntimeVersion,
 			Platform: v1alpha1.IntegrationPlatformSpec{
 				Build: v1alpha1.IntegrationPlatformBuildSpec{
@@ -215,6 +218,7 @@ func TestSanitizeDependencies(t *testing.T) {
 	ctx := builder.Context{
 		Catalog: catalog,
 		Build: v1alpha1.BuildSpec{
+			CamelVersion:   catalog.Version,
 			RuntimeVersion: catalog.RuntimeVersion,
 			Platform: v1alpha1.IntegrationPlatformSpec{
 				Build: v1alpha1.IntegrationPlatformBuildSpec{
diff --git a/pkg/builder/runtime/quarkus.go b/pkg/builder/runtime/quarkus.go
index 243f871..f25a2ae 100644
--- a/pkg/builder/runtime/quarkus.go
+++ b/pkg/builder/runtime/quarkus.go
@@ -45,15 +45,14 @@ func generateQuarkusProject(ctx *builder.Context) error {
 		maven.Dependency{
 			GroupID:    "org.apache.camel.quarkus",
 			ArtifactID: "camel-quarkus-bom",
-			Version:    "0.2.0",
-			//Version:    ctx.Catalog.Version,
-			Type:  "pom",
-			Scope: "import",
+			Version:    ctx.Build.RuntimeProvider.Quarkus.CamelQuarkusVersion,
+			Type:       "pom",
+			Scope:      "import",
 		},
 		maven.Dependency{
 			GroupID:    "org.apache.camel.k",
 			ArtifactID: "camel-k-runtime-bom",
-			Version:    ctx.Catalog.RuntimeVersion,
+			Version:    ctx.Build.RuntimeVersion,
 			Type:       "pom",
 			Scope:      "import",
 		},
@@ -64,14 +63,12 @@ func generateQuarkusProject(ctx *builder.Context) error {
 		maven.Plugin{
 			GroupID:    "io.quarkus",
 			ArtifactID: "quarkus-bootstrap-maven-plugin",
-			// TODO: must be the same as the version required by camel-k-runtime
-			Version: "0.21.2",
+			Version:    ctx.Build.RuntimeProvider.Quarkus.QuarkusVersion,
 		},
 		maven.Plugin{
 			GroupID:    "io.quarkus",
 			ArtifactID: "quarkus-maven-plugin",
-			// TODO: must be the same as the version required by camel-k-runtime
-			Version: "0.21.2",
+			Version:    ctx.Build.RuntimeProvider.Quarkus.QuarkusVersion,
 			Executions: []maven.Execution{
 				{
 					Goals: []string{
@@ -104,6 +101,7 @@ func computeQuarkusDependencies(ctx *builder.Context) error {
 	mc.AdditionalArguments = nil
 	mc.AddArguments("quarkus-bootstrap:build-tree")
 	output := new(bytes.Buffer)
+	// TODO: improve logging while capturing output
 	mc.Stdout = output
 	if err := maven.Run(mc); err != nil {
 		return errors.Wrap(err, "failure while determining dependencies")