Skip to content

Commit

Permalink
Merge pull request #27 from stewartbryson/develop
Browse files Browse the repository at this point in the history
moving everything to stewartbryson
  • Loading branch information
stewartbryson authored Sep 12, 2022
2 parents 0a4df62 + 4d1f4c4 commit cbe757f
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 30 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ It has three basic modes:
2. Slightly heavier publishing using external Snowflake stages and auto-configuration of the [`maven-publish`](https://docs.gradle.org/current/userguide/publishing_maven.html) plugin.
3. Publishing to Snowflake using external stages and custom configuration of the [`maven-publish`](https://docs.gradle.org/current/userguide/publishing_maven.html) plugin.

Have a look at the [API docs](https://s3.amazonaws.com/docs.noumenal.io/gradle-snowflake/latest/io/noumenal/package-summary.html).
Have a look at the [API docs](https://s3.amazonaws.com/stewartbryson.docs/gradle-snowflake/latest/com/github/stewartbryson/package-summary.html).

# Internal Stages using Snowpark
Unless you have a heavy investment in Gradle as an organization, this is likely the option you want to use.
Additionally, if you plan on *sharing* UDFs across Snowflake accounts, this is the option you *have* to use, as JARs need to be in named internal stages.
Look at the [sample project](examples/internal-stage/) and you'll notice a few differences in the [build file](examples/internal-stage/build.gradle). We applied `io.noumenal.gradle.snowflake` and removed `com.github.johnrengelman.shadow` because the `shadow` plugin is automatically applied by the `snowflake` plugin:
Look at the [sample project](examples/internal-stage/) and you'll notice a few differences in the [build file](examples/internal-stage/build.gradle). We applied `com.github.stewartbryson.snowflake` and removed `com.github.johnrengelman.shadow` because the `shadow` plugin is automatically applied by the `snowflake` plugin:

```
plugins {
id 'java'
id 'com.github.ben-manes.versions' version '0.42.0'
id 'io.noumenal.gradle.snowflake' version '0.1.11'
id 'com.github.stewartbryson.snowflake' version '0.1.11'
}
```

Expand All @@ -45,7 +45,7 @@ Path
:snowflakePublish
Type
SnowflakePublish (io.noumenal.SnowflakePublish)
SnowflakePublish (com.github.stewartbryson.SnowflakePublish)
Options
--account Override the URL of the Snowflake account.
Expand Down Expand Up @@ -77,7 +77,7 @@ BUILD SUCCESSFUL in 597ms
```

Several command-line options mention _overriding_ other configuration values.
This is because the plugin also provides a configuration closure called `snowflake` that we can use to configure our build, all of which are documented in the [class API](https://s3.amazonaws.com/docs.noumenal.io/gradle-snowflake/latest/io/noumenal/SnowflakeExtension.html):
This is because the plugin also provides a configuration closure called `snowflake` that we can use to configure our build, all of which are documented in the [class API](https://s3.amazonaws.com/stewartbryson.docs/gradle-snowflake/latest/com/github/stewartbryson/SnowflakeExtension.html):

```
snowflake {
Expand Down Expand Up @@ -109,7 +109,7 @@ snowflake.user = myusername
snowflake.password = mypassword
```

The nested [`applications` closure](https://s3.amazonaws.com/docs.noumenal.io/gradle-snowflake/latest/io/noumenal/ApplicationContainer.html) might seem a bit more daunting.
The nested [`applications` closure](https://s3.amazonaws.com/stewartbryson.docs/gradle-snowflake/latest/com/github/stewartbryson/ApplicationContainer.html) might seem a bit more daunting.
This is a simple way to use DSL to configure all the different UDFs we want to automatically create (or recreate) each time we publish the JAR file.
The example above will generate and execute the statement:

Expand Down Expand Up @@ -162,7 +162,7 @@ Gradle has [built-in support](https://docs.gradle.org/current/userguide/declarin
Looking at the [sample project](examples/external-stage/), notice we've populated a few additional properties:

```
groupId = 'io.noumenal'
groupId = 'com.github.stewartbryson'
artifactId = 'sample-udfs'
```

Expand Down Expand Up @@ -226,7 +226,7 @@ CREATE OR REPLACE function add_numbers (a integer, b integer)
returns string
language JAVA
handler = 'Sample.addNum'
imports = ('@maven/io/noumenal/sample-udfs/0.1.0/sample-udfs-0.1.0-all.jar')
imports = ('@maven/com/github/stewartbryson/sample-udfs/0.1.0/sample-udfs-0.1.0-all.jar')
BUILD SUCCESSFUL in 12s
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

allprojects {
group = 'io.noumenal'
group = 'com.github.stewartbryson'

repositories {
mavenCentral()
Expand All @@ -30,7 +30,7 @@ scmVersion {

githubRelease {
token project.findProperty('githubToken').toString()
owner 'noumenalio'
owner 'stewartbryson'
repo rootProject.name
overwrite true
generateReleaseNotes true
Expand Down
4 changes: 2 additions & 2 deletions examples/external-stage/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java'
id 'com.github.ben-manes.versions' version '0.42.0'
id 'io.noumenal.gradle.snowflake' version '0.2.4'
id 'com.github.stewartbryson.snowflake.snowflake' version '0.2.4'
}

repositories {
Expand Down Expand Up @@ -29,7 +29,7 @@ snowflake {
database = 'stewart_db'
schema = 'developer'
stage = 'maven'
groupId = 'io.noumenal'
groupId = 'com.github.stewartbryson'
artifactId = 'sample-udfs'
applications {
add_numbers {
Expand Down
2 changes: 1 addition & 1 deletion examples/external-stage/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pluginManagement {
repositories {
maven {
url "s3://nio-maven"
url "s3://stewartbryson.maven"
authentication {
awsIm(AwsImAuthentication)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/internal-stage/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java'
id 'com.github.ben-manes.versions' version '0.42.0'
id 'io.noumenal.gradle.snowflake' version '0.2.4'
id 'com.github.stewartbryson.snowflake' version '0.2.4'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/internal-stage/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pluginManagement {
repositories {
maven {
url "s3://nio-maven"
url "s3://stewartbryson.maven"
authentication {
awsIm(AwsImAuthentication)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-jar/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pluginManagement {
repositories {
maven {
url "s3://nio-maven"
url "s3://stewartbryson.maven"
authentication {
awsIm(AwsImAuthentication)
}
Expand Down
12 changes: 6 additions & 6 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ testing {

pluginBundle {
description = 'Simplifies publishing UDFs to Snowflake. Supports internal stages using Snowpark, or external stages with maven-publish.'
website = 'http://noumenal.io/'
vcsUrl = 'https://github.com/noumenalio/gradle-snowflake'
website = 'https://github.com/stewartbryson/gradle-snowflake'
vcsUrl = 'https://github.com/stewartbryson/gradle-snowflake'
tags = ['snowflake', 'snowpark', 'dataops', 'udf']
}

gradlePlugin {
// Define the plugin
plugins {
snowflake {
id = 'io.noumenal.gradle.snowflake'
id = 'com.github.stewartbryson.snowflake'
displayName = 'Snowflake Plugin'
implementationClass = 'io.noumenal.SnowflakePlugin'
implementationClass = 'com.github.stewartbryson.SnowflakePlugin'
}
}
}
Expand All @@ -81,7 +81,7 @@ publishing {
repositories {
maven {
name 's3'
url 's3://nio-maven'
url 's3://stewartbryson.maven'
authentication {
awsIm(AwsImAuthentication)
}
Expand All @@ -90,7 +90,7 @@ publishing {
}

s3 {
bucket = 'docs.noumenal.io'
bucket = 'stewartbryson.docs'
region = 'us-east-1'
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This Groovy source file was generated by the Gradle 'init' task.
*/
package io.noumenal
package com.github.stewartbryson

import groovy.util.logging.Slf4j
import spock.lang.Shared
Expand All @@ -10,7 +10,7 @@ import spock.lang.TempDir
import org.gradle.testkit.runner.GradleRunner

/**
* A simple functional test for the 'io.noumenal.gradle.snowflake' plugin.
* A simple functional test for the 'com.github.stewartbryson.snowflake' plugin.
*/
@Slf4j
class JavaTest extends Specification {
Expand Down Expand Up @@ -47,7 +47,7 @@ class JavaTest extends Specification {
buildFile = new File(projectDir, 'build.gradle')
buildFile.write("""
|plugins {
| id 'io.noumenal.gradle.snowflake'
| id 'com.github.stewartbryson.snowflake'
| id 'java'
|}
|java {
Expand All @@ -56,7 +56,7 @@ class JavaTest extends Specification {
| }
|}
|snowflake {
| groupId = 'io.noumenal'
| groupId = 'com.github.stewartbryson'
| artifactId = 'test-gradle-snowflake'
| role = '$role'
| database = '$database'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.noumenal
package com.github.stewartbryson

import groovy.util.logging.Slf4j

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.noumenal
package com.github.stewartbryson

import org.gradle.api.Project
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.noumenal
package com.github.stewartbryson

import groovy.util.logging.Slf4j
import org.gradle.api.Project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.noumenal
package com.github.stewartbryson

import com.snowflake.snowpark_java.PutResult
import com.snowflake.snowpark_java.Session
Expand Down

0 comments on commit cbe757f

Please sign in to comment.