Skip to content

Commit 9ba8d2a

Browse files
committed
Initial work
1 parent 72575be commit 9ba8d2a

30 files changed

+2029
-0
lines changed

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ hivemq-edge-adapterSdk = "2024.5"
1717
hivemq-edge-extensionSdk = "2024.5"
1818
hivemq-extensionSdk = "4.30.0"
1919
hivemq-mqttClient = "1.3.3"
20+
iot-communication = "1.5.3"
2021
kotlin = "1.9.25"
2122
jackson = "2.18.0"
2223
jacoco = "0.8.11"
@@ -73,6 +74,7 @@ hivemq-edge-adapterSdk = { module = "com.hivemq:hivemq-edge-adapter-sdk", versio
7374
hivemq-edge-extensionSdk = { module = "com.hivemq:hivemq-edge-extension-sdk", version.ref = "hivemq-edge-extensionSdk" }
7475
hivemq-extensionSdk = { module = "com.hivemq:hivemq-extension-sdk", version.ref = "hivemq-extensionSdk" }
7576
hivemq-mqttClient = { module = "com.hivemq:hivemq-mqtt-client", version.ref = "hivemq-mqttClient" }
77+
iot-communication = { module = "com.github.xingshuangs:iot-communication", version.ref = "iot-communication" }
7678
kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "kotlin" }
7779
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
7880
jackson-dataformat-xml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-xml", version.ref = "jackson" }
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2023-present HiveMQ GmbH
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
import nl.javadude.gradle.plugins.license.DownloadLicensesExtension.license
2+
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
3+
import org.gradle.api.tasks.testing.logging.TestLogEvent.*
4+
5+
plugins {
6+
java
7+
alias(libs.plugins.defaults)
8+
alias(libs.plugins.shadow)
9+
alias(libs.plugins.license)
10+
id("com.hivemq.edge-version-updater")
11+
id("com.hivemq.third-party-license-generator")
12+
}
13+
14+
group = "com.hivemq"
15+
16+
java {
17+
toolchain {
18+
languageVersion.set(JavaLanguageVersion.of(11))
19+
}
20+
}
21+
22+
repositories {
23+
mavenCentral()
24+
exclusiveContent {
25+
forRepository {
26+
maven {
27+
url = uri("https://jitpack.io")
28+
}
29+
}
30+
filter {
31+
includeGroup("com.github.simon622.mqtt-sn")
32+
includeGroup("com.github.simon622")
33+
}
34+
}
35+
}
36+
37+
dependencies {
38+
compileOnly(libs.hivemq.edge.adapterSdk)
39+
compileOnly(libs.apache.commonsIO)
40+
compileOnly(libs.jackson.databind)
41+
compileOnly(libs.iot.communication)
42+
compileOnly(libs.slf4j.api)
43+
44+
testImplementation(libs.jackson.databind)
45+
testImplementation(libs.junit.jupiter)
46+
testImplementation(libs.assertj)
47+
testImplementation(libs.mockito.junitJupiter)
48+
testImplementation("com.hivemq:hivemq-edge")
49+
50+
}
51+
52+
tasks.test {
53+
useJUnitPlatform()
54+
testLogging {
55+
events = setOf(STARTED, PASSED, FAILED, SKIPPED, STANDARD_ERROR)
56+
exceptionFormat = TestExceptionFormat.FULL
57+
}
58+
}
59+
60+
tasks.register<Copy>("copyAllDependencies") {
61+
shouldRunAfter("assemble")
62+
from(configurations.runtimeClasspath)
63+
into("${buildDir}/deps/libs")
64+
}
65+
66+
tasks.named("assemble") { finalizedBy("copyAllDependencies") }
67+
68+
/* ******************** artifacts ******************** */
69+
70+
val releaseBinary: Configuration by configurations.creating {
71+
isCanBeConsumed = true
72+
isCanBeResolved = false
73+
attributes {
74+
attribute(Category.CATEGORY_ATTRIBUTE, objects.named("binary"))
75+
attribute(Usage.USAGE_ATTRIBUTE, objects.named("release"))
76+
}
77+
}
78+
79+
val thirdPartyLicenses: Configuration by configurations.creating {
80+
isCanBeConsumed = true
81+
isCanBeResolved = false
82+
attributes {
83+
attribute(Category.CATEGORY_ATTRIBUTE, objects.named("third-party-licenses"))
84+
}
85+
}
86+
87+
artifacts {
88+
add(releaseBinary.name, tasks.shadowJar)
89+
add(thirdPartyLicenses.name, tasks.updateThirdPartyLicenses.flatMap { it.outputDirectory })
90+
}
91+
92+
/* ******************** compliance ******************** */
93+
94+
license {
95+
header = file("HEADER")
96+
mapping("java", "SLASHSTAR_STYLE")
97+
}
98+
99+
downloadLicenses {
100+
aliases = mapOf(
101+
license("Apache License, Version 2.0", "https://opensource.org/licenses/Apache-2.0") to listOf(
102+
"Apache 2",
103+
"Apache 2.0",
104+
"Apache-2.0",
105+
"Apache License 2.0",
106+
"Apache License, 2.0",
107+
"Apache License v2.0",
108+
"Apache License, Version 2",
109+
"Apache License Version 2.0",
110+
"Apache License, Version 2.0",
111+
"Apache License, version 2.0",
112+
"The Apache License, Version 2.0",
113+
"Apache Software License - Version 2.0",
114+
"Apache Software License, version 2.0",
115+
"The Apache Software License, Version 2.0"
116+
),
117+
license("MIT License", "https://opensource.org/licenses/MIT") to listOf(
118+
"MIT License",
119+
"MIT license",
120+
"The MIT License",
121+
"The MIT License (MIT)"
122+
),
123+
license("CDDL, Version 1.0", "https://opensource.org/licenses/CDDL-1.0") to listOf(
124+
"CDDL, Version 1.0",
125+
"Common Development and Distribution License 1.0",
126+
"COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0",
127+
license("CDDL", "https://glassfish.dev.java.net/public/CDDLv1.0.html")
128+
),
129+
license("CDDL, Version 1.1", "https://oss.oracle.com/licenses/CDDL+GPL-1.1") to listOf(
130+
"CDDL 1.1",
131+
"CDDL, Version 1.1",
132+
"Common Development And Distribution License 1.1",
133+
"CDDL+GPL License",
134+
"CDDL + GPLv2 with classpath exception",
135+
"Dual license consisting of the CDDL v1.1 and GPL v2",
136+
"CDDL or GPLv2 with exceptions",
137+
"CDDL/GPLv2+CE"
138+
),
139+
license("LGPL, Version 2.0", "https://opensource.org/licenses/LGPL-2.0") to listOf(
140+
"LGPL, Version 2.0",
141+
"GNU General Public License, version 2"
142+
),
143+
license("LGPL, Version 2.1", "https://opensource.org/licenses/LGPL-2.1") to listOf(
144+
"LGPL, Version 2.1",
145+
"LGPL, version 2.1",
146+
"GNU Lesser General Public License version 2.1 (LGPLv2.1)",
147+
license("GNU Lesser General Public License", "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html")
148+
),
149+
license("LGPL, Version 3.0", "https://opensource.org/licenses/LGPL-3.0") to listOf(
150+
"LGPL, Version 3.0",
151+
"Lesser General Public License, version 3 or greater"
152+
),
153+
license("EPL, Version 1.0", "https://opensource.org/licenses/EPL-1.0") to listOf(
154+
"EPL, Version 1.0",
155+
"Eclipse Public License - v 1.0",
156+
"Eclipse Public License - Version 1.0",
157+
license("Eclipse Public License", "http://www.eclipse.org/legal/epl-v10.html")
158+
),
159+
license("EPL, Version 2.0", "https://opensource.org/licenses/EPL-2.0") to listOf(
160+
"EPL 2.0",
161+
"EPL, Version 2.0"
162+
),
163+
license("EDL, Version 1.0", "https://www.eclipse.org/org/documents/edl-v10.php") to listOf(
164+
"EDL 1.0",
165+
"EDL, Version 1.0",
166+
"Eclipse Distribution License - v 1.0"
167+
),
168+
license("BSD 3-Clause License", "https://opensource.org/licenses/BSD-3-Clause") to listOf(
169+
"BSD 3-clause",
170+
"BSD-3-Clause",
171+
"BSD 3-Clause License",
172+
"3-Clause BSD License",
173+
"New BSD License",
174+
license("BSD", "http://asm.ow2.org/license.html"),
175+
license("BSD", "http://asm.objectweb.org/license.html"),
176+
license("BSD", "LICENSE.txt")
177+
),
178+
license("Bouncy Castle License", "https://www.bouncycastle.org/licence.html") to listOf(
179+
"Bouncy Castle Licence"
180+
),
181+
license("W3C License", "https://opensource.org/licenses/W3C") to listOf(
182+
"W3C License",
183+
"W3C Software Copyright Notice and License",
184+
"The W3C Software License"
185+
),
186+
license("CC0", "https://creativecommons.org/publicdomain/zero/1.0/") to listOf(
187+
"CC0",
188+
"Public Domain"
189+
)
190+
)
191+
192+
dependencyConfiguration = "runtimeClasspath"
193+
}
194+
195+
tasks.updateThirdPartyLicenses {
196+
dependsOn(tasks.downloadLicenses)
197+
projectName.set(project.name)
198+
group = "license"
199+
dependencyLicense.set(tasks.downloadLicenses.get().xmlDestination.resolve("dependency-license.xml"))
200+
outputDirectory.set(layout.buildDirectory.dir("distribution/third-party-licenses"))
201+
}
202+
203+
val javaComponent = components["java"] as AdhocComponentWithVariants
204+
javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements.get()) {
205+
skip()
206+
}
207+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version=2024.8-SNAPSHOT
2+
3+
# Enable build cache.
4+
org.gradle.caching=true
5+
org.gradle.jvmargs=-Xmx1024M
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.1.xsd">
3+
<suppress>
4+
<notes><![CDATA[
5+
CVE has been fixed with jsoup-1.8.3, false positive.
6+
See https://github.com/hibernate/hibernate-validator/pull/424
7+
]]></notes>
8+
<gav regex="true">^org\.jsoup:jsoup:.*$</gav>
9+
<cve>CVE-2015-6748</cve>
10+
</suppress>
11+
<suppress>
12+
<notes><![CDATA[
13+
This CVE only applies to a Drupal module which uses the API
14+
]]></notes>
15+
<gav regex="true">^javax\.ws\.rs:javax\.ws\.rs-api:.*$</gav>
16+
<cve>CVE-2015-4345</cve>
17+
</suppress>
18+
</suppressions>
Binary file not shown.
Binary file not shown.
42.6 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)