Skip to content

Commit

Permalink
Swap to using the published fabric-protos libraries
Browse files Browse the repository at this point in the history
Signed-off-by: fraVlaca <[email protected]>
  • Loading branch information
fraVlaca committed Jul 15, 2022
1 parent 4f665e3 commit 80a36ee
Show file tree
Hide file tree
Showing 91 changed files with 452 additions and 60,033 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

This is a Java based implementation of Hyperledger Fabric chaincode shim APIs, which enables development of smart contracts using the Java language.

This project creates `fabric-chaincode-protos` and `fabric-chaincode-shim` jar
This project creates `fabric-chaincode-shim` jar
files for developers' consumption and the `hyperledger/fabric-javaenv` docker image
to run Java chaincode.

Expand All @@ -16,10 +16,6 @@ Application developers interested in developing Java smart contracts for Hyperle

## Project structure

### fabric-chaincode-protos

Contains the protobuf definition files used by Java shim to communicate with Fabric peers.

### fabric-chaincode-shim

Contains the java shim classes that define Java chaincode API and way to communicate with Fabric peers.
Expand Down
1 change: 0 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ The following artifacts are created as a result of releasing Fabric Chaincode Ja
- [fabric-javaenv](https://hub.docker.com/r/hyperledger/fabric-javaenv)
- Java libraries
- [fabric-chaincode-shim](https://search.maven.org/search?q=a:fabric-chaincode-shim)
- [fabric-chaincode-protos](https://search.maven.org/search?q=a:fabric-chaincode-protos)

**Note:** A docker image with a matching V.R version is required before releasing a new version of Fabric.

Expand Down
6 changes: 0 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ subprojects {
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.9.1'
}

if (!it.name.equals('fabric-chaincode-protos')) {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all,-try"
}
}

test {
useJUnitPlatform()
}
Expand Down
1 change: 0 additions & 1 deletion ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ stages:
# Copy the built artifacts to the staging directory, tgz, and the docker image
- script: |
set -ev
./gradlew -Psigning.keyId=${SIGNING_ID} -Psigning.password=${SIGNING_PASSWORD} -Psigning.secretKeyRingFile=${KEYRING_FILE} publishProtosJarPublicationToMavenLocal
./gradlew -Psigning.keyId=${SIGNING_ID} -Psigning.password=${SIGNING_PASSWORD} -Psigning.secretKeyRingFile=${KEYRING_FILE} publishShimJarPublicationToMavenLocal
tar -zcvf localmaven.tgz ${HOME}/.m2/repository/org/hyperledger
docker image save hyperledger/fabric-javaenv | gzip > $(Build.ArtifactStagingDirectory)/fabric-javaenv.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion ci/publish_jar_nexus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function abort {
exit -1
}

for binary in shim protos; do
for binary in shim; do
echo "Pushing fabric-chaincode-$binary.$PUSH_VERSION.jar to maven releases.."
cp $WORKSPACE/fabric-chaincode-$binary/build/libs/fabric-chaincode-$binary-$PUSH_VERSION.jar $WORKSPACE/fabric-chaincode-$binary/build/libs/fabric-chaincode-$binary.$PUSH_VERSION.jar
mvn org.apache.maven.plugins:maven-deploy-plugin:deploy-file \
Expand Down
6 changes: 3 additions & 3 deletions examples/fabric-contract-example-maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
</dependency>

<dependency>
<groupId>org.hyperledger.fabric-chaincode-java</groupId>
<artifactId>fabric-chaincode-protos</artifactId>
<version>${fabric-chaincode-java.version}</version>
<groupId>org.hyperledger.fabric</groupId>
<artifactId>fabric-protos</artifactId>
<version>0.1.3</version>
<scope>compile</scope>
</dependency>

Expand Down
6 changes: 0 additions & 6 deletions fabric-chaincode-docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ RUN chmod +x /root/chaincode-java/build.sh
WORKDIR /root/chaincode-java/shim-src
RUN gradle \
clean \
fabric-chaincode-protos:build \
fabric-chaincode-protos:publishToMavenLocal \
fabric-chaincode-shim:build \
fabric-chaincode-shim:publishToMavenLocal \
-x javadoc \
Expand All @@ -42,10 +40,6 @@ RUN gradle \
-x checkstyleTest \
-x dependencyCheckAnalyze

# Installing all protos jar dependencies to maven local
WORKDIR /root/chaincode-java/shim-src/fabric-chaincode-protos/build/publications/protosJar/
RUN mvn -f pom-default.xml compile

# Installing all shim jar dependencies to maven local
WORKDIR /root/chaincode-java/shim-src/fabric-chaincode-shim/build/publications/shimJar/
RUN mvn -f pom-default.xml compile
Expand Down
5 changes: 0 additions & 5 deletions fabric-chaincode-docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ task copyAllDeps(type: Copy) {
into('build/distributions/chaincode-java/shim-src/fabric-chaincode-shim/')
}

copy {
from project(':fabric-chaincode-protos').getProjectDir()
into('build/distributions/chaincode-java/shim-src/fabric-chaincode-protos/')
}

copy {
from project.getParent().file("build.gradle")
into('build/distributions/chaincode-java/shim-src/')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repositories {

dependencies {
implementation group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '2.4.1'
implementation group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-protos', version: '2.4.1'
implementation group: 'org.hyperledger.fabric', name:'fabric-protos', version:'0.1.3'
testImplementation group: 'junit', name: 'junit', version: '4.12'
implementation group: 'commons-logging', name: 'commons-logging', version: '1.2'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
</dependency>

<dependency>
<groupId>org.hyperledger.fabric-chaincode-java</groupId>
<artifactId>fabric-chaincode-protos</artifactId>
<version>${fabric-chaincode-java.version}</version>
<groupId>org.hyperledger.fabric</groupId>
<artifactId>fabric-protos</artifactId>
<version>0.1.3</version>
<scope>compile</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repositories {

dependencies {
implementation group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '2.4.1'
implementation group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-protos', version: '2.4.1'
implementation group: 'org.hyperledger.fabric', name:'fabric-protos', version:'0.1.3'
testImplementation group: 'junit', name: 'junit', version: '4.12'
implementation group: 'commons-logging', name: 'commons-logging', version: '1.2'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.hyperledger.fabric.metrics.MetricsProvider;
import org.hyperledger.fabric.shim.ledger.*;
import org.hyperledger.fabric.shim.*;
//import org.hyperledger.fabric.protos.peer.ChaincodeShim;
import java.util.*;
import static java.nio.charset.StandardCharsets.UTF_8;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
</dependency>

<dependency>
<groupId>org.hyperledger.fabric-chaincode-java</groupId>
<artifactId>fabric-chaincode-protos</artifactId>
<version>${fabric-chaincode-java.version}</version>
<groupId>org.hyperledger.fabric</groupId>
<artifactId>fabric-protos</artifactId>
<version>0.1.3</version>
<scope>compile</scope>
</dependency>

Expand Down
226 changes: 0 additions & 226 deletions fabric-chaincode-protos/build.gradle

This file was deleted.

Loading

0 comments on commit 80a36ee

Please sign in to comment.