diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8049c68..ae04661 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/plugin/src/functionalTest/groovy/io/noumenal/FunctionalTest.groovy b/plugin/src/functionalTest/groovy/io/noumenal/FunctionalTest.groovy index 10bae61..2f9802d 100644 --- a/plugin/src/functionalTest/groovy/io/noumenal/FunctionalTest.groovy +++ b/plugin/src/functionalTest/groovy/io/noumenal/FunctionalTest.groovy @@ -46,8 +46,8 @@ class FunctionalTest extends Specification { | database = 'devops' | schema = 'gradle' | publishUrl = 's3://nio-maven-test' - |version='0.1.0' |} + |version='0.1.0' |""".stripMargin()) } @@ -81,12 +81,6 @@ class FunctionalTest extends Specification { def "snowflakePublish task"() { given: taskName = 'snowflakePublish' -// settingsFile << "" -// buildFile << """ -// |plugins { -// | id('io.noumenal.gradle.snowflake') -// |} -// |""".stripMargin() when: result = executeSingleTask(taskName, ['-Si']) diff --git a/plugin/src/main/groovy/io/noumenal/SnowflakePublish.groovy b/plugin/src/main/groovy/io/noumenal/SnowflakePublish.groovy index 087f364..3520f3a 100644 --- a/plugin/src/main/groovy/io/noumenal/SnowflakePublish.groovy +++ b/plugin/src/main/groovy/io/noumenal/SnowflakePublish.groovy @@ -8,6 +8,7 @@ import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.Input import org.gradle.api.tasks.Internal import org.gradle.api.tasks.Optional +import org.gradle.api.tasks.OutputFile import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.options.Option @@ -114,6 +115,9 @@ class SnowflakePublish extends DefaultTask { return session } + @OutputFile + File output = project.file("${project.buildDir}/${PLUGIN}/output.txt") + String getImports(Session session) { String basePath = "@${stage}/${extension.groupId.replace('.', '/')}/${extension.artifactId}/${project.version}" //log.warn "basePath: $basePath" @@ -157,9 +161,12 @@ class SnowflakePublish extends DefaultTask { // create snowflake application // automatically create application spec objects + output.write("Snowflake Application:\n\n") project."$PLUGIN".applications.each { ApplicationContainer app -> String createText = app.getCreate(getImports(session)) - log.warn "Deploying ==> \n$createText" + String message = "Deploying ==> \n$createText" + log.warn message + output.append("$message\n") session.jdbcConnection().createStatement().execute(createText) } session.close() diff --git a/plugin/src/test/groovy/io/noumenal/PluginTest.groovy b/plugin/src/test/groovy/io/noumenal/PluginTest.groovy index ee83011..bf62c3d 100644 --- a/plugin/src/test/groovy/io/noumenal/PluginTest.groovy +++ b/plugin/src/test/groovy/io/noumenal/PluginTest.groovy @@ -19,7 +19,6 @@ class PluginTest extends Specification { project.plugins.apply("io.noumenal.gradle.snowflake") then: - //project.tasks.findByName("snowflakePublish") != null - 1 == 1 + project.tasks.findByName("shadowJar") != null } }