Skip to content

Commit

Permalink
cleanup manifest gen
Browse files Browse the repository at this point in the history
  • Loading branch information
Nephery committed Dec 13, 2023
1 parent f58fdc3 commit 5e93385
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 39 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@ src/integrationTest/resources/pubsubplus-connector-kafka*/

# Local testing
solace.properties
manifest.json
34 changes: 8 additions & 26 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import com.github.spotbugs.snom.SpotBugsTask
import io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository
import groovy.json.JsonOutput
import groovy.text.GStringTemplateEngine
import jdk.nashorn.internal.ir.debug.JSONWriter

plugins {
id 'java-library'
Expand Down Expand Up @@ -80,30 +77,15 @@ spotbugs {
}

// Generate manifest.json file to be compliant with Confluent Hub client
tasks.register("genarateKafkaConnectManifestFile") {

def manifestJsonTemplate = new File('manifest.json.template')
def bindMap = [
"FEATURE_CONFLUENT_CONTROL_CENTER_INTEGRATION_ENABLED": false,
"FEATURE_KAFKA_CONNECT_API_ENABLED": true,
"FEATURE_SINGLE_MESSAGE_TRANSFORMS_ENABLED": true,
"COMPONENT_NAME": project.name,
"RELEASE_DATE": new Date().format("yyyy-MM-dd"),
"VERSION": project.version
]

def manifestJson = JsonOutput.unescaped(
new GStringTemplateEngine()
.createTemplate(manifestJsonTemplate)
.make(bindMap)
.toString()
)

new File(project.projectDir.toString() + "/manifest.json").write JsonOutput.prettyPrint(JsonOutput.toJson(manifestJson))
tasks.register('generateConfluentConnectManifest', Copy) {
def templateContext = [
"project": project.properties
]
from 'src/template/manifest'
into "${buildDir}/generated/manifest"
expand templateContext
}

tasks.genarateKafkaConnectManifestFile.dependsOn assemble

spotbugsIntegrationTest {
enabled = false
}
Expand Down Expand Up @@ -258,7 +240,7 @@ distributions {
from('doc/distribution-readme.md') { into 'doc' }
from('LICENSE') { into 'doc' }
from('THIRD-PARTY-LICENSES') { into 'doc' }
from('manifest.json') { into '' }
from(generateConfluentConnectManifest) {into ''}
into('lib') {
from jar
from(project.configurations.runtimeClasspath)
Expand Down
23 changes: 11 additions & 12 deletions manifest.json.template → src/template/manifest/manifest.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
{
"author": "Solace",
"component_types": [
"sink"
],
"description": "The PubSub+ Kafka Sink Connector consumes Kafka topic records and streams them to the PubSub+ Event Mesh as topic and/or queue data events.",
"documentationUrl": "https://github.com/SolaceProducts/pubsubplus-connector-kafka-sink",
"documentation_url": "https://github.com/SolaceProducts/pubsubplus-connector-kafka-sink",
"features": {
"confluent_control_center_integration": $FEATURE_CONFLUENT_CONTROL_CENTER_INTEGRATION_ENABLED,
"kafka_connect_api": $FEATURE_KAFKA_CONNECT_API_ENABLED,
"single_message_transforms": $FEATURE_SINGLE_MESSAGE_TRANSFORMS_ENABLED,
"confluent_control_center_integration": false,
"kafka_connect_api": true,
"single_message_transforms": true,
"supported_encodings": [
"any"
]
},
"license": [
{
"name": "he Apache Software License, Version 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.txt"
"name": "Apache License, Version 2.0",
"url": "https://github.com/SolaceProducts/pubsubplus-connector-kafka-sink/blob/master/LICENSE"
}
],
"name": "$COMPONENT_NAME",
"name": "${project.name}",
"owner": {
"name": "Solace",
"type": "organization",
"url": "https://github.com/SolaceProducts/pubsubplus-connector-kafka-sink",
"username": "SolaceProducts"
"url": "https://solace.community",
"username": "solace"
},
"release_date": "$RELEASE_DATE",
"release_date": "${new Date().format('yyyy-MM-dd')}",
"source_url": "https://github.com/SolaceProducts/pubsubplus-connector-kafka-sink",
"support": {
"provider_name": "Solace",
Expand All @@ -40,5 +39,5 @@
"connector"
],
"title": "Solace PubSub+ Connector for Kafka: Sink",
"version": "$VERSION"
"version": "${project.version}"
}

0 comments on commit 5e93385

Please sign in to comment.