From 39ae6af7a1f69de6d77903660ea2adac4286caba Mon Sep 17 00:00:00 2001 From: stewartbryson Date: Wed, 20 Mar 2024 14:18:52 -0400 Subject: [PATCH 1/4] Fixes #114. --- .gitignore | 3 +++ plugin/build.gradle | 2 +- .../groovy/io/github/stewartbryson/EphemeralTest.groovy | 1 + .../groovy/io/github/stewartbryson/GroovyTest.groovy | 1 + .../groovy/io/github/stewartbryson/JavaTest.groovy | 2 ++ .../groovy/io/github/stewartbryson/KotlinTest.groovy | 1 + .../groovy/io/github/stewartbryson/ScalaTest.groovy | 1 + .../groovy/io/github/stewartbryson/JavaAmazonTest.groovy | 1 + .../groovy/io/github/stewartbryson/JavaGoogleTest.groovy | 1 + .../io/github/stewartbryson/ApplicationContainer.groovy | 5 +++++ .../test/groovy/io/github/stewartbryson/BuildTest.groovy | 1 + .../groovy/io/github/stewartbryson/GradleSpec.groovy | 2 +- src/examples/groovy/build.gradle | 3 ++- src/examples/java-external-stage/build.gradle | 3 ++- src/examples/java-testing/build.gradle | 3 ++- src/examples/java/build.gradle | 3 ++- src/examples/kotlin/build.gradle | 3 ++- src/examples/scala/build.gradle | 3 ++- src/markdown/README.md | 9 +++++++++ 19 files changed, 40 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index cb402dc..9312a47 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,6 @@ bin/ # Ignore google auth files gha-creds-*.json + +# downloaded libs +lib/ diff --git a/plugin/build.gradle b/plugin/build.gradle index 9a52b32..352a86b 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -9,7 +9,7 @@ plugins { java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(17) } } diff --git a/plugin/src/functionalTest/groovy/io/github/stewartbryson/EphemeralTest.groovy b/plugin/src/functionalTest/groovy/io/github/stewartbryson/EphemeralTest.groovy index 319fd23..a75ffe5 100644 --- a/plugin/src/functionalTest/groovy/io/github/stewartbryson/EphemeralTest.groovy +++ b/plugin/src/functionalTest/groovy/io/github/stewartbryson/EphemeralTest.groovy @@ -21,6 +21,7 @@ class EphemeralTest extends GradleSpec { | add_numbers { | inputs = ["a integer", "b integer"] | returns = "string" + | runtime = '17' | handler = "Sample.addNum" | } | } diff --git a/plugin/src/functionalTest/groovy/io/github/stewartbryson/GroovyTest.groovy b/plugin/src/functionalTest/groovy/io/github/stewartbryson/GroovyTest.groovy index 5a8a796..6bfcb82 100644 --- a/plugin/src/functionalTest/groovy/io/github/stewartbryson/GroovyTest.groovy +++ b/plugin/src/functionalTest/groovy/io/github/stewartbryson/GroovyTest.groovy @@ -24,6 +24,7 @@ class GroovyTest extends GradleSpec { | add_numbers { | inputs = ["a integer", "b integer"] | returns = "string" + | runtime = '17' | handler = "Sample.addNum" | } | } diff --git a/plugin/src/functionalTest/groovy/io/github/stewartbryson/JavaTest.groovy b/plugin/src/functionalTest/groovy/io/github/stewartbryson/JavaTest.groovy index 6e55565..b2859da 100644 --- a/plugin/src/functionalTest/groovy/io/github/stewartbryson/JavaTest.groovy +++ b/plugin/src/functionalTest/groovy/io/github/stewartbryson/JavaTest.groovy @@ -21,6 +21,7 @@ class JavaTest extends GradleSpec { | add_numbers { | inputs = ["a integer", "b integer"] | returns = "string" + | runtime = '17' | handler = "Sample.addNum" | } | } @@ -84,6 +85,7 @@ class JavaTest extends GradleSpec { | add_numbers { | inputs = ["a integer", "b integer"] | returns = "string" + | runtime = '17' | handler = "Sample.addNum" | immutable = true | } diff --git a/plugin/src/functionalTest/groovy/io/github/stewartbryson/KotlinTest.groovy b/plugin/src/functionalTest/groovy/io/github/stewartbryson/KotlinTest.groovy index 17cfcaa..a0fec2b 100644 --- a/plugin/src/functionalTest/groovy/io/github/stewartbryson/KotlinTest.groovy +++ b/plugin/src/functionalTest/groovy/io/github/stewartbryson/KotlinTest.groovy @@ -21,6 +21,7 @@ class KotlinTest extends GradleSpec { | add_numbers { | inputs = ["a integer", "b integer"] | returns = "string" + | runtime = '17' | handler = "Sample.addNum" | } | } diff --git a/plugin/src/functionalTest/groovy/io/github/stewartbryson/ScalaTest.groovy b/plugin/src/functionalTest/groovy/io/github/stewartbryson/ScalaTest.groovy index 1cf3fc0..3ea7c7e 100644 --- a/plugin/src/functionalTest/groovy/io/github/stewartbryson/ScalaTest.groovy +++ b/plugin/src/functionalTest/groovy/io/github/stewartbryson/ScalaTest.groovy @@ -24,6 +24,7 @@ class ScalaTest extends GradleSpec { | add_numbers { | inputs = ["a integer", "b integer"] | returns = "string" + | runtime = '17' | handler = "Sample.addNum" | } | } diff --git a/plugin/src/integrationTest/groovy/io/github/stewartbryson/JavaAmazonTest.groovy b/plugin/src/integrationTest/groovy/io/github/stewartbryson/JavaAmazonTest.groovy index eb85214..e3781ba 100644 --- a/plugin/src/integrationTest/groovy/io/github/stewartbryson/JavaAmazonTest.groovy +++ b/plugin/src/integrationTest/groovy/io/github/stewartbryson/JavaAmazonTest.groovy @@ -30,6 +30,7 @@ class JavaAmazonTest extends GradleSpec { | add_numbers { | inputs = ["a integer", "b integer"] | returns = "string" + | runtme = '17' | handler = "Sample.addNum" | } | } diff --git a/plugin/src/integrationTest/groovy/io/github/stewartbryson/JavaGoogleTest.groovy b/plugin/src/integrationTest/groovy/io/github/stewartbryson/JavaGoogleTest.groovy index 98347d1..426b997 100644 --- a/plugin/src/integrationTest/groovy/io/github/stewartbryson/JavaGoogleTest.groovy +++ b/plugin/src/integrationTest/groovy/io/github/stewartbryson/JavaGoogleTest.groovy @@ -31,6 +31,7 @@ class JavaGoogleTest extends GradleSpec { | add_numbers { | inputs = ["a integer", "b integer"] | returns = "string" + | runtime = '17' | handler = "Sample.addNum" | } | } diff --git a/plugin/src/main/groovy/io/github/stewartbryson/ApplicationContainer.groovy b/plugin/src/main/groovy/io/github/stewartbryson/ApplicationContainer.groovy index 95f2bca..62d2a42 100644 --- a/plugin/src/main/groovy/io/github/stewartbryson/ApplicationContainer.groovy +++ b/plugin/src/main/groovy/io/github/stewartbryson/ApplicationContainer.groovy @@ -30,6 +30,10 @@ class ApplicationContainer { * The 'language' property of the UDF. DEFAULT: 'JAVA'. */ String language = 'JAVA' + /** + * The Java runtime version. DEFAULT: '11'. + */ + String runtime = '11' /** * The 'handler' property of the UDF. */ @@ -49,6 +53,7 @@ class ApplicationContainer { | returns $returns | language $language ${immutable ? "\n IMMUTABLE" : ""} | handler = '$handler' + | runtime_version = '$runtime' | imports = ($imports) |""".stripMargin() } diff --git a/plugin/src/test/groovy/io/github/stewartbryson/BuildTest.groovy b/plugin/src/test/groovy/io/github/stewartbryson/BuildTest.groovy index 8d64e5d..aaa928c 100644 --- a/plugin/src/test/groovy/io/github/stewartbryson/BuildTest.groovy +++ b/plugin/src/test/groovy/io/github/stewartbryson/BuildTest.groovy @@ -24,6 +24,7 @@ class BuildTest extends GradleSpec { | add_numbers { | inputs = ["a integer", "b integer"] | returns = "string" + | runtime = '17' | handler = "Sample.addNum" | } | } diff --git a/plugin/src/test/groovy/io/github/stewartbryson/GradleSpec.groovy b/plugin/src/test/groovy/io/github/stewartbryson/GradleSpec.groovy index 09f8dcb..09a061c 100644 --- a/plugin/src/test/groovy/io/github/stewartbryson/GradleSpec.groovy +++ b/plugin/src/test/groovy/io/github/stewartbryson/GradleSpec.groovy @@ -62,7 +62,7 @@ class GradleSpec extends Specification { |} |java { | toolchain { - | languageVersion = JavaLanguageVersion.of(11) + | languageVersion = JavaLanguageVersion.of(17) | } |} |repositories { diff --git a/src/examples/groovy/build.gradle b/src/examples/groovy/build.gradle index d2e95f6..7feef64 100644 --- a/src/examples/groovy/build.gradle +++ b/src/examples/groovy/build.gradle @@ -13,7 +13,7 @@ dependencies { java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(17) } } @@ -24,6 +24,7 @@ snowflake { add_numbers { inputs = ["a integer", "b integer"] returns = "string" + runtime = '17' handler = "Sample.addNum" } } diff --git a/src/examples/java-external-stage/build.gradle b/src/examples/java-external-stage/build.gradle index 4f50fd1..575c613 100644 --- a/src/examples/java-external-stage/build.gradle +++ b/src/examples/java-external-stage/build.gradle @@ -9,7 +9,7 @@ repositories { java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(17) } } @@ -22,6 +22,7 @@ snowflake { add_numbers { inputs = ["a integer", "b integer"] returns = "string" + runtime = '17' handler = "Sample.addNum" } } diff --git a/src/examples/java-testing/build.gradle b/src/examples/java-testing/build.gradle index 18c6e0c..07ae086 100644 --- a/src/examples/java-testing/build.gradle +++ b/src/examples/java-testing/build.gradle @@ -13,7 +13,7 @@ repositories { java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(17) } } @@ -27,6 +27,7 @@ snowflake { add_numbers { inputs = ["a integer", "b integer"] returns = "string" + runtime = '17' handler = "Sample.addNum" } } diff --git a/src/examples/java/build.gradle b/src/examples/java/build.gradle index 51e80b6..2449da5 100644 --- a/src/examples/java/build.gradle +++ b/src/examples/java/build.gradle @@ -9,7 +9,7 @@ repositories { java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(17) } } @@ -20,6 +20,7 @@ snowflake { add_numbers { inputs = ["a integer", "b integer"] returns = "string" + runtime = '17' handler = "Sample.addNum" } } diff --git a/src/examples/kotlin/build.gradle b/src/examples/kotlin/build.gradle index 868f96a..72e3183 100644 --- a/src/examples/kotlin/build.gradle +++ b/src/examples/kotlin/build.gradle @@ -9,7 +9,7 @@ repositories { java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(17) } } @@ -20,6 +20,7 @@ snowflake { add_numbers { inputs = ["a integer", "b integer"] returns = "string" + runtime = '17' handler = "Sample.addNum" } } diff --git a/src/examples/scala/build.gradle b/src/examples/scala/build.gradle index e240800..00b6be6 100644 --- a/src/examples/scala/build.gradle +++ b/src/examples/scala/build.gradle @@ -14,7 +14,7 @@ dependencies { java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(17) } } @@ -25,6 +25,7 @@ snowflake { add_numbers { inputs = ["a integer", "b integer"] returns = "string" + runtime = '17' handler = "Sample.addNum" } } diff --git a/src/markdown/README.md b/src/markdown/README.md index d9ef681..f926a2c 100644 --- a/src/markdown/README.md +++ b/src/markdown/README.md @@ -112,6 +112,7 @@ snowflake { add_numbers { inputs = ["a integer", "b integer"] returns = "string" + runtime = '17' handler = "Sample.addNum" } } @@ -144,6 +145,7 @@ CREATE OR REPLACE function add_numbers (a integer, b integer) returns string language JAVA handler = 'Sample.addNum' + runtime_version = '17' imports = ('@upload/libs/java-0.1.0-all.jar') ``` @@ -163,6 +165,7 @@ CREATE OR REPLACE function add_numbers (a integer, b integer) returns string language JAVA handler = 'Sample.addNum' + runtime_version = '17' imports = ('@upload/libs/java-0.1.0-all.jar') @@ -367,6 +370,7 @@ CREATE OR REPLACE function add_numbers (a integer, b integer) returns string language JAVA handler = 'Sample.addNum' + runtime_version = '17' imports = ('@upload/libs/java-testing-0.1.0-all.jar') @@ -411,6 +415,7 @@ snowflake { add_numbers { inputs = ["a integer", "b integer"] returns = "string" + runtime = '17' handler = "Sample.addNum" } } @@ -465,6 +470,7 @@ CREATE OR REPLACE function add_numbers (a integer, b integer) returns string language JAVA handler = 'Sample.addNum' + runtime_version = '17' imports = ('@upload/libs/java-testing-0.1.0-all.jar') @@ -504,6 +510,7 @@ CREATE OR REPLACE function add_numbers (a integer, b integer) returns string language JAVA handler = 'Sample.addNum' + runtime_version = '17' imports = ('@upload/libs/java-testing-0.1.0-all.jar') @@ -543,6 +550,7 @@ snowflake { add_numbers { inputs = ["a integer", "b integer"] returns = "string" + runtime = '17' handler = "Sample.addNum" } } @@ -621,6 +629,7 @@ CREATE OR REPLACE function add_numbers (a integer, b integer) returns string language JAVA handler = 'Sample.addNum' + runtime_version = '17' imports = ('@s3_maven/io/github/stewartbryson/sample-udfs/0.1.0/sample-udfs-0.1.0-all.jar') From 79fc0eca9e5d710fe1906d9ef9c344baf48ca51f Mon Sep 17 00:00:00 2001 From: stewartbryson Date: Wed, 20 Mar 2024 16:53:27 -0400 Subject: [PATCH 2/4] Fixes #114. --- .../groovy/io/github/stewartbryson/JavaAmazonTest.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/src/integrationTest/groovy/io/github/stewartbryson/JavaAmazonTest.groovy b/plugin/src/integrationTest/groovy/io/github/stewartbryson/JavaAmazonTest.groovy index e3781ba..8019e2d 100644 --- a/plugin/src/integrationTest/groovy/io/github/stewartbryson/JavaAmazonTest.groovy +++ b/plugin/src/integrationTest/groovy/io/github/stewartbryson/JavaAmazonTest.groovy @@ -30,7 +30,7 @@ class JavaAmazonTest extends GradleSpec { | add_numbers { | inputs = ["a integer", "b integer"] | returns = "string" - | runtme = '17' + | runtime = '17' | handler = "Sample.addNum" | } | } From a498ea73385cfccdcaa8dff2b1441a7714055c4f Mon Sep 17 00:00:00 2001 From: stewartbryson Date: Wed, 20 Mar 2024 17:02:23 -0400 Subject: [PATCH 3/4] Fixes #114. --- examples/groovy/build.gradle | 3 ++- examples/java-external-stage/build.gradle | 3 ++- examples/java-testing/build.gradle | 5 +++-- examples/java/build.gradle | 3 ++- examples/kotlin/build.gradle | 3 ++- examples/scala/build.gradle | 5 +++-- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/examples/groovy/build.gradle b/examples/groovy/build.gradle index 93db20f..653aa83 100644 --- a/examples/groovy/build.gradle +++ b/examples/groovy/build.gradle @@ -13,7 +13,7 @@ dependencies { java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(17) } } @@ -24,6 +24,7 @@ snowflake { add_numbers { inputs = ["a integer", "b integer"] returns = "string" + runtime = '17' handler = "Sample.addNum" } } diff --git a/examples/java-external-stage/build.gradle b/examples/java-external-stage/build.gradle index 3f6cd65..022b3d2 100644 --- a/examples/java-external-stage/build.gradle +++ b/examples/java-external-stage/build.gradle @@ -9,7 +9,7 @@ repositories { java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(17) } } @@ -22,6 +22,7 @@ snowflake { add_numbers { inputs = ["a integer", "b integer"] returns = "string" + runtime = '17' handler = "Sample.addNum" } } diff --git a/examples/java-testing/build.gradle b/examples/java-testing/build.gradle index d10a299..8566235 100644 --- a/examples/java-testing/build.gradle +++ b/examples/java-testing/build.gradle @@ -3,7 +3,7 @@ plugins { id 'groovy' // needed for Spock testing framework id 'io.github.stewartbryson.snowflake' version '2.1.11' id 'com.adarshr.test-logger' version '4.0.0' // added for testing - id 'com.github.ben-manes.versions' version '0.50.0' + id 'com.github.ben-manes.versions' version '0.51.0' } repositories { @@ -13,7 +13,7 @@ repositories { java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(17) } } @@ -27,6 +27,7 @@ snowflake { add_numbers { inputs = ["a integer", "b integer"] returns = "string" + runtime = '17' handler = "Sample.addNum" } } diff --git a/examples/java/build.gradle b/examples/java/build.gradle index 7b5f209..d7246c7 100644 --- a/examples/java/build.gradle +++ b/examples/java/build.gradle @@ -9,7 +9,7 @@ repositories { java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(17) } } @@ -20,6 +20,7 @@ snowflake { add_numbers { inputs = ["a integer", "b integer"] returns = "string" + runtime = '17' handler = "Sample.addNum" } } diff --git a/examples/kotlin/build.gradle b/examples/kotlin/build.gradle index 31b0f94..a6ed428 100644 --- a/examples/kotlin/build.gradle +++ b/examples/kotlin/build.gradle @@ -9,7 +9,7 @@ repositories { java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(17) } } @@ -20,6 +20,7 @@ snowflake { add_numbers { inputs = ["a integer", "b integer"] returns = "string" + runtime = '17' handler = "Sample.addNum" } } diff --git a/examples/scala/build.gradle b/examples/scala/build.gradle index 5c379cd..a4f8f11 100644 --- a/examples/scala/build.gradle +++ b/examples/scala/build.gradle @@ -1,6 +1,6 @@ plugins { id 'scala' - id 'com.github.ben-manes.versions' version '0.50.0' + id 'com.github.ben-manes.versions' version '0.51.0' id 'io.github.stewartbryson.snowflake' version '2.1.11' } @@ -14,7 +14,7 @@ dependencies { java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(17) } } @@ -25,6 +25,7 @@ snowflake { add_numbers { inputs = ["a integer", "b integer"] returns = "string" + runtime = '17' handler = "Sample.addNum" } } From 2e3c139865cddbf5619dcf831a64007e1ca48751 Mon Sep 17 00:00:00 2001 From: stewartbryson Date: Wed, 20 Mar 2024 17:21:15 -0400 Subject: [PATCH 4/4] Fixes #114. --- plugin/build.gradle | 6 +++--- src/examples/groovy/build.gradle | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/build.gradle b/plugin/build.gradle index 352a86b..14253e4 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -14,9 +14,9 @@ java { } dependencies { - implementation 'org.codehaus.groovy:groovy:3.0.20' + implementation 'org.codehaus.groovy:groovy:3.0.21' implementation 'org.slf4j:slf4j-simple:2.0.9' - implementation 'com.snowflake:snowpark:1.10.0' + implementation 'com.snowflake:snowpark:1.11.0' implementation 'gradle.plugin.com.redpillanalytics:gradle-properties:1.0.7' implementation 'gradle.plugin.com.github.johnrengelman:shadow:8.0.0' implementation 'org.apache.commons:commons-lang3:3.14.0' @@ -32,7 +32,7 @@ testing { useSpock('2.3-groovy-3.0') dependencies { implementation project() - implementation 'com.snowflake:snowpark:1.10.0' + implementation 'com.snowflake:snowpark:1.11.0' implementation 'org.apache.commons:commons-lang3:3.14.0' } } diff --git a/src/examples/groovy/build.gradle b/src/examples/groovy/build.gradle index 7feef64..2e876e1 100644 --- a/src/examples/groovy/build.gradle +++ b/src/examples/groovy/build.gradle @@ -8,7 +8,7 @@ repositories { } dependencies { - implementation 'org.codehaus.groovy:groovy:3.0.20' + implementation 'org.codehaus.groovy:groovy:3.0.21' } java {