|
1 | 1 | plugins { |
2 | | - id 'java' |
3 | | - id 'net.saliman.properties' version '1.4.6' |
4 | | - id "com.github.jk1.dependency-license-report" version "1.3" |
| 2 | + id 'java' |
| 3 | + id 'net.saliman.properties' version '1.4.6' |
| 4 | + id "com.github.jk1.dependency-license-report" version "1.3" |
5 | 5 | } |
6 | 6 |
|
7 | 7 | sourceCompatibility = 1.8 |
8 | 8 |
|
9 | 9 | repositories { |
10 | | - mavenCentral() |
11 | | - jcenter() |
| 10 | + mavenCentral() |
| 11 | + jcenter() |
12 | 12 | } |
13 | 13 |
|
14 | 14 | configurations { |
15 | | - documentation |
16 | | - assets |
| 15 | + documentation |
| 16 | + assets |
17 | 17 | } |
18 | 18 |
|
19 | 19 | dependencies { |
20 | | - compileOnly "org.apache.kafka:connect-api:2.5.0" |
21 | | - compileOnly "org.apache.kafka:connect-json:2.5.0" |
| 20 | + compileOnly "org.apache.kafka:connect-api:2.5.0" |
| 21 | + compileOnly "org.apache.kafka:connect-json:2.5.0" |
22 | 22 |
|
23 | | - compile "com.marklogic:marklogic-client-api:5.3.0" |
24 | | - compile ("com.marklogic:marklogic-data-hub:5.2.4") { |
25 | | - // Prefer the version above |
26 | | - exclude module: "marklogic-client-api" |
27 | | - // Excluding these because there's no need for them |
28 | | - exclude module: "spring-boot-autoconfigure" |
29 | | - exclude module: "spring-integration-http" |
30 | | - exclude module: "jaeger-core" |
31 | | - exclude module: "jaeger-thrift" |
| 23 | + compile "com.marklogic:marklogic-client-api:5.3.0" |
| 24 | + compile("com.marklogic:marklogic-data-hub:5.2.4") { |
| 25 | + // Prefer the version above |
| 26 | + exclude module: "marklogic-client-api" |
| 27 | + // Excluding these because there's no need for them |
| 28 | + exclude module: "spring-boot-autoconfigure" |
| 29 | + exclude module: "spring-integration-http" |
| 30 | + exclude module: "jaeger-core" |
| 31 | + exclude module: "jaeger-thrift" |
32 | 32 |
|
33 | | - // Excluding because it causes Kafka Connect to complain mightily if included |
34 | | - exclude module: "logback-classic" |
35 | | - } |
| 33 | + // Excluding because it causes Kafka Connect to complain mightily if included |
| 34 | + exclude module: "logback-classic" |
| 35 | + } |
36 | 36 |
|
37 | | - testCompile "org.junit.jupiter:junit-jupiter-api:5.3.0" |
38 | | - testCompile "org.apache.kafka:connect-api:2.5.0" |
39 | | - testCompile "org.apache.kafka:connect-json:2.5.0" |
40 | | - testCompile "com.google.code.gson:gson:2.8.6" |
| 37 | + testCompile "org.junit.jupiter:junit-jupiter-api:5.3.0" |
| 38 | + testCompile "org.apache.kafka:connect-api:2.5.0" |
| 39 | + testCompile "org.apache.kafka:connect-json:2.5.0" |
| 40 | + testCompile "com.google.code.gson:gson:2.8.6" |
41 | 41 |
|
42 | | - // Needed by Gradle 4.6+ - see https://www.petrikainulainen.net/programming/testing/junit-5-tutorial-running-unit-tests-with-gradle/ |
43 | | - testRuntime "org.junit.jupiter:junit-jupiter-engine:5.3.0" |
| 42 | + // Needed by Gradle 4.6+ - see https://www.petrikainulainen.net/programming/testing/junit-5-tutorial-running-unit-tests-with-gradle/ |
| 43 | + testRuntime "org.junit.jupiter:junit-jupiter-engine:5.3.0" |
44 | 44 |
|
45 | | - // Forcing logback to be used for test logging |
46 | | - testRuntime "ch.qos.logback:logback-classic:1.1.8" |
47 | | - testRuntime group: "org.slf4j", name: "jcl-over-slf4j", version: "1.7.22" |
48 | | - testRuntime group: "org.slf4j", name: "slf4j-api", version: "1.7.22" |
| 45 | + // Forcing logback to be used for test logging |
| 46 | + testRuntime "ch.qos.logback:logback-classic:1.1.8" |
| 47 | + testRuntime group: "org.slf4j", name: "jcl-over-slf4j", version: "1.7.22" |
| 48 | + testRuntime group: "org.slf4j", name: "slf4j-api", version: "1.7.22" |
49 | 49 |
|
50 | | - documentation files('LICENSE.txt') |
51 | | - documentation files('NOTICE.txt') |
52 | | - documentation files('README.md') |
| 50 | + documentation files('LICENSE.txt') |
| 51 | + documentation files('NOTICE.txt') |
| 52 | + documentation files('README.md') |
53 | 53 |
|
54 | | - assets files('MarkLogic_logo.png') |
55 | | - assets files('apache_logo.png') |
| 54 | + assets files('MarkLogic_logo.png') |
| 55 | + assets files('apache_logo.png') |
56 | 56 | } |
57 | 57 |
|
58 | 58 | // Needed by Gradle 4.6+ - see https://www.petrikainulainen.net/programming/testing/junit-5-tutorial-running-unit-tests-with-gradle/ |
59 | 59 | test { |
60 | | - useJUnitPlatform() |
| 60 | + useJUnitPlatform() |
61 | 61 | } |
62 | 62 |
|
63 | 63 | // Customize the Java plugin's jar task to produce a "fat" jar with all dependencies included |
64 | 64 | jar { |
65 | | - manifest { |
66 | | - attributes 'Implementation-Title': 'Kafka-Connect-MarkLogic', |
67 | | - 'Implementation-Version': version |
68 | | - } |
69 | | - from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } |
| 65 | + manifest { |
| 66 | + attributes 'Implementation-Title': 'Kafka-Connect-MarkLogic', |
| 67 | + 'Implementation-Version': version |
| 68 | + } |
| 69 | + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } |
70 | 70 | } |
71 | 71 |
|
72 | 72 | task copyJarToKafka(type: Copy) { |
73 | | - description = "Used for local development and testing; copies the jar to your local Kafka install" |
74 | | - from "build/libs" |
75 | | - into "${kafkaHome}/libs" |
| 73 | + description = "Used for local development and testing; copies the jar to your local Kafka install" |
| 74 | + from "build/libs" |
| 75 | + into "${kafkaHome}/libs" |
76 | 76 | } |
77 | 77 | copyJarToKafka.mustRunAfter(jar) |
78 | 78 |
|
79 | 79 | task copyPropertyFilesToKafka(type: Copy) { |
80 | | - description = "Used for local development and testing; copies the properties files to your local Kafka install" |
81 | | - from "config" |
82 | | - into "${kafkaHome}/config" |
| 80 | + description = "Used for local development and testing; copies the properties files to your local Kafka install" |
| 81 | + from "config" |
| 82 | + into "${kafkaHome}/config" |
83 | 83 | } |
84 | 84 |
|
85 | 85 | task deploy { |
86 | | - description = "Used for local development and testing; builds the jar and copies it and the properties files to your local Kafka install" |
87 | | - dependsOn = ["jar", "copyJarToKafka", "copyPropertyFilesToKafka"] |
| 86 | + description = "Used for local development and testing; builds the jar and copies it and the properties files to your local Kafka install" |
| 87 | + dependsOn = ["jar", "copyJarToKafka", "copyPropertyFilesToKafka"] |
88 | 88 | } |
89 | 89 |
|
90 | 90 | // Tasks for building the archive required for submitting to the Confluence Connector Hub |
91 | | -import org.apache.tools.ant.filters.* |
| 91 | + |
| 92 | +import org.apache.tools.ant.filters.ReplaceTokens |
| 93 | + |
92 | 94 | def baseArchiveBuildDir = "build/connectorArchive" |
93 | 95 | def baseArchiveName = "${componentOwner}-${componentName}-${version}" |
94 | 96 | task connectorArchive_CopyManifestToBuildDirectory(type: Copy) { |
95 | | - description = "Copy the project manifest into the root folder" |
96 | | - group = 'connector archive' |
| 97 | + description = "Copy the project manifest into the root folder" |
| 98 | + group = 'connector archive' |
97 | 99 |
|
98 | | - from '.' |
99 | | - include 'manifest.json' |
100 | | - into "${baseArchiveBuildDir}/${baseArchiveName}" |
101 | | - filter(ReplaceTokens, tokens:[CONFLUENT_USER:componentOwner, VERSION:version]) |
| 100 | + from '.' |
| 101 | + include 'manifest.json' |
| 102 | + into "${baseArchiveBuildDir}/${baseArchiveName}" |
| 103 | + filter(ReplaceTokens, tokens: [CONFLUENT_USER: componentOwner, VERSION: version]) |
102 | 104 | } |
103 | 105 |
|
104 | 106 | task connectorArchive_CopyAssetsToBuildDirectory(type: Copy) { |
105 | | - description = "Copy the project assets into the assets folder" |
106 | | - group = 'connector archive' |
| 107 | + description = "Copy the project assets into the assets folder" |
| 108 | + group = 'connector archive' |
107 | 109 |
|
108 | | - from configurations.assets |
109 | | - into "${baseArchiveBuildDir}/${baseArchiveName}/assets" |
| 110 | + from configurations.assets |
| 111 | + into "${baseArchiveBuildDir}/${baseArchiveName}/assets" |
110 | 112 | } |
111 | 113 |
|
112 | 114 | task connectorArchive_CopyEtcToBuildDirectory(type: Copy) { |
113 | | - description = "Copy the project support files into the etc folder" |
114 | | - group = 'connector archive' |
| 115 | + description = "Copy the project support files into the etc folder" |
| 116 | + group = 'connector archive' |
115 | 117 |
|
116 | | - from 'config' |
117 | | - include '*' |
118 | | - into "${baseArchiveBuildDir}/${baseArchiveName}/etc" |
| 118 | + from 'config' |
| 119 | + include '*' |
| 120 | + into "${baseArchiveBuildDir}/${baseArchiveName}/etc" |
119 | 121 | } |
120 | 122 |
|
121 | 123 | task connectorArchive_CopyDocumentationToBuildDirectory(type: Copy) { |
122 | | - description = "Copy the project documentation into the doc folder" |
123 | | - group = 'connector archive' |
| 124 | + description = "Copy the project documentation into the doc folder" |
| 125 | + group = 'connector archive' |
124 | 126 |
|
125 | | - from configurations.documentation |
126 | | - into "${baseArchiveBuildDir}/${baseArchiveName}/doc" |
| 127 | + from configurations.documentation |
| 128 | + into "${baseArchiveBuildDir}/${baseArchiveName}/doc" |
127 | 129 | } |
128 | 130 |
|
129 | 131 | task connectorArchive_CopyDependenciesToBuildDirectory(type: Copy) { |
130 | | - description = "Copy the dependency jars into the lib folder" |
131 | | - group = 'connector archive' |
132 | | - dependsOn = [jar] |
| 132 | + description = "Copy the dependency jars into the lib folder" |
| 133 | + group = 'connector archive' |
| 134 | + dependsOn = [jar] |
133 | 135 |
|
134 | | - from jar |
135 | | - from configurations.compile |
136 | | - into "${baseArchiveBuildDir}/${baseArchiveName}/lib" |
| 136 | + from jar |
| 137 | + from configurations.compile |
| 138 | + into "${baseArchiveBuildDir}/${baseArchiveName}/lib" |
137 | 139 | } |
138 | 140 |
|
139 | 141 | task connectorArchive_BuildDirectory() { |
140 | | - description = "Build the directory that will be used to create the Kafka Connector Archive" |
141 | | - dependsOn = [connectorArchive_CopyManifestToBuildDirectory, |
142 | | - connectorArchive_CopyDependenciesToBuildDirectory, |
143 | | - connectorArchive_CopyDocumentationToBuildDirectory, |
144 | | - connectorArchive_CopyEtcToBuildDirectory, |
145 | | - connectorArchive_CopyAssetsToBuildDirectory] |
146 | | - group = 'connector archive' |
| 142 | + description = "Build the directory that will be used to create the Kafka Connector Archive" |
| 143 | + dependsOn = [connectorArchive_CopyManifestToBuildDirectory, |
| 144 | + connectorArchive_CopyDependenciesToBuildDirectory, |
| 145 | + connectorArchive_CopyDocumentationToBuildDirectory, |
| 146 | + connectorArchive_CopyEtcToBuildDirectory, |
| 147 | + connectorArchive_CopyAssetsToBuildDirectory] |
| 148 | + group = 'connector archive' |
147 | 149 | } |
148 | 150 |
|
149 | 151 | task connectorArchive(type: Zip, dependsOn: connectorArchive_BuildDirectory) { |
150 | | - description = 'Build a Connector Hub for the Confluent Connector Hub' |
151 | | - group = 'connector archive' |
| 152 | + description = 'Build a Connector Hub for the Confluent Connector Hub' |
| 153 | + group = 'connector archive' |
152 | 154 |
|
153 | | - from "${baseArchiveBuildDir}" |
154 | | - include '**/*' |
155 | | - archiveName "${baseArchiveName}.zip" |
156 | | - destinationDir(file('build/distro')) |
| 155 | + from "${baseArchiveBuildDir}" |
| 156 | + include '**/*' |
| 157 | + archiveName "${baseArchiveName}.zip" |
| 158 | + destinationDir(file('build/distro')) |
157 | 159 | } |
0 commit comments