Skip to content

Commit

Permalink
reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
willyborankin committed Mar 9, 2020
1 parent 172d6f8 commit 5712128
Show file tree
Hide file tree
Showing 28 changed files with 1,409 additions and 342 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are explicitly windows files and should use crlf
*.bat text eol=crlf

10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
target
docs/_build
.idea
*.iml
*.DS_Store
.gradle
.gradletasknamecache
build/
rpm/
rpmbuild/
26 changes: 22 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
##
# Copyright (C) 2020 Aiven Oy
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
##

short_ver = $(shell git describe --abbrev=0 2>/dev/null || echo 0.0.1)
long_ver = $(shell git describe --long 2>/dev/null || echo $(short_ver)-0-unknown-g`git describe --always`)

Expand All @@ -8,15 +25,16 @@ SOURCES := \
src/main/java/io/aiven/kafka/connect/s3/AivenKafkaConnectS3OutputStream.java \
src/main/java/io/aiven/kafka/connect/s3/AivenKafkaConnectS3SinkConnector.java \
src/main/java/io/aiven/kafka/connect/s3/AivenKafkaConnectS3SinkTask.java \
pom.xml \
build.gradle \
gradle/ \
gradlew \
aiven-kafka-connect-s3.spec

all: rpm

build-dep:
sudo dnf install -y --allowerasing --best \
java-1.8.0-openjdk-devel \
maven
rpm-build java-1.8.0-openjdk-devel

clean:
$(RM) -r rpm/ rpmbuild/
Expand All @@ -33,4 +51,4 @@ rpm: $(SOURCES)
cp "$(CURDIR)/rpmbuild/RPMS/noarch"/*.rpm "$@/"

test:
mvn -Dmodule_version=0.0.1 test
./gradlew -Pmodule_version=0.0.1 test
6 changes: 3 additions & 3 deletions aiven-kafka-connect-s3.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ License: Apache (v2)
URL: https://aiven.io/
Source0: aiven-kafka-connect-s3-src.tar
BuildArch: noarch
BuildRequires: java, maven
BuildRequires: java
Requires: java
Packager: Heikki Nousiainen <[email protected]>

Expand All @@ -18,11 +18,11 @@ Aiven Kafka Connect S3 Connector
%setup

%build
mvn -Dmodule_version=%{major_version} package
./gradlew -Pmodule_version=%{major_version} clean build

%install
%{__mkdir_p} %{buildroot}/opt/aiven-kafka/libs
install target/aiven-kafka-connect-s3-%{version}.jar %{buildroot}/opt/aiven-kafka/libs/aiven-kafka-connect-s3-%{version}.jar
install build/libs/aiven-kafka-connect-s3-%{version}.jar %{buildroot}/opt/aiven-kafka/libs/aiven-kafka-connect-s3-%{version}.jar

%files
/opt/aiven-kafka/libs/aiven-kafka-connect-s3-%{version}.jar
Expand Down
137 changes: 137 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
/*
* Copyright (C) 2020 Aiven Oy
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

plugins {

// https://docs.gradle.org/current/userguide/java_library_plugin.html
id "java-library"

// https://docs.gradle.org/current/userguide/checkstyle_plugin.html
id "checkstyle"

// https://docs.gradle.org/current/userguide/jacoco_plugin.html
id "jacoco"

// https://docs.gradle.org/current/userguide/distribution_plugin.html
id "distribution"

// https://docs.gradle.org/current/userguide/publishing_maven.html
id "maven-publish"

}

group = "io.aiven"
version = hasProperty("module_version") ? "$project.module_version" : 'unknown'

repositories {
jcenter()
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

checkstyle {
toolVersion "8.29"
configDir rootProject.file("checkstyle/")
}

jacoco {
toolVersion = "0.8.5"
}

ext {
kafkaVersion = "0.11.0.1"
amazonS3Version = "1.11.718"
slf4jVersion = "1.7.25"
}

distributions {
main {
contents {
from jar
from configurations.runtimeClasspath

into("/") {
from projectDir
include "version.txt", "README*", "LICENSE*", "NOTICE*", "licenses/"
include "config/"
}
}
}
}

publishing {
publications {
maven(MavenPublication) {
// Defaults, for clarity
groupId = getGroup()
artifactId = getName()
version = getVersion()

pom {
name = "Aiven Kafka S3 connector"
description = "A Kafka S3 sink connector for copying data from Kafka to S3."
url = "https://aiven.io"
organization {
name = "Aiven Oy"
url = "https://aiven.io"
}
licenses {
license {
name = "GNU Affero General Public License 3.0"
url = "https://www.gnu.org/licenses/agpl-3.0.en.html"
distribution = "repo"
}
}
scm {
connection = "scm:git:git://github.com/aiven/aiven-kafka-connect-s3.git"
developerConnection = "scm:git:[email protected]:aiven/aiven-kafka-connect-s3.git"
url = "https://github.com/aiven/aiven-kafka-connect-s3.git"
tag = "HEAD"
}
}
}
}
}

processResources {
filesMatching('aiven-kafka-connect-s3-version.properties') {
expand(version: version)
}
}

dependencies {
compileOnly "org.apache.kafka:connect-api:$kafkaVersion"
compileOnly "org.apache.kafka:connect-runtime:$kafkaVersion"

implementation "org.slf4j:slf4j-api:$slf4jVersion"
implementation "com.amazonaws:aws-java-sdk-s3:$amazonS3Version"

runtimeOnly "org.slf4j:slf4j-log4j12:$slf4jVersion"

compileOnly "org.apache.kafka:connect-api:$kafkaVersion"
compileOnly "org.apache.kafka:connect-runtime:$kafkaVersion"
compileOnly "org.slf4j:slf4j-api:$slf4jVersion"

testImplementation "org.apache.kafka:connect-api:$kafkaVersion"
testImplementation "org.apache.kafka:connect-runtime:$kafkaVersion"
testImplementation "org.slf4j:slf4j-simple:$slf4jVersion"
testImplementation 'junit:junit:4.12'
testImplementation 'io.findify:s3mock_2.11:0.2.3'
}
Loading

0 comments on commit 5712128

Please sign in to comment.