Skip to content

Commit

Permalink
build: use common Hiero Gradle config (#15282)
Browse files Browse the repository at this point in the history
Signed-off-by: Jendrik Johannes <jendrik.johannes@gmail.com>
Co-authored-by: Matt Hess <matt.hess@swirldslabs.com>
  • Loading branch information
jjohannes and mhess-swl authored Dec 18, 2024
1 parent 8718aed commit c4e3cf6
Show file tree
Hide file tree
Showing 108 changed files with 514 additions and 3,740 deletions.
7 changes: 1 addition & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
version: 2
updates:
- package-ecosystem: "gradle"
directory: "/hedera-dependency-versions"
schedule:
interval: "daily"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/gradle/plugins"
directory: "/hiero-dependency-versions"
schedule:
interval: "daily"
open-pull-requests-limit: 10
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/node-zxc-build-release-artifact.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
##
# Copyright (C) 2022-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
name: "ZXC: [Node] Deploy Release Artifacts"
on:
workflow_call:
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/zxc-publish-production-image.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
##
# 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
name: "ZXC: Publish Production Image"
on:
workflow_call:
Expand Down
24 changes: 3 additions & 21 deletions example-apps/swirlds-platform-base-example/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
/*
* Copyright (C) 2020-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.
*/

plugins {
id("application")
id("com.hedera.gradle.platform")
}
// SPDX-License-Identifier: Apache-2.0
plugins { id("org.hiero.gradle.module.application") }

mainModuleInfo {
annotationProcessor("com.swirlds.config.processor")
annotationProcessor("com.google.auto.service.processor")
runtimeOnly("com.swirlds.config.impl")
}

application.mainClass.set("com.swirlds.platform.base.example.Application")
application.mainClass = "com.swirlds.platform.base.example.Application"
51 changes: 29 additions & 22 deletions gradle/aggregation/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
/*
* 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.
*/

plugins { id("com.hedera.gradle.reports") }
// 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(":app"))
Expand All @@ -29,9 +19,26 @@ dependencies {
implementation(project(":test-clients"))
}

tasks.named<JacocoReport>("testCodeCoverageReport") {
val exclusions = listOf("test-clients", "testFixtures", "statedumpers", "example-apps")
classDirectories.setFrom(
classDirectories.files.filterNot { file -> exclusions.any { file.path.contains(it) } }
)
tasks.testCodeCoverageReport {
// Redo the setup done in 'JacocoReportAggregationPlugin', but gather the class files in the
// file tree and filter out selected classes by path.
val filteredClassFiles =
configurations.aggregateCodeCoverageReportResults
.get()
.incoming
.artifactView {
componentFilter { id -> id is ProjectComponentIdentifier }
attributes.attribute(
LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE,
objects.named(LibraryElements.CLASSES)
)
}
.files
.asFileTree
.filter { file ->
listOf("test-clients", "testFixtures", "statedumpers", "example-apps").none {
file.path.contains(it)
}
}
classDirectories.setFrom(filteredClassFiles)
}
1 change: 1 addition & 0 deletions gradle/development-branch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
develop
42 changes: 0 additions & 42 deletions gradle/plugins/build.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit c4e3cf6

Please sign in to comment.