Skip to content

Commit

Permalink
Merge branch 'master' into andrewstevenson-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewstevenson authored May 10, 2024
2 parents a003877 + 90d76a3 commit b97597e
Show file tree
Hide file tree
Showing 242 changed files with 76,290 additions and 3,247 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ jobs:
format: 'HTML'
args: >-
--failOnCVSS 5
--suppression https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.owner.login }}/${{github.event.repository.name}}/${{ steps.branch_name.outputs.tag }}${{ steps.branch_name.outputs.current_branch }}/suppression.xml
--suppression https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.owner.login || github.event.repository.owner.login }}/${{ github.event.repository.name }}/${{ steps.branch_name.outputs.tag }}${{ steps.branch_name.outputs.current_branch }}/suppression.xml
- name: Upload Test results
uses: actions/upload-artifact@master
with:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/java-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ jobs:
with:
gradle-version: 8.6

- name: Check License Headers and Test with Gradle
- name: Formatting and Headers Check
run: cd 'java-connectors' && ./gradlew ${{ matrix.module }}:spotlessCheck

- name: Test with Gradle
run: cd 'java-connectors' && ./gradlew ${{ matrix.module }}:test

build-and-cache:
Expand Down Expand Up @@ -126,7 +129,7 @@ jobs:
format: 'HTML'
args: >-
--failOnCVSS 5
--suppression https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.owner.login }}/${{github.event.repository.name}}/${{ steps.branch_name.outputs.tag }}${{ steps.branch_name.outputs.current_branch }}/suppression.xml
--suppression https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.owner.login || github.event.repository.owner.login }}/${{github.event.repository.name}}/${{ steps.branch_name.outputs.tag }}${{ steps.branch_name.outputs.current_branch }}/suppression.xml
- name: Upload Test results
uses: actions/upload-artifact@master
Expand Down
8 changes: 8 additions & 0 deletions ADOPTERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Stream Reactor Adopters

If you're currently using Lenses.io [Stream Reactor](https://github.com/lensesio/stream-reactor) or [SMT](https://github.com/lensesio/kafka-connect-smt) Kafka connector plugins in production, please let us know by adding your company below.


| Organization | Contact | Usage Description |
| ------------ |---------------------|-----------------------------------------------------------------------------------|
| [Skillsoft](https://www.skillsoft.com/) | [@brandon-powers](https://github.com/brandon-powers) | Amazon S3 sink & source connectors + SMTs for Apache Kafka backup and disaster recovery. |
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ Lenses offers the leading Developer Experience solution for engineers building r

Speak to us on our Community Slack channel (Register at https://launchpass.com/lensesio) or ask the Community a question in our [Ask Marios](http://www.lenses.io) forum.

## Version Support Policy

Under our standard support agreement, we provide assistance for the current major version as well as the preceding major version exclusively. For instance, if version 8.x is the current major release, we offer support for Lenses connectors versions within the 8.x and 7.x series.

Enterprise-level support commences from version 7.0 onwards.

Lenses prioritizes backporting fixes rather than incorporating new features, and this is done on a limited basis across select prior releases. For further clarification, please refer to our maintenance policy.

Should you reach out to our support team regarding issues encountered while using an unsupported version, we will direct you to this section of our policy page and encourage you to upgrade.

## Kafka Connectors Roadmap

A series of next-generation Connectors are in active development. Give us your feedback of which connectors we should be working on or to to get the latest information, send us an email at [email protected]
Expand Down
53 changes: 51 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ import sbt.*
import sbt.Project.projectToLocalProject

import java.io.File
import scala.sys.process._

ThisBuild / scalaVersion := Dependencies.scalaVersion

lazy val subProjects: Seq[Project] = Seq(
`query-language`,
`java-common`,
`gcp-common`,
common,
`sql-common`,
`cloud-common`,
Expand Down Expand Up @@ -58,6 +61,34 @@ lazy val `query-language` = (project in file("java-connectors/kafka-connect-quer
.configureTests(baseTestDeps)
.configureAntlr()

lazy val `java-common` = (project in file("java-connectors/kafka-connect-common"))
.settings(
settings ++
Seq(
name := "kafka-connect-java-common",
description := "Common components from java",
libraryDependencies ++= javaCommonDeps,
publish / skip := true,
),
)
.configureAssembly(false)
.configureTests(javaCommonTestDeps)

lazy val `gcp-common` = (project in file("java-connectors/kafka-connect-gcp-common"))
.dependsOn(`java-common`)
.settings(
settings ++
Seq(
name := "kafka-connect-gcp-common",
description := "GCP Commons Module",
libraryDependencies ++= kafkaConnectGcpCommonDeps,
publish / skip := true,
),
)
.configureAssembly(true)
.configureTests(javaCommonTestDeps)
.configureAntlr()

lazy val `sql-common` = (project in file("kafka-connect-sql-common"))
.dependsOn(`query-language`)
.dependsOn(`common`)
Expand All @@ -75,6 +106,7 @@ lazy val `sql-common` = (project in file("kafka-connect-sql-common"))

lazy val common = (project in file("kafka-connect-common"))
.dependsOn(`query-language`)
.dependsOn(`java-common`)
.settings(
settings ++
Seq(
Expand Down Expand Up @@ -155,6 +187,7 @@ lazy val `azure-datalake` = (project in file("kafka-connect-azure-datalake"))

lazy val `gcp-storage` = (project in file("kafka-connect-gcp-storage"))
.dependsOn(common)
.dependsOn(`gcp-common`)
.dependsOn(`cloud-common` % "compile->compile;test->test;it->it")
.dependsOn(`test-common` % "test->compile")
.settings(
Expand Down Expand Up @@ -442,10 +475,25 @@ addCommandAlias(
"validateAll",
"headerCheck;test:headerCheck;it:headerCheck;fun:headerCheck;scalafmtCheckAll;test-common/scalafmtCheck;test-common/headerCheck",
)

lazy val gradleSpotlessApply = taskKey[Unit]("Run 'gradlew spotlessApply' via external process")
gradleSpotlessApply := {
// Specify the desired working directory for the external process
val targetDirectory = baseDirectory.value / "java-connectors"

// Execute 'gradle spotlessApply' in the specified directory
val exitCode = Process("gradlew spotlessApply", targetDirectory).!

if (exitCode != 0) {
throw new RuntimeException("gradlew spotlessApply command failed")
}
}

addCommandAlias(
"formatAll",
"headerCreateAll;scalafmtAll;scalafmtSbt;test-common/scalafmt;test-common/headerCreateAll",
";headerCreateAll;scalafmtAll;scalafmtSbt;test-common/scalafmt;test-common/headerCreateAll;gradleSpotlessApply",
)

addCommandAlias("fullTest", ";test;it:test;fun:test")
addCommandAlias("fullCoverageTest", ";coverage;test;it:test;coverageReport;coverageAggregate")

Expand All @@ -459,7 +507,8 @@ val generateDepCheckModulesList = taskKey[Seq[File]]("generateDepCheckModulesLis
Compile / generateModulesList :=
new FileWriter(subProjects).generate((Compile / resourceManaged).value / "modules.txt")
Compile / generateDepCheckModulesList :=
new FileWriter(subProjects.tail).generate((Compile / resourceManaged).value / "depcheck-modules.txt")
new FileWriter(subProjects.filter(sp => !sp.base.asPath.startsWith("java-connectors/")))
.generate((Compile / resourceManaged).value / "depcheck-modules.txt")
Compile / generateItModulesList :=
new FileWriter(
subProjects.filter(p => p.containsDir("src/it")),
Expand Down
3 changes: 2 additions & 1 deletion java-connectors/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ bin/

### Lenses-specific ###
release/
gradle-modules.txt
gradle-modules.txt
**/src/main/gen/*
28 changes: 15 additions & 13 deletions java-connectors/HEADER.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
Copyright 2017-${year} ${name} Ltd

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
/*
* Copyright 2017-$YEAR Lenses.io Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
52 changes: 29 additions & 23 deletions java-connectors/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'org.cadixdev.licenser' version '0.6.1'
id "com.diffplug.spotless" version "6.25.0"
id 'java'
id 'java-library'
}

allprojects {

group = "io.lenses.streamreactor"
version = "6.4.0-SNAPSHOT"
version = "7.0.1-SNAPSHOT"
description = "stream-reactor"

apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'org.cadixdev.licenser'
apply plugin: 'com.diffplug.spotless'

java {
setSourceCompatibility(JavaVersion.VERSION_11)
Expand Down Expand Up @@ -55,8 +55,10 @@ allprojects {
implementation group: 'ch.qos.logback', name: 'logback-classic', version: logbackVersion

//lombok
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.30'
compileOnly group: 'org.projectlombok', name: 'lombok', version: lombokVersion
testCompileOnly group: 'org.projectlombok', name: 'lombok', version: lombokVersion
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombokVersion
testAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombokVersion

//tests
testImplementation group: 'org.mockito', name: 'mockito-core', version: mockitoJupiterVersion
Expand All @@ -75,22 +77,6 @@ allprojects {
}
}

license {
include("**/**.java", "**/**Test.java")
exclude("**/kcql/antlr4/**.java") //antlr generated files
header = project.file("${project.rootDir}/HEADER.txt")
newLine = false

style {
java = 'BLOCK_COMMENT'
}

properties {
name = 'Lenses.io'
year = LocalDate.now().year
}
}

jar {
manifest {
attributes("StreamReactor-Version": project.version,
Expand Down Expand Up @@ -145,14 +131,34 @@ allprojects {
// exclude(dependency("com.google.guava:guava:28.1-android"))
}


spotless {

format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '.gitattributes', '.gitignore'

// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces() // or spaces. Takes an integer argument if you don't like 4
endWithNewline()
}
java {
toggleOffOn()
// optional: you can specify a specific version and/or config file
eclipse('4.30').configFile("${rootDir}/config/Lenses_eclipse.xml")
licenseHeaderFile(rootProject.file("HEADER.txt"))
}
}

}
compileJava.dependsOn("checkLicenses")
//compileJava.dependsOn("checkLicenses")

task fatJar(dependsOn: [test, jar, shadowJar])

task collectFatJar(type: Copy, dependsOn: [fatJar]) {
from("${buildDir}/libs").include("kafka-connect-*-all.jar")
.exclude("*-common-*").into(libsDir)
.exclude("*-common-*").into(libsDir)
}
}

Expand All @@ -162,7 +168,7 @@ task prepareRelease(dependsOn: [collectFatJar]) {

task releaseModuleList() {
def nonReleaseModules = ["java-reactor", "kafka-connect-cloud-common",
"kafka-connect-common", "kafka-connect-query-language"]
"kafka-connect-common", "kafka-connect-query-language"]

def modulesFile = new File("gradle-modules.txt")
modulesFile.delete()
Expand Down
Loading

0 comments on commit b97597e

Please sign in to comment.