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

Remove copied proto src #123

Open
wants to merge 6 commits into
base: replace-maven-with-gradle
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: mvn dependency:go-offline
- run: gradle build

- save_cache:
paths:
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,11 @@
javadoc/
/build/
.gradle
.idea
.idea
/src/main/proto/
/checkouts/
/checkouts/hedera-protobufs/
/checkouts/hedera-protobufs/.gradle/file-system.probe
/checkouts/hedera-protobufs/mirror/.gradle/file-system.probe
/checkouts/hedera-protobufs/services/.gradle/file-system.probe
/checkouts/hedera-protobufs/streams/.gradle/file-system.probe
41 changes: 7 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
# Hedera Hashgraph Protocol Buffer API Message Definitions

The Hedera Hashgraph API is implemented with protocol buffers, Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. This repository contains the current version of the files used to define the API.
The Hedera Hashgraph API is implemented with protocol buffers, Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. This repository is responsable for building the Java libraries for the Hedera HAPI protobufs. The source proto files are in https://github.com/hashgraph/hedera-protobufs , this repo just pulls a copy of the source from there and build Java Libraries.

## Documentation
## Configure build in gradle.properties
- `version` is the version for the built artifacts
- `hapiBranchOrTag` is the **branch** or **tag** version of HAPI repo, who's source you would like to use in the build.

The protobuf files themselves contain detailed comments which help understand not only the message itself but also some of the features and capabilities of the Hedera Hashgraph network.
## Build

The `/docs` folder of this project contains automatically generated documents in html and markdown format to help navigate through the message definitions.

[NestedDoc.html](https://github.com/hashgraph/hedera-protobuf/blob/master/docs/NestedDoc.html) - nested HTML document to help navigate messages that contain other message definitions (large document that takes a while to open)
[NotNestedDoc.html](https://github.com/hashgraph/hedera-protobuf/blob/master/docs/NotNestedDoc.html) - flat HTML document
[NotNestedDoc.md](https://github.com/hashgraph/hedera-protobuf/blob/master/docs/NotNestedDoc.md) - flat markdown document

__Note__: the HAPI.html document is a large document and may take a few seconds to load in a browser.
- `gradle assemble` will build the new jars
- `gradle publishToMavanLocal` will build and publish into your local maven repo

## Additional resources

Expand All @@ -21,27 +18,3 @@ If you are unfamiliar with protocol buffers (or need a refresher), you may consu
- Protocol Buffers : https://developers.google.com/protocol-buffers/
- gRPC : https://grpc.io

## Deploy to Maven

*You will need the appropriate credentials to do so*

- Update the version number in the `pom.xml` (ensure pom.xml has x.x.x-SNAPSHOT for version)
- Build the project with `mvn clean install`
- Re-generate the documentation

```shell
cd docgenerator
java -jar proto2html.jar "HAPI Documentation" ../src/main/proto/ ../docs
```

```shell
cd ..
```

Commit all changes to github

`mvn release:clean release:prepare` (you will be prompted to confirm version numbers, etc...)

`mvn release:perform`

navigate to Nexus Repository Manager https://oss.sonatype.org/index.html#stagingRepositories and release the newly created repository.
25 changes: 23 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,37 @@ java {
withSourcesJar()
}

tasks.clean {
doFirst {
delete("${rootDir}/src/main/proto")
}
}

sourceSets {
main {
proto {
srcDir("checkouts/hedera-protobufs/streams")
srcDir("checkouts/hedera-protobufs/services")
srcDir("checkouts/hedera-protobufs/mirror")
exclude { file: FileTreeElement ->
return@exclude file.file.endsWith("mirror/consensus_service.proto")
}
}
}
}

protobuf {
protoc{
artifact = "com.google.protobuf:protoc:3.21.0"
}

plugins {
create("grpc").artifact = "io.grpc:protoc-gen-grpc-java:1.50.2"
}

generateProtoTasks {
all().forEach { task: GenerateProtoTask ->
// task.builtins["java"].options.add("lite")
task.plugins.create("grpc")
// task.plugins.create("grpc").options.add("lite")
}
}
}
Expand Down
Binary file removed docgenerator/proto2html.jar
Binary file not shown.
208 changes: 0 additions & 208 deletions docgenerator/proto2html.templ

This file was deleted.

Loading