Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Kotlin DSL / Convention Plugins / Java Modules #1732

Merged
merged 86 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
26f7a0a
Build: start moving config to Kotlin DSL and Convention Plugins
jjohannes Feb 19, 2024
8bef92d
Update Android example
jjohannes Feb 20, 2024
f8fdde0
Update to Gradle 8.6
jjohannes Feb 20, 2024
c4c120d
Move examples into proper Java package
jjohannes Feb 20, 2024
f5f3fc4
Fix system properties setup for integration tests
jjohannes Feb 20, 2024
fa110a1
Load example resources from example Java package
jjohannes Feb 20, 2024
0ebf67c
Remove wrong entry
jjohannes Feb 20, 2024
d541a9d
Move 'sonarqube' config to 'sdk' only
jjohannes Feb 20, 2024
b4fc450
Use Java Modules / cleanup dependencies
jjohannes Feb 20, 2024
f984b01
Turn integration tests into Module
jjohannes Feb 20, 2024
4356c88
Set file encoding 'gradle.properties'
jjohannes Feb 20, 2024
b7c2f27
Add dependency scope check
jjohannes Feb 20, 2024
f337830
Cleanup module patching
jjohannes Feb 20, 2024
fbf7e0f
Create reproducible archives
jjohannes Feb 20, 2024
2657d44
Support to run build in both protobuf 'modes'
jjohannes Feb 20, 2024
0fd43ca
'jackson' upgrade breaks 'json-snapshot' library
jjohannes Feb 20, 2024
cac87dc
Add back 'grpc.netty.shaded' runtime dependency
jjohannes Feb 20, 2024
07b50e6
Fix 'protobuf-javalite' vs 'protobuf-java'
jjohannes Feb 20, 2024
6db5ecc
Enable configuration cache
jjohannes Feb 20, 2024
b3b2204
Add back nexus publish
jjohannes Feb 20, 2024
84e4f98
Fix patching of 'grpc.netty.shaded'
jjohannes Feb 20, 2024
786c671
Fix 'com.google.protobuf' patching
jjohannes Feb 20, 2024
e0e70f2
Load resources from inside the Module when running on Module Path
jjohannes Feb 20, 2024
2f2b43e
Built 'sdk-full' via separate subproject
jjohannes Feb 20, 2024
9d06307
Remove old non-Gradle build files
jjohannes Feb 20, 2024
770b494
Move 'sdk' vs 'sdk-full' logic into convention plugins
jjohannes Feb 22, 2024
f3b2dc3
Run examples on Module Path
jjohannes Feb 22, 2024
a2dee2c
Execute example code from Jar instead of using classes/resources folders
jjohannes Feb 22, 2024
ae024f4
Fix 'jackson-databind' patching for completeness
jjohannes Feb 22, 2024
71a7bb8
Clean up "build" lifecycle group
jjohannes Mar 14, 2024
66113a0
Move test into package
jjohannes Mar 14, 2024
0c0d37e
Configure 'javadoc' task
jjohannes Mar 14, 2024
c0c8e60
chore: update to Gradle 8.7
jjohannes Apr 30, 2024
ae293e6
chore: move classes into packages
jjohannes Apr 30, 2024
1d2e175
chore: update plugin versions
jjohannes Apr 30, 2024
64b8ffc
chore: name things consistent with 'hedera-services'
jjohannes Apr 30, 2024
43f036a
chore: rename - '...integration.test' to '...test.integration'
jjohannes Apr 30, 2024
3958240
fix: forward Gradle properties as system properties to integration tests
jjohannes Apr 30, 2024
1945620
fix: make Android example find versions of dependencies
jjohannes Apr 30, 2024
f3bb6a8
chore: use repository content filtering
jjohannes Apr 30, 2024
82c7d9c
chore: improve comment
jjohannes Apr 30, 2024
454f62e
chore: restore Taskfile.yml
jjohannes Apr 30, 2024
062b360
fix: open 'com.hedera.hashgraph.sdk' package
jjohannes Apr 30, 2024
b20fd6a
fix: no new transitive (api) dependencies
jjohannes May 17, 2024
1f3543b
chore: add 'wiremock'
jjohannes May 24, 2024
2d1c8ec
chore: remove 'publish:' from Taskfile
jjohannes May 24, 2024
85762de
chore: do not upgrade protobuf versions in this PR
jjohannes May 24, 2024
ca60bc8
chore: update to 'gradle/actions/setup-gradle' action
jjohannes Jun 3, 2024
c37adf0
chore: give clearer name to stage that also runs integration tests
jjohannes Jun 3, 2024
79473e1
chore: adjust repository order
jjohannes Jun 3, 2024
3bc336c
chore: update integration test documentation
jjohannes Jun 3, 2024
4351fca
tmp: deactivate test
jjohannes Jun 3, 2024
e7693c8
chore: do not update Guava version compared to 'main'
jjohannes Jun 3, 2024
7f092bb
chore: use latest 'jvm-dependency-conflict-resolution' plugin
jjohannes Jun 3, 2024
9383c16
chore: use latest file permission Gradle API
jjohannes Jun 3, 2024
00eae32
chore: update to Gradle 8.8
jjohannes Jun 3, 2024
c33bc37
build: do not fail tests fast
jjohannes Jun 3, 2024
f8cc47d
tmp: re-enable test
jjohannes Jun 3, 2024
3316556
tmp: deactivate tests
jjohannes Jun 3, 2024
2fc343a
chore: revert rename to not break PR setup
jjohannes Jun 3, 2024
38480de
fix: `io.grpc:grpc-api` vs `io.helidon.grpc:io.grpc`.
jjohannes Jun 3, 2024
e189724
build: move versions into 'sdk-dependency-versions'
jjohannes Jun 3, 2024
11df3bf
tmp (revert): re-activate test
jjohannes Jun 13, 2024
03c3d5b
chore: move example into package
jjohannes Jun 13, 2024
d1e37eb
fix: do not replace 'io.grpc:*' modules / instead update to 1.64.0
jjohannes Jun 13, 2024
85b0b4b
chore; remove wiremock
jjohannes Jun 13, 2024
7d78eac
fix: tweak module patching
jjohannes Jun 13, 2024
9eba750
chore: examples task setup and docs
jjohannes Jun 14, 2024
04f08e2
chore: tweak Android example docs and make ensure that it builds on CI
jjohannes Jun 14, 2024
5371853
chore: do not define a Guava version (use what is provided transitively)
jjohannes Jun 14, 2024
631ccf5
chore: align JVM args in 'gradle.properties'
jjohannes Jun 14, 2024
8910ce9
chore: remove suppress annotations no longer needed after Gradle update
jjohannes Jun 14, 2024
19f2805
chore: convert 'tck/build.gradle' to Kotlin and adjust to setup changes
jjohannes Jun 14, 2024
d294618
chore: update gradle/actions/setup-gradle
jjohannes Jun 18, 2024
54949b0
fix: write and read version at runtime on classpath and module path
jjohannes Jun 18, 2024
ca54cf5
chore: fix name of module in because comment
jjohannes Jun 18, 2024
0eedb93
feat: publish versions for gRPC implementations
jjohannes Jun 18, 2024
90f92a7
chore: adjust gRPC versions in docs and examples
jjohannes Jun 18, 2024
c0969c0
chore: let Dependabot check all build.gradle.kts files
jjohannes Jun 21, 2024
7754d26
Change setup of 'examples' such that it can be used as independent build
jjohannes Jul 4, 2024
fc5566c
fix: quick fix for Guava patching not always working
jjohannes Jul 4, 2024
85bf84d
.env for examples should now be located in examples/.env
jjohannes Jul 4, 2024
e0c1fa8
fix: add 'sdk-full' capability for 'sdk-full'
jjohannes Jul 4, 2024
81202f8
fix: remove 'requires com.google.protobuf' from examples
jjohannes Jul 8, 2024
c9defca
chore: revert sdk dependency version to 2.34.0
thenswan Jul 8, 2024
7c91ea6
fix: Taskfile.yml test:integration task
thenswan Jul 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ updates:
schedule:
interval: weekly
open-pull-requests-limit: 10
- package-ecosystem: gradle
directory: "/gradle/plugins"
schedule:
interval: weekly
open-pull-requests-limit: 10

- package-ecosystem: github-actions
directory: "/"
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@66535aaf56f831b35e3a8481c9c99b665b84dd45 # v3.4.2
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
with:
cache-read-only: false

- name: Compile SDK & Javadoc
run: ./gradlew assemble :sdk:javadoc -Dfile.encoding=UTF-8 --scan
run: ./gradlew assemble :sdk:javadoc --scan

unit-tests:
name: Unit Tests
Expand Down Expand Up @@ -80,14 +80,17 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@66535aaf56f831b35e3a8481c9c99b665b84dd45 # v3.4.2
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2

- name: Install Local Node
run: npm install @hashgraph/hedera-local

- name: Compile Code
run: ./gradlew assemble --scan

- name: Gradle Dependency Scopes Check
run: ./gradlew checkAllModuleInfo --continue --scan

- name: Start Local Node
run: npx @hashgraph/hedera-local start -d --network local

Expand Down Expand Up @@ -138,15 +141,21 @@ jobs:
distribution: temurin
java-version: 17

- name: Setup Android SDK
uses: android-actions/setup-android@00854ea68c109d98c75d956347303bf7c45b0277 # v3.2.1

- name: Setup Gradle
uses: gradle/gradle-build-action@66535aaf56f831b35e3a8481c9c99b665b84dd45 # v3.4.2
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2

- name: Install Local Node
run: npm install @hashgraph/hedera-local

- name: Compile Code
run: ./gradlew assemble --scan

- name: Compile Code - Android Example
run: ./gradlew -p example-android assemble --scan

- name: Start the local node
run: npx @hashgraph/hedera-local start -d --network local

Expand Down Expand Up @@ -187,7 +196,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@66535aaf56f831b35e3a8481c9c99b665b84dd45 # v3.4.2
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2

- name: Install Local Node
run: npm install @hashgraph/hedera-local
Expand All @@ -199,8 +208,7 @@ jobs:
run: npx @hashgraph/hedera-local start -d --network local

- name: Run Tests
run: |
cd tck && ./gradlew test && cd ..
run: ./gradlew :tck:test

- name: Stop the local node
run: npx @hashgraph/hedera-local stop
2 changes: 1 addition & 1 deletion .github/workflows/disabled/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ jobs:
cd hedera-services
docker-compose up &
cd ../hedera-sdk-java
./gradlew -PHEDERA_NETWORK=$HEDERA_NETWORK -POPERATOR_KEY=$OPERATOR_KEY -POPERATOR_ID=$OPERATOR_ID integrationTest
./gradlew -PHEDERA_NETWORK=$HEDERA_NETWORK -POPERATOR_KEY=$OPERATOR_KEY -POPERATOR_ID=$OPERATOR_ID testIntegration
2 changes: 1 addition & 1 deletion .github/workflows/disabled/previewnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ jobs:
OPERATOR_KEY: ${{ secrets.PREVIEWNET_OPERATOR_KEY }}
OPERATOR_ID: ${{ secrets.PREVIEWNET_OPERATOR_ID }}
HEDERA_NETWORK: "previewnet"
run: ./gradlew -PHEDERA_NETWORK=$HEDERA_NETWORK -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY integrationTest
run: ./gradlew -PHEDERA_NETWORK=$HEDERA_NETWORK -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY testIntegration
2 changes: 1 addition & 1 deletion .github/workflows/disabled/testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Compile Tests
run: ./gradlew compileTestJava
- name: Compile Integration Tests
run: ./gradlew compileIntegrationTestJava
run: ./gradlew compileTestIntegrationJava
- name: Compile Examples
run: ./gradlew :examples:compileJava

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@66535aaf56f831b35e3a8481c9c99b665b84dd45 # v3.4.2
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2

- name: Compile SDK
run: ./gradlew compileJava --scan

- name: Generate Javadoc
run: ./gradlew sdk:javadoc -Dfile.encoding=UTF-8 --scan
run: ./gradlew sdk:javadoc --scan

- name: Pages
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
Expand Down
30 changes: 5 additions & 25 deletions .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@66535aaf56f831b35e3a8481c9c99b665b84dd45 # v3.4.2
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
with:
cache-read-only: false

Expand All @@ -66,7 +66,7 @@ jobs:
if: ${{ github.event_name == 'push' }}
run: |
if [[ "${{ steps.tag.outputs.version }}" != "${{ steps.project.outputs.version }}" ]]; then
echo "::error file=version.gradle,line=5,title=Version Mismatch::Tag version '${{ steps.tag.outputs.version }}' does not match the Gradle project version '${{ steps.project.outputs.version }}'. Please update the 'version.gradle' file before tagging."
echo "::error file=version.txt,line=0,title=Version Mismatch::Tag version '${{ steps.tag.outputs.version }}' does not match the Gradle project version '${{ steps.project.outputs.version }}'. Please update the 'version.txt' file before tagging."
exit 1
fi

Expand Down Expand Up @@ -116,33 +116,13 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@66535aaf56f831b35e3a8481c9c99b665b84dd45 # v3.4.2
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
with:
cache-read-only: false

- name: Compile SDK & Javadoc
run: ./gradlew assemble :sdk:javadoc -Dfile.encoding=UTF-8 --scan
run: ./gradlew assemble :sdk:javadoc --scan

- name: Nexus Release
if: ${{ github.event_name == 'push' }}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-parallel -Dfile.encoding=UTF-8 --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }}
jjohannes marked this conversation as resolved.
Show resolved Hide resolved

- name: Nexus Release (workflow_dispatch)
if: ${{ github.event_name == 'workflow_dispatch' }}
run: ./gradlew publishToSonatype closeSonatypeStagingRepository --no-parallel -Dfile.encoding=UTF-8 --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }}

- name: Nexus Release sdk-full artifacts
if: ${{ github.event_name == 'push' }}
run: |
# This is a temporary fix and should be removed once https://github.com/hashgraph/hedera-sdk-java/pull/1732 is merged
sed -i 's#sdk\.gradle#sdk-full.gradle#g' sdk/build.gradle
git clean -fdx
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-parallel -Dfile.encoding=UTF-8 --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }}

- name: Nexus Release sdk-full artifacts (workflow_dispatch)
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
# This is a temporary fix and should be removed once https://github.com/hashgraph/hedera-sdk-java/pull/1732 is merged
sed -i 's#sdk\.gradle#sdk-full.gradle#g' sdk/build.gradle
git clean -fdx
./gradlew publishToSonatype closeSonatypeStagingRepository --no-parallel -Dfile.encoding=UTF-8 --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }}
run: ./gradlew closeAndReleaseSonatypeStagingRepository --no-configuration-cache --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }}
20 changes: 0 additions & 20 deletions .gitlab-ci.yml

This file was deleted.

15 changes: 1 addition & 14 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tasks:

"test:integration":
cmds:
- ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK integrationTest {{.CLI_ARGS}}
- ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK testIntegration {{.CLI_ARGS}}
env:
OPERATOR_KEY: '0xa608e2130a0a3cb34f86e757303c862bee353d9ab77ba4387ec084f881d420d4'
OPERATOR_ID: '0.0.1022'
Expand Down Expand Up @@ -79,16 +79,3 @@ tasks:
- task: "update:proto"
- task: "update:snapshots"
- task: "update:addressbooks"

publish:
env:
FILES: "sdk/src/main/java/com/hedera/hashgraph/sdk/*.java"
preconditions:
- git diff-index --quiet HEAD
cmds:
- git clean -ffdx
- ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
- perl -p -i -e "s#sdk\.gradle#sdk-full.gradle#g" sdk/build.gradle
- git clean -ffdx
- ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
- git restore sdk
111 changes: 0 additions & 111 deletions build.gradle

This file was deleted.

18 changes: 18 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
plugins {
id("com.hedera.gradle.root")
}

dependencyAnalysis.abi {
exclusions {
// Exposes: org.slf4j.Logger
excludeClasses("logger")
// Exposes: com.google.common.base.MoreObjects.ToStringHelper
excludeClasses(".*\\.CustomFee")
// Exposes: com.esaulpaugh.headlong.abi.Tuple
excludeClasses(".*\\.ContractFunctionResult")
// Exposes: org.bouncycastle.crypto.params.KeyParameter
excludeClasses(".*\\.PrivateKey.*")
// Exposes: io.grpc.stub.AbstractFutureStub (and others)
excludeClasses(".*Grpc")
}
}
4 changes: 2 additions & 2 deletions docs/android-app/android-app-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ implementation 'com.hedera.hashgraph:sdk:2.29.0'

2. **gRPC implementation:**
```groovy
// okhttp transport (for lighter-weight applications or Android)
implementation 'io.grpc:grpc-okhttp:1.58.0'
// okhttp transport (for lighter-weight applications or Android
runtimeOnly("io.grpc:grpc-okhttp")
```

## Next steps
Expand Down
Loading
Loading