Skip to content

Commit

Permalink
Merge pull request #9 from noumenalio/develop
Browse files Browse the repository at this point in the history
SnowflakePublish not caches.
  • Loading branch information
stewartbryson authored Aug 13, 2022
2 parents ffb3c5b + fd60dde commit aae030c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down Expand Up @@ -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'])
Expand Down
9 changes: 8 additions & 1 deletion plugin/src/main/groovy/io/noumenal/SnowflakePublish.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 1 addition & 2 deletions plugin/src/test/groovy/io/noumenal/PluginTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit aae030c

Please sign in to comment.