Skip to content
Merged
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
20 changes: 17 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
with:
distribution: 'temurin'
java-version: '11'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: Build and Unit test
Expand All @@ -32,7 +31,7 @@ jobs:
arguments: |
:fabric-chaincode-shim:build

intergationtest:
intergationtest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -42,7 +41,6 @@ jobs:
with:
distribution: 'temurin'
java-version: '11'
cache: 'gradle'
- name: Populate chaincode with latest java-version
run: |
./gradlew -I $GITHUB_WORKSPACE/fabric-chaincode-integration-test/chaincodebootstrap.gradle -PchaincodeRepoDir=$GITHUB_WORKSPACE/fabric-chaincode-integration-test/src/contracts/fabric-shim-api/repository publishShimPublicationToFabricRepository
Expand All @@ -67,3 +65,19 @@ jobs:
with:
arguments: |
:fabric-chaincode-integration-test:build

docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.checkout-ref }}
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Build Docker image
uses: gradle/actions/setup-gradle@v3
with:
arguments: |
:fabric-chaincode-docker:buildImage
28 changes: 15 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,25 @@ subprojects {
group = 'org.hyperledger.fabric-chaincode-java'
version = rootProject.version


sourceCompatibility = 1.8
targetCompatibility = 1.8
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}

dependencies {
implementation group: 'commons-cli', name: 'commons-cli', version: '1.6.0'
implementation group: 'commons-logging', name: 'commons-logging', version: '1.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.3.1'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.3.1'
implementation 'commons-cli:commons-cli:1.6.0'
implementation 'commons-logging:commons-logging:1.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'

testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '2.23.0'
testImplementation group: 'com.github.stefanbirkner', name: 'system-rules', version: 'system-rules-1.17.0'
testImplementation 'org.hamcrest:hamcrest-library:1.3'
testImplementation 'org.mockito:mockito-core:2.23.0'
testImplementation 'com.github.stefanbirkner:system-rules:system-rules-1.17.0'

testCompileOnly group: 'junit', name: 'junit', version: '4.12'
testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.3.1'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.9.1'
testCompileOnly 'junit:junit:4.12'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.1'
testImplementation 'org.assertj:assertj-core:3.9.1'
}

test {
Expand Down
14 changes: 8 additions & 6 deletions examples/fabric-contract-example-as-service/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'java'
}

version '0.0.1'

sourceCompatibility = 1.8
tasks.compileJava {
options.release.set(11)
}

repositories {
mavenLocal()
Expand All @@ -20,17 +22,17 @@ repositories {
}

dependencies {
compile group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '2.3.+'
compile 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.1'
compile 'org.json:json:20231013'
testImplementation 'org.junit.jupiter:junit-jupiter:5.4.2'
testImplementation 'org.assertj:assertj-core:3.11.1'
testImplementation 'org.mockito:mockito-core:2.+'
}

shadowJar {
baseName = 'chaincode'
version = null
classifier = null
archiveBaseName = 'chaincode'
archiveVersion = ''
archiveClassifier = ''
mergeServiceFiles()

manifest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar


plugins {
id("com.github.johnrengelman.shadow") version "7.1.2"
id("org.jetbrains.kotlin.jvm") version "1.3.41"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("org.jetbrains.kotlin.jvm") version "1.9.22"
}


Expand Down Expand Up @@ -41,9 +41,9 @@ repositories {

tasks {
"shadowJar"(ShadowJar::class) {
baseName = "chaincode"
version = null
classifier = null
archiveBaseName = "chaincode"
archiveVersion = ""
archiveClassifier = ""
mergeServiceFiles()
manifest {
attributes(mapOf("Main-Class" to "org.hyperledger.fabric.contract.ContractRouter"))
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 17 additions & 12 deletions examples/fabric-contract-example-gradle-kotlin/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions examples/fabric-contract-example-gradle-kotlin/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions examples/fabric-contract-example-gradle/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'java'
}

version '0.0.1'

sourceCompatibility = 1.8
tasks.compileJava {
options.release.set(11)
}

repositories {
mavenLocal()
Expand All @@ -20,17 +22,17 @@ repositories {
}

dependencies {
compile group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '2.5.1'
compile 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.1'
compile 'org.json:json:20231013'
testImplementation 'org.junit.jupiter:junit-jupiter:5.4.2'
testImplementation 'org.assertj:assertj-core:3.11.1'
testImplementation 'org.mockito:mockito-core:2.+'
}

shadowJar {
baseName = 'chaincode'
version = null
classifier = null
archiveBaseName = 'chaincode'
archiveVersion = ''
archiveClassifier = ''
mergeServiceFiles()

manifest {
Expand Down
14 changes: 8 additions & 6 deletions examples/ledger-api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'java'
}

version '0.0.1'

sourceCompatibility = 1.8
tasks.compileJava {
options.release.set(11)
}

repositories {
mavenLocal()
Expand All @@ -20,17 +22,17 @@ repositories {
}

dependencies {
compile group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '1.4.5'
compile 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.1'
compile 'org.json:json:20231013'
testImplementation 'org.junit.jupiter:junit-jupiter:5.4.2'
testImplementation 'org.assertj:assertj-core:3.11.1'
testImplementation 'org.mockito:mockito-core:2.+'
}

shadowJar {
baseName = 'chaincode'
version = null
classifier = null
archiveBaseName = 'chaincode'
archiveVersion = ''
archiveClassifier = ''
mergeServiceFiles()

manifest {
Expand Down
10 changes: 5 additions & 5 deletions fabric-chaincode-docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:11.0.21_9-jdk as builder
FROM eclipse-temurin:11.0.22_7-jdk as builder
ENV DEBIAN_FRONTEND=noninteractive

# Build tools
Expand All @@ -10,10 +10,10 @@ RUN curl -s "https://get.sdkman.io" | bash

SHELL ["/bin/bash", "-c"]

RUN source /root/.sdkman/bin/sdkman-init.sh; sdk install gradle 7.6.3
RUN source /root/.sdkman/bin/sdkman-init.sh; sdk install maven 3.9.5
RUN source /root/.sdkman/bin/sdkman-init.sh; sdk install gradle 8.6
RUN source /root/.sdkman/bin/sdkman-init.sh; sdk install maven 3.9.6

FROM eclipse-temurin:11.0.21_9-jdk as dependencies
FROM eclipse-temurin:11.0.22_7-jdk as dependencies

COPY --from=builder /root/.sdkman/candidates/gradle/current /usr/bin/gradle
COPY --from=builder /root/.sdkman/candidates/maven/current /usr/bin/maven
Expand Down Expand Up @@ -53,7 +53,7 @@ RUN mvn -N io.takari:maven:wrapper

# Creating final javaenv image which will include all required
# dependencies to build and compile java chaincode
FROM eclipse-temurin:11.0.21_9-jdk
FROM eclipse-temurin:11.0.22_7-jdk

RUN apt-get update \
&& apt-get -y install zip unzip \
Expand Down
2 changes: 1 addition & 1 deletion fabric-chaincode-docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ task copyAllDeps(type: Copy) {
task buildImage(type: DockerBuildImage) {
dependsOn copyAllDeps
inputDir = project.file('Dockerfile').parentFile
tags = ['hyperledger/fabric-javaenv', 'hyperledger/fabric-javaenv:amd64-2.5.1', 'hyperledger/fabric-javaenv:amd64-latest']
tags = ['hyperledger/fabric-javaenv', 'hyperledger/fabric-javaenv:2.5', 'hyperledger/fabric-javaenv:amd64-2.5.1', 'hyperledger/fabric-javaenv:amd64-latest']
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ plugins {
group 'org.hyperledger.fabric-chaincode-java'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8
tasks.compileJava {
sourceCompatibility = '1.8'
}

repositories {
mavenLocal()
Expand All @@ -18,7 +20,7 @@ repositories {
}

dependencies {
implementation'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.1'
implementation 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.1'
implementation 'org.hyperledger.fabric:fabric-protos:0.2.+'
}

Expand Down
Loading