Skip to content

Commit

Permalink
Include vendor JDBC drivers and license assertions (#47)
Browse files Browse the repository at this point in the history
* Whitespace cleanups in build files.

* Licenses: Enforce licenses at test-time.

* Include PostgreSQL, Snowflake, Redshift JDBC clients under appropriate licenses.
  • Loading branch information
shevek-google authored Jul 4, 2022
1 parent ef115f6 commit 41bf627
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@
plugins {
id 'java'
id 'java-test-fixtures'
id 'com.diffplug.spotless'
id 'com.diffplug.spotless'
}

repositories {
mavenCentral()
}

configurations {
all {
exclude group: 'javax.activation' // In JDK since mumble.
exclude group: 'findbugs', module: 'annotations'
exclude group: 'net.jcip', module: 'jcip-annotations' // In google-findbugs-annotations.
exclude group: 'org.springframework', module: 'spring-jcl' // In jcl-over-slf4j
exclude group: 'commons-logging' // Replaced by jcl-over-slf4j
}
all {
exclude group: 'javax.activation' // In JDK since mumble.
exclude group: 'findbugs', module: 'annotations'
exclude group: 'net.jcip', module: 'jcip-annotations' // In google-findbugs-annotations.
exclude group: 'org.springframework', module: 'spring-jcl' // In jcl-over-slf4j
exclude group: 'commons-logging' // Replaced by jcl-over-slf4j
}
}

dependencies {
Expand All @@ -49,7 +49,7 @@ dependencies {

constraints {
// Define dependency versions as constraints
def guavaVersion = '31.0.1-jre'
def guavaVersion = '31.0.1-jre'
implementation "com.google.guava:guava:$guavaVersion"
testFixturesImplementation "com.google.guava:guava:$guavaVersion"
def jacksonVersion = '2.9.0'
Expand All @@ -72,12 +72,16 @@ dependencies {
runtimeOnly "ch.qos.logback:logback-classic:$logbackVersion"
runtimeOnly "org.slf4j:jcl-over-slf4j:$jclOverSlf4jVersion"

testFixturesApi "org.apache.commons:commons-compress:1.18"
runtimeOnly "org.postgresql:postgresql:9.4.1208.jre7"
runtimeOnly "net.snowflake:snowflake-jdbc:3.13.20"
runtimeOnly "com.amazon.redshift:redshift-jdbc42:2.1.0.8"

testFixturesApi "org.apache.commons:commons-compress:1.18"
testFixturesApi "commons-io:commons-io:2.6"
testImplementation "org.xerial:sqlite-jdbc:3.32.3"
testImplementation "com.github.stefanbirkner:system-rules:1.18.0"
testImplementation "org.postgresql:postgresql:9.4.1208.jre7"
testImplementation "joda-time:joda-time:2.3"
testImplementation "org.xerial:sqlite-jdbc:3.32.3"
testImplementation "com.github.stefanbirkner:system-rules:1.18.0"
testImplementation "org.postgresql:postgresql:9.4.1208.jre7"
testImplementation "joda-time:joda-time:2.3"
}

implementation "org.slf4j:slf4j-api:$slf4jVersion"
Expand Down
14 changes: 11 additions & 3 deletions dumper/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ dependencies {
runtimeOnly "ch.qos.logback:logback-classic"
runtimeOnly "org.slf4j:jcl-over-slf4j"

runtimeOnly "org.postgresql:postgresql"
runtimeOnly "net.snowflake:snowflake-jdbc"
runtimeOnly "com.amazon.redshift:redshift-jdbc42"

testFixturesApi testFixtures(project(':dumper:lib-common'))

testImplementation "org.xerial:sqlite-jdbc"
Expand All @@ -69,20 +73,24 @@ dependencies {
application {
// Define the main class for the application.
mainClass = 'com.google.edwmigration.dumper.application.dumper.MetadataDumper'
applicationName = 'dwh-migration-dumper'
applicationName = 'dwh-migration-dumper'
}

licenseReport {
// onlyIf { ! gradle.startParameter.offline }
filters = [
// new com.github.jk1.license.filter.LicenseBundleNormalizer(bundlePath: rootProject.file("gradle/license-bundle-normalizer.json"), createDefaultTransformationRules: true)
new com.github.jk1.license.filter.LicenseBundleNormalizer(bundlePath: rootProject.file("gradle/license-bundle-normalizer.json"), createDefaultTransformationRules: true)
]
renderers = [
// new com.github.jk1.license.render.XmlReportRenderer("licenses.xml", "Licenses of Third Party Dependencies"),
new com.github.jk1.license.render.CsvReportRenderer(),
new com.github.jk1.license.render.InventoryHtmlReportRenderer("index.html", "Licenses of Third Party Dependencies")
]
allowedLicensesFile = new File("$rootProject.projectDir/gradle/license-allowed.json")
allowedLicensesFile = rootProject.file("gradle/license-allowed.json")
}

tasks.named('check') {
dependsOn 'checkLicense'
}

tasks.register('generateSourceMirror', Copy) {
Expand Down

0 comments on commit 41bf627

Please sign in to comment.