-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: use plugins from 'hedera-gradle-conventions'
Signed-off-by: Jendrik Johannes <[email protected]>
- Loading branch information
Showing
40 changed files
with
341 additions
and
1,218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
info@lfdecentralizedtrust.org=The Hiero Team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,92 @@ | ||
/*- | ||
* | ||
* Hedera Java SDK | ||
* | ||
* Copyright (C) 2024 Hedera Hashgraph, LLC | ||
* | ||
* 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. | ||
* | ||
*/ | ||
|
||
// SPDX-License-Identifier: Apache-2.0 | ||
plugins { | ||
id("com.hedera.gradle.examples.java") | ||
id("org.hiero.gradle.module.application") | ||
id("org.gradlex.java-module-dependencies") | ||
} | ||
|
||
mainModuleInfo { | ||
runtimeOnly("io.grpc.netty.shaded") | ||
runtimeOnly("org.slf4j.simple") | ||
} | ||
|
||
dependencies { | ||
implementation("org.bouncycastle:bcpkix-jdk18on:1.78.1") | ||
implementation("org.bouncycastle:bcprov-jdk18on:1.78.1") | ||
// 'com.google.protobuf' implementation is provided through 'sdk' as it differs between 'sdk' and | ||
// 'sdk-full' | ||
dependencyAnalysis { | ||
issues { | ||
all { onUsedTransitiveDependencies { exclude("com.google.protobuf:protobuf-javalite") } } | ||
} | ||
} | ||
|
||
dependencies.constraints { | ||
implementation("io.github.cdimascio:dotenv-java:3.0.2") | ||
implementation("com.hedera.hashgraph:sdk:2.46.0") | ||
implementation("com.hedera.hashgraph:sdk-full:2.46.0") | ||
} | ||
|
||
tasks.register<RunAllExample>("runAllExamples") { | ||
workingDirectory = rootDir | ||
sources.from(sourceSets.main.get().java.asFileTree) | ||
rtClasspath.from(configurations.runtimeClasspath.get() + files(tasks.jar)) | ||
} | ||
|
||
tasks.addRule("Pattern: run<Example>: Runs an example.") { | ||
if (startsWith("run")) { | ||
tasks.register<JavaExec>(this) { | ||
workingDir = rootDir | ||
classpath = configurations.runtimeClasspath.get() + files(tasks.jar) | ||
mainModule = "com.hedera.hashgraph.examples" | ||
mainClass = | ||
"com.hedera.hashgraph.sdk.examples.${this@addRule.substring("run".length)}Example" | ||
} | ||
} | ||
} | ||
|
||
abstract class RunAllExample : DefaultTask() { | ||
@get:InputFiles abstract val sources: ConfigurableFileCollection | ||
|
||
@get:InputFiles abstract val rtClasspath: ConfigurableFileCollection | ||
|
||
@get:Internal abstract val workingDirectory: RegularFileProperty | ||
|
||
@get:Inject abstract val exec: ExecOperations | ||
|
||
@TaskAction | ||
fun runAll() { | ||
val exampleClasses = | ||
sources | ||
.filter { it.name.endsWith("Example.java") } | ||
.asSequence() | ||
.map { it.name.replace(".java", "") } | ||
.filter { | ||
it != "ValidateChecksumExample" | ||
} // disabled this example, because it needs user input (but it WORKS) | ||
.filter { | ||
it != "ConsensusPubSubChunkedExample" | ||
} // is flaky on local-node env, will be investigated | ||
.filter { | ||
it != "InitializeClientWithMirrorNetworkExample" | ||
} // disabled - cannot run on localnode | ||
.toList() | ||
|
||
exampleClasses.forEach { className -> | ||
println( | ||
""" | ||
---EXECUTING $className: | ||
""" | ||
.trimIndent() | ||
) | ||
|
||
exec.javaexec { | ||
workingDir = workingDirectory.get().asFile | ||
classpath = rtClasspath | ||
mainModule = "com.hedera.hashgraph.examples" | ||
mainClass = "com.hedera.hashgraph.sdk.examples.$className" | ||
|
||
// NOTE: Uncomment to enable trace logs in the SDK during the examples | ||
// jvmArgs "-Dorg.slf4j.simpleLogger.log.com.hedera.hashgraph=trace" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
jdk=17.0.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,7 @@ | ||
/*- | ||
* | ||
* Hedera Java SDK | ||
* | ||
* Copyright (C) 2024 Hedera Hashgraph, LLC | ||
* | ||
* 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. | ||
* | ||
*/ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
plugins { id("org.hiero.gradle.build") version "0.1.0" } | ||
|
||
pluginManagement { | ||
includeBuild("../gradle/plugins") | ||
repositories { | ||
gradlePluginPortal() | ||
} | ||
} | ||
@Suppress("UnstableApiUsage") dependencyResolutionManagement { repositories.mavenCentral() } | ||
|
||
// --- Remove to use a published SDK version --- | ||
includeBuild("..") | ||
// --------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.1.0-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
plugins { | ||
id("org.hiero.gradle.base.lifecycle") | ||
id("org.hiero.gradle.report.code-coverage") | ||
id("org.hiero.gradle.check.spotless") | ||
id("org.hiero.gradle.check.spotless-kotlin") | ||
} | ||
|
||
dependencies { | ||
implementation(project(":sdk")) | ||
implementation("io.grpc:grpc-protobuf") | ||
} |
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
gradle/plugins/src/main/kotlin/com.hedera.gradle.base.gradle.kts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.